pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36165?usp=email )
Change subject: Small improvements to DIAMETER_ts29_272_Templates.ttcn ......................................................................
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 --- M library/DIAMETER_Templates.ttcn M library/DIAMETER_ts29_272_Templates.ttcn 2 files changed, 42 insertions(+), 27 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/65/36165/1
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 98ca9bd..5390d6e 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -715,24 +715,6 @@ } }
-/* 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 d3c7a95..0aa5c64 100644 --- a/library/DIAMETER_ts29_272_Templates.ttcn +++ b/library/DIAMETER_ts29_272_Templates.ttcn @@ -238,11 +238,11 @@ } } } -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 (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 @@ } }
+/* 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 (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 (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 (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) } } }