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
This commit is contained in:
gstaa 2024-04-04 16:29:20 +02:00 committed by GitHub
parent 3ee4bb7d3c
commit eb2b19b39c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 573 additions and 392 deletions

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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. */

View File

@ -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;

View File

@ -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]",

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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. */

View File

@ -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;

View File

@ -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. */

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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;

View File

@ -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:

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);

View File

@ -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. */

View File

@ -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;

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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();

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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);

View File

@ -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. */

View File

@ -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;