pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34713?usp=email )
Change subject: library/DIAMETER: Add several missing tr templates ...................................................................... library/DIAMETER: Add several missing tr templates Change-Id: I21da18a5e1f0d368176d653494e0e0cde0beb656 --- M library/DIAMETER_Templates.ttcn M library/Osmocom_Types.ttcn 2 files changed, 171 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/34713/1 diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 8bb53e0..fde071b 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -852,6 +852,14 @@ /* TS 29.272 7.3.27 Context-Identifier */ +template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t ctx := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), + avp_data := { + avp_AAA_3GPP_Context_Identifier := int2oct_tmpl(ctx, 4) + } + } +} template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), @@ -871,6 +879,15 @@ } } +template (present) GenericAVP tr_AVP_3GPP_SubscrRauTauTmr(template (present) uint32_t tmr := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer), + avp_data := { + avp_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer := int2oct_tmpl(tmr, 4) + } + } +} + template (value) GenericAVP ts_AVP_3GPP_SubscrRauTauTmr(uint32_t tmr) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer), @@ -881,6 +898,14 @@ } /* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */ +template (present) GenericAVP tr_AVP_3GPP_AllApnConfigsIncl(template (present) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), + avp_data := { + avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind + } + } +} template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), @@ -891,6 +916,14 @@ } /* TS 29.272 7.3.34 APN-Configuration-Profile */ +template (present) GenericAVP tr_AVP_3GPP_ApnConfigProfile(template (present) AVP_list content := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), + avp_data := { + avp_AAA_3GPP_APN_Configuration_Profile := content + } + } +} template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), @@ -901,6 +934,21 @@ } /* TS 29.272 7.3.35 APN-Configuration */ +template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t ctx := ?, + template (present) AAA_3GPP_PDN_Type pdn_type := ?, + template (present) charstring apn := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), + avp_data := { + avp_AAA_3GPP_APN_Configuration := { + tr_AVP_3GPP_ContextId(ctx), + tr_AVP_3GPP_PdnType(pdn_type), + tr_AVP_3GPP_EpsSubscrQosProfile(?, ?), + tr_AVP_ServiceSelection(apn) + } + } + } +} template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, charstring apn) := { avp := { @@ -917,6 +965,14 @@ } /* TS 29.272 7.3.36 Service-Selection (refers to 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), @@ -971,6 +1027,15 @@ } } +template (present) GenericAVP tr_AVP_PCC_3GPP_QoS_Class_Identifier(template (present) uint32_t val := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier), + avp_data := { + avp_PCC_3GPP_QoS_Class_Identifier := int2oct_tmpl(val, 4) + } + } +} + 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), @@ -980,6 +1045,15 @@ } } +template (present) GenericAVP tr_AVP_3GPP_PriorityLevel(template (present) uint32_t prio := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Priority_Level), + avp_data := { + avp_PCC_3GPP_Priority_Level := int2oct_tmpl(prio, 4) + } + } +} + template (value) GenericAVP ts_AVP_3GPP_PriorityLevel(uint32_t prio) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Priority_Level), @@ -989,6 +1063,18 @@ } } +template (present) GenericAVP tr_AVP_PCC_3GPP_AllocRetenPrio(template (present) uint32_t prio := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Allocation_Retention_Priority), + avp_data := { + avp_PCC_3GPP_Allocation_Retention_Priority := { + tr_AVP_3GPP_PriorityLevel(prio) + /* pre-emption capability */ + /* pre-emption vulnerability */ + } + } + } +} 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), @@ -1002,6 +1088,19 @@ } } +template (present) GenericAVP tr_AVP_3GPP_EpsSubscrQosProfile(template (present) uint32_t qos_class := ?, + template (present) uint32_t prio := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile), + avp_data := { + avp_AAA_3GPP_EPS_Subscribed_QoS_Profile := { + tr_AVP_PCC_3GPP_QoS_Class_Identifier(qos_class), + tr_AVP_PCC_3GPP_AllocRetenPrio(prio) + } + } + } +} + template (value) GenericAVP ts_AVP_3GPP_EpsSubscrQosProfile(uint32_t qos_class, uint32_t prio) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile), @@ -1016,6 +1115,17 @@ /* TS 29.272 7.3.41 AMBR */ +template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), + avp_data := { + avp_AAA_3GPP_AMBR := { + tr_AVP_3GPP_MaxReqBwUL(ul), + tr_AVP_3GPP_MaxReqBwDL(dl) + } + } + } +} template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), @@ -1028,6 +1138,15 @@ } } +template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4) + } + } +} + template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), @@ -1037,6 +1156,15 @@ } } +template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), + avp_data := { + avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4) + } + } +} + template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), @@ -1209,6 +1337,14 @@ } /* TS 29.272 7.3.62 PDN-Type */ +template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), + avp_data := { + avp_AAA_3GPP_PDN_Type := pdn_type + } + } +} template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { avp := { avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 8892631..ce22c1e 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -153,6 +153,32 @@ } } +function int2oct_tmpl(template integer inp, integer num_oct) return template octetstring +{ + if (istemplatekind(inp, "omit")) { + return omit; + } else if (istemplatekind(inp, "*")) { + return *; + } else if (istemplatekind(inp, "?")) { + return ?; + } else { + return int2oct(valueof(inp), num_oct); + } +} + +function char2oct_tmpl(template charstring inp) return template octetstring +{ + if (istemplatekind(inp, "omit")) { + return omit; + } else if (istemplatekind(inp, "*")) { + return *; + } else if (istemplatekind(inp, "?")) { + return ?; + } else { + return char2oct(valueof(inp)); + } +} + function f_array_contains(IntegerRecord arr, integer key) return boolean { for (var integer i:= 0; i< sizeof(arr); i := i + 1) { if (arr[i] == key) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34713?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I21da18a5e1f0d368176d653494e0e0cde0beb656 Gerrit-Change-Number: 34713 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-MessageType: newchange