mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 05:10:10 +00:00
[SBI] Crash occurs when ENUM in the MAP (#2103)
This commit is contained in:
parent
ce668c556c
commit
969c116e77
1097 changed files with 266728 additions and 42047 deletions
|
|
@ -38,23 +38,37 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_cre
|
|||
|
||||
void OpenAPI_expected_ue_behaviour_data_1_free(OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == expected_ue_behaviour_data_1) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_scheduled_communication_time_1_free(expected_ue_behaviour_data_1->scheduled_communication_time);
|
||||
OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) {
|
||||
OpenAPI_location_area_1_free(node->data);
|
||||
if (expected_ue_behaviour_data_1->scheduled_communication_time) {
|
||||
OpenAPI_scheduled_communication_time_1_free(expected_ue_behaviour_data_1->scheduled_communication_time);
|
||||
expected_ue_behaviour_data_1->scheduled_communication_time = NULL;
|
||||
}
|
||||
if (expected_ue_behaviour_data_1->expected_umts) {
|
||||
OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) {
|
||||
OpenAPI_location_area_1_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(expected_ue_behaviour_data_1->expected_umts);
|
||||
expected_ue_behaviour_data_1->expected_umts = NULL;
|
||||
}
|
||||
if (expected_ue_behaviour_data_1->battery_indication) {
|
||||
OpenAPI_battery_indication_free(expected_ue_behaviour_data_1->battery_indication);
|
||||
expected_ue_behaviour_data_1->battery_indication = NULL;
|
||||
}
|
||||
if (expected_ue_behaviour_data_1->validity_time) {
|
||||
ogs_free(expected_ue_behaviour_data_1->validity_time);
|
||||
expected_ue_behaviour_data_1->validity_time = NULL;
|
||||
}
|
||||
OpenAPI_list_free(expected_ue_behaviour_data_1->expected_umts);
|
||||
OpenAPI_battery_indication_free(expected_ue_behaviour_data_1->battery_indication);
|
||||
ogs_free(expected_ue_behaviour_data_1->validity_time);
|
||||
ogs_free(expected_ue_behaviour_data_1);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (expected_ue_behaviour_data_1 == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [ExpectedUeBehaviourData_1]");
|
||||
|
|
@ -62,7 +76,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (expected_ue_behaviour_data_1->stationary_indication) {
|
||||
if (expected_ue_behaviour_data_1->stationary_indication != OpenAPI_stationary_indication_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "stationaryIndication", OpenAPI_stationary_indication_ToString(expected_ue_behaviour_data_1->stationary_indication)) == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [stationary_indication]");
|
||||
goto end;
|
||||
|
|
@ -96,7 +110,7 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be
|
|||
}
|
||||
}
|
||||
|
||||
if (expected_ue_behaviour_data_1->scheduled_communication_type) {
|
||||
if (expected_ue_behaviour_data_1->scheduled_communication_type != OpenAPI_scheduled_communication_type_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "scheduledCommunicationType", OpenAPI_scheduled_communication_type_ToString(expected_ue_behaviour_data_1->scheduled_communication_type)) == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [scheduled_communication_type]");
|
||||
goto end;
|
||||
|
|
@ -109,21 +123,17 @@ cJSON *OpenAPI_expected_ue_behaviour_data_1_convertToJSON(OpenAPI_expected_ue_be
|
|||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *expected_umts_node;
|
||||
if (expected_ue_behaviour_data_1->expected_umts) {
|
||||
OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, expected_umts_node) {
|
||||
cJSON *itemLocal = OpenAPI_location_area_1_convertToJSON(expected_umts_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(expected_umtsList, itemLocal);
|
||||
OpenAPI_list_for_each(expected_ue_behaviour_data_1->expected_umts, node) {
|
||||
cJSON *itemLocal = OpenAPI_location_area_1_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(expected_umtsList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (expected_ue_behaviour_data_1->traffic_profile) {
|
||||
if (expected_ue_behaviour_data_1->traffic_profile != OpenAPI_traffic_profile_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "trafficProfile", OpenAPI_traffic_profile_ToString(expected_ue_behaviour_data_1->traffic_profile)) == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_convertToJSON() failed [traffic_profile]");
|
||||
goto end;
|
||||
|
|
@ -157,9 +167,23 @@ end:
|
|||
OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_parseFromJSON(cJSON *expected_ue_behaviour_data_1JSON)
|
||||
{
|
||||
OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_data_1_local_var = NULL;
|
||||
cJSON *stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "stationaryIndication");
|
||||
|
||||
OpenAPI_stationary_indication_e stationary_indicationVariable;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *stationary_indication = NULL;
|
||||
OpenAPI_stationary_indication_e stationary_indicationVariable = 0;
|
||||
cJSON *communication_duration_time = NULL;
|
||||
cJSON *periodic_time = NULL;
|
||||
cJSON *scheduled_communication_time = NULL;
|
||||
OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_local_nonprim = NULL;
|
||||
cJSON *scheduled_communication_type = NULL;
|
||||
OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable = 0;
|
||||
cJSON *expected_umts = NULL;
|
||||
OpenAPI_list_t *expected_umtsList = NULL;
|
||||
cJSON *traffic_profile = NULL;
|
||||
OpenAPI_traffic_profile_e traffic_profileVariable = 0;
|
||||
cJSON *battery_indication = NULL;
|
||||
OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL;
|
||||
cJSON *validity_time = NULL;
|
||||
stationary_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "stationaryIndication");
|
||||
if (stationary_indication) {
|
||||
if (!cJSON_IsString(stationary_indication)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [stationary_indication]");
|
||||
|
|
@ -168,8 +192,7 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
stationary_indicationVariable = OpenAPI_stationary_indication_FromString(stationary_indication->valuestring);
|
||||
}
|
||||
|
||||
cJSON *communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "communicationDurationTime");
|
||||
|
||||
communication_duration_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "communicationDurationTime");
|
||||
if (communication_duration_time) {
|
||||
if (!cJSON_IsNumber(communication_duration_time)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [communication_duration_time]");
|
||||
|
|
@ -177,8 +200,7 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "periodicTime");
|
||||
|
||||
periodic_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "periodicTime");
|
||||
if (periodic_time) {
|
||||
if (!cJSON_IsNumber(periodic_time)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [periodic_time]");
|
||||
|
|
@ -186,16 +208,12 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationTime");
|
||||
|
||||
OpenAPI_scheduled_communication_time_1_t *scheduled_communication_time_local_nonprim = NULL;
|
||||
scheduled_communication_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationTime");
|
||||
if (scheduled_communication_time) {
|
||||
scheduled_communication_time_local_nonprim = OpenAPI_scheduled_communication_time_1_parseFromJSON(scheduled_communication_time);
|
||||
}
|
||||
|
||||
cJSON *scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationType");
|
||||
|
||||
OpenAPI_scheduled_communication_type_e scheduled_communication_typeVariable;
|
||||
scheduled_communication_type = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "scheduledCommunicationType");
|
||||
if (scheduled_communication_type) {
|
||||
if (!cJSON_IsString(scheduled_communication_type)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [scheduled_communication_type]");
|
||||
|
|
@ -204,38 +222,32 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
scheduled_communication_typeVariable = OpenAPI_scheduled_communication_type_FromString(scheduled_communication_type->valuestring);
|
||||
}
|
||||
|
||||
cJSON *expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "expectedUmts");
|
||||
|
||||
OpenAPI_list_t *expected_umtsList;
|
||||
expected_umts = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "expectedUmts");
|
||||
if (expected_umts) {
|
||||
cJSON *expected_umts_local_nonprimitive;
|
||||
if (!cJSON_IsArray(expected_umts)){
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
expected_umtsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(expected_umts_local_nonprimitive, expected_umts ) {
|
||||
if (!cJSON_IsObject(expected_umts_local_nonprimitive)) {
|
||||
cJSON *expected_umts_local = NULL;
|
||||
if (!cJSON_IsArray(expected_umts)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_location_area_1_t *expected_umtsItem = OpenAPI_location_area_1_parseFromJSON(expected_umts_local_nonprimitive);
|
||||
|
||||
if (!expected_umtsItem) {
|
||||
ogs_error("No expected_umtsItem");
|
||||
OpenAPI_list_free(expected_umtsList);
|
||||
goto end;
|
||||
expected_umtsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(expected_umts_local, expected_umts) {
|
||||
if (!cJSON_IsObject(expected_umts_local)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [expected_umts]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_location_area_1_t *expected_umtsItem = OpenAPI_location_area_1_parseFromJSON(expected_umts_local);
|
||||
if (!expected_umtsItem) {
|
||||
ogs_error("No expected_umtsItem");
|
||||
OpenAPI_list_free(expected_umtsList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(expected_umtsList, expected_umtsItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(expected_umtsList, expected_umtsItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "trafficProfile");
|
||||
|
||||
OpenAPI_traffic_profile_e traffic_profileVariable;
|
||||
traffic_profile = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "trafficProfile");
|
||||
if (traffic_profile) {
|
||||
if (!cJSON_IsString(traffic_profile)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [traffic_profile]");
|
||||
|
|
@ -244,17 +256,14 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
traffic_profileVariable = OpenAPI_traffic_profile_FromString(traffic_profile->valuestring);
|
||||
}
|
||||
|
||||
cJSON *battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "batteryIndication");
|
||||
|
||||
OpenAPI_battery_indication_t *battery_indication_local_nonprim = NULL;
|
||||
battery_indication = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "batteryIndication");
|
||||
if (battery_indication) {
|
||||
battery_indication_local_nonprim = OpenAPI_battery_indication_parseFromJSON(battery_indication);
|
||||
}
|
||||
|
||||
cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "validityTime");
|
||||
|
||||
validity_time = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviour_data_1JSON, "validityTime");
|
||||
if (validity_time) {
|
||||
if (!cJSON_IsString(validity_time)) {
|
||||
if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_data_1_parseFromJSON() failed [validity_time]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -271,11 +280,26 @@ OpenAPI_expected_ue_behaviour_data_1_t *OpenAPI_expected_ue_behaviour_data_1_par
|
|||
expected_umts ? expected_umtsList : NULL,
|
||||
traffic_profile ? traffic_profileVariable : 0,
|
||||
battery_indication ? battery_indication_local_nonprim : NULL,
|
||||
validity_time ? ogs_strdup(validity_time->valuestring) : NULL
|
||||
validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL
|
||||
);
|
||||
|
||||
return expected_ue_behaviour_data_1_local_var;
|
||||
end:
|
||||
if (scheduled_communication_time_local_nonprim) {
|
||||
OpenAPI_scheduled_communication_time_1_free(scheduled_communication_time_local_nonprim);
|
||||
scheduled_communication_time_local_nonprim = NULL;
|
||||
}
|
||||
if (expected_umtsList) {
|
||||
OpenAPI_list_for_each(expected_umtsList, node) {
|
||||
OpenAPI_location_area_1_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(expected_umtsList);
|
||||
expected_umtsList = NULL;
|
||||
}
|
||||
if (battery_indication_local_nonprim) {
|
||||
OpenAPI_battery_indication_free(battery_indication_local_nonprim);
|
||||
battery_indication_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue