diff --git a/lib/gtp/path.c b/lib/gtp/path.c index d550bf1bb..b20f491c0 100644 --- a/lib/gtp/path.c +++ b/lib/gtp/path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -128,3 +128,16 @@ int ogs_gtp_sendto(ogs_gtp_node_t *gnode, ogs_pkbuf_t *pkbuf) return OGS_OK; } + +void ogs_gtp_send_error_message( + ogs_gtp_xact_t *xact, uint32_t teid, uint8_t type, uint8_t cause_value) +{ + switch (xact->gtp_version) { + case 1: + ogs_gtp1_send_error_message(xact, teid, type, cause_value); + break; + case 2: + ogs_gtp2_send_error_message(xact, teid, type, cause_value); + break; + } +} diff --git a/lib/gtp/path.h b/lib/gtp/path.h index e9bdef8e1..6cb39ac77 100644 --- a/lib/gtp/path.h +++ b/lib/gtp/path.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -72,6 +72,9 @@ int ogs_gtp_connect(ogs_sock_t *ipv4, ogs_sock_t *ipv6, ogs_gtp_node_t *gnode); int ogs_gtp_send(ogs_gtp_node_t *gnode, ogs_pkbuf_t *pkbuf); int ogs_gtp_sendto(ogs_gtp_node_t *gnode, ogs_pkbuf_t *pkbuf); +void ogs_gtp_send_error_message( + ogs_gtp_xact_t *xact, uint32_t teid, uint8_t type, uint8_t cause_value); + #ifdef __cplusplus } #endif diff --git a/lib/gtp/v2/message.c b/lib/gtp/v2/message.c index 96b7342c9..31c79a3f8 100644 --- a/lib/gtp/v2/message.c +++ b/lib/gtp/v2/message.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,7 +20,7 @@ /******************************************************************************* * This file had been created by gtp-tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2024-03-23 07:21:22.444548 by acetcom + * Created on: 2023-08-26 16:35:12.648272 by acetcom * from 29274-h70.docx ******************************************************************************/ diff --git a/lib/gtp/v2/message.h b/lib/gtp/v2/message.h index d294e9645..a6fcb161b 100644 --- a/lib/gtp/v2/message.h +++ b/lib/gtp/v2/message.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,7 +20,7 @@ /******************************************************************************* * This file had been created by gtp-tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2024-03-23 07:21:22.438775 by acetcom + * Created on: 2023-08-26 16:35:12.642445 by acetcom * from 29274-h70.docx ******************************************************************************/ @@ -44,9 +44,6 @@ typedef struct ogs_gtp2_header_s { struct { #define OGS_GTP2_VERSION_0 0 #define OGS_GTP2_VERSION_1 1 - -#define OGS_GTP2_TEID_NO_PRESENCE 0 -#define OGS_GTP2_TEID_PRESENCE 1 ED4(uint8_t version:3;, uint8_t piggybacked:1;, uint8_t teid_presence:1;, diff --git a/lib/gtp/v2/path.c b/lib/gtp/v2/path.c index 757f51c62..26549ab81 100644 --- a/lib/gtp/v2/path.c +++ b/lib/gtp/v2/path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -160,8 +160,8 @@ ogs_pkbuf_t *ogs_gtp2_handle_echo_req(ogs_pkbuf_t *pkb) return pkb_resp; } -void ogs_gtp2_send_error_message(ogs_gtp_xact_t *xact, - int teid_presence, uint32_t teid, uint8_t type, uint8_t cause_value) +void ogs_gtp2_send_error_message( + ogs_gtp_xact_t *xact, uint32_t teid, uint8_t type, uint8_t cause_value) { int rv; ogs_gtp2_message_t errmsg; @@ -170,7 +170,6 @@ void ogs_gtp2_send_error_message(ogs_gtp_xact_t *xact, ogs_pkbuf_t *pkbuf = NULL; memset(&errmsg, 0, sizeof(ogs_gtp2_message_t)); - errmsg.h.teid_presence = teid_presence; errmsg.h.teid = teid; errmsg.h.type = type; @@ -258,7 +257,7 @@ void ogs_gtp2_send_echo_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_ECHO_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_NO_PRESENCE; + h.teid = 0; pkbuf = ogs_gtp2_build_echo_request(h.type, recovery, features); if (!pkbuf) { @@ -285,7 +284,7 @@ void ogs_gtp2_send_echo_response(ogs_gtp_xact_t *xact, memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_ECHO_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_NO_PRESENCE; + h.teid = 0; pkbuf = ogs_gtp2_build_echo_response(h.type, recovery, features); if (!pkbuf) { diff --git a/lib/gtp/v2/path.h b/lib/gtp/v2/path.h index 8a21cd6f2..7b3aa6dda 100644 --- a/lib/gtp/v2/path.h +++ b/lib/gtp/v2/path.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -36,8 +36,8 @@ int ogs_gtp2_send_user_plane( ogs_pkbuf_t *pkbuf); ogs_pkbuf_t *ogs_gtp2_handle_echo_req(ogs_pkbuf_t *pkb); -void ogs_gtp2_send_error_message(ogs_gtp_xact_t *xact, - int teid_presence, uint32_t teid, uint8_t type, uint8_t cause_value); +void ogs_gtp2_send_error_message( + ogs_gtp_xact_t *xact, uint32_t teid, uint8_t type, uint8_t cause_value); void ogs_gtp2_send_echo_request( ogs_gtp_node_t *gnode, uint8_t recovery, uint8_t features); diff --git a/lib/gtp/v2/support/gtp-tlv.py b/lib/gtp/v2/support/gtp-tlv.py index 4ff6da798..fafd12268 100644 --- a/lib/gtp/v2/support/gtp-tlv.py +++ b/lib/gtp/v2/support/gtp-tlv.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2024 by Sukchan Lee +# Copyright (C) 2019-2023 by Sukchan Lee # This file is part of Open5GS. @@ -60,7 +60,7 @@ def write_file(f, string): def output_header_to_file(f): now = datetime.datetime.now() f.write("""/* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -461,9 +461,6 @@ typedef struct ogs_gtp2_header_s { struct { #define OGS_GTP2_VERSION_0 0 #define OGS_GTP2_VERSION_1 1 - -#define OGS_GTP2_TEID_NO_PRESENCE 0 -#define OGS_GTP2_TEID_PRESENCE 1 ED4(uint8_t version:3;, uint8_t piggybacked:1;, uint8_t teid_presence:1;, diff --git a/lib/gtp/xact.c b/lib/gtp/xact.c index 0da03de76..ffec8621a 100644 --- a/lib/gtp/xact.c +++ b/lib/gtp/xact.c @@ -1,7 +1,6 @@ /* * Copyright (C) 2019 by Sukchan Lee * Copyright (C) 2022 by sysmocom - s.f.m.c. GmbH - * Copyright (C) 2023-2024 by Sukchan Lee * * This file is part of Open5GS. * @@ -408,7 +407,7 @@ int ogs_gtp_xact_update_tx(ogs_gtp_xact_t *xact, return OGS_ERROR; } - if (hdesc->teid_presence) { + if (hdesc->type > OGS_GTP2_VERSION_NOT_SUPPORTED_INDICATION_TYPE) { gtp_hlen = OGS_GTPV2C_HEADER_LEN; } else { gtp_hlen = OGS_GTPV2C_HEADER_LEN - OGS_GTP2_TEID_LEN; @@ -421,12 +420,12 @@ int ogs_gtp_xact_update_tx(ogs_gtp_xact_t *xact, h->version = 2; h->type = hdesc->type; - if (hdesc->teid_presence) { - h->teid_presence = OGS_GTP2_TEID_PRESENCE; + if (hdesc->type > OGS_GTP2_VERSION_NOT_SUPPORTED_INDICATION_TYPE) { + h->teid_presence = 1; h->teid = htobe32(hdesc->teid); h->sqn = OGS_GTP2_XID_TO_SQN(xact->xid); } else { - h->teid_presence = OGS_GTP2_TEID_NO_PRESENCE; + h->teid_presence = 0; h->sqn_only = OGS_GTP2_XID_TO_SQN(xact->xid); } h->length = htobe16(pkbuf->len - 4); diff --git a/lib/pfcp/message.c b/lib/pfcp/message.c index d183e5325..50941162d 100644 --- a/lib/pfcp/message.c +++ b/lib/pfcp/message.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,7 +20,7 @@ /******************************************************************************* * This file had been created by pfcp-tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2024-03-23 07:20:44.691773 by acetcom + * Created on: 2024-01-19 23:36:01.346970 by acetcom * from 29244-h71-modified.docx ******************************************************************************/ diff --git a/lib/pfcp/message.h b/lib/pfcp/message.h index 46d716d67..c186cb988 100644 --- a/lib/pfcp/message.h +++ b/lib/pfcp/message.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,7 +20,7 @@ /******************************************************************************* * This file had been created by pfcp-tlv.py script v0.1.0 * Please do not modify this file but regenerate it via script. - * Created on: 2024-03-23 07:20:44.672650 by acetcom + * Created on: 2024-01-19 23:36:01.327925 by acetcom * from 29244-h71-modified.docx ******************************************************************************/ @@ -41,8 +41,6 @@ extern "C" { typedef struct ogs_pfcp_header_s { union { struct { -#define OGS_PFCP_SEID_NO_PRESENCE 0 -#define OGS_PFCP_SEID_PRESENCE 1 ED4(uint8_t version:3;, uint8_t spare1:3;, uint8_t mp:1;, diff --git a/lib/pfcp/path.c b/lib/pfcp/path.c index 963844064..82e3a3467 100644 --- a/lib/pfcp/path.c +++ b/lib/pfcp/path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -140,7 +140,7 @@ int ogs_pfcp_send_heartbeat_request(ogs_pfcp_node_t *node, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_HEARTBEAT_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; xact = ogs_pfcp_xact_local_create(node, cb, node); if (!xact) { @@ -176,7 +176,7 @@ int ogs_pfcp_send_heartbeat_response(ogs_pfcp_xact_t *xact) memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_HEARTBEAT_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; pkbuf = ogs_pfcp_build_heartbeat_response(h.type); if (!pkbuf) { @@ -217,7 +217,7 @@ int ogs_pfcp_cp_send_association_setup_request(ogs_pfcp_node_t *node, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_ASSOCIATION_SETUP_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; xact = ogs_pfcp_xact_local_create(node, cb, node); if (!xact) { @@ -254,7 +254,7 @@ int ogs_pfcp_cp_send_association_setup_response(ogs_pfcp_xact_t *xact, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_ASSOCIATION_SETUP_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; pkbuf = ogs_pfcp_cp_build_association_setup_response(h.type, cause); if (!pkbuf) { @@ -286,7 +286,7 @@ int ogs_pfcp_up_send_association_setup_request(ogs_pfcp_node_t *node, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_ASSOCIATION_SETUP_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; xact = ogs_pfcp_xact_local_create(node, cb, node); if (!xact) { @@ -323,7 +323,7 @@ int ogs_pfcp_up_send_association_setup_response(ogs_pfcp_xact_t *xact, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_ASSOCIATION_SETUP_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_NO_PRESENCE; + h.seid = 0; pkbuf = ogs_pfcp_up_build_association_setup_response(h.type, cause); if (!pkbuf) { @@ -468,7 +468,7 @@ void ogs_pfcp_send_buffered_packet(ogs_pfcp_pdr_t *pdr) } void ogs_pfcp_send_error_message( - ogs_pfcp_xact_t *xact, int seid_presence, uint64_t seid, uint8_t type, + ogs_pfcp_xact_t *xact, uint64_t seid, uint8_t type, uint8_t cause_value, uint16_t offending_ie_value) { int rv; @@ -480,7 +480,6 @@ void ogs_pfcp_send_error_message( ogs_assert(xact); memset(&errmsg, 0, sizeof(ogs_pfcp_message_t)); - errmsg.h.seid_presence = seid_presence; errmsg.h.seid = seid; errmsg.h.type = type; diff --git a/lib/pfcp/path.h b/lib/pfcp/path.h index eb1014d05..379e992eb 100644 --- a/lib/pfcp/path.h +++ b/lib/pfcp/path.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -86,7 +86,7 @@ int ogs_pfcp_send_end_marker(ogs_pfcp_pdr_t *pdr); void ogs_pfcp_send_buffered_packet(ogs_pfcp_pdr_t *pdr); void ogs_pfcp_send_error_message( - ogs_pfcp_xact_t *xact, int seid_presence, uint64_t seid, uint8_t type, + ogs_pfcp_xact_t *xact, uint64_t seid, uint8_t type, uint8_t cause_value, uint16_t offending_ie_value); #ifdef __cplusplus diff --git a/lib/pfcp/support/pfcp-tlv.py b/lib/pfcp/support/pfcp-tlv.py index 2306af1a1..671b81640 100644 --- a/lib/pfcp/support/pfcp-tlv.py +++ b/lib/pfcp/support/pfcp-tlv.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2024 by Sukchan Lee +# Copyright (C) 2019-2023 by Sukchan Lee # This file is part of Open5GS. @@ -54,7 +54,7 @@ def write_file(f, string): def output_header_to_file(f): now = datetime.datetime.now() f.write("""/* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -541,8 +541,6 @@ extern "C" { typedef struct ogs_pfcp_header_s { union { struct { -#define OGS_PFCP_SEID_NO_PRESENCE 0 -#define OGS_PFCP_SEID_PRESENCE 1 ED4(uint8_t version:3;, uint8_t spare1:3;, uint8_t mp:1;, diff --git a/lib/pfcp/xact.c b/lib/pfcp/xact.c index 53a947df5..dc0c1ef2c 100644 --- a/lib/pfcp/xact.c +++ b/lib/pfcp/xact.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -246,7 +246,7 @@ int ogs_pfcp_xact_update_tx(ogs_pfcp_xact_t *xact, return OGS_ERROR; } - if (hdesc->seid_presence) { + if (hdesc->type >= OGS_PFCP_SESSION_ESTABLISHMENT_REQUEST_TYPE) { pfcp_hlen = OGS_PFCP_HEADER_LEN; } else { pfcp_hlen = OGS_PFCP_HEADER_LEN - OGS_PFCP_SEID_LEN; @@ -259,7 +259,7 @@ int ogs_pfcp_xact_update_tx(ogs_pfcp_xact_t *xact, h->version = OGS_PFCP_VERSION; h->type = hdesc->type; - if (hdesc->seid_presence) { + if (h->type >= OGS_PFCP_SESSION_ESTABLISHMENT_REQUEST_TYPE) { h->seid_presence = 1; h->seid = htobe64(hdesc->seid); h->sqn = OGS_PFCP_XID_TO_SQN(xact->xid); diff --git a/src/mme/mme-gtp-path.c b/src/mme/mme-gtp-path.c index a5bc1fb39..7d9e8f3f3 100644 --- a/src/mme/mme-gtp-path.c +++ b/src/mme/mme-gtp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -254,7 +254,6 @@ int mme_gtp_send_create_session_request(mme_sess_t *sess, int create_action) memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_SESSION_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_create_session_request(h.type, sess, create_action); @@ -294,7 +293,6 @@ int mme_gtp_send_modify_bearer_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_modify_bearer_request(h.type, mme_ue, uli_presence); @@ -334,7 +332,6 @@ int mme_gtp_send_delete_session_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_SESSION_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; s11buf = mme_s11_build_delete_session_request(h.type, sess, action); @@ -403,7 +400,6 @@ int mme_gtp_send_create_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_create_bearer_response(h.type, bearer, cause_value); @@ -449,7 +445,6 @@ int mme_gtp_send_update_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_update_bearer_response(h.type, bearer, cause_value); @@ -495,7 +490,6 @@ int mme_gtp_send_delete_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_delete_bearer_response(h.type, bearer, cause_value); @@ -531,7 +525,6 @@ int mme_gtp_send_release_access_bearers_request(mme_ue_t *mme_ue, int action) memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_RELEASE_ACCESS_BEARERS_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_release_access_bearers_request(h.type); @@ -629,7 +622,6 @@ int mme_gtp_send_downlink_data_notification_ack( /* Build Downlink data notification ack */ memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; s11buf = mme_s11_build_downlink_data_notification_ack(h.type, cause_value); @@ -665,7 +657,6 @@ int mme_gtp_send_create_indirect_data_forwarding_tunnel_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_create_indirect_data_forwarding_tunnel_request( @@ -705,7 +696,6 @@ int mme_gtp_send_delete_indirect_data_forwarding_tunnel_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = ogs_pkbuf_alloc(NULL, OGS_TLV_MAX_HEADROOM); @@ -748,7 +738,6 @@ int mme_gtp_send_bearer_resource_command( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgw_ue->sgw_s11_teid; pkbuf = mme_s11_build_bearer_resource_command(h.type, bearer, nas_message); diff --git a/src/mme/mme-s11-handler.c b/src/mme/mme-s11-handler.c index 148f0e94e..339bde7ef 100644 --- a/src/mme/mme-s11-handler.c +++ b/src/mme/mme-s11-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -823,9 +823,7 @@ void mme_s11_handle_create_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sgw_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgw_ue ? sgw_ue->sgw_s11_teid : 0, + ogs_gtp2_send_error_message(xact, sgw_ue ? sgw_ue->sgw_s11_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -861,9 +859,7 @@ void mme_s11_handle_create_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sgw_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgw_ue ? sgw_ue->sgw_s11_teid : 0, + ogs_gtp2_send_error_message(xact, sgw_ue ? sgw_ue->sgw_s11_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -1019,9 +1015,7 @@ void mme_s11_handle_update_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sgw_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgw_ue ? sgw_ue->sgw_s11_teid : 0, + ogs_gtp2_send_error_message(xact, sgw_ue ? sgw_ue->sgw_s11_teid : 0, OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -1192,9 +1186,7 @@ void mme_s11_handle_delete_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sgw_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgw_ue ? sgw_ue->sgw_s11_teid : 0, + ogs_gtp2_send_error_message(xact, sgw_ue ? sgw_ue->sgw_s11_teid : 0, OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); return; @@ -1451,9 +1443,7 @@ void mme_s11_handle_downlink_data_notification( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sgw_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgw_ue ? sgw_ue->sgw_s11_teid : 0, + ogs_gtp2_send_error_message(xact, sgw_ue ? sgw_ue->sgw_s11_teid : 0, OGS_GTP2_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); return; diff --git a/src/sgwc/gtp-path.c b/src/sgwc/gtp-path.c index 01b5c9b3a..6ce21e64f 100644 --- a/src/sgwc/gtp-path.c +++ b/src/sgwc/gtp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -182,7 +182,6 @@ int sgwc_gtp_send_create_session_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgwc_ue->mme_s11_teid; pkbuf = sgwc_s11_build_create_session_response(h.type, sess); @@ -230,7 +229,6 @@ int sgwc_gtp_send_downlink_data_notification( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DOWNLINK_DATA_NOTIFICATION_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sgwc_ue->mme_s11_teid; pkbuf = sgwc_s11_build_downlink_data_notification(cause_value, bearer); diff --git a/src/sgwc/pfcp-path.c b/src/sgwc/pfcp-path.c index 984c65516..fa5c9f505 100644 --- a/src/sgwc/pfcp-path.c +++ b/src/sgwc/pfcp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -222,7 +222,6 @@ int sgwc_pfcp_send_bearer_to_modify_list( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwu_sxa_seid; sxabuf = sgwc_sxa_build_bearer_to_modify_list(h.type, sess, xact); @@ -303,7 +302,6 @@ int sgwc_pfcp_send_session_establishment_request( * over N4 towards another SMF or another PFCP entity in the SMF * as specified in clause 5.22.2 and clause 5.22.3. */ - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwu_sxa_seid; sxabuf = sgwc_sxa_build_session_establishment_request(h.type, sess); @@ -391,7 +389,6 @@ int sgwc_pfcp_send_bearer_modification_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwu_sxa_seid; sxabuf = sgwc_sxa_build_bearer_to_modify_list(h.type, sess, xact); @@ -440,7 +437,6 @@ int sgwc_pfcp_send_session_deletion_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwu_sxa_seid; sxabuf = sgwc_sxa_build_session_deletion_request(h.type, sess); @@ -470,7 +466,6 @@ int sgwc_pfcp_send_session_report_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwu_sxa_seid; sxabuf = ogs_pfcp_build_session_report_response(h.type, cause); diff --git a/src/sgwc/s11-handler.c b/src/sgwc/s11-handler.c index 3164af820..f6fe9c319 100644 --- a/src/sgwc/s11-handler.c +++ b/src/sgwc/s11-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -173,9 +173,8 @@ void sgwc_s11_handle_create_session_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -215,9 +214,8 @@ void sgwc_s11_handle_create_session_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -264,9 +262,8 @@ void sgwc_s11_handle_create_session_request( /* Check if selected SGW-U is associated with SGW-C */ ogs_assert(sess->pfcp_node); if (!OGS_FSM_CHECK(&sess->pfcp_node->sm, sgwc_pfcp_state_associated)) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING); return; @@ -426,9 +423,8 @@ void sgwc_s11_handle_modify_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -535,9 +531,8 @@ void sgwc_s11_handle_modify_bearer_request( if (i == 0) { ogs_error("No Bearer"); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -614,9 +609,8 @@ void sgwc_s11_handle_delete_session_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -635,9 +629,8 @@ void sgwc_s11_handle_delete_session_request( indication->operation_indication == 1 && indication->scope_indication == 1) { ogs_error("Invalid Indication"); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_INVALID_MESSAGE_FORMAT); return; @@ -663,7 +656,6 @@ void sgwc_s11_handle_delete_session_request( } else { message->h.type = OGS_GTP2_DELETE_SESSION_REQUEST_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sess->pgw_s5c_teid; gtpbuf = ogs_gtp2_build_msg(message); @@ -770,9 +762,7 @@ void sgwc_s11_handle_create_bearer_response( sgwc_pfcp_send_bearer_modification_request( bearer, NULL, NULL, OGS_PFCP_MODIFY_UL_ONLY|OGS_PFCP_MODIFY_REMOVE)); - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -791,9 +781,7 @@ void sgwc_s11_handle_create_bearer_response( sgwc_pfcp_send_bearer_modification_request( bearer, NULL, NULL, OGS_PFCP_MODIFY_UL_ONLY|OGS_PFCP_MODIFY_REMOVE)); - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -927,9 +915,7 @@ void sgwc_s11_handle_update_bearer_response( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -944,9 +930,7 @@ void sgwc_s11_handle_update_bearer_response( cause_value = cause->value; if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Bearer Cause [VALUE:%d]", cause_value); - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -956,9 +940,7 @@ void sgwc_s11_handle_update_bearer_response( cause_value = cause->value; if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Cause [Value:%d]", cause_value); - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -975,7 +957,6 @@ void sgwc_s11_handle_update_bearer_response( sess->sgw_s5c_teid, sess->pgw_s5c_teid); message->h.type = OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sess->pgw_s5c_teid; pkbuf = ogs_gtp2_build_msg(message); @@ -1147,9 +1128,8 @@ void sgwc_s11_handle_release_access_bearers_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE, cause_value); return; } @@ -1255,9 +1235,8 @@ void sgwc_s11_handle_create_indirect_data_forwarding_tunnel_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE, cause_value); return; @@ -1274,9 +1253,8 @@ void sgwc_s11_handle_create_indirect_data_forwarding_tunnel_request( for (i = 0; req->bearer_contexts[i].presence; i++) { if (req->bearer_contexts[i].eps_bearer_id.presence == 0) { ogs_error("No EBI"); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -1298,9 +1276,8 @@ void sgwc_s11_handle_create_indirect_data_forwarding_tunnel_request( rv = ogs_gtp2_f_teid_to_ip(req_teid, &tunnel->remote_ip); if (rv != OGS_OK) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message(s11_xact, + sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -1334,9 +1311,8 @@ void sgwc_s11_handle_create_indirect_data_forwarding_tunnel_request( rv = ogs_gtp2_f_teid_to_ip(req_teid, &tunnel->remote_ip); if (rv != OGS_OK) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message(s11_xact, + sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -1390,9 +1366,8 @@ void sgwc_s11_handle_delete_indirect_data_forwarding_tunnel_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE, cause_value); return; @@ -1466,9 +1441,8 @@ void sgwc_s11_handle_bearer_resource_command( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value); return; } @@ -1488,9 +1462,8 @@ void sgwc_s11_handle_bearer_resource_command( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value); return; } @@ -1510,7 +1483,6 @@ void sgwc_s11_handle_bearer_resource_command( sess->sgw_s5c_teid, sess->pgw_s5c_teid); message->h.type = OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sess->pgw_s5c_teid; pkbuf = ogs_gtp2_build_msg(message); diff --git a/src/sgwc/s5c-handler.c b/src/sgwc/s5c-handler.c index d8acb267c..377a7d5e2 100644 --- a/src/sgwc/s5c-handler.c +++ b/src/sgwc/s5c-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024444 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -122,9 +122,8 @@ void sgwc_s5c_handle_create_session_response( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -161,9 +160,8 @@ void sgwc_s5c_handle_create_session_response( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -187,10 +185,8 @@ void sgwc_s5c_handle_create_session_response( bearer_cause = cause->value; if (bearer_cause != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Bearer Cause [VALUE:%d]", bearer_cause); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, bearer_cause); return; } @@ -203,9 +199,8 @@ void sgwc_s5c_handle_create_session_response( session_cause != OGS_GTP2_CAUSE_NEW_PDN_TYPE_DUE_TO_SINGLE_ADDRESS_BEARER_ONLY) { ogs_error("GTP Cause [VALUE:%d]", session_cause); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, session_cause); return; } @@ -238,10 +233,8 @@ void sgwc_s5c_handle_create_session_response( bearer = sgwc_bearer_find_by_sess_ebi(sess, rsp->bearer_contexts_created[i].eps_bearer_id.u8); if (!bearer) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -260,10 +253,8 @@ void sgwc_s5c_handle_create_session_response( rv = ogs_gtp2_f_teid_to_ip(pgw_s5u_teid, &ul_tunnel->remote_ip); if (rv != OGS_OK) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -363,15 +354,13 @@ void sgwc_s5c_handle_modify_bearer_response( if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); else - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -387,15 +376,13 @@ void sgwc_s5c_handle_modify_bearer_response( if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); else - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -407,15 +394,13 @@ void sgwc_s5c_handle_modify_bearer_response( if (session_cause != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Cause [VALUE:%d]", session_cause); if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, session_cause); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, session_cause); else - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, session_cause); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, session_cause); return; } @@ -435,7 +420,6 @@ void sgwc_s5c_handle_modify_bearer_response( sgwc_gtp_send_create_session_response(sess, s11_xact)); } else { message->h.type = OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(message); @@ -509,9 +493,8 @@ void sgwc_s5c_handle_delete_session_response( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -590,9 +573,7 @@ void sgwc_s5c_handle_create_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -620,9 +601,7 @@ void sgwc_s5c_handle_create_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -652,9 +631,7 @@ void sgwc_s5c_handle_create_bearer_request( rv = ogs_gtp2_f_teid_to_ip(pgw_s5u_teid, &ul_tunnel->remote_ip); if (rv != OGS_OK) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, OGS_GTP2_CAUSE_MANDATORY_IE_MISSING); return; @@ -732,9 +709,7 @@ void sgwc_s5c_handle_update_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -754,7 +729,6 @@ void sgwc_s5c_handle_update_bearer_request( sess->sgw_s5c_teid, sess->pgw_s5c_teid); message->h.type = OGS_GTP2_UPDATE_BEARER_REQUEST_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(message); @@ -876,9 +850,7 @@ void sgwc_s5c_handle_delete_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -898,7 +870,6 @@ void sgwc_s5c_handle_delete_bearer_request( sess->sgw_s5c_teid, sess->pgw_s5c_teid); message->h.type = OGS_GTP2_DELETE_BEARER_REQUEST_TYPE; - message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; message->h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(message); @@ -999,8 +970,6 @@ void sgwc_s5c_handle_bearer_resource_failure_indication( cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; } - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message(s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value); } diff --git a/src/sgwc/sxa-handler.c b/src/sgwc/sxa-handler.c index dffd2a76d..14fb667cb 100644 --- a/src/sgwc/sxa-handler.c +++ b/src/sgwc/sxa-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -245,9 +245,8 @@ void sgwc_sxa_handle_session_establishment_response( if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { if (sess) sgwc_ue = sess->sgwc_ue; - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -270,11 +269,10 @@ void sgwc_sxa_handle_session_establishment_response( if (dl_tunnel->local_addr == NULL && dl_tunnel->local_addr6 == NULL) { ogs_error("No UP F-TEID"); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, - OGS_GTP2_CAUSE_GRE_KEY_NOT_FOUND); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, + OGS_GTP2_CAUSE_GRE_KEY_NOT_FOUND); return; } @@ -349,7 +347,6 @@ void sgwc_sxa_handle_session_establishment_response( memset(&send_message, 0, sizeof(ogs_gtp2_message_t)); send_message.h.type = OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE; - send_message.h.teid_presence = OGS_GTP2_TEID_PRESENCE; send_message.h.teid = sess->pgw_s5c_teid; /* Send Control Plane(DL) : SGW-S5C */ @@ -399,7 +396,6 @@ void sgwc_sxa_handle_session_establishment_response( /* Create Session Request */ recv_message->h.type = OGS_GTP2_CREATE_SESSION_REQUEST_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sess->pgw_s5c_teid; /* Send Control Plane(DL) : SGW-S5C */ @@ -585,10 +581,9 @@ void sgwc_sxa_handle_session_modification_response( s5c_xact = pfcp_xact->assoc_xact; if (s5c_xact) { - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, - OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s5c_xact, sess ? sess->pgw_s5c_teid : 0, + OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE, cause_value); } sgwc_bearer_remove(bearer); @@ -596,9 +591,8 @@ void sgwc_sxa_handle_session_modification_response( s5c_xact = pfcp_xact->assoc_xact; ogs_assert(s5c_xact); - ogs_gtp2_send_error_message(s5c_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->pgw_s5c_teid : 0, + ogs_gtp_send_error_message( + s5c_xact, sess ? sess->pgw_s5c_teid : 0, OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); @@ -607,20 +601,16 @@ void sgwc_sxa_handle_session_modification_response( s11_xact = pfcp_xact->assoc_xact; ogs_assert(s11_xact); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); } else if (flags & OGS_PFCP_MODIFY_DL_ONLY) { s11_xact = pfcp_xact->assoc_xact; ogs_assert(s11_xact); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); } else { ogs_fatal("Invalid modify_flags[0x%llx]", (long long)flags); @@ -630,10 +620,9 @@ void sgwc_sxa_handle_session_modification_response( s11_xact = pfcp_xact->assoc_xact; ogs_assert(s11_xact); - ogs_gtp2_send_error_message(s11_xact, - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE, cause_value); } ogs_pfcp_xact_commit(pfcp_xact); @@ -705,7 +694,6 @@ void sgwc_sxa_handle_session_modification_response( send_message.h.type = OGS_GTP2_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE; - send_message.h.teid_presence = OGS_GTP2_TEID_PRESENCE; send_message.h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(&send_message); @@ -732,7 +720,6 @@ void sgwc_sxa_handle_session_modification_response( if (s5c_xact) { ogs_assert(recv_message); recv_message->h.type = OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sess->pgw_s5c_teid; pkbuf = ogs_gtp2_build_msg(recv_message); @@ -782,7 +769,6 @@ void sgwc_sxa_handle_session_modification_response( gtp_req->bearer_contexts.s1_u_enodeb_f_teid.len = len; recv_message->h.type = OGS_GTP2_CREATE_BEARER_REQUEST_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(recv_message); @@ -850,7 +836,6 @@ void sgwc_sxa_handle_session_modification_response( gtp_rsp->bearer_contexts.s5_s8_u_pgw_f_teid.len = len; recv_message->h.type = OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sess->pgw_s5c_teid; pkbuf = ogs_gtp2_build_msg(recv_message); @@ -977,7 +962,6 @@ void sgwc_sxa_handle_session_modification_response( send_message.h.type = OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE; - send_message.h.teid_presence = OGS_GTP2_TEID_PRESENCE; send_message.h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(&send_message); @@ -1062,7 +1046,6 @@ void sgwc_sxa_handle_session_modification_response( } recv_message->h.type = OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(recv_message); @@ -1100,7 +1083,6 @@ void sgwc_sxa_handle_session_modification_response( if (indication && indication->handover_indication) { recv_message->h.type = OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE; - recv_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; recv_message->h.teid = sess->pgw_s5c_teid; pkbuf = ogs_gtp2_build_msg(recv_message); @@ -1186,7 +1168,6 @@ void sgwc_sxa_handle_session_modification_response( } send_message.h.type = OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE; - send_message.h.teid_presence = OGS_GTP2_TEID_PRESENCE; send_message.h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(&send_message); @@ -1252,7 +1233,6 @@ void sgwc_sxa_handle_session_modification_response( send_message.h.type = OGS_GTP2_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE; - send_message.h.teid_presence = OGS_GTP2_TEID_PRESENCE; send_message.h.teid = sgwc_ue->mme_s11_teid; pkbuf = ogs_gtp2_build_msg(&send_message); @@ -1284,7 +1264,6 @@ void sgwc_sxa_handle_session_deletion_response( { int rv; uint8_t cause_value = 0; - int teid_presence = OGS_GTP2_TEID_NO_PRESENCE; uint32_t teid = 0; sgwc_ue_t *sgwc_ue = NULL; @@ -1336,8 +1315,6 @@ void sgwc_sxa_handle_session_deletion_response( * 2. SMF sends Delete Session Response to SGW/MME. */ if (sess) sgwc_ue = sess->sgwc_ue; - teid_presence = - sgwc_ue ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE; teid = sgwc_ue ? sgwc_ue->mme_s11_teid : 0; break; case OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE: @@ -1354,8 +1331,6 @@ void sgwc_sxa_handle_session_deletion_response( * - Bearer Resource Command * - Delete Bearer Request/Response with DEDICATED BEARER. */ - teid_presence = - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE; teid = sess ? sess->pgw_s5c_teid : 0; break; default: @@ -1365,8 +1340,8 @@ void sgwc_sxa_handle_session_deletion_response( if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { if (gtp_xact) { - ogs_gtp2_send_error_message(gtp_xact, - teid_presence, teid, gtp_message->h.type, cause_value); + ogs_gtp_send_error_message( + gtp_xact, teid, gtp_message->h.type, cause_value); } return; } @@ -1383,7 +1358,6 @@ void sgwc_sxa_handle_session_deletion_response( * If gtp_message->h.type == OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE * Then gtp_xact is S5C-XACT */ - gtp_message->h.teid_presence = OGS_GTP2_TEID_PRESENCE; gtp_message->h.teid = teid; pkbuf = ogs_gtp2_build_msg(gtp_message); @@ -1445,8 +1419,7 @@ void sgwc_sxa_handle_session_report_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_pfcp_send_error_message(pfcp_xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, cause_value, 0); return; @@ -1458,9 +1431,7 @@ void sgwc_sxa_handle_session_report_request( if (!sgwc_ue->gnode) { ogs_error("No SGWC-UE GTP Node"); - ogs_pfcp_send_error_message(pfcp_xact, - sess ? OGS_PFCP_SEID_PRESENCE : OGS_PFCP_SEID_NO_PRESENCE, - sess ? sess->sgwu_sxa_seid : 0, + ogs_pfcp_send_error_message(pfcp_xact, sess ? sess->sgwu_sxa_seid : 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; diff --git a/src/sgwu/pfcp-path.c b/src/sgwu/pfcp-path.c index e54423fe0..d9f423bbf 100644 --- a/src/sgwu/pfcp-path.c +++ b/src/sgwu/pfcp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -180,7 +180,6 @@ int sgwu_pfcp_send_session_establishment_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwc_sxa_f_seid.seid; sxabuf = sgwu_sxa_build_session_establishment_response( @@ -214,7 +213,6 @@ int sgwu_pfcp_send_session_modification_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwc_sxa_f_seid.seid; sxabuf = sgwu_sxa_build_session_modification_response( @@ -247,7 +245,6 @@ int sgwu_pfcp_send_session_deletion_response(ogs_pfcp_xact_t *xact, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwc_sxa_f_seid.seid; sxabuf = sgwu_sxa_build_session_deletion_response(h.type, sess); @@ -298,7 +295,6 @@ int sgwu_pfcp_send_session_report_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->sgwc_sxa_f_seid.seid; xact = ogs_pfcp_xact_local_create(sess->pfcp_node, sess_timeout, sess); diff --git a/src/sgwu/sxa-handler.c b/src/sgwu/sxa-handler.c index 4fd54f868..ec25214e3 100644 --- a/src/sgwu/sxa-handler.c +++ b/src/sgwu/sxa-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -45,8 +45,7 @@ void sgwu_sxa_handle_session_establishment_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE, OGS_PFCP_CAUSE_MANDATORY_IE_MISSING, 0); return; @@ -143,9 +142,7 @@ void sgwu_sxa_handle_session_establishment_request( cleanup: ogs_pfcp_sess_clear(&sess->pfcp); - ogs_pfcp_send_error_message(xact, - sess ? OGS_PFCP_SEID_PRESENCE : OGS_PFCP_SEID_NO_PRESENCE, - sess ? sess->sgwu_sxa_seid : 0, + ogs_pfcp_send_error_message(xact, sess ? sess->sgwu_sxa_seid : 0, OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE, cause_value, offending_ie_value); } @@ -171,8 +168,7 @@ void sgwu_sxa_handle_session_modification_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; @@ -313,9 +309,7 @@ void sgwu_sxa_handle_session_modification_request( cleanup: ogs_pfcp_sess_clear(&sess->pfcp); - ogs_pfcp_send_error_message(xact, - sess ? OGS_PFCP_SEID_PRESENCE : OGS_PFCP_SEID_NO_PRESENCE, - sess ? sess->sgwu_sxa_seid : 0, + ogs_pfcp_send_error_message(xact, sess ? sess->sgwu_sxa_seid : 0, OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE, cause_value, offending_ie_value); } @@ -331,8 +325,7 @@ void sgwu_sxa_handle_session_deletion_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; diff --git a/src/smf/binding.c b/src/smf/binding.c index 8fbefeeb7..72ee3e517 100644 --- a/src/smf/binding.c +++ b/src/smf/binding.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -363,7 +363,6 @@ void smf_bearer_binding(smf_sess_t *sess) memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_UPDATE_BEARER_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; pkbuf = smf_s5c_build_update_bearer_request( @@ -440,7 +439,6 @@ int smf_gtp2_send_create_bearer_request(smf_bearer_t *bearer) ogs_assert(sess); h.type = OGS_GTP2_CREATE_BEARER_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; memset(&tft, 0, sizeof tft); diff --git a/src/smf/gsm-sm.c b/src/smf/gsm-sm.c index 60ff146bd..d1226ca9e 100644 --- a/src/smf/gsm-sm.c +++ b/src/smf/gsm-sm.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee + * * This file is part of Open5GS. * @@ -73,9 +74,7 @@ static void send_gtp_create_err_msg(const smf_sess_t *sess, ogs_gtp1_send_error_message(gtp_xact, sess->sgw_s5c_teid, OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, gtp_cause); else - ogs_gtp2_send_error_message(gtp_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess->sgw_s5c_teid, + ogs_gtp2_send_error_message(gtp_xact, sess->sgw_s5c_teid, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, gtp_cause); } @@ -86,9 +85,7 @@ static void send_gtp_delete_err_msg(const smf_sess_t *sess, ogs_gtp1_send_error_message(gtp_xact, sess->sgw_s5c_teid, OGS_GTP1_DELETE_PDP_CONTEXT_RESPONSE_TYPE, gtp_cause); else - ogs_gtp2_send_error_message(gtp_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess->sgw_s5c_teid, + ogs_gtp2_send_error_message(gtp_xact, sess->sgw_s5c_teid, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, gtp_cause); } @@ -778,10 +775,8 @@ void smf_gsm_state_operational(ogs_fsm_t *s, smf_event_t *e) sess, e->gtp_xact, >p2_message->delete_session_request); if (gtp2_cause != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(e->gtp_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess->sgw_s5c_teid, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, gtp2_cause); + ogs_gtp2_send_error_message(e->gtp_xact, sess->sgw_s5c_teid, + OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, gtp2_cause); return; } OGS_FSM_TRAN(s, smf_gsm_state_wait_pfcp_deletion); diff --git a/src/smf/gtp-path.c b/src/smf/gtp-path.c index c77d46742..8d88ee20e 100644 --- a/src/smf/gtp-path.c +++ b/src/smf/gtp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -444,7 +444,6 @@ int smf_gtp2_send_create_session_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; pkbuf = smf_s5c_build_create_session_response(h.type, sess); @@ -479,7 +478,6 @@ int smf_gtp2_send_modify_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; pkbuf = smf_s5c_build_modify_bearer_response( @@ -513,7 +511,6 @@ int smf_gtp2_send_delete_session_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; pkbuf = smf_s5c_build_delete_session_response(h.type, sess); @@ -551,7 +548,6 @@ int smf_gtp2_send_delete_bearer_request( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_BEARER_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->sgw_s5c_teid; pkbuf = smf_s5c_build_delete_bearer_request( diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index 6727666ad..355ff1477 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -971,7 +971,6 @@ void smf_epc_n4_handle_session_modification_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.teid = sess->sgw_s5c_teid; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.type = OGS_GTP2_DELETE_BEARER_REQUEST_TYPE; pkbuf = smf_s5c_build_delete_bearer_request( @@ -1183,8 +1182,7 @@ void smf_n4_handle_session_report_request( } if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { - ogs_pfcp_send_error_message(pfcp_xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, cause_value, 0); return; @@ -1224,8 +1222,7 @@ void smf_n4_handle_session_report_request( if (paging_policy_indication_value) { ogs_warn("Not implement - " "Paging Policy Indication Value"); - ogs_pfcp_send_error_message(pfcp_xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SERVICE_NOT_SUPPORTED, 0); return; @@ -1235,8 +1232,7 @@ void smf_n4_handle_session_report_request( qos_flow = smf_qos_flow_find_by_qfi(sess, qfi); if (!qos_flow) { ogs_error("Cannot find the QoS Flow[%d]", qfi); - ogs_pfcp_send_error_message(pfcp_xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; @@ -1261,8 +1257,7 @@ void smf_n4_handle_session_report_request( if (!pdr) { ogs_error("No Context"); - ogs_pfcp_send_error_message(pfcp_xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; diff --git a/src/smf/pfcp-path.c b/src/smf/pfcp-path.c index 37fdb6916..fc02ae6ae 100644 --- a/src/smf/pfcp-path.c +++ b/src/smf/pfcp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -370,7 +370,6 @@ int smf_pfcp_send_modify_list( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; n4buf = (*modify_list)(h.type, sess, xact); @@ -448,7 +447,6 @@ int smf_5gc_pfcp_send_session_establishment_request( * over N4 towards another SMF or another PFCP entity in the SMF * as specified in clause 5.22.2 and clause 5.22.3. */ - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; n4buf = smf_n4_build_session_establishment_request(h.type, sess, xact); @@ -551,7 +549,6 @@ int smf_5gc_pfcp_send_session_deletion_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; n4buf = smf_n4_build_session_deletion_request(h.type, sess); @@ -625,7 +622,6 @@ int smf_epc_pfcp_send_session_establishment_request( * over N4 towards another SMF or another PFCP entity in the SMF * as specified in clause 5.22.2 and clause 5.22.3. */ - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; n4buf = smf_n4_build_session_establishment_request(h.type, sess, xact); @@ -769,7 +765,6 @@ int smf_epc_pfcp_send_session_deletion_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; n4buf = smf_n4_build_session_deletion_request(h.type, sess); @@ -868,7 +863,6 @@ int smf_pfcp_send_session_report_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->upf_n4_seid; sxabuf = ogs_pfcp_build_session_report_response(h.type, cause); diff --git a/src/smf/pfcp-sm.c b/src/smf/pfcp-sm.c index 084f985f6..bf0235842 100644 --- a/src/smf/pfcp-sm.c +++ b/src/smf/pfcp-sm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -324,8 +324,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); else - ogs_gtp2_send_error_message(gtp_xact, - OGS_GTP2_TEID_NO_PRESENCE, 0, + ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); break; @@ -360,8 +359,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) OGS_GTP1_DELETE_PDP_CONTEXT_RESPONSE_TYPE, OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); else - ogs_gtp2_send_error_message(gtp_xact, - OGS_GTP2_TEID_NO_PRESENCE, 0, + ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); break; diff --git a/src/smf/s5c-handler.c b/src/smf/s5c-handler.c index e20b23ecf..da65704e7 100644 --- a/src/smf/s5c-handler.c +++ b/src/smf/s5c-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -504,9 +504,7 @@ void smf_s5c_handle_modify_bearer_request( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(gtp_xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message(gtp_xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -1188,9 +1186,7 @@ void smf_s5c_handle_bearer_resource_command( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message(xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value); return; } @@ -1215,9 +1211,7 @@ void smf_s5c_handle_bearer_resource_command( } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp2_send_error_message(xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message(xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value); return; } @@ -1246,10 +1240,8 @@ void smf_s5c_handle_bearer_resource_command( pf = smf_pf_find_by_id(bearer, tft.pf[i].identifier+1); if (pf) { if (reconfigure_packet_filter(pf, &tft, i) < 0) { - ogs_gtp2_send_error_message(xact, - sess ? OGS_GTP2_TEID_PRESENCE : - OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message( + xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER); return; @@ -1317,9 +1309,8 @@ void smf_s5c_handle_bearer_resource_command( ogs_assert(pf); if (reconfigure_packet_filter(pf, &tft, i) < 0) { - ogs_gtp2_send_error_message(xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message( + xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER); return; @@ -1405,9 +1396,7 @@ void smf_s5c_handle_bearer_resource_command( if (tft_update == 0 && tft_delete == 0 && qos_update == 0) { /* No modification */ - ogs_gtp2_send_error_message(xact, - sess ? OGS_GTP2_TEID_PRESENCE : OGS_GTP2_TEID_NO_PRESENCE, - sess ? sess->sgw_s5c_teid : 0, + ogs_gtp2_send_error_message(xact, sess ? sess->sgw_s5c_teid : 0, OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, OGS_GTP2_CAUSE_SERVICE_NOT_SUPPORTED); return; @@ -1433,7 +1422,6 @@ void smf_s5c_handle_bearer_resource_command( } else { memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.teid = sess->sgw_s5c_teid; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.type = OGS_GTP2_UPDATE_BEARER_REQUEST_TYPE; pkbuf = smf_s5c_build_update_bearer_request( diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index 992373f7a..60fc8f0a8 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -144,8 +144,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) } if (!sess) { ogs_error("No Session"); - ogs_gtp2_send_error_message(gtp_xact, - OGS_GTP2_TEID_NO_PRESENCE, 0, + ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); break; @@ -159,8 +158,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) smf_metrics_inst_gtp_node_inc(smf_gnode->metrics, SMF_METR_GTP_NODE_CTR_S5C_RX_DELETESESSIONREQ); if (!sess) { ogs_error("No Session"); - ogs_gtp2_send_error_message(gtp_xact, - OGS_GTP2_TEID_NO_PRESENCE, 0, + ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); break; diff --git a/src/upf/n4-handler.c b/src/upf/n4-handler.c index ff6443dcf..b9b0bf9b2 100644 --- a/src/upf/n4-handler.c +++ b/src/upf/n4-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -69,8 +69,7 @@ void upf_n4_handle_session_establishment_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE, OGS_PFCP_CAUSE_MANDATORY_IE_MISSING, 0); upf_metrics_inst_by_cause_add(OGS_PFCP_CAUSE_MANDATORY_IE_MISSING, @@ -215,9 +214,7 @@ cleanup: upf_metrics_inst_by_cause_add(cause_value, UPF_METR_CTR_SM_N4SESSIONESTABFAIL, 1); ogs_pfcp_sess_clear(&sess->pfcp); - ogs_pfcp_send_error_message(xact, - sess ? OGS_PFCP_SEID_PRESENCE : OGS_PFCP_SEID_NO_PRESENCE, - sess ? sess->smf_n4_f_seid.seid : 0, + ogs_pfcp_send_error_message(xact, sess ? sess->smf_n4_f_seid.seid : 0, OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE, cause_value, offending_ie_value); } @@ -243,8 +240,7 @@ void upf_n4_handle_session_modification_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; @@ -417,9 +413,7 @@ void upf_n4_handle_session_modification_request( cleanup: ogs_pfcp_sess_clear(&sess->pfcp); - ogs_pfcp_send_error_message(xact, - sess ? OGS_PFCP_SEID_PRESENCE : OGS_PFCP_SEID_NO_PRESENCE, - sess ? sess->smf_n4_f_seid.seid : 0, + ogs_pfcp_send_error_message(xact, sess ? sess->smf_n4_f_seid.seid : 0, OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE, cause_value, offending_ie_value); } @@ -437,8 +431,7 @@ void upf_n4_handle_session_deletion_request( if (!sess) { ogs_error("No Context"); - ogs_pfcp_send_error_message(xact, - OGS_PFCP_SEID_NO_PRESENCE, 0, + ogs_pfcp_send_error_message(xact, 0, OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; diff --git a/src/upf/pfcp-path.c b/src/upf/pfcp-path.c index 1bebaee4c..0935e9922 100644 --- a/src/upf/pfcp-path.c +++ b/src/upf/pfcp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019 by Sukchan Lee * * This file is part of Open5GS. * @@ -183,7 +183,6 @@ int upf_pfcp_send_session_establishment_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->smf_n4_f_seid.seid; n4buf = upf_n4_build_session_establishment_response( @@ -217,7 +216,6 @@ int upf_pfcp_send_session_modification_response( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->smf_n4_f_seid.seid; n4buf = upf_n4_build_session_modification_response( @@ -250,7 +248,6 @@ int upf_pfcp_send_session_deletion_response(ogs_pfcp_xact_t *xact, memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->smf_n4_f_seid.seid; n4buf = upf_n4_build_session_deletion_response(h.type, sess); @@ -303,7 +300,6 @@ int upf_pfcp_send_session_report_request( memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_REQUEST_TYPE; - h.seid_presence = OGS_PFCP_SEID_PRESENCE; h.seid = sess->smf_n4_f_seid.seid; xact = ogs_pfcp_xact_local_create(sess->pfcp_node, sess_timeout, sess); diff --git a/tests/non3gpp/gtp-path.c b/tests/non3gpp/gtp-path.c index c5b2453cd..3992bd01d 100644 --- a/tests/non3gpp/gtp-path.c +++ b/tests/non3gpp/gtp-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 by Sukchan Lee + * Copyright (C) 2019,2020 by Sukchan Lee * * This file is part of Open5GS. * @@ -135,7 +135,6 @@ int test_s2b_send_create_session_request(test_sess_t *sess, bool handover_ind) memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_SESSION_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->smf_s2b_c_teid; pkbuf = test_s2b_build_create_session_request(h.type, sess, handover_ind); @@ -167,7 +166,6 @@ int test_s2b_send_delete_session_request(test_sess_t *sess) memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_SESSION_REQUEST_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->smf_s2b_c_teid; pkbuf = test_s2b_build_delete_session_request(h.type, sess); @@ -203,7 +201,6 @@ int test_s2b_send_create_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->smf_s2b_c_teid; pkbuf = test_s2b_build_create_bearer_response(h.type, bearer); @@ -239,7 +236,6 @@ int test_s2b_send_delete_bearer_response( memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE; - h.teid_presence = OGS_GTP2_TEID_PRESENCE; h.teid = sess->smf_s2b_c_teid; pkbuf = test_s2b_build_delete_bearer_response(h.type, bearer);