forked from acouzens/open5gs
Fixed a crash on explicit network-initiated deregister with SUBSCRIPTION_WITHDRAWN
This commit is contained in:
parent
474b2d4134
commit
888e58a94e
|
@ -1252,29 +1252,41 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
|
|
||||||
SWITCH(message->h.resource.component[0])
|
SWITCH(message->h.resource.component[0])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
|
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
|
||||||
message->NFProfile =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_nf_profile_parseFromJSON(item);
|
message->NFProfile =
|
||||||
if (!message->NFProfile) {
|
OpenAPI_nf_profile_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->NFProfile) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS)
|
CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS)
|
||||||
message->SubscriptionData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_subscription_data_parseFromJSON(item);
|
message->SubscriptionData =
|
||||||
if (!message->SubscriptionData) {
|
OpenAPI_subscription_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->SubscriptionData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
|
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
|
||||||
message->NotificationData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_notification_data_parseFromJSON(item);
|
message->NotificationData =
|
||||||
if (!message->NotificationData) {
|
OpenAPI_notification_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->NotificationData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1288,11 +1300,15 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
|
CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
|
||||||
SWITCH(message->h.resource.component[0])
|
SWITCH(message->h.resource.component[0])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
|
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
|
||||||
message->SearchResult =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_search_result_parseFromJSON(item);
|
message->SearchResult =
|
||||||
if (!message->SearchResult) {
|
OpenAPI_search_result_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->SearchResult) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1389,10 +1405,14 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS)
|
CASE(OGS_SBI_RESOURCE_NAME_AUTH_EVENTS)
|
||||||
message->AuthEvent = OpenAPI_auth_event_parseFromJSON(item);
|
if (message->res_status < 300) {
|
||||||
if (!message->AuthEvent) {
|
message->AuthEvent = OpenAPI_auth_event_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->AuthEvent) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1410,7 +1430,8 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS)
|
CASE(OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS)
|
||||||
|
|
||||||
SWITCH(message->h.method)
|
SWITCH(message->h.method)
|
||||||
CASE(OGS_SBI_HTTP_METHOD_PUT)
|
CASE(OGS_SBI_HTTP_METHOD_PUT)
|
||||||
|
if (message->res_status < 300) {
|
||||||
message->Amf3GppAccessRegistration =
|
message->Amf3GppAccessRegistration =
|
||||||
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
|
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
|
||||||
item);
|
item);
|
||||||
|
@ -1418,8 +1439,13 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
rv = OGS_ERROR;
|
rv = OGS_ERROR;
|
||||||
ogs_error("JSON parse error");
|
ogs_error("JSON parse error");
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
CASE(OGS_SBI_HTTP_METHOD_PATCH)
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
CASE(OGS_SBI_HTTP_METHOD_PATCH)
|
||||||
|
if (message->res_status < 300) {
|
||||||
message->Amf3GppAccessRegistrationModification =
|
message->Amf3GppAccessRegistrationModification =
|
||||||
OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(
|
OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(
|
||||||
item);
|
item);
|
||||||
|
@ -1427,11 +1453,15 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
rv = OGS_ERROR;
|
rv = OGS_ERROR;
|
||||||
ogs_error("JSON parse error");
|
ogs_error("JSON parse error");
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
DEFAULT
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
rv = OGS_ERROR;
|
message->res_status);
|
||||||
ogs_error("Unknown method [%s]", message->h.method);
|
}
|
||||||
END
|
break;
|
||||||
|
DEFAULT
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("Unknown method [%s]", message->h.method);
|
||||||
|
END
|
||||||
break;
|
break;
|
||||||
DEFAULT
|
DEFAULT
|
||||||
rv = OGS_ERROR;
|
rv = OGS_ERROR;
|
||||||
|
@ -1450,57 +1480,80 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
|
CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
|
||||||
SWITCH(message->h.resource.component[1])
|
SWITCH(message->h.resource.component[1])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
||||||
message->AccessAndMobilitySubscriptionData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(
|
message->AccessAndMobilitySubscriptionData =
|
||||||
item);
|
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(
|
||||||
if (!message->AccessAndMobilitySubscriptionData) {
|
item);
|
||||||
rv = OGS_ERROR;
|
if (!message->AccessAndMobilitySubscriptionData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
|
||||||
message->SmfSelectionSubscriptionData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
|
message->SmfSelectionSubscriptionData =
|
||||||
if (!message->SmfSelectionSubscriptionData) {
|
OpenAPI_smf_selection_subscription_data_parseFromJSON(
|
||||||
rv = OGS_ERROR;
|
item);
|
||||||
ogs_error("JSON parse error");
|
if (!message->SmfSelectionSubscriptionData) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
|
||||||
message->UeContextInSmfData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_ue_context_in_smf_data_parseFromJSON(item);
|
message->UeContextInSmfData =
|
||||||
if (!message->UeContextInSmfData) {
|
OpenAPI_ue_context_in_smf_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->UeContextInSmfData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
||||||
if (item) {
|
if (message->res_status < 300) {
|
||||||
OpenAPI_session_management_subscription_data_t *smsub_item = NULL;
|
if (item) {
|
||||||
cJSON *smsubJSON = NULL;
|
OpenAPI_session_management_subscription_data_t
|
||||||
message->SessionManagementSubscriptionDataList = OpenAPI_list_create();
|
*smsub_item = NULL;
|
||||||
cJSON_ArrayForEach(smsubJSON, item) {
|
cJSON *smsubJSON = NULL;
|
||||||
if (!cJSON_IsObject(smsubJSON)) {
|
message->SessionManagementSubscriptionDataList =
|
||||||
rv = OGS_ERROR;
|
OpenAPI_list_create();
|
||||||
ogs_error("Unknown JSON");
|
cJSON_ArrayForEach(smsubJSON, item) {
|
||||||
goto cleanup;
|
if (!cJSON_IsObject(smsubJSON)) {
|
||||||
}
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("Unknown JSON");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
||||||
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
|
CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
|
||||||
message->SDMSubscription =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_sdm_subscription_parseFromJSON(item);
|
message->SDMSubscription =
|
||||||
if (!message->SDMSubscription) {
|
OpenAPI_sdm_subscription_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->SDMSubscription) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1528,11 +1581,16 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS)
|
CASE(OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS)
|
||||||
message->AuthEvent =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_auth_event_parseFromJSON(item);
|
message->AuthEvent =
|
||||||
if (!message->AuthEvent) {
|
OpenAPI_auth_event_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->AuthEvent) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
DEFAULT
|
DEFAULT
|
||||||
|
@ -1543,12 +1601,17 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_CONTEXT_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_CONTEXT_DATA)
|
||||||
message->Amf3GppAccessRegistration =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
|
message->Amf3GppAccessRegistration =
|
||||||
item);
|
OpenAPI_amf3_gpp_access_registration_parseFromJSON(
|
||||||
if (!message->Amf3GppAccessRegistration) {
|
item);
|
||||||
rv = OGS_ERROR;
|
if (!message->Amf3GppAccessRegistration) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1557,48 +1620,69 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_PROVISIONED_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_PROVISIONED_DATA)
|
||||||
SWITCH(message->h.resource.component[4])
|
SWITCH(message->h.resource.component[4])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
||||||
message->AccessAndMobilitySubscriptionData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
|
message->AccessAndMobilitySubscriptionData =
|
||||||
if (!message->AccessAndMobilitySubscriptionData) {
|
OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->
|
||||||
ogs_error("JSON parse error");
|
AccessAndMobilitySubscriptionData) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA)
|
||||||
message->SmfSelectionSubscriptionData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
|
message->SmfSelectionSubscriptionData =
|
||||||
if (!message->SmfSelectionSubscriptionData) {
|
OpenAPI_smf_selection_subscription_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->SmfSelectionSubscriptionData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
|
||||||
message->UeContextInSmfData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_ue_context_in_smf_data_parseFromJSON(
|
message->UeContextInSmfData =
|
||||||
item);
|
OpenAPI_ue_context_in_smf_data_parseFromJSON(
|
||||||
if (!message->UeContextInSmfData) {
|
item);
|
||||||
rv = OGS_ERROR;
|
if (!message->UeContextInSmfData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
||||||
if (item) {
|
if (message->res_status < 300) {
|
||||||
OpenAPI_session_management_subscription_data_t *smsub_item = NULL;
|
if (item) {
|
||||||
cJSON *smsubJSON = NULL;
|
OpenAPI_session_management_subscription_data_t *smsub_item = NULL;
|
||||||
message->SessionManagementSubscriptionDataList = OpenAPI_list_create();
|
cJSON *smsubJSON = NULL;
|
||||||
cJSON_ArrayForEach(smsubJSON, item) {
|
message->SessionManagementSubscriptionDataList = OpenAPI_list_create();
|
||||||
if (!cJSON_IsObject(smsubJSON)) {
|
cJSON_ArrayForEach(smsubJSON, item) {
|
||||||
rv = OGS_ERROR;
|
if (!cJSON_IsObject(smsubJSON)) {
|
||||||
ogs_error("Unknown JSON");
|
rv = OGS_ERROR;
|
||||||
goto cleanup;
|
ogs_error("Unknown JSON");
|
||||||
}
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
smsub_item = OpenAPI_session_management_subscription_data_parseFromJSON(smsubJSON);
|
||||||
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
OpenAPI_list_add(message->SessionManagementSubscriptionDataList, smsub_item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1622,22 +1706,30 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_UES)
|
CASE(OGS_SBI_RESOURCE_NAME_UES)
|
||||||
SWITCH(message->h.resource.component[3])
|
SWITCH(message->h.resource.component[3])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
|
||||||
|
if (message->res_status < 300) {
|
||||||
message->AmPolicyData =
|
message->AmPolicyData =
|
||||||
OpenAPI_am_policy_data_parseFromJSON(item);
|
OpenAPI_am_policy_data_parseFromJSON(item);
|
||||||
if (!message->AmPolicyData) {
|
if (!message->AmPolicyData) {
|
||||||
rv = OGS_ERROR;
|
rv = OGS_ERROR;
|
||||||
ogs_error("JSON parse error");
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
CASE(OGS_SBI_RESOURCE_NAME_SM_DATA)
|
||||||
|
if (message->res_status < 300) {
|
||||||
message->SmPolicyData =
|
message->SmPolicyData =
|
||||||
OpenAPI_sm_policy_data_parseFromJSON(item);
|
OpenAPI_sm_policy_data_parseFromJSON(item);
|
||||||
if (!message->SmPolicyData) {
|
if (!message->SmPolicyData) {
|
||||||
rv = OGS_ERROR;
|
rv = OGS_ERROR;
|
||||||
ogs_error("JSON parse error");
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1988,11 +2080,16 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
} else {
|
} else {
|
||||||
SWITCH(message->h.method)
|
SWITCH(message->h.method)
|
||||||
CASE(OGS_SBI_HTTP_METHOD_PATCH)
|
CASE(OGS_SBI_HTTP_METHOD_PATCH)
|
||||||
message->AppSessionContextUpdateDataPatch =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_app_session_context_update_data_patch_parseFromJSON(item);
|
message->AppSessionContextUpdateDataPatch =
|
||||||
if (!message->AppSessionContextUpdateDataPatch) {
|
OpenAPI_app_session_context_update_data_patch_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->AppSessionContextUpdateDataPatch) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
DEFAULT
|
DEFAULT
|
||||||
|
@ -2030,29 +2127,42 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_SERVICE_NAME_NAMF_CALLBACK)
|
CASE(OGS_SBI_SERVICE_NAME_NAMF_CALLBACK)
|
||||||
SWITCH(message->h.resource.component[1])
|
SWITCH(message->h.resource.component[1])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS)
|
CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS)
|
||||||
message->SmContextStatusNotification =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_sm_context_status_notification_parseFromJSON(item);
|
message->SmContextStatusNotification =
|
||||||
if (!message->SmContextStatusNotification) {
|
OpenAPI_sm_context_status_notification_parseFromJSON(
|
||||||
rv = OGS_ERROR;
|
item);
|
||||||
ogs_error("JSON parse error");
|
if (!message->SmContextStatusNotification) {
|
||||||
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY)
|
CASE(OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY)
|
||||||
message->DeregistrationData =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_deregistration_data_parseFromJSON(item);
|
message->DeregistrationData =
|
||||||
if (!message->DeregistrationData) {
|
OpenAPI_deregistration_data_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->DeregistrationData) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY)
|
CASE(OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY)
|
||||||
message->ModificationNotification =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_modification_notification_parseFromJSON(item);
|
message->ModificationNotification =
|
||||||
if (!message->ModificationNotification) {
|
OpenAPI_modification_notification_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->ModificationNotification) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2066,31 +2176,45 @@ static int parse_json(ogs_sbi_message_t *message,
|
||||||
CASE(OGS_SBI_SERVICE_NAME_NSMF_CALLBACK)
|
CASE(OGS_SBI_SERVICE_NAME_NSMF_CALLBACK)
|
||||||
SWITCH(message->h.resource.component[0])
|
SWITCH(message->h.resource.component[0])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_FAILURE_NOTIFY)
|
CASE(OGS_SBI_RESOURCE_NAME_N1_N2_FAILURE_NOTIFY)
|
||||||
message->N1N2MsgTxfrFailureNotification =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON(
|
message->N1N2MsgTxfrFailureNotification =
|
||||||
item);
|
OpenAPI_n1_n2_msg_txfr_failure_notification_parseFromJSON(
|
||||||
if (!message->N1N2MsgTxfrFailureNotification) {
|
item);
|
||||||
rv = OGS_ERROR;
|
if (!message->N1N2MsgTxfrFailureNotification) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d", message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY)
|
CASE(OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY)
|
||||||
SWITCH(message->h.resource.component[2])
|
SWITCH(message->h.resource.component[2])
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_UPDATE)
|
CASE(OGS_SBI_RESOURCE_NAME_UPDATE)
|
||||||
message->SmPolicyNotification =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_sm_policy_notification_parseFromJSON(item);
|
message->SmPolicyNotification =
|
||||||
if (!message->SmPolicyNotification) {
|
OpenAPI_sm_policy_notification_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->SmPolicyNotification) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE(OGS_SBI_RESOURCE_NAME_TERMINATE)
|
CASE(OGS_SBI_RESOURCE_NAME_TERMINATE)
|
||||||
message->TerminationNotification =
|
if (message->res_status < 300) {
|
||||||
OpenAPI_termination_notification_parseFromJSON(item);
|
message->TerminationNotification =
|
||||||
if (!message->TerminationNotification) {
|
OpenAPI_termination_notification_parseFromJSON(item);
|
||||||
rv = OGS_ERROR;
|
if (!message->TerminationNotification) {
|
||||||
ogs_error("JSON parse error");
|
rv = OGS_ERROR;
|
||||||
|
ogs_error("JSON parse error");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ogs_error("HTTP ERROR Status : %d",
|
||||||
|
message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,6 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->suci, sbi_message->res_status);
|
amf_ue->suci, sbi_message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.method)
|
SWITCH(sbi_message->h.method)
|
||||||
|
@ -222,7 +221,6 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
|
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->supi, sbi_message->res_status);
|
amf_ue->supi, sbi_message->res_status);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.resource.component[1])
|
SWITCH(sbi_message->h.resource.component[1])
|
||||||
|
@ -292,7 +290,6 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
|
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->supi, sbi_message->res_status);
|
amf_ue->supi, sbi_message->res_status);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.resource.component[1])
|
SWITCH(sbi_message->h.resource.component[1])
|
||||||
|
@ -663,7 +660,6 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->suci, sbi_message->res_status);
|
amf_ue->suci, sbi_message->res_status);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.method)
|
SWITCH(sbi_message->h.method)
|
||||||
|
@ -704,7 +700,6 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
|
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->supi, sbi_message->res_status);
|
amf_ue->supi, sbi_message->res_status);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.resource.component[1])
|
SWITCH(sbi_message->h.resource.component[1])
|
||||||
|
@ -780,7 +775,6 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
||||||
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
|
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
|
||||||
ogs_error("[%s] HTTP response error [%d]",
|
ogs_error("[%s] HTTP response error [%d]",
|
||||||
amf_ue->supi, sbi_message->res_status);
|
amf_ue->supi, sbi_message->res_status);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH(sbi_message->h.resource.component[1])
|
SWITCH(sbi_message->h.resource.component[1])
|
||||||
|
|
|
@ -927,7 +927,8 @@ int amf_namf_callback_handle_sdm_data_change_notify(
|
||||||
if (CM_CONNECTED(amf_ue)) {
|
if (CM_CONNECTED(amf_ue)) {
|
||||||
r = nas_5gs_send_de_registration_request(
|
r = nas_5gs_send_de_registration_request(
|
||||||
amf_ue,
|
amf_ue,
|
||||||
OpenAPI_deregistration_reason_REREGISTRATION_REQUIRED, 0);
|
OpenAPI_deregistration_reason_REREGISTRATION_REQUIRED,
|
||||||
|
OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED);
|
||||||
ogs_expect(r == OGS_OK);
|
ogs_expect(r == OGS_OK);
|
||||||
ogs_assert(r != OGS_ERROR);
|
ogs_assert(r != OGS_ERROR);
|
||||||
|
|
||||||
|
|
|
@ -421,10 +421,11 @@ bool udm_nudm_uecm_handle_registration_update(
|
||||||
ogs_assert(true ==
|
ogs_assert(true ==
|
||||||
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN,
|
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN,
|
||||||
message, "Guami mismatch", udm_ue->supi));
|
message, "Guami mismatch", udm_ue->supi));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Amf3GppAccessRegistrationModification->is_purge_flag) {
|
if (Amf3GppAccessRegistrationModification->is_purge_flag) {
|
||||||
|
ogs_assert(udm_ue->amf_3gpp_access_registration);
|
||||||
udm_ue->amf_3gpp_access_registration->is_purge_flag =
|
udm_ue->amf_3gpp_access_registration->is_purge_flag =
|
||||||
Amf3GppAccessRegistrationModification->is_purge_flag;
|
Amf3GppAccessRegistrationModification->is_purge_flag;
|
||||||
udm_ue->amf_3gpp_access_registration->purge_flag =
|
udm_ue->amf_3gpp_access_registration->purge_flag =
|
||||||
|
@ -434,7 +435,6 @@ bool udm_nudm_uecm_handle_registration_update(
|
||||||
PatchItemList = OpenAPI_list_create();
|
PatchItemList = OpenAPI_list_create();
|
||||||
ogs_assert(PatchItemList);
|
ogs_assert(PatchItemList);
|
||||||
|
|
||||||
|
|
||||||
if (Amf3GppAccessRegistrationModification->is_purge_flag) {
|
if (Amf3GppAccessRegistrationModification->is_purge_flag) {
|
||||||
memset(&item, 0, sizeof(item));
|
memset(&item, 0, sizeof(item));
|
||||||
item.op = OpenAPI_patch_operation_replace;
|
item.op = OpenAPI_patch_operation_replace;
|
||||||
|
|
Loading…
Reference in New Issue