From c5715d6695b366ae232ac27539908eb6cc007d84 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 13 May 2022 23:15:28 +0200 Subject: [PATCH] [SMF] Gy CCR: append 3GPP-RAT-Type AVP (#1536) --- lib/diameter/gy/message.c | 2 ++ lib/diameter/gy/message.h | 1 + src/smf/gy-path.c | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/lib/diameter/gy/message.c b/lib/diameter/gy/message.c index 25c296d38..698d799e0 100644 --- a/lib/diameter/gy/message.c +++ b/lib/diameter/gy/message.c @@ -71,6 +71,7 @@ struct dict_object *ogs_diam_gy_pre_emption_capability = NULL; struct dict_object *ogs_diam_gy_pre_emption_vulnerability = NULL; struct dict_object *ogs_diam_gy_apn_aggregate_max_bitrate_ul = NULL; struct dict_object *ogs_diam_gy_apn_aggregate_max_bitrate_dl = NULL; +struct dict_object *ogs_diam_gy_3gpp_rat_type = NULL; struct dict_object *ogs_diam_gy_3gpp_user_location_info = NULL; struct dict_object *ogs_diam_gy_called_station_id = NULL; struct dict_object *ogs_diam_gy_3gpp_ms_timezone = NULL; @@ -134,6 +135,7 @@ int ogs_diam_gy_init(void) CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Pre-emption-Vulnerability", &ogs_diam_gy_pre_emption_vulnerability); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-UL" , &ogs_diam_gy_apn_aggregate_max_bitrate_ul); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Aggregate-Max-Bitrate-DL" , &ogs_diam_gy_apn_aggregate_max_bitrate_dl); + CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-RAT-Type" , &ogs_diam_gy_3gpp_rat_type); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-User-Location-Info", &ogs_diam_gy_3gpp_user_location_info); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Called-Station-Id", &ogs_diam_gy_called_station_id); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-MS-TimeZone", &ogs_diam_gy_3gpp_ms_timezone); diff --git a/lib/diameter/gy/message.h b/lib/diameter/gy/message.h index 2390694e8..1d2e107b6 100644 --- a/lib/diameter/gy/message.h +++ b/lib/diameter/gy/message.h @@ -121,6 +121,7 @@ extern struct dict_object *ogs_diam_gy_pre_emption_capability; extern struct dict_object *ogs_diam_gy_pre_emption_vulnerability; extern struct dict_object *ogs_diam_gy_apn_aggregate_max_bitrate_ul; extern struct dict_object *ogs_diam_gy_apn_aggregate_max_bitrate_dl; +extern struct dict_object *ogs_diam_gy_3gpp_rat_type; #define OGS_DIAM_GY_3GPP_USER_LOCATION_INFO_TYPE_TAI 128 #define OGS_DIAM_GY_3GPP_USER_LOCATION_INFO_TYPE_ECGI 129 #define OGS_DIAM_GY_3GPP_USER_LOCATION_INFO_TYPE_TAI_AND_ECGI 130 diff --git a/src/smf/gy-path.c b/src/smf/gy-path.c index 9818a7ab7..f96b2ae4d 100644 --- a/src/smf/gy-path.c +++ b/src/smf/gy-path.c @@ -239,6 +239,17 @@ static void fill_multiple_services_credit_control_ccr(smf_sess_t *sess, ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1); ogs_assert(ret == 0); + /* 3GPP-RAT-Type, TS 29.061 16.4.7.2 21 */ + /* GGSN: TS 29.060 7.7.50, PGW: TS 29.274 8.17 */ + ret = fd_msg_avp_new(ogs_diam_gy_3gpp_rat_type, 0, &avpch1); + ogs_assert(ret == 0); + val.os.data = (uint8_t*)&sess->gtp_rat_type; + val.os.len = 1; + ret = fd_msg_avp_setvalue (avpch1, &val); + ogs_assert(ret == 0); + ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1); + ogs_assert(ret == 0); + /* Multiple Services AVP add to req: */ ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp); ogs_assert(ret == 0);