mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-03 13:50:08 +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
|
|
@ -66,39 +66,83 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
|||
|
||||
void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configuration)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == dnn_configuration) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_pdu_session_types_free(dnn_configuration->pdu_session_types);
|
||||
OpenAPI_ssc_modes_free(dnn_configuration->ssc_modes);
|
||||
OpenAPI_subscribed_default_qos_free(dnn_configuration->_5g_qos_profile);
|
||||
OpenAPI_ambr_free(dnn_configuration->session_ambr);
|
||||
ogs_free(dnn_configuration->_3gpp_charging_characteristics);
|
||||
OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) {
|
||||
OpenAPI_ip_address_free(node->data);
|
||||
if (dnn_configuration->pdu_session_types) {
|
||||
OpenAPI_pdu_session_types_free(dnn_configuration->pdu_session_types);
|
||||
dnn_configuration->pdu_session_types = NULL;
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->static_ip_address);
|
||||
OpenAPI_up_security_free(dnn_configuration->up_security);
|
||||
ogs_free(dnn_configuration->nidd_nef_id);
|
||||
OpenAPI_nidd_information_free(dnn_configuration->nidd_info);
|
||||
OpenAPI_acs_info_free(dnn_configuration->acs_info);
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
if (dnn_configuration->ssc_modes) {
|
||||
OpenAPI_ssc_modes_free(dnn_configuration->ssc_modes);
|
||||
dnn_configuration->ssc_modes = NULL;
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->ipv4_frame_route_list);
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
if (dnn_configuration->_5g_qos_profile) {
|
||||
OpenAPI_subscribed_default_qos_free(dnn_configuration->_5g_qos_profile);
|
||||
dnn_configuration->_5g_qos_profile = NULL;
|
||||
}
|
||||
if (dnn_configuration->session_ambr) {
|
||||
OpenAPI_ambr_free(dnn_configuration->session_ambr);
|
||||
dnn_configuration->session_ambr = NULL;
|
||||
}
|
||||
if (dnn_configuration->_3gpp_charging_characteristics) {
|
||||
ogs_free(dnn_configuration->_3gpp_charging_characteristics);
|
||||
dnn_configuration->_3gpp_charging_characteristics = NULL;
|
||||
}
|
||||
if (dnn_configuration->static_ip_address) {
|
||||
OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) {
|
||||
OpenAPI_ip_address_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->static_ip_address);
|
||||
dnn_configuration->static_ip_address = NULL;
|
||||
}
|
||||
if (dnn_configuration->up_security) {
|
||||
OpenAPI_up_security_free(dnn_configuration->up_security);
|
||||
dnn_configuration->up_security = NULL;
|
||||
}
|
||||
if (dnn_configuration->nidd_nef_id) {
|
||||
ogs_free(dnn_configuration->nidd_nef_id);
|
||||
dnn_configuration->nidd_nef_id = NULL;
|
||||
}
|
||||
if (dnn_configuration->nidd_info) {
|
||||
OpenAPI_nidd_information_free(dnn_configuration->nidd_info);
|
||||
dnn_configuration->nidd_info = NULL;
|
||||
}
|
||||
if (dnn_configuration->acs_info) {
|
||||
OpenAPI_acs_info_free(dnn_configuration->acs_info);
|
||||
dnn_configuration->acs_info = NULL;
|
||||
}
|
||||
if (dnn_configuration->ipv4_frame_route_list) {
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->ipv4_frame_route_list);
|
||||
dnn_configuration->ipv4_frame_route_list = NULL;
|
||||
}
|
||||
if (dnn_configuration->ipv6_frame_route_list) {
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list);
|
||||
dnn_configuration->ipv6_frame_route_list = NULL;
|
||||
}
|
||||
if (dnn_configuration->dn_aaa_address) {
|
||||
OpenAPI_ip_address_free(dnn_configuration->dn_aaa_address);
|
||||
dnn_configuration->dn_aaa_address = NULL;
|
||||
}
|
||||
if (dnn_configuration->iptv_acc_ctrl_info) {
|
||||
ogs_free(dnn_configuration->iptv_acc_ctrl_info);
|
||||
dnn_configuration->iptv_acc_ctrl_info = NULL;
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list);
|
||||
OpenAPI_ip_address_free(dnn_configuration->dn_aaa_address);
|
||||
ogs_free(dnn_configuration->iptv_acc_ctrl_info);
|
||||
ogs_free(dnn_configuration);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_configuration)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (dnn_configuration == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [DnnConfiguration]");
|
||||
|
|
@ -106,6 +150,10 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!dnn_configuration->pdu_session_types) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *pdu_session_types_local_JSON = OpenAPI_pdu_session_types_convertToJSON(dnn_configuration->pdu_session_types);
|
||||
if (pdu_session_types_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_types]");
|
||||
|
|
@ -117,6 +165,10 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (!dnn_configuration->ssc_modes) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *ssc_modes_local_JSON = OpenAPI_ssc_modes_convertToJSON(dnn_configuration->ssc_modes);
|
||||
if (ssc_modes_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ssc_modes]");
|
||||
|
|
@ -174,17 +226,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *static_ip_address_node;
|
||||
if (dnn_configuration->static_ip_address) {
|
||||
OpenAPI_list_for_each(dnn_configuration->static_ip_address, static_ip_address_node) {
|
||||
cJSON *itemLocal = OpenAPI_ip_address_convertToJSON(static_ip_address_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(static_ip_addressList, itemLocal);
|
||||
OpenAPI_list_for_each(dnn_configuration->static_ip_address, node) {
|
||||
cJSON *itemLocal = OpenAPI_ip_address_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(static_ip_addressList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -201,7 +249,7 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->pdu_session_continuity_ind) {
|
||||
if (dnn_configuration->pdu_session_continuity_ind != OpenAPI_pdu_session_continuity_ind_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "pduSessionContinuityInd", OpenAPI_pdu_session_continuity_ind_ToString(dnn_configuration->pdu_session_continuity_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [pdu_session_continuity_ind]");
|
||||
goto end;
|
||||
|
|
@ -254,17 +302,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *ipv4_frame_route_list_node;
|
||||
if (dnn_configuration->ipv4_frame_route_list) {
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, ipv4_frame_route_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv4_frame_route_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal);
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv4_frame_route_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ipv4_frame_route_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -274,17 +318,13 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *ipv6_frame_route_list_node;
|
||||
if (dnn_configuration->ipv6_frame_route_list) {
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, ipv6_frame_route_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(ipv6_frame_route_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal);
|
||||
OpenAPI_list_for_each(dnn_configuration->ipv6_frame_route_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_frame_route_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ipv6_frame_route_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -336,26 +376,54 @@ end:
|
|||
OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_configurationJSON)
|
||||
{
|
||||
OpenAPI_dnn_configuration_t *dnn_configuration_local_var = NULL;
|
||||
cJSON *pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionTypes");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *pdu_session_types = NULL;
|
||||
OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL;
|
||||
cJSON *ssc_modes = NULL;
|
||||
OpenAPI_ssc_modes_t *ssc_modes_local_nonprim = NULL;
|
||||
cJSON *iwk_eps_ind = NULL;
|
||||
cJSON *_5g_qos_profile = NULL;
|
||||
OpenAPI_subscribed_default_qos_t *_5g_qos_profile_local_nonprim = NULL;
|
||||
cJSON *session_ambr = NULL;
|
||||
OpenAPI_ambr_t *session_ambr_local_nonprim = NULL;
|
||||
cJSON *_3gpp_charging_characteristics = NULL;
|
||||
cJSON *static_ip_address = NULL;
|
||||
OpenAPI_list_t *static_ip_addressList = NULL;
|
||||
cJSON *up_security = NULL;
|
||||
OpenAPI_up_security_t *up_security_local_nonprim = NULL;
|
||||
cJSON *pdu_session_continuity_ind = NULL;
|
||||
OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable = 0;
|
||||
cJSON *nidd_nef_id = NULL;
|
||||
cJSON *nidd_info = NULL;
|
||||
OpenAPI_nidd_information_t *nidd_info_local_nonprim = NULL;
|
||||
cJSON *redundant_session_allowed = NULL;
|
||||
cJSON *acs_info = NULL;
|
||||
OpenAPI_acs_info_t *acs_info_local_nonprim = NULL;
|
||||
cJSON *ipv4_frame_route_list = NULL;
|
||||
OpenAPI_list_t *ipv4_frame_route_listList = NULL;
|
||||
cJSON *ipv6_frame_route_list = NULL;
|
||||
OpenAPI_list_t *ipv6_frame_route_listList = NULL;
|
||||
cJSON *atsss_allowed = NULL;
|
||||
cJSON *secondary_auth = NULL;
|
||||
cJSON *dn_aaa_ip_address_allocation = NULL;
|
||||
cJSON *dn_aaa_address = NULL;
|
||||
OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL;
|
||||
cJSON *iptv_acc_ctrl_info = NULL;
|
||||
pdu_session_types = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionTypes");
|
||||
if (!pdu_session_types) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_types]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_pdu_session_types_t *pdu_session_types_local_nonprim = NULL;
|
||||
pdu_session_types_local_nonprim = OpenAPI_pdu_session_types_parseFromJSON(pdu_session_types);
|
||||
|
||||
cJSON *ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sscModes");
|
||||
ssc_modes = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sscModes");
|
||||
if (!ssc_modes) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ssc_modes]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_ssc_modes_t *ssc_modes_local_nonprim = NULL;
|
||||
ssc_modes_local_nonprim = OpenAPI_ssc_modes_parseFromJSON(ssc_modes);
|
||||
|
||||
cJSON *iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iwkEpsInd");
|
||||
|
||||
iwk_eps_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iwkEpsInd");
|
||||
if (iwk_eps_ind) {
|
||||
if (!cJSON_IsBool(iwk_eps_ind)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [iwk_eps_ind]");
|
||||
|
|
@ -363,68 +431,55 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *_5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "5gQosProfile");
|
||||
|
||||
OpenAPI_subscribed_default_qos_t *_5g_qos_profile_local_nonprim = NULL;
|
||||
_5g_qos_profile = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "5gQosProfile");
|
||||
if (_5g_qos_profile) {
|
||||
_5g_qos_profile_local_nonprim = OpenAPI_subscribed_default_qos_parseFromJSON(_5g_qos_profile);
|
||||
}
|
||||
|
||||
cJSON *session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sessionAmbr");
|
||||
|
||||
OpenAPI_ambr_t *session_ambr_local_nonprim = NULL;
|
||||
session_ambr = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "sessionAmbr");
|
||||
if (session_ambr) {
|
||||
session_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(session_ambr);
|
||||
}
|
||||
|
||||
cJSON *_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "3gppChargingCharacteristics");
|
||||
|
||||
_3gpp_charging_characteristics = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "3gppChargingCharacteristics");
|
||||
if (_3gpp_charging_characteristics) {
|
||||
if (!cJSON_IsString(_3gpp_charging_characteristics)) {
|
||||
if (!cJSON_IsString(_3gpp_charging_characteristics) && !cJSON_IsNull(_3gpp_charging_characteristics)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [_3gpp_charging_characteristics]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "staticIpAddress");
|
||||
|
||||
OpenAPI_list_t *static_ip_addressList;
|
||||
static_ip_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "staticIpAddress");
|
||||
if (static_ip_address) {
|
||||
cJSON *static_ip_address_local_nonprimitive;
|
||||
if (!cJSON_IsArray(static_ip_address)){
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
static_ip_addressList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(static_ip_address_local_nonprimitive, static_ip_address ) {
|
||||
if (!cJSON_IsObject(static_ip_address_local_nonprimitive)) {
|
||||
cJSON *static_ip_address_local = NULL;
|
||||
if (!cJSON_IsArray(static_ip_address)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ip_address_t *static_ip_addressItem = OpenAPI_ip_address_parseFromJSON(static_ip_address_local_nonprimitive);
|
||||
|
||||
if (!static_ip_addressItem) {
|
||||
ogs_error("No static_ip_addressItem");
|
||||
OpenAPI_list_free(static_ip_addressList);
|
||||
goto end;
|
||||
static_ip_addressList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(static_ip_address_local, static_ip_address) {
|
||||
if (!cJSON_IsObject(static_ip_address_local)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [static_ip_address]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ip_address_t *static_ip_addressItem = OpenAPI_ip_address_parseFromJSON(static_ip_address_local);
|
||||
if (!static_ip_addressItem) {
|
||||
ogs_error("No static_ip_addressItem");
|
||||
OpenAPI_list_free(static_ip_addressList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(static_ip_addressList, static_ip_addressItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(static_ip_addressList, static_ip_addressItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *up_security = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "upSecurity");
|
||||
|
||||
OpenAPI_up_security_t *up_security_local_nonprim = NULL;
|
||||
up_security = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "upSecurity");
|
||||
if (up_security) {
|
||||
up_security_local_nonprim = OpenAPI_up_security_parseFromJSON(up_security);
|
||||
}
|
||||
|
||||
cJSON *pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionContinuityInd");
|
||||
|
||||
OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_indVariable;
|
||||
pdu_session_continuity_ind = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "pduSessionContinuityInd");
|
||||
if (pdu_session_continuity_ind) {
|
||||
if (!cJSON_IsString(pdu_session_continuity_ind)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [pdu_session_continuity_ind]");
|
||||
|
|
@ -433,24 +488,20 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
pdu_session_continuity_indVariable = OpenAPI_pdu_session_continuity_ind_FromString(pdu_session_continuity_ind->valuestring);
|
||||
}
|
||||
|
||||
cJSON *nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddNefId");
|
||||
|
||||
nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddNefId");
|
||||
if (nidd_nef_id) {
|
||||
if (!cJSON_IsString(nidd_nef_id)) {
|
||||
if (!cJSON_IsString(nidd_nef_id) && !cJSON_IsNull(nidd_nef_id)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [nidd_nef_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddInfo");
|
||||
|
||||
OpenAPI_nidd_information_t *nidd_info_local_nonprim = NULL;
|
||||
nidd_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddInfo");
|
||||
if (nidd_info) {
|
||||
nidd_info_local_nonprim = OpenAPI_nidd_information_parseFromJSON(nidd_info);
|
||||
}
|
||||
|
||||
cJSON *redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "redundantSessionAllowed");
|
||||
|
||||
redundant_session_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "redundantSessionAllowed");
|
||||
if (redundant_session_allowed) {
|
||||
if (!cJSON_IsBool(redundant_session_allowed)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [redundant_session_allowed]");
|
||||
|
|
@ -458,73 +509,62 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "acsInfo");
|
||||
|
||||
OpenAPI_acs_info_t *acs_info_local_nonprim = NULL;
|
||||
acs_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "acsInfo");
|
||||
if (acs_info) {
|
||||
acs_info_local_nonprim = OpenAPI_acs_info_parseFromJSON(acs_info);
|
||||
}
|
||||
|
||||
cJSON *ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv4FrameRouteList");
|
||||
|
||||
OpenAPI_list_t *ipv4_frame_route_listList;
|
||||
ipv4_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv4FrameRouteList");
|
||||
if (ipv4_frame_route_list) {
|
||||
cJSON *ipv4_frame_route_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(ipv4_frame_route_list)){
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ipv4_frame_route_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv4_frame_route_list_local_nonprimitive, ipv4_frame_route_list ) {
|
||||
if (!cJSON_IsObject(ipv4_frame_route_list_local_nonprimitive)) {
|
||||
cJSON *ipv4_frame_route_list_local = NULL;
|
||||
if (!cJSON_IsArray(ipv4_frame_route_list)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_frame_route_info_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv4_frame_route_list_local_nonprimitive);
|
||||
|
||||
if (!ipv4_frame_route_listItem) {
|
||||
ogs_error("No ipv4_frame_route_listItem");
|
||||
OpenAPI_list_free(ipv4_frame_route_listList);
|
||||
goto end;
|
||||
ipv4_frame_route_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv4_frame_route_list_local, ipv4_frame_route_list) {
|
||||
if (!cJSON_IsObject(ipv4_frame_route_list_local)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv4_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_frame_route_info_t *ipv4_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv4_frame_route_list_local);
|
||||
if (!ipv4_frame_route_listItem) {
|
||||
ogs_error("No ipv4_frame_route_listItem");
|
||||
OpenAPI_list_free(ipv4_frame_route_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(ipv4_frame_route_listList, ipv4_frame_route_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv6FrameRouteList");
|
||||
|
||||
OpenAPI_list_t *ipv6_frame_route_listList;
|
||||
ipv6_frame_route_list = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "ipv6FrameRouteList");
|
||||
if (ipv6_frame_route_list) {
|
||||
cJSON *ipv6_frame_route_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(ipv6_frame_route_list)){
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ipv6_frame_route_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv6_frame_route_list_local_nonprimitive, ipv6_frame_route_list ) {
|
||||
if (!cJSON_IsObject(ipv6_frame_route_list_local_nonprimitive)) {
|
||||
cJSON *ipv6_frame_route_list_local = NULL;
|
||||
if (!cJSON_IsArray(ipv6_frame_route_list)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_frame_route_info_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv6_frame_route_list_local_nonprimitive);
|
||||
|
||||
if (!ipv6_frame_route_listItem) {
|
||||
ogs_error("No ipv6_frame_route_listItem");
|
||||
OpenAPI_list_free(ipv6_frame_route_listList);
|
||||
goto end;
|
||||
ipv6_frame_route_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv6_frame_route_list_local, ipv6_frame_route_list) {
|
||||
if (!cJSON_IsObject(ipv6_frame_route_list_local)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [ipv6_frame_route_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_frame_route_info_t *ipv6_frame_route_listItem = OpenAPI_frame_route_info_parseFromJSON(ipv6_frame_route_list_local);
|
||||
if (!ipv6_frame_route_listItem) {
|
||||
ogs_error("No ipv6_frame_route_listItem");
|
||||
OpenAPI_list_free(ipv6_frame_route_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(ipv6_frame_route_listList, ipv6_frame_route_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "atsssAllowed");
|
||||
|
||||
atsss_allowed = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "atsssAllowed");
|
||||
if (atsss_allowed) {
|
||||
if (!cJSON_IsBool(atsss_allowed)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [atsss_allowed]");
|
||||
|
|
@ -532,8 +572,7 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "secondaryAuth");
|
||||
|
||||
secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "secondaryAuth");
|
||||
if (secondary_auth) {
|
||||
if (!cJSON_IsBool(secondary_auth)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [secondary_auth]");
|
||||
|
|
@ -541,8 +580,7 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaIpAddressAllocation");
|
||||
|
||||
dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaIpAddressAllocation");
|
||||
if (dn_aaa_ip_address_allocation) {
|
||||
if (!cJSON_IsBool(dn_aaa_ip_address_allocation)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [dn_aaa_ip_address_allocation]");
|
||||
|
|
@ -550,17 +588,14 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaAddress");
|
||||
|
||||
OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL;
|
||||
dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaAddress");
|
||||
if (dn_aaa_address) {
|
||||
dn_aaa_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(dn_aaa_address);
|
||||
}
|
||||
|
||||
cJSON *iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iptvAccCtrlInfo");
|
||||
|
||||
iptv_acc_ctrl_info = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "iptvAccCtrlInfo");
|
||||
if (iptv_acc_ctrl_info) {
|
||||
if (!cJSON_IsString(iptv_acc_ctrl_info)) {
|
||||
if (!cJSON_IsString(iptv_acc_ctrl_info) && !cJSON_IsNull(iptv_acc_ctrl_info)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [iptv_acc_ctrl_info]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -573,11 +608,11 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
iwk_eps_ind ? iwk_eps_ind->valueint : 0,
|
||||
_5g_qos_profile ? _5g_qos_profile_local_nonprim : NULL,
|
||||
session_ambr ? session_ambr_local_nonprim : NULL,
|
||||
_3gpp_charging_characteristics ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL,
|
||||
_3gpp_charging_characteristics && !cJSON_IsNull(_3gpp_charging_characteristics) ? ogs_strdup(_3gpp_charging_characteristics->valuestring) : NULL,
|
||||
static_ip_address ? static_ip_addressList : NULL,
|
||||
up_security ? up_security_local_nonprim : NULL,
|
||||
pdu_session_continuity_ind ? pdu_session_continuity_indVariable : 0,
|
||||
nidd_nef_id ? ogs_strdup(nidd_nef_id->valuestring) : NULL,
|
||||
nidd_nef_id && !cJSON_IsNull(nidd_nef_id) ? ogs_strdup(nidd_nef_id->valuestring) : NULL,
|
||||
nidd_info ? nidd_info_local_nonprim : NULL,
|
||||
redundant_session_allowed ? true : false,
|
||||
redundant_session_allowed ? redundant_session_allowed->valueint : 0,
|
||||
|
|
@ -591,11 +626,64 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
dn_aaa_ip_address_allocation ? true : false,
|
||||
dn_aaa_ip_address_allocation ? dn_aaa_ip_address_allocation->valueint : 0,
|
||||
dn_aaa_address ? dn_aaa_address_local_nonprim : NULL,
|
||||
iptv_acc_ctrl_info ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL
|
||||
iptv_acc_ctrl_info && !cJSON_IsNull(iptv_acc_ctrl_info) ? ogs_strdup(iptv_acc_ctrl_info->valuestring) : NULL
|
||||
);
|
||||
|
||||
return dnn_configuration_local_var;
|
||||
end:
|
||||
if (pdu_session_types_local_nonprim) {
|
||||
OpenAPI_pdu_session_types_free(pdu_session_types_local_nonprim);
|
||||
pdu_session_types_local_nonprim = NULL;
|
||||
}
|
||||
if (ssc_modes_local_nonprim) {
|
||||
OpenAPI_ssc_modes_free(ssc_modes_local_nonprim);
|
||||
ssc_modes_local_nonprim = NULL;
|
||||
}
|
||||
if (_5g_qos_profile_local_nonprim) {
|
||||
OpenAPI_subscribed_default_qos_free(_5g_qos_profile_local_nonprim);
|
||||
_5g_qos_profile_local_nonprim = NULL;
|
||||
}
|
||||
if (session_ambr_local_nonprim) {
|
||||
OpenAPI_ambr_free(session_ambr_local_nonprim);
|
||||
session_ambr_local_nonprim = NULL;
|
||||
}
|
||||
if (static_ip_addressList) {
|
||||
OpenAPI_list_for_each(static_ip_addressList, node) {
|
||||
OpenAPI_ip_address_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(static_ip_addressList);
|
||||
static_ip_addressList = NULL;
|
||||
}
|
||||
if (up_security_local_nonprim) {
|
||||
OpenAPI_up_security_free(up_security_local_nonprim);
|
||||
up_security_local_nonprim = NULL;
|
||||
}
|
||||
if (nidd_info_local_nonprim) {
|
||||
OpenAPI_nidd_information_free(nidd_info_local_nonprim);
|
||||
nidd_info_local_nonprim = NULL;
|
||||
}
|
||||
if (acs_info_local_nonprim) {
|
||||
OpenAPI_acs_info_free(acs_info_local_nonprim);
|
||||
acs_info_local_nonprim = NULL;
|
||||
}
|
||||
if (ipv4_frame_route_listList) {
|
||||
OpenAPI_list_for_each(ipv4_frame_route_listList, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ipv4_frame_route_listList);
|
||||
ipv4_frame_route_listList = NULL;
|
||||
}
|
||||
if (ipv6_frame_route_listList) {
|
||||
OpenAPI_list_for_each(ipv6_frame_route_listList, node) {
|
||||
OpenAPI_frame_route_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ipv6_frame_route_listList);
|
||||
ipv6_frame_route_listList = NULL;
|
||||
}
|
||||
if (dn_aaa_address_local_nonprim) {
|
||||
OpenAPI_ip_address_free(dn_aaa_address_local_nonprim);
|
||||
dn_aaa_address_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue