Skip to content

Commit

Permalink
[gtp] more articulate/unique gtp error messages (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencersevilla committed Jan 24, 2024
1 parent 1e65d10 commit 784f15b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/sgwc/pfcp-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static void sess_timeout(ogs_pfcp_xact_t *pfcp_xact, void *data)
gtp_cause = OGS_GTP1_CAUSE_NETWORK_FAILURE;
break;
case 2:
gtp_cause = OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
gtp_cause = OGS_GTP2_CAUSE_TIMED_OUT_REQUEST;
break;
}

Expand Down
8 changes: 4 additions & 4 deletions src/smf/gsm-sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static uint8_t gtp_cause_from_diameter(uint8_t gtp_version,
case OGS_DIAM_UNKNOWN_SESSION_ID:
return OGS_GTP2_CAUSE_APN_ACCESS_DENIED_NO_SUBSCRIPTION;
case ER_DIAMETER_UNABLE_TO_DELIVER:
return OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
return OGS_GTP2_CAUSE_UE_NOT_AUTHORISED_BY_OCS_OR_EXTERNAL_AAA_SERVER;
}
break;
}
Expand Down Expand Up @@ -726,7 +726,7 @@ void smf_gsm_state_wait_pfcp_establishment(ogs_fsm_t *s, smf_event_t *e)
ogs_gtp_xact_t *gtp_xact = (ogs_gtp_xact_t *) sess->timeout_xact->assoc_xact;
uint8_t gtp_cause = (gtp_xact->gtp_version == 1) ?
OGS_GTP1_CAUSE_NETWORK_FAILURE :
OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
OGS_GTP2_CAUSE_TIMED_OUT_REQUEST;
send_gtp_create_err_msg(sess, gtp_xact, gtp_cause);
} else {
OGS_FSM_TRAN(s, smf_gsm_state_5gc_n1_n2_reject);
Expand Down Expand Up @@ -1284,7 +1284,7 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e)
ogs_gtp_xact_t *gtp_xact = (ogs_gtp_xact_t *) sess->timeout_xact->assoc_xact;
uint8_t gtp_cause = (gtp_xact->gtp_version == 1) ?
OGS_GTP1_CAUSE_NETWORK_FAILURE :
OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
OGS_GTP2_CAUSE_TIMED_OUT_REQUEST;
send_gtp_create_err_msg(sess, gtp_xact, gtp_cause);
} else {
OGS_FSM_TRAN(s, smf_gsm_state_5gc_n1_n2_reject);
Expand Down Expand Up @@ -1473,7 +1473,7 @@ void smf_gsm_state_wait_pfcp_deletion(ogs_fsm_t *s, smf_event_t *e)
ogs_gtp_xact_t *gtp_xact = (ogs_gtp_xact_t *) sess->timeout_xact->assoc_xact;
uint8_t gtp_cause = (gtp_xact->gtp_version == 1) ?
OGS_GTP1_CAUSE_NETWORK_FAILURE :
OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
OGS_GTP2_CAUSE_TIMED_OUT_REQUEST;
send_gtp_delete_err_msg(sess, gtp_xact, gtp_cause);
} else {
ogs_error("5GC Session Deletion timeout not written");
Expand Down
8 changes: 4 additions & 4 deletions src/smf/s5c-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ uint8_t smf_s5c_handle_create_session_request(

if (!ogs_diam_app_connected(OGS_DIAM_GX_APPLICATION_ID)) {
ogs_error("No Gx Diameter Peer");
cause_value = OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
cause_value = OGS_GTP2_CAUSE_UE_NOT_AUTHORISED_BY_OCS_OR_EXTERNAL_AAA_SERVER;
}
switch (sess->gtp_rat_type) {
case OGS_GTP2_RAT_TYPE_EUTRAN:
Expand All @@ -154,7 +154,7 @@ uint8_t smf_s5c_handle_create_session_request(
case OGS_GTP2_RAT_TYPE_WLAN:
if (!ogs_diam_app_connected(OGS_DIAM_S6B_APPLICATION_ID)) {
ogs_error("No S6b Diameter Peer");
cause_value = OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
cause_value = OGS_GTP2_CAUSE_UE_NOT_AUTHORISED_BY_OCS_OR_EXTERNAL_AAA_SERVER;
}
if (req->bearer_contexts_to_be_created[0].
s2b_u_epdg_f_teid_5.presence == 0) {
Expand Down Expand Up @@ -426,13 +426,13 @@ uint8_t smf_s5c_handle_delete_session_request(

if (!ogs_diam_app_connected(OGS_DIAM_GX_APPLICATION_ID)) {
ogs_error("No Gx Diameter Peer");
return OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
return OGS_GTP2_CAUSE_UE_NOT_AUTHORISED_BY_OCS_OR_EXTERNAL_AAA_SERVER;
}

if (sess->gtp_rat_type == OGS_GTP2_RAT_TYPE_WLAN) {
if (!ogs_diam_app_connected(OGS_DIAM_S6B_APPLICATION_ID)) {
ogs_error("No S6b Diameter Peer");
return OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING;
return OGS_GTP2_CAUSE_UE_NOT_AUTHORISED_BY_OCS_OR_EXTERNAL_AAA_SERVER;
}
}

Expand Down

0 comments on commit 784f15b

Please sign in to comment.