From 6477d7358a23627abacfb8f1bca534a61f82a3be Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 3 Jun 2022 12:04:40 +0200 Subject: [PATCH] DIAMETER: Introduce and rework some AVP templates All the AVP ecosystem in DIAMETER is quite a mess. There's AVPs defined in several different specs, sometimes even with the same name and different AVP code and vendor. Hence, as we add more templates it becomes important to start using the prefix in order to differentiate where they come from. Change-Id: Iec7c51dae136629d6b754de4dd798e988ac51f6b --- ggsn_tests/GGSN_Tests.ttcn | 6 ++-- library/DIAMETER_Templates.ttcn | 49 ++++++++++++++++++++++++++++----- pgw/PGW_Tests.ttcn | 6 ++-- 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index ddc651c33..be1953ea4 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -531,7 +531,7 @@ module GGSN_Tests { tr_AVP_Multiple_Services_Credit_Control(content := superset( tr_AVP_Requested_Service_Unit, tr_AVP_Used_Service_Unit, - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset( @@ -578,7 +578,7 @@ module GGSN_Tests { tr_AVP_Requested_Service_Unit, tr_AVP_Used_Service_Unit, /* tr_AVP_3GPP_Reporting_Reason, can be sometimes inside UsedServiceUnit */ - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset( @@ -626,7 +626,7 @@ module GGSN_Tests { /* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */ tr_AVP_Used_Service_Unit, tr_AVP_3GPP_Reporting_Reason(FINAL), - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset( diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 2bc9e7732..be3d8a2a5 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -860,7 +860,7 @@ template (value) GenericAVP ts_AVP_ServiceSelection(charstring apn) := { } } -template (present) GenericAVP tr_AVP_3GPP_QoS_Information(template (present) AVP_list list := ?) := { +template (present) GenericAVP tr_AVP_PCC_3GPP_QoS_Information(template (present) AVP_list list := ?) := { avp := { avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Information), avp_data := { @@ -869,11 +869,47 @@ template (present) GenericAVP tr_AVP_3GPP_QoS_Information(template (present) AVP } } -template (value) GenericAVP ts_AVP_3GPP_QosClassId(uint32_t id) := { +template (value) GenericAVP ts_AVP_PCC_3GPP_QoS_Information(template (value) AVP_list list) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Information), + avp_data := { + avp_PCC_3GPP_QoS_Information := list + } + } +} + +template (value) GenericAVP ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL(uint32_t val) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL), + avp_data := { + avp_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL := int2oct(val, 4) + } + } +} + +template (value) GenericAVP ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL(uint32_t val) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL), + avp_data := { + avp_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL := int2oct(val, 4) + } + } +} + +template (value) GenericAVP ts_AVP_PCC_3GPP_Default_EPS_Bearer_QoS(template (value) AVP_list list) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Default_EPS_Bearer_QoS), + avp_data := { + avp_PCC_3GPP_Default_EPS_Bearer_QoS := list + } + } +} + +template (value) GenericAVP ts_AVP_PCC_3GPP_QoS_Class_Identifier(uint32_t val) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier), avp_data := { - avp_PCC_3GPP_QoS_Class_Identifier := int2oct(id, 4) + avp_PCC_3GPP_QoS_Class_Identifier := int2oct(val, 4) } } } @@ -887,8 +923,7 @@ template (value) GenericAVP ts_AVP_3GPP_PriorityLevel(uint32_t prio) := { } } - -template (value) GenericAVP ts_AVP_3GPP_AllocRetenPrio(uint32_t prio) := { +template (value) GenericAVP ts_AVP_PCC_3GPP_AllocRetenPrio(uint32_t prio) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Allocation_Retention_Priority), avp_data := { @@ -906,8 +941,8 @@ template (value) GenericAVP ts_AVP_3GPP_EpsSubscrQosProfile(uint32_t qos_class, avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile), avp_data := { avp_AAA_3GPP_EPS_Subscribed_QoS_Profile := { - ts_AVP_3GPP_QosClassId(qos_class), - ts_AVP_3GPP_AllocRetenPrio(prio) + ts_AVP_PCC_3GPP_QoS_Class_Identifier(qos_class), + ts_AVP_PCC_3GPP_AllocRetenPrio(prio) } } } diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn index e1f49abaa..1041898ce 100644 --- a/pgw/PGW_Tests.ttcn +++ b/pgw/PGW_Tests.ttcn @@ -361,7 +361,7 @@ runs on PGW_Session_CT return template (present) PDU_DIAMETER tr_AVP_Multiple_Services_Credit_Control(content := superset( tr_AVP_Requested_Service_Unit, tr_AVP_Used_Service_Unit, - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset( @@ -410,7 +410,7 @@ runs on PGW_Session_CT return template (present) PDU_DIAMETER tr_AVP_Requested_Service_Unit, tr_AVP_Used_Service_Unit, /* tr_AVP_3GPP_Reporting_Reason, can be sometimes inside UsedServiceUnit */ - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset( @@ -460,7 +460,7 @@ runs on PGW_Session_CT return template (present) PDU_DIAMETER /* tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */ tr_AVP_Used_Service_Unit, tr_AVP_3GPP_Reporting_Reason(FINAL), - tr_AVP_3GPP_QoS_Information, + tr_AVP_PCC_3GPP_QoS_Information, tr_AVP_GI_3GPP_RatType(rat_type) )), tr_AVP_3GPP_ServiceInformation(content := superset(