From eb2b19b39ca5e64fb3875207f2e6f0c5a81753b9 Mon Sep 17 00:00:00 2001 From: gstaa <93838663+gstaa@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:29:20 +0200 Subject: [PATCH] Include cause in HTTP response ProblemDetails (#3051) Cause is set according to particular NF standard. Additionally: - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED typo fixed. - [PCF] Fixed SM Policy establishment error handling --- lib/sbi/message.h | 2 +- lib/sbi/mhd-server.c | 2 +- lib/sbi/nghttp2-server.c | 2 +- lib/sbi/nnrf-handler.c | 23 ++++----- lib/sbi/server.c | 3 +- lib/sbi/server.h | 3 +- src/amf/amf-sm.c | 25 +++++----- src/amf/namf-handler.c | 2 +- src/ausf/ausf-sm.c | 16 +++--- src/ausf/nausf-handler.c | 8 +-- src/ausf/nudm-handler.c | 44 ++++++++++++----- src/ausf/sbi-path.c | 4 +- src/ausf/ue-sm.c | 10 ++-- src/bsf/bsf-sm.c | 16 +++--- src/bsf/nbsf-handler.c | 3 +- src/bsf/sbi-path.c | 4 +- src/nrf/nf-sm.c | 32 ++++++------ src/nrf/nnrf-handler.c | 55 ++++++++++++--------- src/nrf/nrf-sm.c | 22 +++++---- src/nssf/nnssf-handler.c | 3 +- src/nssf/nssf-sm.c | 12 +++-- src/pcf/am-sm.c | 10 ++-- src/pcf/nbsf-handler.c | 3 +- src/pcf/npcf-handler.c | 35 ++++++++++---- src/pcf/nudr-handler.c | 19 ++++++-- src/pcf/pcf-sm.c | 30 +++++++----- src/pcf/sbi-path.c | 4 +- src/pcf/sm-sm.c | 52 +++++++++++++++----- src/scp/sbi-path.c | 12 +++-- src/scp/scp-sm.c | 14 +++--- src/sepp/handshake-sm.c | 6 +-- src/sepp/n32c-handler.c | 10 ++-- src/sepp/sbi-path.c | 2 +- src/sepp/sepp-sm.c | 16 +++--- src/smf/gsm-sm.c | 47 +++++++++++------- src/smf/n4-handler.c | 2 +- src/smf/namf-handler.c | 8 +-- src/smf/npcf-handler.c | 2 +- src/smf/nudm-handler.c | 2 +- src/smf/pfcp-path.c | 3 +- src/smf/sbi-path.c | 4 +- src/smf/smf-sm.c | 28 ++++++----- src/udm/nudm-handler.c | 102 +++++++++++++++++++++++---------------- src/udm/nudr-handler.c | 96 +++++++++++++++++++----------------- src/udm/sbi-path.c | 4 +- src/udm/sess-sm.c | 7 +-- src/udm/udm-sm.c | 22 +++++---- src/udm/ue-sm.c | 26 +++++----- src/udr/nudr-handler.c | 70 +++++++++++++++------------ src/udr/udr-sm.c | 18 ++++--- tests/af/af-sm.c | 20 ++++---- 51 files changed, 573 insertions(+), 392 deletions(-) diff --git a/lib/sbi/message.h b/lib/sbi/message.h index b295f3195..7f5cd9109 100644 --- a/lib/sbi/message.h +++ b/lib/sbi/message.h @@ -48,7 +48,7 @@ extern "C" { #define OGS_SBI_HTTP_STATUS_UNAUTHORIZED 401 /* ALL */ #define OGS_SBI_HTTP_STATUS_FORBIDDEN 403 /* ALL */ #define OGS_SBI_HTTP_STATUS_NOT_FOUND 404 /* ALL */ -#define OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED 405 /* ALL */ +#define OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED 405 /* ALL */ #define OGS_SBI_HTTP_STATUS_NOT_ACCEPTABLE 406 /* GET OPTIONS */ #define OGS_SBI_HTTP_STATUS_REQUEST_TIMEOUT 408 /* ALL */ #define OGS_SBI_HTTP_STATUS_CONFLICT 409 /* PATCH POST PUT */ diff --git a/lib/sbi/mhd-server.c b/lib/sbi/mhd-server.c index 913d0f931..a5d3eef7f 100644 --- a/lib/sbi/mhd-server.c +++ b/lib/sbi/mhd-server.c @@ -576,7 +576,7 @@ suspend: ogs_assert(true == ogs_sbi_server_send_error((ogs_sbi_stream_t *)sbi_sess, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "server callback error", NULL)); + "server callback error", NULL, NULL)); return MHD_YES; } diff --git a/lib/sbi/nghttp2-server.c b/lib/sbi/nghttp2-server.c index 43074beb9..4352d46e1 100644 --- a/lib/sbi/nghttp2-server.c +++ b/lib/sbi/nghttp2-server.c @@ -1174,7 +1174,7 @@ static int on_frame_recv(nghttp2_session *session, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "server callback error", NULL)); + "server callback error", NULL, NULL)); return 0; } diff --git a/lib/sbi/nnrf-handler.c b/lib/sbi/nnrf-handler.c index 3279cd4af..b36c7c375 100644 --- a/lib/sbi/nnrf-handler.c +++ b/lib/sbi/nnrf-handler.c @@ -927,7 +927,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_error("No NotificationData"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NotificationData", NULL)); + recvmsg, "No NotificationData", NULL, NULL)); return false; } @@ -935,7 +935,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_error("No nfInstanceUri"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No nfInstanceUri", NULL)); + recvmsg, "No nfInstanceUri", NULL, NULL)); return false; } @@ -947,7 +947,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_error("Cannot parse nfInstanceUri [%s]", header.uri); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "Cannot parse nfInstanceUri", header.uri)); + recvmsg, "Cannot parse nfInstanceUri", header.uri, NULL)); return false; } @@ -955,7 +955,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_error("No nfInstanceId [%s]", header.uri); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "Cannot parse nfInstanceUri", header.uri)); + recvmsg, "Cannot parse nfInstanceUri", header.uri, NULL)); ogs_sbi_header_free(&header); return false; } @@ -966,7 +966,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, recvmsg, "The notification is not allowed", - message.h.resource.component[1])); + message.h.resource.component[1], NULL)); ogs_sbi_header_free(&header); return false; } @@ -982,7 +982,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile", NULL)); + recvmsg, "No NFProfile", NULL, NULL)); ogs_sbi_header_free(&header); return false; } @@ -992,7 +992,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFInstanceId", NULL)); + recvmsg, "No NFProfile.NFInstanceId", NULL, NULL)); ogs_sbi_header_free(&header); return false; } @@ -1002,7 +1002,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFType", NULL)); + recvmsg, "No NFProfile.NFType", NULL, NULL)); ogs_sbi_header_free(&header); return false; } @@ -1012,7 +1012,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFStatus", NULL)); + recvmsg, "No NFProfile.NFStatus", NULL, NULL)); ogs_sbi_header_free(&header); return false; } @@ -1086,7 +1086,8 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Not found", message.h.resource.component[1])); + recvmsg, "Not found", message.h.resource.component[1], + NULL)); ogs_sbi_header_free(&header); return false; } @@ -1098,7 +1099,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "Not supported event", - eventstr ? eventstr : "Unknown")); + eventstr ? eventstr : "Unknown", NULL)); ogs_sbi_header_free(&header); return false; } diff --git a/lib/sbi/server.c b/lib/sbi/server.c index 151bcf033..49cf3015e 100644 --- a/lib/sbi/server.c +++ b/lib/sbi/server.c @@ -197,7 +197,7 @@ bool ogs_sbi_server_send_problem( bool ogs_sbi_server_send_error(ogs_sbi_stream_t *stream, int status, ogs_sbi_message_t *message, - const char *title, const char *detail) + const char *title, const char *detail, const char *cause) { OpenAPI_problem_details_t problem; @@ -224,6 +224,7 @@ bool ogs_sbi_server_send_error(ogs_sbi_stream_t *stream, } problem.title = (char*)title; problem.detail = (char*)detail; + problem.cause = (char*)cause; ogs_sbi_server_send_problem(stream, &problem); diff --git a/lib/sbi/server.h b/lib/sbi/server.h index 50480713f..ddd5e96c6 100644 --- a/lib/sbi/server.h +++ b/lib/sbi/server.h @@ -90,7 +90,8 @@ bool ogs_sbi_server_send_response( ogs_sbi_stream_t *stream, ogs_sbi_response_t *response); bool ogs_sbi_server_send_error(ogs_sbi_stream_t *stream, int status, ogs_sbi_message_t *message, - const char *title, const char *detail); + const char *title, const char *detail, const char *cause); + bool ogs_sbi_server_send_problem( ogs_sbi_stream_t *stream, OpenAPI_problem_details_t *problem); diff --git a/src/amf/amf-sm.c b/src/amf/amf-sm.c index 22de3f852..e2df53c4d 100644 --- a/src/amf/amf-sm.c +++ b/src/amf/amf-sm.c @@ -99,7 +99,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, NULL)); break; } @@ -117,7 +117,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &sbi_message, "Not supported version", NULL)); + &sbi_message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&sbi_message); break; } @@ -137,7 +137,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &sbi_message, - "Invalid HTTP method", sbi_message.h.method)); + "Invalid HTTP method", sbi_message.h.method, NULL)); END break; @@ -148,7 +148,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; @@ -166,7 +166,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, - "No N1N2MessageTransferReqData", NULL)); + "No N1N2MessageTransferReqData", NULL, NULL)); } break; @@ -176,7 +176,8 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &sbi_message, - "Invalid HTTP method", sbi_message.h.method)); + "Invalid HTTP method", sbi_message.h.method, + NULL)); END break; @@ -192,7 +193,8 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &sbi_message, - "Invalid HTTP method", sbi_message.h.method)); + "Invalid HTTP method", sbi_message.h.method, + NULL)); END break; @@ -203,7 +205,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[2])); + sbi_message.h.resource.component[2], NULL)); END break; @@ -214,7 +216,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; @@ -245,7 +247,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[1])); + sbi_message.h.resource.component[1], NULL)); END break; @@ -254,7 +256,8 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, - "Invalid API name", sbi_message.h.resource.component[0])); + "Invalid API name", sbi_message.h.resource.component[0], + NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ diff --git a/src/amf/namf-handler.c b/src/amf/namf-handler.c index 2cc8c46d4..d1b97cffe 100644 --- a/src/amf/namf-handler.c +++ b/src/amf/namf-handler.c @@ -1467,7 +1467,7 @@ cleanup: ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, NULL, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, NULL, strerror, NULL, NULL)); ogs_free(strerror); return OGS_ERROR; diff --git a/src/ausf/ausf-sm.c b/src/ausf/ausf-sm.c index a7eb5ae60..f17bb4348 100644 --- a/src/ausf/ausf-sm.c +++ b/src/ausf/ausf-sm.c @@ -73,7 +73,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -82,7 +82,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -104,7 +104,8 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -115,7 +116,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -147,7 +148,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.method)); + &message, "Not found", message.h.method, NULL)); break; } @@ -167,7 +168,8 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.resource.component[0])); + "Invalid API name", message.h.resource.component[0], + NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -428,7 +430,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); break; default: ogs_error("Unknown timer[%s:%d]", diff --git a/src/ausf/nausf-handler.c b/src/ausf/nausf-handler.c index a255a7508..2c4fd45e6 100644 --- a/src/ausf/nausf-handler.c +++ b/src/ausf/nausf-handler.c @@ -37,7 +37,7 @@ bool ausf_nausf_auth_handle_authenticate(ausf_ue_t *ausf_ue, ogs_error("[%s] No AuthenticationInfo", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationInfo", ausf_ue->suci)); + recvmsg, "No AuthenticationInfo", ausf_ue->suci, NULL)); return false; } @@ -46,7 +46,7 @@ bool ausf_nausf_auth_handle_authenticate(ausf_ue_t *ausf_ue, ogs_error("[%s] No servingNetworkName", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No servingNetworkName", ausf_ue->suci)); + recvmsg, "No servingNetworkName", ausf_ue->suci, NULL)); return false; } @@ -82,7 +82,7 @@ bool ausf_nausf_auth_handle_authenticate_confirmation(ausf_ue_t *ausf_ue, ogs_error("[%s] No ConfirmationData", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No ConfirmationData", ausf_ue->suci)); + recvmsg, "No ConfirmationData", ausf_ue->suci, NULL)); return false; } @@ -91,7 +91,7 @@ bool ausf_nausf_auth_handle_authenticate_confirmation(ausf_ue_t *ausf_ue, ogs_error("[%s] No ConfirmationData.resStar", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No ConfirmationData.resStar", ausf_ue->suci)); + recvmsg, "No ConfirmationData.resStar", ausf_ue->suci, NULL)); return false; } diff --git a/src/ausf/nudm-handler.c b/src/ausf/nudm-handler.c index 8872b6026..91d835170 100644 --- a/src/ausf/nudm-handler.c +++ b/src/ausf/nudm-handler.c @@ -63,7 +63,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationInfoResult", ausf_ue->suci)); + recvmsg, "No AuthenticationInfoResult", ausf_ue->suci, + NULL)); return false; } @@ -75,7 +76,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_IMPLEMENTED, - recvmsg, "Not supported Auth Method", ausf_ue->suci)); + recvmsg, "Not supported Auth Method", ausf_ue->suci, + NULL)); return false; } @@ -86,17 +88,32 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector", ausf_ue->suci)); + recvmsg, "No AuthenticationVector", ausf_ue->suci, NULL)); return false; } if (AuthenticationVector->av_type != OpenAPI_av_type_5G_HE_AKA) { ogs_error("[%s] Not supported Auth Method [%d]", ausf_ue->suci, AuthenticationVector->av_type); + /* + * TS29.509 + * 5.2.2.2.2 5G AKA + * + * On failure or redirection, one of the HTTP status code + * listed in table 6.1.7.3-1 shall be returned with the message + * body containing a ProblemDetails structure with the "cause" + * attribute set to one of the application error listed in + * Table 6.1.7.3-1. + * Application Error: AUTHENTICATION_REJECTED + * HTTP status code: 403 Forbidden + * Description: The user cannot be authenticated with this + * authentication method e.g. only SIM data available + */ ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - recvmsg, "Not supported Auth Method", ausf_ue->suci)); + recvmsg, "Not supported Auth Method", ausf_ue->suci, + "AUTHENTICATION_REJECTED")); return false; } @@ -105,7 +122,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector.rand", ausf_ue->suci)); + recvmsg, "No AuthenticationVector.rand", ausf_ue->suci, + NULL)); return false; } @@ -115,7 +133,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector.xresStar", ausf_ue->suci)); + recvmsg, "No AuthenticationVector.xresStar", ausf_ue->suci, + NULL)); return false; } @@ -124,7 +143,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector.autn", ausf_ue->suci)); + recvmsg, "No AuthenticationVector.autn", ausf_ue->suci, + NULL)); return false; } @@ -133,7 +153,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector.kausf", ausf_ue->suci)); + recvmsg, "No AuthenticationVector.kausf", ausf_ue->suci, + NULL)); return false; } @@ -142,7 +163,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationVector.supi", ausf_ue->suci)); + recvmsg, "No AuthenticationVector.supi", ausf_ue->suci, + NULL)); return false; } @@ -274,7 +296,7 @@ bool ausf_nudm_ueau_handle_result_confirmation_inform(ausf_ue_t *ausf_ue, ogs_error("[%s] No AuthEvent", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthEvent", ausf_ue->suci)); + recvmsg, "No AuthEvent", ausf_ue->suci, NULL)); return false; } @@ -282,7 +304,7 @@ bool ausf_nudm_ueau_handle_result_confirmation_inform(ausf_ue_t *ausf_ue, ogs_error("[%s] No Location", ausf_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Location", ausf_ue->suci)); + recvmsg, "No Location", ausf_ue->suci, NULL)); return false; } diff --git a/src/ausf/sbi-path.c b/src/ausf/sbi-path.c index d80c81aa4..34d252b38 100644 --- a/src/ausf/sbi-path.c +++ b/src/ausf/sbi-path.c @@ -96,7 +96,7 @@ int ausf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", ausf_ue->suci)); + "Cannot discover", ausf_ue->suci, NULL)); return OGS_ERROR; } @@ -109,7 +109,7 @@ int ausf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", ausf_ue->suci)); + "Cannot discover", ausf_ue->suci, NULL)); return r; } diff --git a/src/ausf/ue-sm.c b/src/ausf/ue-sm.c index f2f8f4716..a701aac96 100644 --- a/src/ausf/ue-sm.c +++ b/src/ausf/ue-sm.c @@ -95,7 +95,7 @@ void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "[%s] No SUPI", ausf_ue->suci)); + message, "[%s] No SUPI", ausf_ue->suci, NULL)); OGS_FSM_TRAN(s, ausf_ue_state_exception); break; } @@ -114,7 +114,7 @@ void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "[%s] No SUPI", ausf_ue->suci)); + message, "[%s] No SUPI", ausf_ue->suci, NULL)); OGS_FSM_TRAN(s, ausf_ue_state_exception); break; } @@ -133,7 +133,8 @@ void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, + NULL)); END break; @@ -162,7 +163,8 @@ void ausf_ue_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, message->res_status, - NULL, "HTTP response error", ausf_ue->suci)); + NULL, "HTTP response error", ausf_ue->suci, + message->ProblemDetails->cause)); break; } diff --git a/src/bsf/bsf-sm.c b/src/bsf/bsf-sm.c index e67ad24d4..730038e07 100644 --- a/src/bsf/bsf-sm.c +++ b/src/bsf/bsf-sm.c @@ -76,7 +76,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, NULL)); break; } @@ -85,7 +85,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -105,7 +105,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -116,7 +116,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -166,7 +166,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.uri)); + &message, "Not found", message.h.uri, NULL)); break; } @@ -180,7 +180,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -189,7 +189,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -412,7 +412,7 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); } break; diff --git a/src/bsf/nbsf-handler.c b/src/bsf/nbsf-handler.c index dbf315294..c391500a6 100644 --- a/src/bsf/nbsf-handler.c +++ b/src/bsf/nbsf-handler.c @@ -303,7 +303,8 @@ cleanup: ogs_assert(status); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL, + NULL)); ogs_free(strerror); return false; diff --git a/src/bsf/sbi-path.c b/src/bsf/sbi-path.c index d9d973905..5d5383ad4 100644 --- a/src/bsf/sbi-path.c +++ b/src/bsf/sbi-path.c @@ -96,7 +96,7 @@ int bsf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", sess->dnn)); + "Cannot discover", sess->dnn, NULL)); return OGS_ERROR; } @@ -109,7 +109,7 @@ int bsf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", sess->dnn)); + "Cannot discover", sess->dnn, NULL)); return r; } diff --git a/src/nrf/nf-sm.c b/src/nrf/nf-sm.c index 8e2047297..545d68bd0 100644 --- a/src/nrf/nf-sm.c +++ b/src/nrf/nf-sm.c @@ -128,8 +128,8 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid HTTP method", message->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -138,9 +138,9 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.resource.component[0]); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, "Invalid resource name", - message->h.resource.component[0])); + message->h.resource.component[0], NULL)); END break; @@ -149,8 +149,9 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.service.name); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid resource name", message->h.service.name)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid resource name", message->h.service.name, + NULL)); END OGS_FSM_TRAN(s, nrf_nf_state_registered); @@ -162,7 +163,8 @@ void nrf_nf_state_will_register(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - message, "Unknown event", nrf_event_get_name(e))); + message, "Unknown event", nrf_event_get_name(e), + NULL)); OGS_FSM_TRAN(s, nrf_nf_state_exception); break; } @@ -256,8 +258,8 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid HTTP method", message->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -266,9 +268,9 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.resource.component[0]); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, "Invalid resource name", - message->h.resource.component[0])); + message->h.resource.component[0], NULL)); END break; @@ -277,8 +279,9 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) nf_instance->id, message->h.service.name); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, message, - "Invalid resource name", message->h.service.name)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid resource name", message->h.service.name, + NULL)); END break; @@ -288,7 +291,8 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - message, "Unknown event", nrf_event_get_name(e))); + message, "Unknown event", nrf_event_get_name(e), + NULL)); OGS_FSM_TRAN(s, nrf_nf_state_exception); break; } diff --git a/src/nrf/nnrf-handler.c b/src/nrf/nnrf-handler.c index 1368e2fcb..69bccb90d 100644 --- a/src/nrf/nnrf-handler.c +++ b/src/nrf/nnrf-handler.c @@ -42,7 +42,7 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_error("No NFProfile"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile", NULL)); + recvmsg, "No NFProfile", NULL, NULL)); return false; } @@ -51,7 +51,7 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFInstanceId", NULL)); + recvmsg, "No NFProfile.NFInstanceId", NULL, NULL)); return false; } @@ -60,7 +60,7 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFType", NULL)); + recvmsg, "No NFProfile.NFType", NULL, NULL)); return false; } @@ -69,7 +69,7 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No NFProfile.NFStatus", NULL)); + recvmsg, "No NFProfile.NFStatus", NULL, NULL)); return false; } @@ -220,7 +220,7 @@ bool nrf_nnrf_handle_nf_update(ogs_sbi_nf_instance_t *nf_instance, ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList", NULL)); + recvmsg, "No PatchItemList", NULL, NULL)); return false; } @@ -231,7 +231,7 @@ bool nrf_nnrf_handle_nf_update(ogs_sbi_nf_instance_t *nf_instance, ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItem", NULL)); + recvmsg, "No PatchItem", NULL, NULL)); return false; } @@ -296,16 +296,15 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "Invalid POST Format", - recvmsg->h.resource.component[1])); + recvmsg->h.resource.component[1], NULL)); return false; } SubscriptionData = recvmsg->SubscriptionData; if (!SubscriptionData) { - ogs_error("No SubscriptionData"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SubscriptionData", NULL)); + recvmsg, "No SubscriptionData", NULL, NULL)); return false; } @@ -314,7 +313,8 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SubscriptionData", "NFStatusNotificationURL")); + recvmsg, "No SubscriptionData", "NFStatusNotificationURL", + NULL)); return false; } @@ -403,7 +403,8 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "Invalid URI", subscription_data->notification_uri)); + recvmsg, "Invalid URI", subscription_data->notification_uri, + NULL)); ogs_sbi_subscription_data_remove(subscription_data); return false; } @@ -496,7 +497,7 @@ bool nrf_nnrf_handle_nf_status_update( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SubscriptionId", NULL)); + recvmsg, "No SubscriptionId", NULL, NULL)); return false; } @@ -507,7 +508,8 @@ bool nrf_nnrf_handle_nf_status_update( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Not found", recvmsg->h.resource.component[1])); + recvmsg, "Not found", recvmsg->h.resource.component[1], + NULL)); return false; } ogs_assert(subscription_data->id); @@ -518,7 +520,8 @@ bool nrf_nnrf_handle_nf_status_update( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList", subscription_data->id)); + recvmsg, "No PatchItemList", subscription_data->id, + NULL)); return false; } @@ -529,7 +532,7 @@ bool nrf_nnrf_handle_nf_status_update( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItem", NULL)); + recvmsg, "No PatchItem", NULL, NULL)); return false; } @@ -634,7 +637,7 @@ bool nrf_nnrf_handle_nf_status_unsubscribe( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SubscriptionId", NULL)); + recvmsg, "No SubscriptionId", NULL, NULL)); return false; } @@ -645,7 +648,8 @@ bool nrf_nnrf_handle_nf_status_unsubscribe( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Not found", recvmsg->h.resource.component[1])); + recvmsg, "Not found", recvmsg->h.resource.component[1], + NULL)); return false; } @@ -741,7 +745,8 @@ bool nrf_nnrf_handle_nf_profile_retrieval( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Not found", recvmsg->h.resource.component[1])); + recvmsg, "Not found", recvmsg->h.resource.component[1], + NULL)); return false; } @@ -783,14 +788,14 @@ bool nrf_nnrf_handle_nf_discover( ogs_error("No target-nf-type [%s]", recvmsg->h.uri); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No target-nf-type", NULL)); + recvmsg, "No target-nf-type", NULL, NULL)); return false; } if (!recvmsg->param.requester_nf_type) { ogs_error("No requester-nf-type [%s]", recvmsg->h.uri); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No requester-nf-type", NULL)); + recvmsg, "No requester-nf-type", NULL, NULL)); return false; } @@ -1004,7 +1009,7 @@ bool nrf_nnrf_handle_nf_discover( ogs_error("nrf_assoc_add() failed"); ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "nrf_assoc_add() failed", NULL)); + recvmsg, "nrf_assoc_add() failed", NULL, NULL)); goto cleanup; } @@ -1016,7 +1021,8 @@ bool nrf_nnrf_handle_nf_discover( ogs_error("ogs_nnrf_disc_build_discover() failed"); ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "ogs_nnrf_disc_build_discover() failed", NULL)); + recvmsg, "ogs_nnrf_disc_build_discover() failed", NULL, + NULL)); nrf_assoc_remove(assoc); goto cleanup; } @@ -1027,7 +1033,8 @@ bool nrf_nnrf_handle_nf_discover( ogs_error("ogs_sbi_send_request_to_client"); ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "ogs_sbi_send_request_to_client() failed", NULL)); + recvmsg, "ogs_sbi_send_request_to_client() failed", NULL, + NULL)); ogs_sbi_request_free(request); nrf_assoc_remove(assoc); goto cleanup; @@ -1085,7 +1092,7 @@ static int discover_handler( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "response_handler() failed", NULL)); + "response_handler() failed", NULL, NULL)); nrf_assoc_remove(assoc); diff --git a/src/nrf/nrf-sm.c b/src/nrf/nrf-sm.c index d9038e333..5a16a9e2f 100644 --- a/src/nrf/nrf-sm.c +++ b/src/nrf/nrf-sm.c @@ -73,7 +73,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -82,7 +82,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -108,7 +108,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) stream, OGS_SBI_HTTP_STATUS_NOT_IMPLEMENTED, &message, "OPTIONS method is not implemented yet", - NULL)); + NULL, NULL)); break; DEFAULT @@ -131,7 +131,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) stream, OGS_SBI_HTTP_STATUS_PAYLOAD_TOO_LARGE, &message, "Insufficient space", - message.h.resource.component[1])); + message.h.resource.component[1], NULL)); break; } nf_instance = ogs_sbi_nf_instance_add(); @@ -153,7 +153,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, &message, "Not found", - message.h.resource.component[1])); + message.h.resource.component[1], NULL)); END } @@ -202,7 +202,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -213,7 +213,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -233,7 +233,8 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -245,7 +246,7 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -254,7 +255,8 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.resource.component[0])); + "Invalid API name", message.h.resource.component[0], + NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ diff --git a/src/nssf/nnssf-handler.c b/src/nssf/nnssf-handler.c index 8d4371fc6..c4a1fc3b6 100644 --- a/src/nssf/nnssf-handler.c +++ b/src/nssf/nnssf-handler.c @@ -84,7 +84,8 @@ cleanup: ogs_assert(strerror); ogs_error("%s", strerror); - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL, + NULL); ogs_free(strerror); return false; diff --git a/src/nssf/nssf-sm.c b/src/nssf/nssf-sm.c index 71561e713..a62c42a36 100644 --- a/src/nssf/nssf-sm.c +++ b/src/nssf/nssf-sm.c @@ -74,7 +74,7 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -91,7 +91,7 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -111,7 +111,8 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - &message, "Invalid HTTP method", message.h.method)); + &message, "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -122,7 +123,7 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -131,7 +132,8 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.resource.component[0])); + "Invalid API name", message.h.resource.component[0], + NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ diff --git a/src/pcf/am-sm.c b/src/pcf/am-sm.c index b8ba51e5a..74c1dacd9 100644 --- a/src/pcf/am-sm.c +++ b/src/pcf/am-sm.c @@ -83,8 +83,8 @@ void pcf_am_state_operational(ogs_fsm_t *s, pcf_event_t *e) pcf_ue->supi, message->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -113,7 +113,8 @@ void pcf_am_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, message->res_status, - NULL, "HTTP response error", pcf_ue->supi)); + NULL, "HTTP response error", pcf_ue->supi, + NULL)); break; } @@ -140,7 +141,8 @@ void pcf_am_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid API name", message->h.resource.component[0])); + "Invalid API name", message->h.resource.component[0], + NULL)); END break; diff --git a/src/pcf/nbsf-handler.c b/src/pcf/nbsf-handler.c index 56f6345eb..84c3ddbb4 100644 --- a/src/pcf/nbsf-handler.c +++ b/src/pcf/nbsf-handler.c @@ -399,7 +399,8 @@ cleanup: ogs_assert(status); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL, + NULL)); ogs_free(strerror); OGS_SESSION_DATA_FREE(&session_data); diff --git a/src/pcf/npcf-handler.c b/src/pcf/npcf-handler.c index abd56150c..1754a1186 100644 --- a/src/pcf/npcf-handler.c +++ b/src/pcf/npcf-handler.c @@ -51,7 +51,8 @@ bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_error("[%s] No PolicyAssociationRequest", pcf_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "[%s] No PolicyAssociationRequest", pcf_ue->supi)); + message, "[%s] No PolicyAssociationRequest", pcf_ue->supi, + NULL)); return false; } @@ -59,7 +60,7 @@ bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_error("[%s] No notificationUri", pcf_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No notificationUri", pcf_ue->supi)); + message, "No notificationUri", pcf_ue->supi, NULL)); return false; } @@ -67,7 +68,7 @@ bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_error("[%s] No supi", pcf_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No supi", pcf_ue->supi)); + message, "No supi", pcf_ue->supi, NULL)); return false; } @@ -75,7 +76,7 @@ bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_error("[%s] No suppFeat", pcf_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No suppFeat", pcf_ue->supi)); + message, "No suppFeat", pcf_ue->supi, NULL)); return false; } @@ -86,7 +87,7 @@ bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, pcf_ue->supi, PolicyAssociationRequest->notification_uri); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "[%s] Invalid URI", pcf_ue->supi)); + message, "[%s] Invalid URI", pcf_ue->supi, NULL)); return false; } @@ -546,8 +547,21 @@ cleanup: ogs_assert(status); ogs_assert(strerror); ogs_error("%s", strerror); + /* + * TS29.512 + * 4.2.2.2 SM Policy Association establishment + * + * If the PCF is, due to incomplete, erroneous or missing + * information (e.g. QoS, RAT type, subscriber information) + * not able to provision a policy decision as response to + * the request for PCC rules by the SMF, the PCF may reject + * the request and include in an HTTP "400 Bad Request" + * response message the "cause" attribute of the ProblemDetails + * data structure set to "ERROR_INITIAL_PARAMETERS". + */ ogs_assert(true == - ogs_sbi_server_send_error(stream, status, message, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, message, + strerror, NULL, "ERROR_INITIAL_PARAMETERS")); ogs_free(strerror); return false; @@ -605,7 +619,8 @@ cleanup: ogs_assert(strerror); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, message, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, message, strerror, NULL, + NULL)); ogs_free(strerror); return false; @@ -1071,7 +1086,8 @@ cleanup: ogs_assert(strerror); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL, + NULL)); ogs_free(strerror); OpenAPI_list_for_each(PccRuleList, node) { @@ -1483,7 +1499,8 @@ cleanup: ogs_assert(strerror); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, + NULL, NULL)); ogs_free(strerror); OpenAPI_list_for_each(PccRuleList, node) { diff --git a/src/pcf/nudr-handler.c b/src/pcf/nudr-handler.c index eb0ebfb0b..f39407d27 100644 --- a/src/pcf/nudr-handler.c +++ b/src/pcf/nudr-handler.c @@ -174,7 +174,8 @@ cleanup: ogs_assert(status); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, + NULL, NULL)); ogs_free(strerror); ogs_subscription_data_free(&subscription_data); @@ -249,10 +250,22 @@ bool pcf_nudr_dr_handle_query_sm_data( cleanup: ogs_assert(strerror); - ogs_assert(status); + status = OGS_SBI_HTTP_STATUS_FORBIDDEN; ogs_error("%s", strerror); + /* + * TS29.512 + * 4.2.2.2 SM Policy Association establishment + * + * If the PCF, based on local configuration and/or operator + * policies, denies the creation of the Individual SM Policy + * resource, the PCF may reject the request and include in + * an HTTP "403 Forbidden" response message the "cause" + * attribute of the ProblemDetails data structure set to + * "POLICY_CONTEXT_DENIED". + */ ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, + NULL, "POLICY_CONTEXT_DENIED")); ogs_free(strerror); return false; diff --git a/src/pcf/pcf-sm.c b/src/pcf/pcf-sm.c index 2e1973860..10381a1a4 100644 --- a/src/pcf/pcf-sm.c +++ b/src/pcf/pcf-sm.c @@ -79,7 +79,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -88,7 +88,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -108,7 +108,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -119,7 +119,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -153,7 +153,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.method)); + &message, "Not found", message.h.method, NULL)); break; } @@ -204,13 +204,21 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) DEFAULT END - if (!sess) { ogs_error("Not found [%s]", message.h.uri); + /* + * TS29.512 + * 4.2.2.2 SM Policy Association establishment + * + * If the user information received within the "supi" attribute is + * unknown, the PCF shall reject the request with an HTTP "400 Bad + * Request" response message including the "cause" attribute + * of the ProblemDetails data structure set to "USER_UNKNOWN". + */ ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.uri)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + &message, "Not found", message.h.uri, "USER_UNKNOWN")); break; } @@ -260,7 +268,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.uri)); + &message, "Not found", message.h.uri, NULL)); break; } @@ -282,7 +290,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -694,7 +702,7 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); break; default: diff --git a/src/pcf/sbi-path.c b/src/pcf/sbi-path.c index 46d75d138..2dff9a07f 100644 --- a/src/pcf/sbi-path.c +++ b/src/pcf/sbi-path.c @@ -174,7 +174,7 @@ int pcf_ue_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", pcf_ue->supi)); + "Cannot discover", pcf_ue->supi, NULL)); return r; } @@ -217,7 +217,7 @@ int pcf_sess_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", NULL)); + "Cannot discover", NULL, NULL)); return r; } diff --git a/src/pcf/sm-sm.c b/src/pcf/sm-sm.c index 92de11b44..527f40930 100644 --- a/src/pcf/sm-sm.c +++ b/src/pcf/sm-sm.c @@ -96,8 +96,8 @@ void pcf_sm_state_operational(ogs_fsm_t *s, pcf_event_t *e) pcf_ue->supi, sess->psi, message->h.uri); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.uri)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.uri, NULL)); END } break; @@ -116,8 +116,8 @@ void pcf_sm_state_operational(ogs_fsm_t *s, pcf_event_t *e) message->h.resource.component[2]); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid resource name", message->h.uri)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, + "Invalid resource name", message->h.uri, NULL)); END } else { SWITCH(message->h.method) @@ -130,8 +130,8 @@ void pcf_sm_state_operational(ogs_fsm_t *s, pcf_event_t *e) pcf_ue->supi, sess->psi, message->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.uri)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.uri, NULL)); END } } else { @@ -145,8 +145,8 @@ void pcf_sm_state_operational(ogs_fsm_t *s, pcf_event_t *e) pcf_ue->supi, sess->psi, message->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.uri)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, message, + "Invalid HTTP method", message->h.uri, NULL)); END } break; @@ -176,14 +176,42 @@ void pcf_sm_state_operational(ogs_fsm_t *s, pcf_event_t *e) OGS_SBI_HTTP_STATUS_NOT_FOUND) { ogs_warn("[%s:%d] Cannot find SUPI [%d]", pcf_ue->supi, sess->psi, message->res_status); + /* + * TS29.512 + * 4.2.2.2 SM Policy Association establishment + * + * If the user information received within the "supi" + * attribute is unknown, the PCF shall reject the + * request with an HTTP "400 Bad Request" response + * message including the "cause" attribute of the + * ProblemDetails data structure set to "USER_UNKNOWN". + */ + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + NULL, "End user is unknown to the PCF", + pcf_ue->supi, "USER_UNKNOWN")); } else { ogs_error("[%s:%d] HTTP response error [%d]", pcf_ue->supi, sess->psi, message->res_status); + /* + * TS29.512 + * 4.2.2.2 SM Policy Association establishment + * + * If the PCF, based on local configuration and/or + * operator policies, denies the creation of the + * Individual SM Policy resource, the PCF may reject + * the request and include in an HTTP "403 Forbidden" + * response message the "cause" attribute of the + * ProblemDetails data structure set to + * "POLICY_CONTEXT_DENIED". + */ + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, + NULL, "HTTP response error", + pcf_ue->supi, "POLICY_CONTEXT_DENIED")); } - ogs_assert(true == - ogs_sbi_server_send_error( - stream, message->res_status, - NULL, "HTTP response error", pcf_ue->supi)); break; } diff --git a/src/scp/sbi-path.c b/src/scp/sbi-path.c index 1a16953e0..50ad923d3 100644 --- a/src/scp/sbi-path.c +++ b/src/scp/sbi-path.c @@ -631,7 +631,7 @@ static int response_handler( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "response_handler() failed", NULL)); + "response_handler() failed", NULL, NULL)); scp_assoc_remove(assoc); @@ -700,7 +700,7 @@ static int nf_discover_handler( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "nf_discover_handler() failed", NULL)); + "nf_discover_handler() failed", NULL, NULL)); scp_assoc_remove(assoc); return OGS_ERROR; @@ -787,7 +787,8 @@ cleanup: ogs_assert(true == ogs_sbi_server_send_error( - stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL, + NULL)); ogs_free(strerror); @@ -829,7 +830,7 @@ static int sepp_discover_handler( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "sepp_discover_handler() failed", NULL)); + "sepp_discover_handler() failed", NULL, NULL)); scp_assoc_remove(assoc); return OGS_ERROR; @@ -881,7 +882,8 @@ cleanup: ogs_assert(true == ogs_sbi_server_send_error( - stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL, + NULL)); ogs_free(strerror); diff --git a/src/scp/scp-sm.c b/src/scp/scp-sm.c index 8613dc1cc..587ab1ac4 100644 --- a/src/scp/scp-sm.c +++ b/src/scp/scp-sm.c @@ -72,7 +72,8 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, + NULL)); break; } @@ -81,7 +82,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -101,7 +102,8 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -112,7 +114,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -121,7 +123,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -314,7 +316,7 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); } break; diff --git a/src/sepp/handshake-sm.c b/src/sepp/handshake-sm.c index 4d7d25570..0ff9d7a0e 100644 --- a/src/sepp/handshake-sm.c +++ b/src/sepp/handshake-sm.c @@ -154,7 +154,7 @@ void sepp_handshake_state_will_establish(ogs_fsm_t *s, sepp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, "PRINS is not supported", - sepp_node->receiver)); + sepp_node->receiver, NULL)); } else if (sepp_node->negotiated_security_scheme == OpenAPI_security_capability_NONE) { @@ -341,7 +341,7 @@ void sepp_handshake_state_established(ogs_fsm_t *s, sepp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, "PRINS is not supported", - sepp_node->receiver)); + sepp_node->receiver, NULL)); } else if (sepp_node->negotiated_security_scheme == OpenAPI_security_capability_NONE) { @@ -483,7 +483,7 @@ void sepp_handshake_state_terminated(ogs_fsm_t *s, sepp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, "PRINS is not supported", - sepp_node->receiver)); + sepp_node->receiver, NULL)); } else if (sepp_node->negotiated_security_scheme == OpenAPI_security_capability_NONE) { diff --git a/src/sepp/n32c-handler.c b/src/sepp/n32c-handler.c index 75af2e0f1..7c4a9a8a5 100644 --- a/src/sepp/n32c-handler.c +++ b/src/sepp/n32c-handler.c @@ -40,7 +40,8 @@ bool sepp_n32c_handshake_handle_security_capability_request( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SecNegotiateReqData", sepp_node->receiver)); + recvmsg, "No SecNegotiateReqData", sepp_node->receiver, + NULL)); return false; } @@ -49,7 +50,8 @@ bool sepp_n32c_handshake_handle_security_capability_request( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SecNegotiateReqData.sender", sepp_node->receiver)); + recvmsg, "No SecNegotiateReqData.sender", sepp_node->receiver, + NULL)); return false; } @@ -66,7 +68,7 @@ bool sepp_n32c_handshake_handle_security_capability_request( ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "No supported_sec_capability_list", - sepp_node->receiver)); + sepp_node->receiver, NULL)); return false; } @@ -104,7 +106,7 @@ bool sepp_n32c_handshake_handle_security_capability_request( ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "Unknown SupportedSecCapability", - sepp_node->receiver)); + sepp_node->receiver, NULL)); return false; } diff --git a/src/sepp/sbi-path.c b/src/sepp/sbi-path.c index 187e42a44..78b68ec68 100644 --- a/src/sepp/sbi-path.c +++ b/src/sepp/sbi-path.c @@ -422,7 +422,7 @@ static int response_handler( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "response_handler() failed", NULL)); + "response_handler() failed", NULL, NULL)); sepp_assoc_remove(assoc); diff --git a/src/sepp/sepp-sm.c b/src/sepp/sepp-sm.c index 835d972ec..58b484d80 100644 --- a/src/sepp/sepp-sm.c +++ b/src/sepp/sepp-sm.c @@ -76,7 +76,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, NULL)); break; } @@ -85,7 +85,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -111,7 +111,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -122,7 +122,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -157,7 +157,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -168,7 +168,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END if (!sepp_node) { @@ -176,7 +176,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.method)); + &message, "Not found", message.h.method, NULL)); break; } @@ -194,7 +194,7 @@ void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ diff --git a/src/smf/gsm-sm.c b/src/smf/gsm-sm.c index d1226ca9e..32da155f2 100644 --- a/src/smf/gsm-sm.c +++ b/src/smf/gsm-sm.c @@ -263,7 +263,7 @@ void smf_gsm_state_initial(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, "Invalid resource name [%s]", - sbi_message->h.resource.component[2])); + sbi_message->h.resource.component[2], NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); break; DEFAULT @@ -280,7 +280,8 @@ void smf_gsm_state_initial(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, - "Invalid API name", sbi_message->h.service.name)); + "Invalid API name", sbi_message->h.service.name, + NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -315,7 +316,8 @@ void smf_gsm_state_initial(ogs_fsm_t *s, smf_event_t *e) ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, + NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -477,7 +479,8 @@ void smf_gsm_state_wait_5gc_sm_policy_association(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, sbi_message->res_status, - sbi_message, strerror, NULL)); + sbi_message, strerror, NULL, + sbi_message->ProblemDetails->cause)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -501,7 +504,7 @@ void smf_gsm_state_wait_5gc_sm_policy_association(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - sbi_message, strerror, NULL)); + sbi_message, strerror, NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -872,7 +875,7 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, "Invalid resource name [%s]", - sbi_message->h.resource.component[2])); + sbi_message->h.resource.component[2], NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -882,7 +885,8 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, - "Invalid API name", sbi_message->h.service.name)); + "Invalid API name", sbi_message->h.service.name, + NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -913,7 +917,8 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, sbi_message->res_status, - sbi_message, strerror, NULL)); + sbi_message, strerror, NULL, + sbi_message->ProblemDetails->cause)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -993,7 +998,7 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - sbi_message, strerror, NULL)); + sbi_message, strerror, NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); END @@ -1010,7 +1015,7 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - sbi_message, strerror, NULL)); + sbi_message, strerror, NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); END @@ -1100,7 +1105,8 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, + NULL, NULL)); ogs_free(strerror); } break; @@ -1157,7 +1163,8 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, + NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -1601,7 +1608,7 @@ void smf_gsm_state_wait_5gc_n1_n2_release(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, "Invalid resource name [%s]", - sbi_message->h.resource.component[2])); + sbi_message->h.resource.component[2], NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -1611,7 +1618,8 @@ void smf_gsm_state_wait_5gc_n1_n2_release(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, - "Invalid API name", sbi_message->h.service.name)); + "Invalid API name", sbi_message->h.service.name, + NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -1704,7 +1712,8 @@ void smf_gsm_state_wait_5gc_n1_n2_release(ogs_fsm_t *s, smf_event_t *e) ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, + NULL, NULL)); ogs_free(strerror); OGS_FSM_TRAN(s, smf_gsm_state_exception); @@ -1771,7 +1780,8 @@ void smf_gsm_state_wait_5gc_n1_n2_release(ogs_fsm_t *s, smf_event_t *e) ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, + NULL, NULL)); ogs_free(strerror); } break; @@ -1938,7 +1948,7 @@ void smf_gsm_state_5gc_session_will_deregister(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, "Invalid resource name [%s]", - sbi_message->h.resource.component[2])); + sbi_message->h.resource.component[2], NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; @@ -1948,7 +1958,8 @@ void smf_gsm_state_5gc_session_will_deregister(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, sbi_message, - "Invalid API name", sbi_message->h.service.name)); + "Invalid API name", sbi_message->h.service.name, + NULL)); OGS_FSM_TRAN(s, smf_gsm_state_exception); END break; diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index 355ff1477..db1f91c2f 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -705,7 +705,7 @@ int smf_5gc_n4_handle_session_deletion_response( ogs_assert(stream); ogs_assert(true == ogs_sbi_server_send_error( - stream, status, NULL, strerror, NULL)); + stream, status, NULL, strerror, NULL, NULL)); } else if (trigger == OGS_PFCP_DELETE_TRIGGER_PCF_INITIATED) { /* No stream - Nothing */ } else { diff --git a/src/smf/namf-handler.c b/src/smf/namf-handler.c index d04b38ccb..5bfa823da 100644 --- a/src/smf/namf-handler.c +++ b/src/smf/namf-handler.c @@ -198,7 +198,7 @@ bool smf_namf_comm_handle_n1_n2_message_transfer_failure_notify( ogs_error("No N1N2MsgTxfrFailureNotification"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No N1N2MsgTxfrFailureNotification", NULL)); + recvmsg, "No N1N2MsgTxfrFailureNotification", NULL, NULL)); return false; } @@ -206,7 +206,7 @@ bool smf_namf_comm_handle_n1_n2_message_transfer_failure_notify( ogs_error("No Cause"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Cause", NULL)); + recvmsg, "No Cause", NULL, NULL)); return false; } @@ -214,7 +214,7 @@ bool smf_namf_comm_handle_n1_n2_message_transfer_failure_notify( ogs_error("No n1n2MsgDataUri"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No n1n2MsgDataUri", NULL)); + recvmsg, "No n1n2MsgDataUri", NULL, NULL)); return false; } @@ -225,7 +225,7 @@ bool smf_namf_comm_handle_n1_n2_message_transfer_failure_notify( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, recvmsg, N1N2MsgTxfrFailureNotification->n1n2_msg_data_uri, - NULL)); + NULL, NULL)); return false; } diff --git a/src/smf/npcf-handler.c b/src/smf/npcf-handler.c index 22441af2e..631363fda 100644 --- a/src/smf/npcf-handler.c +++ b/src/smf/npcf-handler.c @@ -697,7 +697,7 @@ cleanup: ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; diff --git a/src/smf/nudm-handler.c b/src/smf/nudm-handler.c index 62b47ac40..fff72ffd4 100644 --- a/src/smf/nudm-handler.c +++ b/src/smf/nudm-handler.c @@ -373,7 +373,7 @@ cleanup: ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; diff --git a/src/smf/pfcp-path.c b/src/smf/pfcp-path.c index fc02ae6ae..168eeb963 100644 --- a/src/smf/pfcp-path.c +++ b/src/smf/pfcp-path.c @@ -283,7 +283,8 @@ static void sess_5gc_timeout(ogs_pfcp_xact_t *xact, void *data) ogs_assert(stream); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, strerror, NULL)); + OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, strerror, + NULL, NULL)); } else { ogs_fatal("Unknown trigger [%d]", trigger); ogs_assert_if_reached(); diff --git a/src/smf/sbi-path.c b/src/smf/sbi-path.c index fb0e89f4c..7edcef793 100644 --- a/src/smf/sbi-path.c +++ b/src/smf/sbi-path.c @@ -206,7 +206,7 @@ int smf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", smf_ue->supi)); + "Cannot discover", smf_ue->supi, NULL)); return OGS_ERROR; } @@ -222,7 +222,7 @@ int smf_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", smf_ue->supi)); + "Cannot discover", smf_ue->supi, NULL)); return r; } diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index 60fc8f0a8..1ba9e4319 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -429,7 +429,8 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, + NULL)); break; } @@ -447,7 +448,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &sbi_message, "Not supported version", NULL)); + &sbi_message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&sbi_message); break; } @@ -467,7 +468,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &sbi_message, - "Invalid HTTP method", sbi_message.h.method)); + "Invalid HTTP method", sbi_message.h.method, NULL)); END break; @@ -478,7 +479,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; @@ -533,7 +534,8 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, - "Invalid HTTP method", sbi_message.h.method)); + "Invalid HTTP method", sbi_message.h.method, + NULL)); break; END @@ -555,7 +557,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; @@ -573,7 +575,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "No smContextRef", - sbi_message.h.resource.component[1])); + sbi_message.h.resource.component[1], NULL)); break; } @@ -586,7 +588,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, &sbi_message, "Not found", - sbi_message.h.resource.component[1])); + sbi_message.h.resource.component[1], NULL)); break; } @@ -606,7 +608,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; DEFAULT @@ -616,7 +618,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, "Invalid resource name", - sbi_message.h.resource.component[0])); + sbi_message.h.resource.component[0], NULL)); END break; @@ -625,7 +627,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &sbi_message, - "Invalid API name", sbi_message.h.service.name)); + "Invalid API name", sbi_message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -852,7 +854,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, strerror, NULL)); + NULL, strerror, NULL, NULL)); ogs_free(strerror); break; } @@ -976,7 +978,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); } break; diff --git a/src/udm/nudm-handler.c b/src/udm/nudm-handler.c index 63b180db8..2aa6d638b 100644 --- a/src/udm/nudm-handler.c +++ b/src/udm/nudm-handler.c @@ -37,7 +37,8 @@ bool udm_nudm_ueau_handle_get( ogs_error("[%s] No AuthenticationInfoRequest", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthenticationInfoRequest", udm_ue->suci)); + recvmsg, "No AuthenticationInfoRequest", udm_ue->suci, + NULL)); return false; } @@ -45,7 +46,7 @@ bool udm_nudm_ueau_handle_get( ogs_error("[%s] No servingNetworkName", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No servingNetworkName", udm_ue->suci)); + recvmsg, "No servingNetworkName", udm_ue->suci, NULL)); return false; } @@ -53,7 +54,7 @@ bool udm_nudm_ueau_handle_get( ogs_error("[%s] No ausfInstanceId", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No ausfInstanceId", udm_ue->suci)); + recvmsg, "No ausfInstanceId", udm_ue->suci, NULL)); return false; } @@ -90,7 +91,7 @@ bool udm_nudm_ueau_handle_get( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No RAND", udm_ue->suci)); + recvmsg, "No RAND", udm_ue->suci, NULL)); return false; } @@ -99,7 +100,7 @@ bool udm_nudm_ueau_handle_get( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AUTS", udm_ue->suci)); + recvmsg, "No AUTS", udm_ue->suci, NULL)); return false; } @@ -118,7 +119,7 @@ bool udm_nudm_ueau_handle_get( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "Invalid RAND", udm_ue->suci)); + recvmsg, "Invalid RAND", udm_ue->suci, NULL)); return false; } @@ -133,7 +134,7 @@ bool udm_nudm_ueau_handle_get( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_UNAUTHORIZED, - recvmsg, "Re-sync MAC failed", udm_ue->suci)); + recvmsg, "Re-sync MAC failed", udm_ue->suci, NULL)); return false; } @@ -187,7 +188,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No AuthEvent", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No AuthEvent", udm_ue->suci)); + message, "No AuthEvent", udm_ue->suci, NULL)); return false; } @@ -195,7 +196,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No nfInstanceId", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No nfInstanceId", udm_ue->suci)); + message, "No nfInstanceId", udm_ue->suci, NULL)); return false; } @@ -203,7 +204,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No success", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No success", udm_ue->suci)); + message, "No success", udm_ue->suci, NULL)); return false; } @@ -211,7 +212,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No timeStamp", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No timeStamp", udm_ue->suci)); + message, "No timeStamp", udm_ue->suci, NULL)); return false; } @@ -219,7 +220,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No authType", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No authType", udm_ue->suci)); + message, "No authType", udm_ue->suci, NULL)); return false; } @@ -227,7 +228,7 @@ bool udm_nudm_ueau_handle_result_confirmation_inform( ogs_error("[%s] No servingNetworkName", udm_ue->suci); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No servingNetworkName", udm_ue->suci)); + message, "No servingNetworkName", udm_ue->suci, NULL)); return false; } @@ -259,7 +260,8 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No Amf3GppAccessRegistration", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Amf3GppAccessRegistration", udm_ue->supi)); + message, "No Amf3GppAccessRegistration", udm_ue->supi, + NULL)); return false; } @@ -267,7 +269,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No amfInstanceId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No amfInstanceId", udm_ue->supi)); + message, "No amfInstanceId", udm_ue->supi, NULL)); return false; } @@ -275,7 +277,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No dregCallbackUri", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No dregCallbackUri", udm_ue->supi)); + message, "No dregCallbackUri", udm_ue->supi, NULL)); return false; } @@ -284,7 +286,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No Guami", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Guami", udm_ue->supi)); + message, "No Guami", udm_ue->supi, NULL)); return false; } @@ -292,7 +294,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No Guami.AmfId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Guami.AmfId", udm_ue->supi)); + message, "No Guami.AmfId", udm_ue->supi, NULL)); return false; } @@ -300,7 +302,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No PlmnId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId", udm_ue->supi)); + message, "No PlmnId", udm_ue->supi, NULL)); return false; } @@ -308,7 +310,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No PlmnId.Mnc", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId.Mnc", udm_ue->supi)); + message, "No PlmnId.Mnc", udm_ue->supi, NULL)); return false; } @@ -316,7 +318,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No PlmnId.Mcc", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId.Mcc", udm_ue->supi)); + message, "No PlmnId.Mcc", udm_ue->supi, NULL)); return false; } @@ -324,7 +326,7 @@ bool udm_nudm_uecm_handle_amf_registration( ogs_error("[%s] No RatType", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No RatType", udm_ue->supi)); + message, "No RatType", udm_ue->supi, NULL)); return false; } @@ -371,7 +373,8 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No Amf3GppAccessRegistrationModification", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Amf3GppAccessRegistrationModification", udm_ue->supi)); + message, "No Amf3GppAccessRegistrationModification", udm_ue->supi, + NULL)); return false; } @@ -380,7 +383,7 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No Guami", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Guami", udm_ue->supi)); + message, "No Guami", udm_ue->supi, NULL)); return false; } @@ -388,7 +391,7 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No Guami.AmfId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No Guami.AmfId", udm_ue->supi)); + message, "No Guami.AmfId", udm_ue->supi, NULL)); return false; } @@ -396,7 +399,7 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No PlmnId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId", udm_ue->supi)); + message, "No PlmnId", udm_ue->supi, NULL)); return false; } @@ -404,7 +407,7 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No PlmnId.Mnc", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId.Mnc", udm_ue->supi)); + message, "No PlmnId.Mnc", udm_ue->supi, NULL)); return false; } @@ -412,7 +415,7 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_error("[%s] No PlmnId.Mcc", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No PlmnId.Mcc", udm_ue->supi)); + message, "No PlmnId.Mcc", udm_ue->supi, NULL)); return false; } @@ -424,9 +427,25 @@ bool udm_nudm_uecm_handle_amf_registration_update( ogs_sbi_parse_guami(&recv_guami, Guami); if (memcmp(&recv_guami, &udm_ue->guami, sizeof(recv_guami)) != 0) { ogs_error("[%s] Guami mismatch", udm_ue->supi); + /* + * TS29.503 + * 6.2.7.3 Application Errors + * + * Protocol and application errors common to several 5GC SBI API + * specifications for which the NF shall include in the HTTP + * response a payload body ("ProblemDetails" data structure or + * application specific error data structure) with the "cause" + * attribute indicating corresponding error are listed in table + * 5.2.7.2-1. + * Application Error: INVALID_GUAMI + * HTTP status code: 403 Forbidden + * Description: The AMF is not allowed to modify the registration + * information stored in the UDM, as it is not the registered AMF. + */ ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - message, "Guami mismatch", udm_ue->supi)); + message, "Guami mismatch", udm_ue->supi, + "INVALID_GUAMI")); return false; } @@ -480,7 +499,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No SmfRegistration", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No SmfRegistration", udm_ue->supi)); + message, "No SmfRegistration", udm_ue->supi, NULL)); return false; } @@ -488,7 +507,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No smfInstanceId", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No smfInstanceId", udm_ue->supi)); + message, "No smfInstanceId", udm_ue->supi, NULL)); return false; } @@ -496,7 +515,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No pduSessionId", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No pduSessionId", udm_ue->supi)); + message, "No pduSessionId", udm_ue->supi, NULL)); return false; } @@ -504,7 +523,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No singleNssai", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No singleNssai", udm_ue->supi)); + message, "No singleNssai", udm_ue->supi, NULL)); return false; } @@ -512,7 +531,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No dnn", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No dnn", udm_ue->supi)); + message, "No dnn", udm_ue->supi, NULL)); return false; } @@ -521,7 +540,7 @@ bool udm_nudm_uecm_handle_smf_registration( ogs_error("[%s:%d] No plmnId", udm_ue->supi, sess->psi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - message, "No plmnId", udm_ue->supi)); + message, "No plmnId", udm_ue->supi, NULL)); return false; } @@ -612,7 +631,7 @@ bool udm_nudm_sdm_handle_subscription_create( ogs_error("[%s] No SDMSubscription", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SDMSubscription", udm_ue->supi)); + recvmsg, "No SDMSubscription", udm_ue->supi, NULL)); return false; } @@ -620,7 +639,7 @@ bool udm_nudm_sdm_handle_subscription_create( ogs_error("[%s] No nfInstanceId", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No nfInstanceId", udm_ue->supi)); + recvmsg, "No nfInstanceId", udm_ue->supi, NULL)); return false; } @@ -628,7 +647,7 @@ bool udm_nudm_sdm_handle_subscription_create( ogs_error("[%s] No callbackReference", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No callbackReference", udm_ue->supi)); + recvmsg, "No callbackReference", udm_ue->supi, NULL)); return false; } @@ -637,7 +656,7 @@ bool udm_nudm_sdm_handle_subscription_create( ogs_error("[%s] No monitoredResourceUris", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No monitoredResourceUris", udm_ue->supi)); + recvmsg, "No monitoredResourceUris", udm_ue->supi, NULL)); return false; } @@ -689,7 +708,7 @@ bool udm_nudm_sdm_handle_subscription_delete( ogs_error("[%s] No subscriptionID", udm_ue->supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No subscriptionID", udm_ue->supi)); + recvmsg, "No subscriptionID", udm_ue->supi, NULL)); return false; } sdm_subscription = udm_sdm_subscription_find_by_id( @@ -703,7 +722,8 @@ bool udm_nudm_sdm_handle_subscription_delete( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Subscription Not found", recvmsg->h.method)); + recvmsg, "Subscription Not found", recvmsg->h.method, + NULL)); return false; } diff --git a/src/udm/nudr-handler.c b/src/udm/nudr-handler.c index e11b9326e..0bd5a874c 100644 --- a/src/udm/nudr-handler.c +++ b/src/udm/nudr-handler.c @@ -88,7 +88,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error( - stream, recvmsg->res_status, recvmsg, strerror, NULL)); + stream, recvmsg->res_status, recvmsg, strerror, NULL, + recvmsg->ProblemDetails->cause)); ogs_free(strerror); return false; } @@ -100,7 +101,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, recvmsg, "No AuthenticationSubscription", - udm_ue->suci)); + udm_ue->suci, NULL)); return false; } @@ -112,7 +113,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - recvmsg, "Not supported Auth Method", udm_ue->suci)); + recvmsg, "Not supported Auth Method", udm_ue->suci, + NULL)); return false; } @@ -122,7 +124,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "No encPermanentKey", udm_ue->suci)); + recvmsg, "No encPermanentKey", udm_ue->suci, + NULL)); return false; } if (!AuthenticationSubscription->enc_opc_key) { @@ -130,7 +133,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "No encPermanentKey", udm_ue->suci)); + recvmsg, "No encPermanentKey", udm_ue->suci, NULL)); return false; } if (!AuthenticationSubscription->authentication_management_field) { @@ -139,7 +142,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "No authenticationManagementField", udm_ue->suci)); + recvmsg, "No authenticationManagementField", udm_ue->suci, + NULL)); return false; } if (!AuthenticationSubscription->sequence_number) { @@ -147,7 +151,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "No SequenceNumber", udm_ue->suci)); + recvmsg, "No SequenceNumber", udm_ue->suci, NULL)); return false; } if (!AuthenticationSubscription->sequence_number->sqn) { @@ -155,7 +159,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "No SequenceNumber.sqn", udm_ue->suci)); + recvmsg, "No SequenceNumber.sqn", udm_ue->suci, NULL)); return false; } @@ -189,7 +193,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error( - stream, recvmsg->res_status, recvmsg, strerror, NULL)); + stream, recvmsg->res_status, recvmsg, strerror, NULL, + recvmsg->ProblemDetails->cause)); ogs_free(strerror); return false; } @@ -261,7 +266,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, recvmsg, - "Invalid HTTP method", recvmsg->h.method)); + "Invalid HTTP method", recvmsg->h.method, NULL)); return false; END break; @@ -277,7 +282,8 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_error("%s", strerror); ogs_assert(true == ogs_sbi_server_send_error( - stream, recvmsg->res_status, recvmsg, strerror, NULL)); + stream, recvmsg->res_status, recvmsg, strerror, NULL, + recvmsg->ProblemDetails->cause)); ogs_free(strerror); return false; } @@ -288,7 +294,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthEvent", udm_ue->suci)); + recvmsg, "No AuthEvent", udm_ue->suci, NULL)); return false; } @@ -297,7 +303,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No nfInstanceId", udm_ue->suci)); + recvmsg, "No nfInstanceId", udm_ue->suci, NULL)); return false; } @@ -306,7 +312,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No success", udm_ue->suci)); + recvmsg, "No success", udm_ue->suci, NULL)); return false; } @@ -315,7 +321,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No timeStamp", udm_ue->suci)); + recvmsg, "No timeStamp", udm_ue->suci, NULL)); return false; } @@ -324,7 +330,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No authType", udm_ue->suci)); + recvmsg, "No authType", udm_ue->suci, NULL)); return false; } @@ -333,7 +339,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No servingNetworkName", udm_ue->suci)); + recvmsg, "No servingNetworkName", udm_ue->suci, NULL)); return false; } @@ -376,7 +382,7 @@ bool udm_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; END @@ -408,7 +414,8 @@ bool udm_nudr_dr_handle_subscription_context( udm_ue->supi, recvmsg->res_status); ogs_assert(true == ogs_sbi_server_send_error(stream, recvmsg->res_status, - NULL, "HTTP response error", udm_ue->supi)); + NULL, "HTTP response error", udm_ue->supi, + recvmsg->ProblemDetails->cause)); return false; } @@ -433,7 +440,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; END @@ -452,7 +459,8 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Amf3GppAccessRegistration", udm_ue->supi)); + recvmsg, "No Amf3GppAccessRegistration", udm_ue->supi, + NULL)); return false; } @@ -461,7 +469,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No amfInstanceId", udm_ue->supi)); + recvmsg, "No amfInstanceId", udm_ue->supi, NULL)); return false; } @@ -470,7 +478,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No dregCallbackUri", udm_ue->supi)); + recvmsg, "No dregCallbackUri", udm_ue->supi, NULL)); return false; } @@ -480,7 +488,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Guami", udm_ue->supi)); + recvmsg, "No Guami", udm_ue->supi, NULL)); return false; } @@ -489,7 +497,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Guami.AmfId", udm_ue->supi)); + recvmsg, "No Guami.AmfId", udm_ue->supi, NULL)); return false; } @@ -498,7 +506,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PlmnId", udm_ue->supi)); + recvmsg, "No PlmnId", udm_ue->supi, NULL)); return false; } @@ -507,7 +515,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PlmnId.Mnc", udm_ue->supi)); + recvmsg, "No PlmnId.Mnc", udm_ue->supi, NULL)); return false; } @@ -516,7 +524,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PlmnId.Mcc", udm_ue->supi)); + recvmsg, "No PlmnId.Mcc", udm_ue->supi, NULL)); return false; } @@ -525,7 +533,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No RatType", udm_ue->supi)); + recvmsg, "No RatType", udm_ue->supi, NULL)); return false; } @@ -584,7 +592,7 @@ bool udm_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; END @@ -622,7 +630,7 @@ bool udm_nudr_dr_handle_subscription_provisioned( ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "No AccessAndMobilitySubscriptionData", - udm_ue->supi)); + udm_ue->supi, NULL)); return false; } @@ -651,7 +659,7 @@ bool udm_nudr_dr_handle_subscription_provisioned( ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "No SmfSelectionSubscriptionData", - udm_ue->supi)); + udm_ue->supi, NULL)); return false; } @@ -684,7 +692,7 @@ bool udm_nudr_dr_handle_subscription_provisioned( ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "No SessionManagementSubscriptionData", - udm_ue->supi)); + udm_ue->supi, NULL)); return false; } @@ -723,7 +731,7 @@ bool udm_nudr_dr_handle_subscription_provisioned( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; END @@ -759,7 +767,8 @@ bool udm_nudr_dr_handle_smf_registration( udm_ue->supi, sess->psi, recvmsg->res_status); ogs_assert(true == ogs_sbi_server_send_error(stream, recvmsg->res_status, - NULL, "HTTP response error", udm_ue->supi)); + NULL, "HTTP response error", udm_ue->supi, + recvmsg->ProblemDetails->cause)); return false; } @@ -776,7 +785,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SmfRegistration", udm_ue->supi)); + recvmsg, "No SmfRegistration", udm_ue->supi, NULL)); return false; } @@ -785,7 +794,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No smfInstanceId", udm_ue->supi)); + recvmsg, "No smfInstanceId", udm_ue->supi, NULL)); return false; } @@ -794,7 +803,8 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No pduSessionId", udm_ue->supi)); + recvmsg, "No pduSessionId", udm_ue->supi, + NULL)); return false; } @@ -804,7 +814,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No singleNssai", udm_ue->supi)); + recvmsg, "No singleNssai", udm_ue->supi, NULL)); return false; } @@ -813,7 +823,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No dnn", udm_ue->supi)); + recvmsg, "No dnn", udm_ue->supi, NULL)); return false; } @@ -824,7 +834,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No plmnId", udm_ue->supi)); + recvmsg, "No plmnId", udm_ue->supi, NULL)); return false; } @@ -882,7 +892,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, recvmsg, - "Invalid HTTP method", recvmsg->h.method)); + "Invalid HTTP method", recvmsg->h.method, NULL)); END break; @@ -895,7 +905,7 @@ bool udm_nudr_dr_handle_smf_registration( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, strerror, NULL)); + recvmsg, strerror, NULL, NULL)); ogs_free(strerror); return false; END diff --git a/src/udm/sbi-path.c b/src/udm/sbi-path.c index 770c2b8e6..022b4064a 100644 --- a/src/udm/sbi-path.c +++ b/src/udm/sbi-path.c @@ -147,7 +147,7 @@ int udm_ue_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", udm_ue->suci)); + "Cannot discover", udm_ue->suci, NULL)); return r; } @@ -170,7 +170,7 @@ int udm_sess_sbi_discover_and_send( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot discover", NULL)); + "Cannot discover", NULL, NULL)); return r; } diff --git a/src/udm/sess-sm.c b/src/udm/sess-sm.c index a6a4a3e90..a6ddc33ec 100644 --- a/src/udm/sess-sm.c +++ b/src/udm/sess-sm.c @@ -85,7 +85,8 @@ void udm_sess_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, + NULL)); END break; DEFAULT @@ -95,7 +96,7 @@ void udm_sess_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -104,7 +105,7 @@ void udm_sess_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid API name", message->h.service.name)); + "Invalid API name", message->h.service.name, NULL)); END break; diff --git a/src/udm/udm-sm.c b/src/udm/udm-sm.c index ebf0214c0..ec0f7f1e4 100644 --- a/src/udm/udm-sm.c +++ b/src/udm/udm-sm.c @@ -75,7 +75,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -92,7 +92,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -113,7 +113,8 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -124,7 +125,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -136,7 +137,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.method)); + &message, "Not found", message.h.method, NULL)); break; } @@ -145,7 +146,8 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Invalid resource name", message.h.method)); + &message, "Invalid resource name", message.h.method, + NULL)); break; } @@ -169,7 +171,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, NULL, NULL)); + &message, NULL, NULL, NULL)); break; } } @@ -180,7 +182,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.method)); + &message, "Not found", message.h.method, NULL)); break; } @@ -229,7 +231,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -549,7 +551,7 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); break; default: diff --git a/src/udm/ue-sm.c b/src/udm/ue-sm.c index 2c50f2c47..a31234183 100644 --- a/src/udm/ue-sm.c +++ b/src/udm/ue-sm.c @@ -80,7 +80,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid resource name", message->h.method)); + "Invalid resource name", message->h.method, NULL)); END break; @@ -96,7 +96,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid resource name", message->h.method)); + "Invalid resource name", message->h.method, NULL)); END break; @@ -106,7 +106,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -125,7 +125,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, NULL)); END break; CASE(OGS_SBI_HTTP_METHOD_PATCH) @@ -141,7 +141,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, NULL)); END break; DEFAULT @@ -150,7 +150,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, NULL)); END break; @@ -180,7 +180,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid resource name", message->h.method)); + "Invalid resource name", message->h.method, NULL)); END break; @@ -197,7 +197,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid resource name", message->h.method)); + "Invalid resource name", message->h.method, NULL)); END break; @@ -214,7 +214,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid resource name", message->h.method)); + "Invalid resource name", message->h.method, NULL)); END break; DEFAULT @@ -223,7 +223,8 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, message, - "Invalid HTTP method", message->h.method)); + "Invalid HTTP method", message->h.method, + NULL)); END break; @@ -232,7 +233,7 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid API name", message->h.service.name)); + "Invalid API name", message->h.service.name, NULL)); END break; @@ -286,7 +287,8 @@ void udm_ue_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, - "Invalid API name", message->h.resource.component[0])); + "Invalid API name", message->h.resource.component[0], + NULL)); END break; diff --git a/src/udr/nudr-handler.c b/src/udr/nudr-handler.c index 290ab27fa..07c78ea4a 100644 --- a/src/udr/nudr-handler.c +++ b/src/udr/nudr-handler.c @@ -50,7 +50,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_error("No SUPI"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SUPI", NULL)); + recvmsg, "No SUPI", NULL, NULL)); return false; } @@ -59,7 +59,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_error("[%s] Unknown SUPI Type", supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - recvmsg, "Unknwon SUPI Type", supi)); + recvmsg, "Unknwon SUPI Type", supi, NULL)); return false; } @@ -68,7 +68,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_warn("[%s] Cannot find SUPI in DB", supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, - recvmsg, "Cannot find SUPI Type", supi)); + recvmsg, "Cannot find SUPI Type", supi, NULL)); return false; } @@ -128,7 +128,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList Array", NULL)); + recvmsg, "No PatchItemList Array", NULL, NULL)); return false; } @@ -146,7 +146,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList", NULL)); + recvmsg, "No PatchItemList", NULL, NULL)); return false; } @@ -160,7 +160,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "Cannot update SQN", supi)); + recvmsg, "Cannot update SQN", supi, NULL)); return false; } @@ -170,7 +170,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "Cannot increment SQN", supi)); + recvmsg, "Cannot increment SQN", supi, NULL)); return false; } @@ -187,8 +187,9 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, - recvmsg, "Invalid HTTP method", recvmsg->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method, + NULL)); END break; @@ -205,7 +206,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No AuthEvent", supi)); + recvmsg, "No AuthEvent", supi, NULL)); return false; } @@ -216,7 +217,7 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, - recvmsg, "Cannot increment SQN", supi)); + recvmsg, "Cannot increment SQN", supi, NULL)); return false; } @@ -231,8 +232,9 @@ bool udr_nudr_dr_handle_subscription_authentication( ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, - recvmsg, "Invalid HTTP method", recvmsg->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method, + NULL)); END break; @@ -241,9 +243,9 @@ bool udr_nudr_dr_handle_subscription_authentication( recvmsg->h.resource.component[3]); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, recvmsg, "Unknown resource name", - recvmsg->h.resource.component[3])); + recvmsg->h.resource.component[3], NULL)); END return false; @@ -265,7 +267,7 @@ bool udr_nudr_dr_handle_subscription_context( ogs_error("No SUPI"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SUPI", NULL)); + recvmsg, "No SUPI", NULL, NULL)); return false; } @@ -274,7 +276,7 @@ bool udr_nudr_dr_handle_subscription_context( ogs_error("[%s] Unknown SUPI Type", supi); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - recvmsg, "Unknwon SUPI Type", supi)); + recvmsg, "Unknwon SUPI Type", supi, NULL)); return false; } @@ -290,7 +292,7 @@ bool udr_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No Amf3GppAccessRegistration", supi)); + recvmsg, "No Amf3GppAccessRegistration", supi, NULL)); return false; } @@ -336,7 +338,7 @@ bool udr_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList", supi)); + recvmsg, "No PatchItemList", supi, NULL)); return false; } @@ -355,8 +357,9 @@ bool udr_nudr_dr_handle_subscription_context( ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, - recvmsg, "Invalid HTTP method", recvmsg->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method, + NULL)); END break; CASE(OGS_SBI_RESOURCE_NAME_SMF_REGISTRATIONS) @@ -370,7 +373,7 @@ bool udr_nudr_dr_handle_subscription_context( ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No SmfRegistration", supi)); + recvmsg, "No SmfRegistration", supi, NULL)); return false; } @@ -397,8 +400,9 @@ bool udr_nudr_dr_handle_subscription_context( ogs_error("Invalid HTTP method [%s]", recvmsg->h.method); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, - recvmsg, "Invalid HTTP method", recvmsg->h.method)); + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, + recvmsg, "Invalid HTTP method", recvmsg->h.method, + NULL)); END break; @@ -407,9 +411,9 @@ bool udr_nudr_dr_handle_subscription_context( recvmsg->h.resource.component[3]); ogs_assert(true == ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED, + OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED, recvmsg, "Unknown resource name", - recvmsg->h.resource.component[3])); + recvmsg->h.resource.component[3], NULL)); END return false; @@ -1029,7 +1033,7 @@ bool udr_nudr_dr_handle_subscription_provisioned( DEFAULT strerror = ogs_msprintf("Invalid resource name [%s]", recvmsg->h.resource.component[3]); - status = OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED; + status = OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED; goto cleanup; END @@ -1042,7 +1046,8 @@ cleanup: ogs_assert(status); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL, + NULL)); ogs_free(strerror); ogs_subscription_data_free(&subscription_data); @@ -1263,7 +1268,7 @@ bool udr_nudr_dr_handle_policy_data( DEFAULT strerror = ogs_msprintf("Invalid resource name [%s]", recvmsg->h.resource.component[3]); - status = OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED; + status = OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED; goto cleanup; END @@ -1272,7 +1277,7 @@ bool udr_nudr_dr_handle_policy_data( DEFAULT strerror = ogs_msprintf("Invalid HTTP method [%s]", recvmsg->h.method); - status = OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED; + status = OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED; goto cleanup; END @@ -1281,7 +1286,7 @@ bool udr_nudr_dr_handle_policy_data( DEFAULT strerror = ogs_msprintf("Invalid resource name [%s]", recvmsg->h.resource.component[1]); - status = OGS_SBI_HTTP_STATUS_MEHTOD_NOT_ALLOWED; + status = OGS_SBI_HTTP_STATUS_METHOD_NOT_ALLOWED; goto cleanup; END @@ -1294,7 +1299,8 @@ cleanup: ogs_assert(status); ogs_error("%s", strerror); ogs_assert(true == - ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); + ogs_sbi_server_send_error(stream, status, recvmsg, strerror, + NULL, NULL)); ogs_free(strerror); ogs_subscription_data_free(&subscription_data); diff --git a/src/udr/udr-sm.c b/src/udr/udr-sm.c index a41c5600c..3d8c888d6 100644 --- a/src/udr/udr-sm.c +++ b/src/udr/udr-sm.c @@ -72,7 +72,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP message", NULL)); + NULL, "cannot parse HTTP message", NULL, NULL)); break; } @@ -81,7 +81,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -102,7 +102,8 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, - &message, "Invalid HTTP method", message.h.method)); + &message, "Invalid HTTP method", message.h.method, + NULL)); END break; @@ -113,7 +114,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -145,7 +146,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, "Invalid HTTP method", - message.h.method)); + message.h.method, NULL)); END break; DEFAULT @@ -155,7 +156,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[2])); + message.h.resource.component[2], NULL)); END END break; @@ -171,7 +172,7 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Unknown resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -180,7 +181,8 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.resource.component[0])); + "Invalid API name", message.h.resource.component[0], + NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ diff --git a/tests/af/af-sm.c b/tests/af/af-sm.c index 0c9bfadba..ba19eb63e 100644 --- a/tests/af/af-sm.c +++ b/tests/af/af-sm.c @@ -77,7 +77,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - NULL, "cannot parse HTTP sbi_message", NULL)); + NULL, "cannot parse HTTP sbi_message", NULL, NULL)); break; } @@ -86,7 +86,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "Not supported version", NULL)); + &message, "Not supported version", NULL, NULL)); ogs_sbi_message_free(&message); break; } @@ -106,7 +106,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, - "Invalid HTTP method", message.h.method)); + "Invalid HTTP method", message.h.method, NULL)); END break; @@ -117,7 +117,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -133,7 +133,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, &message, "Not found", - message.h.resource.component[1])); + message.h.resource.component[1], NULL)); break; } @@ -146,7 +146,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, &message, "Not found", - message.h.resource.component[1])); + message.h.resource.component[1], NULL)); break; } @@ -163,7 +163,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[2])); + message.h.resource.component[2], NULL)); END break; DEFAULT @@ -173,7 +173,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, "Invalid resource name", - message.h.resource.component[0])); + message.h.resource.component[0], NULL)); END break; @@ -182,7 +182,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid API name", message.h.service.name)); + "Invalid API name", message.h.service.name, NULL)); END /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ @@ -497,7 +497,7 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL, - "Cannot receive SBI message", NULL)); + "Cannot receive SBI message", NULL, NULL)); } break;