pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34776?usp=email )
Change subject: library/DIAMETER: Add several AVPs required for SWx interface ......................................................................
library/DIAMETER: Add several AVPs required for SWx interface
Those are required/used in SWx interface (3GPP TS 29.273), but are specified on other documents.
Related: OS#6204 Change-Id: If31e14215fc7fb18cef12d68600b4f170bbb68af --- M library/DIAMETER_Templates.ttcn 1 file changed, 199 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/34776/1
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index b6723e7..bbf3cff 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -400,6 +400,44 @@ } }
+private function enum2int_Vendor_Id_tmpl(template Vendor_Id inp) return template integer +{ + if (istemplatekind(inp, "omit")) { + return omit; + } else if (istemplatekind(inp, "*")) { + return *; + } else if (istemplatekind(inp, "?")) { + return ?; + } else { + return enum2int(valueof(inp)); + } +} + +template (present) GenericAVP tr_AVP_VendorSpecAppId(template (present) Vendor_Id vendor_id := ?, + template (present) uint32_t auth_app_id := ?) := { + avp := { + avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Specific_Application_Id), + avp_data := { + avp_BASE_NONE_Vendor_Specific_Application_Id := { + { + avp := { + avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id), + avp_data := { + avp_BASE_NONE_Vendor_Id := int2oct_tmpl(enum2int_Vendor_Id_tmpl(vendor_id), 4) + } + } + }, { + avp := { + avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), + avp_data := { + avp_BASE_NONE_Auth_Application_Id := int2oct_tmpl(auth_app_id, 4) + } + } + } + } + } + } +} template (value) GenericAVP ts_AVP_VendorSpecAppId(Vendor_Id vendor_id, uint32_t auth_app_id) := { avp := { avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Specific_Application_Id), @@ -2069,4 +2107,152 @@ } }
+ +/***************************** + * Cx, Dx, 3GPP TS 29.229 + *****************************/ +/* SIP-Auth-Data-Item, 3GPP TS 29.229 6.3.8 */ +template (present) GenericAVP tr_AVP_3GPP_SIPNumAuthDataItems(template (present) uint32_t num := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Number_Auth_Items), + avp_data := { + avp_CxDx_3GPP_SIP_Number_Auth_Items := int2oct_tmpl(num, 4) /* CxDx_3GPP_SIP_Number_Auth_Items */ + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPNumAuthDataItems(uint32_t num) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Number_Auth_Items), + avp_data := { + avp_CxDx_3GPP_SIP_Number_Auth_Items := int2oct(num, 4) /* CxDx_3GPP_SIP_Number_Auth_Items */ + } + } +} + +/* SIP-Authentication-Scheme, 3GPP TS 29.229 6.3.9 */ +template (present) GenericAVP tr_AVP_3GPP_SIPAuthScheme(template (present) CxDx_3GPP_SIP_Authentication_Scheme scheme := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authentication_Scheme), + avp_data := { + avp_CxDx_3GPP_SIP_Authentication_Scheme := scheme + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPAuthScheme(template (value) CxDx_3GPP_SIP_Authentication_Scheme scheme) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authentication_Scheme), + avp_data := { + avp_CxDx_3GPP_SIP_Authentication_Scheme := scheme + } + } +} + +/* SIP-Authenticate, 3GPP TS 29.229 6.3.10 */ +template (present) GenericAVP tr_AVP_3GPP_SIPAuthenticate(template (present) CxDx_3GPP_SIP_Authenticate rand_autn_concatenated := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authenticate), + avp_data := { + avp_CxDx_3GPP_SIP_Authenticate := rand_autn_concatenated + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPAuthenticate(template (value) CxDx_3GPP_SIP_Authenticate rand_autn_concatenated) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authenticate), + avp_data := { + avp_CxDx_3GPP_SIP_Authenticate := rand_autn_concatenated + } + } +} + +/* SIP-Authorization, 3GPP TS 29.229 6.3.11 */ +template (present) GenericAVP tr_AVP_3GPP_SIPAuthorization(template (present) CxDx_3GPP_SIP_Authorization rand_autn_concatenated := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authorization), + avp_data := { + avp_CxDx_3GPP_SIP_Authorization := rand_autn_concatenated + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPAuthorization(template (value) CxDx_3GPP_SIP_Authorization rand_autn_concatenated) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authorization), + avp_data := { + avp_CxDx_3GPP_SIP_Authorization := rand_autn_concatenated + } + } +} + +/* SIP-Authentication-Context, 3GPP TS 29.229 6.3.12 */ +template (present) GenericAVP tr_AVP_3GPP_SIPAuthContext(template (present) CxDx_3GPP_SIP_Authentication_Context val := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authentication_Context), + avp_data := { + avp_CxDx_3GPP_SIP_Authentication_Context := val + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPAuthContext(template (value) CxDx_3GPP_SIP_Authentication_Context val) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Authentication_Context), + avp_data := { + avp_CxDx_3GPP_SIP_Authentication_Context := val + } + } +} + +/* SIP-Item-Number, 3GPP TS 29.229 6.3.14 */ +template (present) GenericAVP tr_AVP_3GPP_SIPItemNumber(template (present) uint32_t num := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Item_Number), + avp_data := { + avp_CxDx_3GPP_SIP_Item_Number := int2oct_tmpl(num, 4) /* CxDx_3GPP_SIP_Item_Number */ + } + } +} +template (value) GenericAVP ts_AVP_3GPP_SIPItemNumber(uint32_t num) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Item_Number), + avp_data := { + avp_CxDx_3GPP_SIP_Item_Number := int2oct(num, 4) /* CxDx_3GPP_SIP_Item_Number */ + } + } +} + +/* Confidentiality-Key, 3GPP TS 29.229 6.3.27 */ +template (present) GenericAVP tr_AVP_3GPP_ConfidentialityKey(template (present) CxDx_3GPP_Confidentiality_Key ckey := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Confidentiality_Key), + avp_data := { + avp_CxDx_3GPP_Confidentiality_Key := ckey + } + } +} +template (value) GenericAVP ts_AVP_3GPP_ConfidentialityKey(template (value) CxDx_3GPP_Confidentiality_Key ckey) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Confidentiality_Key), + avp_data := { + avp_CxDx_3GPP_Confidentiality_Key := ckey + } + } +} + +/* Inegrity-Key, 3GPP TS 29.229 6.3.28 */ +template (present) GenericAVP tr_AVP_3GPP_IntegrityKey(template (present) CxDx_3GPP_Integrity_Key ckey := ?) := { + avp := { + avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Integrity_Key), + avp_data := { + avp_CxDx_3GPP_Integrity_Key := ckey + } + } +} +template (value) GenericAVP ts_AVP_3GPP_IntegrityKey(template (value) CxDx_3GPP_Integrity_Key ckey) := { + avp := { + avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Integrity_Key), + avp_data := { + avp_CxDx_3GPP_Integrity_Key := ckey + } + } +} + }