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
|
|
@ -52,37 +52,75 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_create(
|
|||
|
||||
void OpenAPI_hsmf_updated_data_free(OpenAPI_hsmf_updated_data_t *hsmf_updated_data)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == hsmf_updated_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_ref_to_binary_data_free(hsmf_updated_data->n1_sm_info_to_ue);
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info);
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext1);
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext2);
|
||||
OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) {
|
||||
ogs_free(node->data);
|
||||
if (hsmf_updated_data->n1_sm_info_to_ue) {
|
||||
OpenAPI_ref_to_binary_data_free(hsmf_updated_data->n1_sm_info_to_ue);
|
||||
hsmf_updated_data->n1_sm_info_to_ue = NULL;
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->dnai_list);
|
||||
ogs_free(hsmf_updated_data->supported_features);
|
||||
OpenAPI_roaming_charging_profile_free(hsmf_updated_data->roaming_charging_profile);
|
||||
OpenAPI_up_security_free(hsmf_updated_data->up_security);
|
||||
OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) {
|
||||
OpenAPI_qos_flow_setup_item_free(node->data);
|
||||
if (hsmf_updated_data->n4_info) {
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info);
|
||||
hsmf_updated_data->n4_info = NULL;
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->qos_flows_setup_list);
|
||||
OpenAPI_ambr_free(hsmf_updated_data->session_ambr);
|
||||
OpenAPI_eps_pdn_cnx_info_free(hsmf_updated_data->eps_pdn_cnx_info);
|
||||
OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) {
|
||||
OpenAPI_eps_bearer_info_free(node->data);
|
||||
if (hsmf_updated_data->n4_info_ext1) {
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext1);
|
||||
hsmf_updated_data->n4_info_ext1 = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->n4_info_ext2) {
|
||||
OpenAPI_n4_information_free(hsmf_updated_data->n4_info_ext2);
|
||||
hsmf_updated_data->n4_info_ext2 = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->dnai_list) {
|
||||
OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->dnai_list);
|
||||
hsmf_updated_data->dnai_list = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->supported_features) {
|
||||
ogs_free(hsmf_updated_data->supported_features);
|
||||
hsmf_updated_data->supported_features = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->roaming_charging_profile) {
|
||||
OpenAPI_roaming_charging_profile_free(hsmf_updated_data->roaming_charging_profile);
|
||||
hsmf_updated_data->roaming_charging_profile = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->up_security) {
|
||||
OpenAPI_up_security_free(hsmf_updated_data->up_security);
|
||||
hsmf_updated_data->up_security = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->qos_flows_setup_list) {
|
||||
OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) {
|
||||
OpenAPI_qos_flow_setup_item_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->qos_flows_setup_list);
|
||||
hsmf_updated_data->qos_flows_setup_list = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->session_ambr) {
|
||||
OpenAPI_ambr_free(hsmf_updated_data->session_ambr);
|
||||
hsmf_updated_data->session_ambr = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->eps_pdn_cnx_info) {
|
||||
OpenAPI_eps_pdn_cnx_info_free(hsmf_updated_data->eps_pdn_cnx_info);
|
||||
hsmf_updated_data->eps_pdn_cnx_info = NULL;
|
||||
}
|
||||
if (hsmf_updated_data->eps_bearer_info) {
|
||||
OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) {
|
||||
OpenAPI_eps_bearer_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->eps_bearer_info);
|
||||
hsmf_updated_data->eps_bearer_info = NULL;
|
||||
}
|
||||
OpenAPI_list_free(hsmf_updated_data->eps_bearer_info);
|
||||
ogs_free(hsmf_updated_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf_updated_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (hsmf_updated_data == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [HsmfUpdatedData]");
|
||||
|
|
@ -143,19 +181,17 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf
|
|||
}
|
||||
|
||||
if (hsmf_updated_data->dnai_list) {
|
||||
cJSON *dnai_list = cJSON_AddArrayToObject(item, "dnaiList");
|
||||
if (dnai_list == NULL) {
|
||||
cJSON *dnai_listList = cJSON_AddArrayToObject(item, "dnaiList");
|
||||
if (dnai_listList == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *dnai_list_node;
|
||||
OpenAPI_list_for_each(hsmf_updated_data->dnai_list, dnai_list_node) {
|
||||
if (cJSON_AddStringToObject(dnai_list, "", (char*)dnai_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
OpenAPI_list_for_each(hsmf_updated_data->dnai_list, node) {
|
||||
if (cJSON_AddStringToObject(dnai_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hsmf_updated_data->supported_features) {
|
||||
|
|
@ -191,14 +227,14 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf
|
|||
}
|
||||
}
|
||||
|
||||
if (hsmf_updated_data->max_integrity_protected_data_rate_ul) {
|
||||
if (hsmf_updated_data->max_integrity_protected_data_rate_ul != OpenAPI_max_integrity_protected_data_rate_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateUl", OpenAPI_max_integrity_protected_data_rate_ToString(hsmf_updated_data->max_integrity_protected_data_rate_ul)) == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [max_integrity_protected_data_rate_ul]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (hsmf_updated_data->max_integrity_protected_data_rate_dl) {
|
||||
if (hsmf_updated_data->max_integrity_protected_data_rate_dl != OpenAPI_max_integrity_protected_data_rate_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRateDl", OpenAPI_max_integrity_protected_data_rate_ToString(hsmf_updated_data->max_integrity_protected_data_rate_dl)) == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [max_integrity_protected_data_rate_dl]");
|
||||
goto end;
|
||||
|
|
@ -218,17 +254,13 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf
|
|||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *qos_flows_setup_list_node;
|
||||
if (hsmf_updated_data->qos_flows_setup_list) {
|
||||
OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, qos_flows_setup_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(qos_flows_setup_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal);
|
||||
OpenAPI_list_for_each(hsmf_updated_data->qos_flows_setup_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_qos_flow_setup_item_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(qos_flows_setup_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -264,17 +296,13 @@ cJSON *OpenAPI_hsmf_updated_data_convertToJSON(OpenAPI_hsmf_updated_data_t *hsmf
|
|||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *eps_bearer_info_node;
|
||||
if (hsmf_updated_data->eps_bearer_info) {
|
||||
OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, eps_bearer_info_node) {
|
||||
cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(eps_bearer_info_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(eps_bearer_infoList, itemLocal);
|
||||
OpenAPI_list_for_each(hsmf_updated_data->eps_bearer_info, node) {
|
||||
cJSON *itemLocal = OpenAPI_eps_bearer_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_convertToJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(eps_bearer_infoList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -292,80 +320,96 @@ end:
|
|||
OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf_updated_dataJSON)
|
||||
{
|
||||
OpenAPI_hsmf_updated_data_t *hsmf_updated_data_local_var = NULL;
|
||||
cJSON *n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n1SmInfoToUe");
|
||||
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *n1_sm_info_to_ue = NULL;
|
||||
OpenAPI_ref_to_binary_data_t *n1_sm_info_to_ue_local_nonprim = NULL;
|
||||
cJSON *n4_info = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_local_nonprim = NULL;
|
||||
cJSON *n4_info_ext1 = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL;
|
||||
cJSON *n4_info_ext2 = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL;
|
||||
cJSON *dnai_list = NULL;
|
||||
OpenAPI_list_t *dnai_listList = NULL;
|
||||
cJSON *supported_features = NULL;
|
||||
cJSON *roaming_charging_profile = NULL;
|
||||
OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL;
|
||||
cJSON *up_security = NULL;
|
||||
OpenAPI_up_security_t *up_security_local_nonprim = NULL;
|
||||
cJSON *max_integrity_protected_data_rate_ul = NULL;
|
||||
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable = 0;
|
||||
cJSON *max_integrity_protected_data_rate_dl = NULL;
|
||||
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable = 0;
|
||||
cJSON *ipv6_multi_homing_ind = NULL;
|
||||
cJSON *qos_flows_setup_list = NULL;
|
||||
OpenAPI_list_t *qos_flows_setup_listList = NULL;
|
||||
cJSON *session_ambr = NULL;
|
||||
OpenAPI_ambr_t *session_ambr_local_nonprim = NULL;
|
||||
cJSON *eps_pdn_cnx_info = NULL;
|
||||
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL;
|
||||
cJSON *eps_bearer_info = NULL;
|
||||
OpenAPI_list_t *eps_bearer_infoList = NULL;
|
||||
cJSON *pti = NULL;
|
||||
n1_sm_info_to_ue = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n1SmInfoToUe");
|
||||
if (n1_sm_info_to_ue) {
|
||||
n1_sm_info_to_ue_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_info_to_ue);
|
||||
}
|
||||
|
||||
cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4Info");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_local_nonprim = NULL;
|
||||
n4_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4Info");
|
||||
if (n4_info) {
|
||||
n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info);
|
||||
}
|
||||
|
||||
cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt1");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL;
|
||||
n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt1");
|
||||
if (n4_info_ext1) {
|
||||
n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1);
|
||||
}
|
||||
|
||||
cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt2");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL;
|
||||
n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "n4InfoExt2");
|
||||
if (n4_info_ext2) {
|
||||
n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2);
|
||||
}
|
||||
|
||||
cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "dnaiList");
|
||||
|
||||
OpenAPI_list_t *dnai_listList;
|
||||
dnai_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "dnaiList");
|
||||
if (dnai_list) {
|
||||
cJSON *dnai_list_local;
|
||||
if (!cJSON_IsArray(dnai_list)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
dnai_listList = OpenAPI_list_create();
|
||||
cJSON *dnai_list_local = NULL;
|
||||
if (!cJSON_IsArray(dnai_list)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON_ArrayForEach(dnai_list_local, dnai_list) {
|
||||
if (!cJSON_IsString(dnai_list_local)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring));
|
||||
}
|
||||
dnai_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(dnai_list_local, dnai_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(dnai_list_local)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [dnai_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(dnai_listList, ogs_strdup(dnai_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "supportedFeatures");
|
||||
|
||||
supported_features = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "supportedFeatures");
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features)) {
|
||||
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "roamingChargingProfile");
|
||||
|
||||
OpenAPI_roaming_charging_profile_t *roaming_charging_profile_local_nonprim = NULL;
|
||||
roaming_charging_profile = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "roamingChargingProfile");
|
||||
if (roaming_charging_profile) {
|
||||
roaming_charging_profile_local_nonprim = OpenAPI_roaming_charging_profile_parseFromJSON(roaming_charging_profile);
|
||||
}
|
||||
|
||||
cJSON *up_security = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "upSecurity");
|
||||
|
||||
OpenAPI_up_security_t *up_security_local_nonprim = NULL;
|
||||
up_security = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "upSecurity");
|
||||
if (up_security) {
|
||||
up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security);
|
||||
}
|
||||
|
||||
cJSON *max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateUl");
|
||||
|
||||
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_ulVariable;
|
||||
max_integrity_protected_data_rate_ul = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateUl");
|
||||
if (max_integrity_protected_data_rate_ul) {
|
||||
if (!cJSON_IsString(max_integrity_protected_data_rate_ul)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [max_integrity_protected_data_rate_ul]");
|
||||
|
|
@ -374,9 +418,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf
|
|||
max_integrity_protected_data_rate_ulVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_ul->valuestring);
|
||||
}
|
||||
|
||||
cJSON *max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateDl");
|
||||
|
||||
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate_dlVariable;
|
||||
max_integrity_protected_data_rate_dl = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "maxIntegrityProtectedDataRateDl");
|
||||
if (max_integrity_protected_data_rate_dl) {
|
||||
if (!cJSON_IsString(max_integrity_protected_data_rate_dl)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [max_integrity_protected_data_rate_dl]");
|
||||
|
|
@ -385,8 +427,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf
|
|||
max_integrity_protected_data_rate_dlVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate_dl->valuestring);
|
||||
}
|
||||
|
||||
cJSON *ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "ipv6MultiHomingInd");
|
||||
|
||||
ipv6_multi_homing_ind = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "ipv6MultiHomingInd");
|
||||
if (ipv6_multi_homing_ind) {
|
||||
if (!cJSON_IsBool(ipv6_multi_homing_ind)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [ipv6_multi_homing_ind]");
|
||||
|
|
@ -394,80 +435,67 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "qosFlowsSetupList");
|
||||
|
||||
OpenAPI_list_t *qos_flows_setup_listList;
|
||||
qos_flows_setup_list = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "qosFlowsSetupList");
|
||||
if (qos_flows_setup_list) {
|
||||
cJSON *qos_flows_setup_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(qos_flows_setup_list)){
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
qos_flows_setup_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(qos_flows_setup_list_local_nonprimitive, qos_flows_setup_list ) {
|
||||
if (!cJSON_IsObject(qos_flows_setup_list_local_nonprimitive)) {
|
||||
cJSON *qos_flows_setup_list_local = NULL;
|
||||
if (!cJSON_IsArray(qos_flows_setup_list)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local_nonprimitive);
|
||||
|
||||
if (!qos_flows_setup_listItem) {
|
||||
ogs_error("No qos_flows_setup_listItem");
|
||||
OpenAPI_list_free(qos_flows_setup_listList);
|
||||
goto end;
|
||||
qos_flows_setup_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(qos_flows_setup_list_local, qos_flows_setup_list) {
|
||||
if (!cJSON_IsObject(qos_flows_setup_list_local)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [qos_flows_setup_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_qos_flow_setup_item_t *qos_flows_setup_listItem = OpenAPI_qos_flow_setup_item_parseFromJSON(qos_flows_setup_list_local);
|
||||
if (!qos_flows_setup_listItem) {
|
||||
ogs_error("No qos_flows_setup_listItem");
|
||||
OpenAPI_list_free(qos_flows_setup_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(qos_flows_setup_listList, qos_flows_setup_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "sessionAmbr");
|
||||
|
||||
OpenAPI_ambr_t *session_ambr_local_nonprim = NULL;
|
||||
session_ambr = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "sessionAmbr");
|
||||
if (session_ambr) {
|
||||
session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr);
|
||||
}
|
||||
|
||||
cJSON *eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsPdnCnxInfo");
|
||||
|
||||
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info_local_nonprim = NULL;
|
||||
eps_pdn_cnx_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsPdnCnxInfo");
|
||||
if (eps_pdn_cnx_info) {
|
||||
eps_pdn_cnx_info_local_nonprim = OpenAPI_eps_pdn_cnx_info_parseFromJSON(eps_pdn_cnx_info);
|
||||
}
|
||||
|
||||
cJSON *eps_bearer_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsBearerInfo");
|
||||
|
||||
OpenAPI_list_t *eps_bearer_infoList;
|
||||
eps_bearer_info = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "epsBearerInfo");
|
||||
if (eps_bearer_info) {
|
||||
cJSON *eps_bearer_info_local_nonprimitive;
|
||||
if (!cJSON_IsArray(eps_bearer_info)){
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
eps_bearer_infoList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(eps_bearer_info_local_nonprimitive, eps_bearer_info ) {
|
||||
if (!cJSON_IsObject(eps_bearer_info_local_nonprimitive)) {
|
||||
cJSON *eps_bearer_info_local = NULL;
|
||||
if (!cJSON_IsArray(eps_bearer_info)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local_nonprimitive);
|
||||
|
||||
if (!eps_bearer_infoItem) {
|
||||
ogs_error("No eps_bearer_infoItem");
|
||||
OpenAPI_list_free(eps_bearer_infoList);
|
||||
goto end;
|
||||
eps_bearer_infoList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(eps_bearer_info_local, eps_bearer_info) {
|
||||
if (!cJSON_IsObject(eps_bearer_info_local)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [eps_bearer_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_eps_bearer_info_t *eps_bearer_infoItem = OpenAPI_eps_bearer_info_parseFromJSON(eps_bearer_info_local);
|
||||
if (!eps_bearer_infoItem) {
|
||||
ogs_error("No eps_bearer_infoItem");
|
||||
OpenAPI_list_free(eps_bearer_infoList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(eps_bearer_infoList, eps_bearer_infoItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *pti = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "pti");
|
||||
|
||||
pti = cJSON_GetObjectItemCaseSensitive(hsmf_updated_dataJSON, "pti");
|
||||
if (pti) {
|
||||
if (!cJSON_IsNumber(pti)) {
|
||||
ogs_error("OpenAPI_hsmf_updated_data_parseFromJSON() failed [pti]");
|
||||
|
|
@ -481,7 +509,7 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf
|
|||
n4_info_ext1 ? n4_info_ext1_local_nonprim : NULL,
|
||||
n4_info_ext2 ? n4_info_ext2_local_nonprim : NULL,
|
||||
dnai_list ? dnai_listList : NULL,
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
roaming_charging_profile ? roaming_charging_profile_local_nonprim : NULL,
|
||||
up_security ? up_security_local_nonprim : NULL,
|
||||
max_integrity_protected_data_rate_ul ? max_integrity_protected_data_rate_ulVariable : 0,
|
||||
|
|
@ -498,6 +526,59 @@ OpenAPI_hsmf_updated_data_t *OpenAPI_hsmf_updated_data_parseFromJSON(cJSON *hsmf
|
|||
|
||||
return hsmf_updated_data_local_var;
|
||||
end:
|
||||
if (n1_sm_info_to_ue_local_nonprim) {
|
||||
OpenAPI_ref_to_binary_data_free(n1_sm_info_to_ue_local_nonprim);
|
||||
n1_sm_info_to_ue_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_local_nonprim);
|
||||
n4_info_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_ext1_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_ext1_local_nonprim);
|
||||
n4_info_ext1_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_ext2_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_ext2_local_nonprim);
|
||||
n4_info_ext2_local_nonprim = NULL;
|
||||
}
|
||||
if (dnai_listList) {
|
||||
OpenAPI_list_for_each(dnai_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnai_listList);
|
||||
dnai_listList = NULL;
|
||||
}
|
||||
if (roaming_charging_profile_local_nonprim) {
|
||||
OpenAPI_roaming_charging_profile_free(roaming_charging_profile_local_nonprim);
|
||||
roaming_charging_profile_local_nonprim = NULL;
|
||||
}
|
||||
if (up_security_local_nonprim) {
|
||||
OpenAPI_up_security_free(up_security_local_nonprim);
|
||||
up_security_local_nonprim = NULL;
|
||||
}
|
||||
if (qos_flows_setup_listList) {
|
||||
OpenAPI_list_for_each(qos_flows_setup_listList, node) {
|
||||
OpenAPI_qos_flow_setup_item_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(qos_flows_setup_listList);
|
||||
qos_flows_setup_listList = NULL;
|
||||
}
|
||||
if (session_ambr_local_nonprim) {
|
||||
OpenAPI_ambr_free(session_ambr_local_nonprim);
|
||||
session_ambr_local_nonprim = NULL;
|
||||
}
|
||||
if (eps_pdn_cnx_info_local_nonprim) {
|
||||
OpenAPI_eps_pdn_cnx_info_free(eps_pdn_cnx_info_local_nonprim);
|
||||
eps_pdn_cnx_info_local_nonprim = NULL;
|
||||
}
|
||||
if (eps_bearer_infoList) {
|
||||
OpenAPI_list_for_each(eps_bearer_infoList, node) {
|
||||
OpenAPI_eps_bearer_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(eps_bearer_infoList);
|
||||
eps_bearer_infoList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue