mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
Add AUSF, UDM, and UDR
This commit is contained in:
parent
0c0241d5e5
commit
72370ff0b2
1151 changed files with 140173 additions and 24799 deletions
99
lib/sbi/openapi/model/nr_v2x_auth.c
Normal file
99
lib/sbi/openapi/model/nr_v2x_auth.c
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "nr_v2x_auth.h"
|
||||
|
||||
OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_create(
|
||||
OpenAPI_ue_auth_t *vehicle_ue_auth,
|
||||
OpenAPI_ue_auth_t *pedestrian_ue_auth
|
||||
)
|
||||
{
|
||||
OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = OpenAPI_malloc(sizeof(OpenAPI_nr_v2x_auth_t));
|
||||
if (!nr_v2x_auth_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
nr_v2x_auth_local_var->vehicle_ue_auth = vehicle_ue_auth;
|
||||
nr_v2x_auth_local_var->pedestrian_ue_auth = pedestrian_ue_auth;
|
||||
|
||||
return nr_v2x_auth_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_nr_v2x_auth_free(OpenAPI_nr_v2x_auth_t *nr_v2x_auth)
|
||||
{
|
||||
if (NULL == nr_v2x_auth) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_ue_auth_free(nr_v2x_auth->vehicle_ue_auth);
|
||||
OpenAPI_ue_auth_free(nr_v2x_auth->pedestrian_ue_auth);
|
||||
ogs_free(nr_v2x_auth);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_nr_v2x_auth_convertToJSON(OpenAPI_nr_v2x_auth_t *nr_v2x_auth)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (nr_v2x_auth == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [NrV2xAuth]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (nr_v2x_auth->vehicle_ue_auth) {
|
||||
cJSON *vehicle_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(nr_v2x_auth->vehicle_ue_auth);
|
||||
if (vehicle_ue_auth_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "vehicleUeAuth", vehicle_ue_auth_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [vehicle_ue_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr_v2x_auth->pedestrian_ue_auth) {
|
||||
cJSON *pedestrian_ue_auth_local_JSON = OpenAPI_ue_auth_convertToJSON(nr_v2x_auth->pedestrian_ue_auth);
|
||||
if (pedestrian_ue_auth_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "pedestrianUeAuth", pedestrian_ue_auth_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_nr_v2x_auth_convertToJSON() failed [pedestrian_ue_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_nr_v2x_auth_t *OpenAPI_nr_v2x_auth_parseFromJSON(cJSON *nr_v2x_authJSON)
|
||||
{
|
||||
OpenAPI_nr_v2x_auth_t *nr_v2x_auth_local_var = NULL;
|
||||
cJSON *vehicle_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "vehicleUeAuth");
|
||||
|
||||
OpenAPI_ue_auth_t *vehicle_ue_auth_local_nonprim = NULL;
|
||||
if (vehicle_ue_auth) {
|
||||
vehicle_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(vehicle_ue_auth);
|
||||
}
|
||||
|
||||
cJSON *pedestrian_ue_auth = cJSON_GetObjectItemCaseSensitive(nr_v2x_authJSON, "pedestrianUeAuth");
|
||||
|
||||
OpenAPI_ue_auth_t *pedestrian_ue_auth_local_nonprim = NULL;
|
||||
if (pedestrian_ue_auth) {
|
||||
pedestrian_ue_auth_local_nonprim = OpenAPI_ue_auth_parseFromJSON(pedestrian_ue_auth);
|
||||
}
|
||||
|
||||
nr_v2x_auth_local_var = OpenAPI_nr_v2x_auth_create (
|
||||
vehicle_ue_auth ? vehicle_ue_auth_local_nonprim : NULL,
|
||||
pedestrian_ue_auth ? pedestrian_ue_auth_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return nr_v2x_auth_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue