From 5154e357e4eb9395a2baba7013e58aae46de7845 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 5 Mar 2024 13:23:40 +0100 Subject: Small improvements to DIAMETER_ts29_272_Templates.ttcn * Move Service-Selection template to the TS 29.272 since it belongs there. * Set some parameter types to "template (value)" which makes it easier for users, since both a template and a value can then be passed. Change-Id: Ic57b2c5ec0a953f9a1751d4ce4ad441daafd3c87 --- epdg/gen_links.sh | 2 +- library/DIAMETER_Templates.ttcn | 18 ---------------- library/DIAMETER_ts29_272_Templates.ttcn | 37 ++++++++++++++++++++++++-------- library/DIAMETER_ts29_273_Templates.ttcn | 1 + 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/epdg/gen_links.sh b/epdg/gen_links.sh index 7a4e60db..ec8b9da5 100755 --- a/epdg/gen_links.sh +++ b/epdg/gen_links.sh @@ -55,7 +55,7 @@ FILES+="Osmocom_CTRL_Types.ttcn " FILES+="L3_Common.ttcn " FILES+="DNS_Helpers.ttcn " FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn " -FILES+="DIAMETER_Templates.ttcn DIAMETER_rfc5447_Templates.ttcn DIAMETER_ts29_273_Templates.ttcn " +FILES+="DIAMETER_Templates.ttcn DIAMETER_rfc5447_Templates.ttcn DIAMETER_ts29_272_Templates.ttcn DIAMETER_ts29_273_Templates.ttcn " FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp " FILES+="PCO_Types.ttcn GSUP_Types.ttcn GSUP_Templates.ttcn GSUP_Emulation.ttcn " diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 98ca9bd5..5390d6e3 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -715,24 +715,6 @@ template (value) GenericAVP ts_AVP_3GPP_SubscrRauTauTmr(uint32_t tmr) := { } } -/* Service-Selection, TS 29.272 7.3.36, TS 29.273 5.2.3.5, (RFC 5778) */ -template (present) GenericAVP tr_AVP_ServiceSelection(template (present) charstring apn := ?) := { - avp := { - avp_header := tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), - avp_data := { - avp_MIPv6_NONE_Service_Selection := char2oct_tmpl(apn) - } - } -} -template (value) GenericAVP ts_AVP_ServiceSelection(charstring apn) := { - avp := { - avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), - avp_data := { - avp_MIPv6_NONE_Service_Selection := char2oct(apn) - } - } -} - 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), diff --git a/library/DIAMETER_ts29_272_Templates.ttcn b/library/DIAMETER_ts29_272_Templates.ttcn index d3c7a954..0aa5c642 100644 --- a/library/DIAMETER_ts29_272_Templates.ttcn +++ b/library/DIAMETER_ts29_272_Templates.ttcn @@ -238,11 +238,11 @@ template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t } } } -template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { +template (value) GenericAVP ts_AVP_3GPP_ContextId(template (value) uint32_t ctx) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), avp_data := { - avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) + avp_AAA_3GPP_Context_Identifier := int2oct(valueof(ctx), 4) } } } @@ -345,8 +345,9 @@ template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t } } } -template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, - charstring apn) := { +template (value) GenericAVP ts_AVP_3GPP_ApnConfig(template (value) uint32_t ctx, + template (value) AAA_3GPP_PDN_Type pdn_type, + template (value) charstring apn) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), avp_data := { @@ -360,6 +361,23 @@ template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Typ } } +/* Service-Selection, TS 29.272 7.3.36, TS 29.273 5.2.3.5, (RFC 5778) */ +template (present) GenericAVP tr_AVP_ServiceSelection(template (present) charstring apn := ?) := { + avp := { + avp_header := tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), + avp_data := { + avp_MIPv6_NONE_Service_Selection := char2oct_tmpl(apn) + } + } +} +template (value) GenericAVP ts_AVP_ServiceSelection(template (value) charstring apn) := { + avp := { + avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), + avp_data := { + avp_MIPv6_NONE_Service_Selection := char2oct(valueof(apn)) + } + } +} /* TS 29.272 7.3.41 AMBR */ template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { @@ -373,7 +391,8 @@ template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := } } } -template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { +template (value) GenericAVP ts_AVP_3GPP_AMBR(template (value) uint32_t ul, + template (value) uint32_t dl) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), avp_data := { @@ -394,11 +413,11 @@ template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t } } -template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { +template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(template (value) uint32_t bw) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) + avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(valueof(bw), 4) } } } @@ -412,11 +431,11 @@ template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t } } -template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { +template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(template (value) uint32_t bw) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), avp_data := { - avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) + avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(valueof(bw), 4) } } } diff --git a/library/DIAMETER_ts29_273_Templates.ttcn b/library/DIAMETER_ts29_273_Templates.ttcn index 87d16011..c7f2a456 100644 --- a/library/DIAMETER_ts29_273_Templates.ttcn +++ b/library/DIAMETER_ts29_273_Templates.ttcn @@ -15,6 +15,7 @@ import from General_Types all; import from DIAMETER_Types all; import from DIAMETER_Templates all; import from DIAMETER_rfc5447_Templates all; +import from DIAMETER_ts29_272_Templates all; import from Osmocom_Types all; import from Misc_Helpers all; -- cgit v1.2.3