| module DIAMETER_Templates { |
| |
| /* (C) 2019 by Harald Welte <laforge@gnumonks.org> |
| * All rights reserved. |
| * |
| * Released under the terms of GNU General Public License, Version 2 or |
| * (at your option) any later version. |
| * |
| * SPDX-License-Identifier: GPL-2.0-or-later |
| */ |
| |
| import from General_Types all; |
| import from DIAMETER_Types all; |
| import from Osmocom_Types all; |
| import from Misc_Helpers all; |
| |
| /* https://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml#aaa-parameters-4 */ |
| type enumerated DIAMETER_Resultcode { |
| /* Informational */ |
| DIAMETER_MULTI_ROUND_AUTH (1001), |
| |
| /* Success */ |
| DIAMETER_SUCCESS (2001), |
| DIAMETER_LIMITED_SUCCESS (2002), |
| DIAMETER_FIRST_REGISTRATION (2003), |
| DIAMETER_SUBSEQUENT_REGISTRATION (2004), |
| DIAMETER_UNREGISTERED_SERVICE (2005), |
| DIAMETER_SUCCESS_SERVER_NAME_NOT_STORED (2006), |
| DIAMETER_SERVER_SELECTION (2007), |
| DIAMETER_SUCCESS_AUTH_SENT_SERVER_NOT_STORED (2008), |
| DIAMETER_SUCCESS_RELOCATE_HA (2009), |
| |
| /* Protocol Errors */ |
| DIAMETER_COMMAND_UNSUPPORTED (3001), |
| DIAMETER_UNABLE_TO_DELIVER (3002), |
| DIAMETER_REALM_NOT_SERVED (3003), |
| DIAMETER_TOO_BUSY (3004), |
| DIAMETER_LOOP_DETECTED (3005), |
| DIAMETER_REDIRECT_INDICATION (3006), |
| DIAMETER_APPLICATION_UNSUPPORTED (3007), |
| DIAMETER_INVALID_HDR_BITS (3008), |
| DIAMETER_INVALID_AVP_BITS (3009), |
| DIAMETER_UNKNOWN_PEER (3010), |
| DIAMETER_REALM_REDIRECT_INDICATION (3011), |
| |
| /* Transient Failures */ |
| DIAMETER_AUTHENTICATION_REJECTED (4001), |
| DIAMETER_OUT_OF_SPACE (4002), |
| ELECTION_LOST (4003), |
| DIAMETER_ERROR_MIP_REPLY_FAILURE (4005), |
| DIAMETER_ERROR_HA_NOT_AVAILABLE (4006), |
| DIAMETER_ERROR_BAD_KEY (4007), |
| DIAMETER_ERROR_MIP_FILTER_NOT_SUPPORTED (4008), |
| DIAMETER_END_USER_SERVICE_DENIED (4010), |
| DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE (4011), |
| DIAMETER_CREDIT_LIMIT_REACHED (4012), |
| DIAMETER_USER_NAME_REQUIRED (4013), |
| RESOURCE_FAILURE (4014), |
| |
| DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), |
| DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4882), |
| |
| /* Permanent Failure */ |
| DIAMETER_AVP_UNSUPPORTED (5001), |
| DIAMETER_UNKNOWN_SESSION_ID (5002), |
| DIAMETER_AUTHORIZATION_REJECTED (5003), |
| DIAMETER_INVALID_AVP_VALUE (5004), |
| DIAMETER_MISSING_AVP (5005), |
| DIAMETER_RESOURCES_EXCEEDED (5006), |
| DIAMETER_CONTRADICTING_AVPS (5007), |
| DIAMETER_AVP_NOT_ALLOWED (5008), |
| DIAMETER_AVP_OCCURS_TOO_MANY_TIMES (5009), |
| DIAMETER_NO_COMMON_APPLICATION (5010), |
| DIAMETER_UNSUPPORTED_VERSION (5011), |
| DIAMETER_UNABLE_TO_COMPLY (5012), |
| DIAMETER_INVALID_BIT_IN_HEADER (5013), |
| DIAMETER_INVALID_AVP_LENGTH (5014), |
| DIAMETER_INVALID_MESSAGE_LENGTH (5015), |
| DIAMETER_INVALID_AVP_BIT_COMBO (5016), |
| DIAMETER_NO_COMMON_SECURITY (5017), |
| DIAMETER_RADIUS_AVP_UNTRANSLATABLE (5018), |
| DIAMETER_ERROR_NO_FOREIGN_HA_SERVICE (5024), |
| DIAMETER_ERROR_END_TO_END_MIP_KEY_ENCRYPTION (5025), |
| DIAMETER_USER_UNKNOWN (5030), |
| DIAMETER_RATING_FAILED (5031), |
| DIAMETER_ERROR_USER_UNKNOWN (5032), |
| DIAMETER_ERROR_IDENTITIES_DONT_MATCH (5033), |
| DIAMETER_ERROR_IDENTITY_NOT_REGISTERED (5034), |
| DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5035), |
| DIAMETER_ERROR_IDENTITY_ALREADY_REGISTERED (5036), |
| DIAMETER_ERROR_AUTH_SCHEME_NOT_SUPPORTED (5037), |
| DIAMETER_ERROR_IN_ASSIGNMENT_TYPE (5038), |
| DIAMETER_ERROR_TOO_MUCH_DATA (5039), |
| DIAMETER_ERROR_NOT_SUPPORTED_USER_DATA (5040), |
| DIAMETER_ERROR_MIP6_AUTH_MODE (5041), |
| UNKNOWN_BINDING_TEMPLATE_NAME (5042), |
| BINDING_FAILURE (5043), |
| MAX_BINDINGS_SET_FAILURE (5044), |
| MAXIMUM_BINDINGS_REACHED_FOR_ENDPOINT (5045), |
| SESSION_EXISTS (5046), |
| INSUFFICIENT_CLASSIFIERS (5047), |
| DIAMETER_ERROR_EAP_CODE_UNKNOWN (5048) |
| }; |
| |
| /* 3GPP TS 29.272 section 7.4. Errors in Experimental-Result-Code */ |
| type enumerated DIAMETER_ExperimentalResultcode { |
| /* transient */ |
| DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), |
| DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4182), |
| /* permanent */ |
| DIAMETER_ERROR_USER_UNKNOWN (5001), |
| DIAMETER_AUTHORIZATION_REJECTED (5003), |
| DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5004), |
| DIAMETER_MISSING_AVP (5005), |
| DIAMETER_ERROR_UNKNOWN_EPS_SUBSCRIPTION (5420), |
| DIAMETER_ERROR_RAT_NOT_ALLOWED (5421), |
| DIAMETER_ERROR_EQUIPMENT_UNKNOWN (5422), |
| DIAMETER_ERROR_UNKOWN_SERVING_NODE (5423) |
| } |
| |
| /* Gy : 3GPP TS 32.299 7.1.6, RFC4006 3.1 */ |
| const uint32_t c_DIAMETER_CREDIT_CONTROL_AID := 4; |
| /* 3GPP TS 29.272 Section 7.1.8 */ |
| const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238; |
| const uint32_t c_DIAMETER_3GPP_S6_AID := 16777251; |
| const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252; |
| const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308; |
| /* 3GPP TS 29.273 Section 8.2 */ |
| const uint32_t c_DIAMETER_3GPP_SWx_AID := 16777265; |
| /* 3GPP TS 29.273 Section 9 */ |
| const uint32_t c_DIAMETER_3GPP_S6b_AID := 16777272; |
| |
| const octetstring c_def_sess_id := char2oct("ttcn3.session"); |
| |
| template (value) PDU_DIAMETER |
| ts_DIAMETER(template (value) DIAMETER_Types.BIT8 flags, |
| template (value) Command_Code cmd_code, |
| template (value) OCTET4 app_id := '00000000'O, |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O, |
| template (value) AVP_list avps := {} |
| ) := { |
| version := 1, |
| message_length := 0, /* overwritten */ |
| RPETxxxx := flags, |
| command_code := cmd_code, |
| application_id := app_id, |
| hop_by_hop_id := hbh_id, |
| end_to_end_id := ete_id, |
| avps := avps |
| } |
| template (present) PDU_DIAMETER |
| tr_DIAMETER(template (present) DIAMETER_Types.BIT8 flags := ?, |
| template (present) Command_Code cmd_code := ?, |
| template (present) OCTET4 app_id := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?, |
| template (present) AVP_list avps := ?) := { |
| version := 1, |
| message_length := ?, |
| RPETxxxx := flags, |
| command_code := cmd_code, |
| application_id := app_id, |
| hop_by_hop_id := hbh_id, |
| end_to_end_id := ete_id, |
| avps := avps |
| } |
| template (present) PDU_DIAMETER |
| tr_DIAMETER_A( |
| template (present) Command_Code cmd_code := ?, |
| template (present) OCTET4 app_id := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?, |
| template (present) AVP_list avps := ?) := |
| tr_DIAMETER('0???????'B, cmd_code, app_id, hbh_id, ete_id, avps); |
| template (present) PDU_DIAMETER |
| tr_DIAMETER_R( |
| template (present) Command_Code cmd_code := ?, |
| template (present) OCTET4 app_id := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?, |
| template (present) AVP_list avps := ?) := |
| tr_DIAMETER('1???????'B, cmd_code, app_id, hbh_id, ete_id, avps); |
| |
| |
| template (value) AVP_Header |
| ts_DIA_Hdr(template (value) AVP_Code avp_code, |
| template (value) DIAMETER_Types.BIT8 flags := '01000000'B) := { |
| avp_code := avp_code, |
| VMPxxxxx := flags, |
| avp_length := 0, /* overwritten */ |
| vendor_id := omit |
| } |
| template (present) AVP_Header |
| tr_DIA_Hdr(template (present) AVP_Code avp_code, |
| template (present) DIAMETER_Types.BIT8 flags := '0???????'B) := { |
| avp_code := avp_code, |
| VMPxxxxx := flags, |
| avp_length := ?, /* overwritten */ |
| vendor_id := omit |
| } |
| |
| template (value) AVP_Header |
| ts_DIA_Hdr_3GPP(template (value) AVP_Code avp_code, |
| template (value) DIAMETER_Types.BIT8 flags := '11000000'B) := { |
| avp_code := avp_code, |
| VMPxxxxx := flags, |
| avp_length := 0, /* overwritten */ |
| vendor_id := vendor_id_3GPP |
| } |
| template (present) AVP_Header |
| tr_DIA_Hdr_3GPP(template (present) AVP_Code avp_code, |
| template (present) DIAMETER_Types.BIT8 flags := '1???????'B) := { |
| avp_code := avp_code, |
| VMPxxxxx := flags, |
| avp_length := ?, /* overwritten */ |
| vendor_id := vendor_id_3GPP |
| } |
| |
| template (present) AVP_Address tr_AVP_Address(template (present) AddressType addr_type := ?, |
| template (present) octetstring addr_data := ?) := { |
| address_type := addr_type, |
| address_data := addr_data |
| } |
| |
| template (present) GenericAVP tr_AVP_SubcrId(template (present) DCC_NONE_Subscription_Id t) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id), |
| avp_data := { |
| avp_DCC_NONE_Subscription_Id := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_SubcrIdType(template (present) DCC_NONE_Subscription_Id_Type t) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type), |
| avp_data := { |
| avp_DCC_NONE_Subscription_Id_Type := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_SubcrIdData(template (present) DCC_NONE_Subscription_Id_Data t) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data), |
| avp_data := { |
| avp_DCC_NONE_Subscription_Id_Data := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_RequestedAction(template (present) DCC_NONE_Requested_Action t := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Action), |
| avp_data := { |
| avp_DCC_NONE_Requested_Action := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_MultipleServicesIndicator(template (present) DCC_NONE_Multiple_Services_Indicator t := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Indicator), |
| avp_data := { |
| avp_DCC_NONE_Multiple_Services_Indicator := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_ServiceContextId(template (present) DCC_NONE_Service_Context_Id id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Service_Context_Id), |
| avp_data := { |
| avp_DCC_NONE_Service_Context_Id := id |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_OriginHost(template (value) charstring host) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Host), |
| avp_data := { |
| avp_BASE_NONE_Origin_Host := host |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_OriginHost(template (present) charstring host := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Host), |
| avp_data := { |
| avp_BASE_NONE_Origin_Host := host |
| } |
| } |
| } |
| |
| |
| template (value) GenericAVP ts_AVP_OriginRealm(template (value) charstring realm) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Realm), |
| avp_data := { |
| avp_BASE_NONE_Origin_Realm := realm |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_OriginRealm(template (present) charstring realm := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Realm), |
| avp_data := { |
| avp_BASE_NONE_Origin_Realm := realm |
| } |
| } |
| } |
| |
| |
| template (value) GenericAVP ts_AVP_OriginStateId(template (value) OCTET4 state_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_State_Id), |
| avp_data := { |
| avp_BASE_NONE_Origin_State_Id := state_id |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_OriginStateId(template (present) OCTET4 state_id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_State_Id), |
| avp_data := { |
| avp_BASE_NONE_Origin_State_Id := state_id |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_TerminationCause(template (present) BASE_NONE_Termination_Cause tc) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Termination_Cause), |
| avp_data := { |
| avp_BASE_NONE_Termination_Cause := tc |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_HostIpAddr(template (value) OCTET4 ipv4_addr) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Host_IP_Address), |
| avp_data := { |
| avp_BASE_NONE_Host_IP_Address := { |
| address_type := IP, |
| address_data := ipv4_addr |
| } |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_VendorId(Vendor_Id vendor_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id, '00000000'B), |
| avp_data := { |
| avp_BASE_NONE_Vendor_Id := int2oct(enum2int(vendor_id), 4) |
| } |
| } |
| } |
| private function f_tr_AVP_VendorId(template (present) Vendor_Id vendor_id) |
| return template (present) BASE_NONE_Vendor_Id { |
| if (istemplatekind(vendor_id, "?")) { |
| return ?; |
| } else { |
| var template (present) BASE_NONE_Vendor_Id c; |
| c := int2oct(enum2int(valueof(vendor_id)), 4); |
| return c; |
| } |
| } |
| template (present) GenericAVP tr_AVP_VendorId(template (present) Vendor_Id vendor_id) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id), |
| avp_data := { |
| avp_BASE_NONE_Vendor_Id := f_tr_AVP_VendorId(vendor_id) |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_ProductName(charstring name) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Product_Name, '00000000'B), |
| avp_data := { |
| avp_BASE_NONE_Product_Name := char2oct(name) |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_FwRevision(octetstring fw_version) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Firmware_Revision, '00000000'B), |
| avp_data := { |
| avp_BASE_NONE_Firmware_Revision := fw_version |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_InbSecId(template (value) OCTET4 inb_sec_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Inband_Security_Id), |
| avp_data := { |
| avp_BASE_NONE_Inband_Security_Id := inb_sec_id |
| } |
| } |
| } |
| |
| 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), |
| avp_data := { |
| avp_BASE_NONE_Vendor_Specific_Application_Id := { |
| { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id), |
| avp_data := { |
| avp_BASE_NONE_Vendor_Id := int2oct(enum2int(vendor_id), 4) |
| } |
| } |
| }, { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| avp_data := { |
| avp_BASE_NONE_Auth_Application_Id := int2oct(auth_app_id, 4) |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_AuthAppId(template (value) OCTET4 auth_app_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| avp_data := { |
| avp_BASE_NONE_Auth_Application_Id := auth_app_id |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_AuthAppId(template (present) OCTET4 auth_app_id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| avp_data := { |
| avp_BASE_NONE_Auth_Application_Id := auth_app_id |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_CcReqType(template (value) DCC_NONE_CC_Request_Type r) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type), |
| avp_data := { |
| avp_DCC_NONE_CC_Request_Type := r |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_CcReqType(template (present) DCC_NONE_CC_Request_Type r := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type), |
| avp_data := { |
| avp_DCC_NONE_CC_Request_Type := r |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_CcReqNum(template (value) AVP_Unsigned32 n) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number), |
| avp_data := { |
| avp_DCC_NONE_CC_Request_Number := n |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_CcReqNum(template (present) AVP_Unsigned32 n := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number), |
| avp_data := { |
| avp_DCC_NONE_CC_Request_Number := n |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_EventTimestamp(template (present) AVP_Unsigned32 n := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Event_Timestamp), |
| avp_data := { |
| avp_BASE_NONE_Event_Timestamp := n |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_ExperimentalResultCode(template (present) AVP_Unsigned32 n := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Experimental_Result_Code), |
| avp_data := { |
| avp_BASE_NONE_Experimental_Result_Code := n |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_ExperimentalResult(template (present) Vendor_Id vendor_id := ?, |
| template (present) AVP_Unsigned32 err_code := ? |
| ) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Experimental_Result), |
| avp_data := { |
| avp_BASE_NONE_Experimental_Result := { |
| tr_AVP_VendorId(vendor_id), |
| tr_AVP_ExperimentalResultCode(err_code) |
| } |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_SuppVendorIdRaw(uint32_t vendor_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Supported_Vendor_Id), |
| avp_data := { |
| avp_BASE_NONE_Supported_Vendor_Id := int2oct(vendor_id, 4) |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_SuppVendorId(Vendor_Id vendor_id) := |
| ts_AVP_SuppVendorIdRaw(enum2int(vendor_id)); |
| |
| template (value) GenericAVP ts_AVP_ResultCode(DIAMETER_Resultcode res_code) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code), |
| avp_data := { |
| avp_BASE_NONE_Result_Code := int2oct(enum2int(res_code), 4) |
| } |
| } |
| } |
| private function f_tr_DIAMETER_Resultcode(template (present) DIAMETER_Resultcode res_code) |
| return template (present) BASE_NONE_Result_Code { |
| if (istemplatekind(res_code, "?")) { |
| return ?; |
| } else { |
| var template (present) BASE_NONE_Result_Code c; |
| c := int2oct(enum2int(valueof(res_code)), 4); |
| return c; |
| } |
| } |
| template (present) GenericAVP tr_AVP_ResultCode(template (present) DIAMETER_Resultcode res_code) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code), |
| avp_data := { |
| avp_BASE_NONE_Result_Code := f_tr_DIAMETER_Resultcode(res_code) |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_AuthSessionState(template (value) BASE_NONE_Auth_Session_State ass := NO_STATE_MAINTAINED) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Session_State), |
| avp_data := { |
| avp_BASE_NONE_Auth_Session_State := ass |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_AuthSessionState(template (present) BASE_NONE_Auth_Session_State ass := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Session_State), |
| avp_data := { |
| avp_BASE_NONE_Auth_Session_State := ass |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_SessionId(template (value) octetstring session_id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Session_Id), |
| avp_data := { |
| avp_BASE_NONE_Session_Id := session_id |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_SessionId(template (present) octetstring session_id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Session_Id), |
| avp_data := { |
| avp_BASE_NONE_Session_Id := session_id |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_DestinationHost(template (present) charstring host := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Host), |
| avp_data := { |
| avp_BASE_NONE_Destination_Host := host |
| } |
| } |
| } |
| |
| /* 3.3 Destination Realm */ |
| template (value) GenericAVP ts_AVP_DestinationRealm(template (value) charstring dest_realm) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Realm), |
| avp_data := { |
| avp_BASE_NONE_Destination_Realm := dest_realm |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_DestinationRealm(template (present) charstring dest_realm := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Realm), |
| avp_data := { |
| avp_BASE_NONE_Destination_Realm := dest_realm |
| } |
| } |
| } |
| |
| /* 8.14 User-Name */ |
| template (value) GenericAVP ts_AVP_UserName(template (value) octetstring uid) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_User_Name), |
| avp_data := { |
| avp_BASE_NONE_User_Name := uid |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_UserName(template (present) octetstring uid := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_User_Name), |
| avp_data := { |
| avp_BASE_NONE_User_Name := uid |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_UserNameImsi(hexstring imsi) := ts_AVP_UserName(char2oct(hex2str(imsi))); |
| template (present) GenericAVP tr_AVP_UserNameImsi(template (present) hexstring imsi := ?) := tr_AVP_UserName(char2oct_tmpl(hex2str_tmpl(imsi))); |
| |
| |
| |
| /* TS 29.272 7.3.53 RAND */ |
| template (value) GenericAVP ts_AVP_RAND(template (value) octetstring rand) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_RAND), |
| avp_data := { |
| avp_AAA_3GPP_RAND := rand |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.54 XRES */ |
| template (value) GenericAVP ts_AVP_XRES(template (value) octetstring xres) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_XRES), |
| avp_data := { |
| avp_AAA_3GPP_XRES := xres |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.55 XRES */ |
| template (value) GenericAVP ts_AVP_AUTN(template (value) octetstring autn) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AUTN), |
| avp_data := { |
| avp_AAA_3GPP_AUTN := autn |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.56 KASME */ |
| template (value) GenericAVP ts_AVP_KASME(template (value) octetstring kasme) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| avp_data := { |
| avp_AAA_3GPP_KASME := kasme |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.23 Item-Number */ |
| template (value) GenericAVP ts_AVP_ItemNumber(uint32_t num) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| avp_data := { |
| avp_AAA_3GPP_Item_Number := int2oct(num, 4) |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.18 E-UTRAN Vector */ |
| template (value) GenericAVP ts_AVP_EutranVec(uint32_t item_num, octetstring rand, octetstring xres, |
| octetstring autn, octetstring kasme) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_E_UTRAN_Vector), |
| avp_data := { |
| avp_AAA_3GPP_E_UTRAN_Vector := { |
| ts_AVP_ItemNumber(item_num), |
| ts_AVP_RAND(rand), |
| ts_AVP_XRES(xres), |
| ts_AVP_AUTN(autn), |
| ts_AVP_KASME(kasme) |
| } |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.2 Subscription-Data */ |
| template (value) GenericAVP ts_AVP_3GPP_SubscriptionData(template (value) AVP_list content) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| avp_data := { |
| avp_AAA_3GPP_Subscription_Data := content |
| } |
| } |
| } |
| template (present) GenericAVP |
| tr_AVP_3GPP_SubscriptionData(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| avp_data := { |
| avp_AAA_3GPP_Subscription_Data := content |
| } |
| } |
| } |
| |
| |
| /* TS 29.272 7.3.17 Authentication-Info */ |
| template (value) GenericAVP ts_AVP_3GPP_AuthInfo(template (value) AVP_list content) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| avp_data := { |
| avp_AAA_3GPP_Authentication_Info := content |
| } |
| } |
| } |
| template (present) GenericAVP |
| tr_AVP_3GPP_AuthInfo(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| avp_data := { |
| avp_AAA_3GPP_Authentication_Info := content |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.9 Visited-PLMN-Id */ |
| template (value) GenericAVP ts_AVP_3GPP_VisitedPlmnId(template (value) octetstring id) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| avp_data := { |
| avp_AAA_3GPP_Visited_PLMN_Id := id |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_3GPP_VisitedPlmnId(template (present) octetstring id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| avp_data := { |
| avp_AAA_3GPP_Visited_PLMN_Id := id |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.13 RAT-Type */ |
| template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) PCC_3GPP_RAT_Type rat_type) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| avp_data := { |
| avp_PCC_3GPP_RAT_Type := rat_type |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) PCC_3GPP_RAT_Type rat_type := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| avp_data := { |
| avp_PCC_3GPP_RAT_Type := rat_type |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) GI_3GPP_3GPP_RAT_Type rat_type := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type), |
| avp_data := { |
| avp_GI_3GPP_3GPP_RAT_Type := rat_type |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.7 ULR-Flags */ |
| template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 flags) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| avp_data := { |
| avp_AAA_3GPP_ULR_Flags := flags |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_3GPP_UlrFlags(template (present) UINT32 flags := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| avp_data := { |
| avp_AAA_3GPP_ULR_Flags := flags |
| } |
| } |
| } |
| |
| /* TS 29.272 7.3.8 ULA-Flags */ |
| template (value) GenericAVP ts_AVP_3GPP_UlaFlags(template (value) UINT32 flags) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| avp_data := { |
| avp_AAA_3GPP_ULA_Flags := flags |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_3GPP_UlaFlags(template (present) UINT32 flags := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| avp_data := { |
| avp_AAA_3GPP_ULA_Flags := flags |
| } |
| } |
| } |
| |
| |
| |
| template (value) GenericAVP ts_AVP_NumOfReqVectors(template (value) UINT32 num_req := '00000004'O) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Number_Of_Requested_Vectors), |
| avp_data := { |
| avp_AAA_3GPP_Number_Of_Requested_Vectors := num_req |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_ImmReqPref(template (value) UINT32 par := '00000000'O) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Immediate_Response_Preferred), |
| avp_data := { |
| avp_AAA_3GPP_Immediate_Response_Preferred := par |
| } |
| } |
| } |
| |
| |
| /* 7.3.11 Requested-EUTRAN-Authentication-Info */ |
| template (value) GenericAVP ts_AVP_RequestedEutranAuthInfo(template (value) UINT32 num_vec := '00000004'O) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Requested_EUTRAN_Authentication_Info), |
| avp_data := { |
| avp_AAA_3GPP_Requested_EUTRAN_Authentication_Info := { |
| ts_AVP_NumOfReqVectors(num_vec), |
| ts_AVP_ImmReqPref('00000000'O) |
| } |
| } |
| } |
| } |
| |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) |
| } |
| } |
| } |
| |
| /* Ts 29.272 7.3.29 Subscriber-Status */ |
| template (present) GenericAVP tr_AVP_3GPP_SubscriberStatus(template (present) AAA_3GPP_Subscriber_Status sts) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), |
| avp_data := { |
| avp_AAA_3GPP_Subscriber_Status := sts |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), |
| avp_data := { |
| avp_AAA_3GPP_Subscriber_Status := sts |
| } |
| } |
| } |
| |
| /* Ts 29.272 7.3.30 Operator-Determined-Barring */ |
| template (present) GenericAVP tr_AVP_3GPP_OperatorDeterminedBarring(template (present) uint32_t val := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), |
| avp_data := { |
| avp_AAA_3GPP_Operator_Determined_Barring := int2oct_tmpl(val, 4) |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_3GPP_OperatorDeterminedBarring(uint32_t val) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), |
| avp_data := { |
| avp_AAA_3GPP_Operator_Determined_Barring := int2oct(val, 4) |
| } |
| } |
| } |
| |
| 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), |
| avp_data := { |
| avp_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer := int2oct(tmr, 4) |
| } |
| } |
| } |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind |
| } |
| } |
| } |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_APN_Configuration_Profile := content |
| } |
| } |
| } |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_APN_Configuration := superset( |
| tr_AVP_3GPP_ContextId(ctx), |
| tr_AVP_3GPP_PdnType(pdn_type), |
| tr_AVP_ServiceSelection(apn), |
| tr_AVP_3GPP_EpsSubscrQosProfile(?, ?) |
| ) |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, |
| charstring apn) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), |
| avp_data := { |
| avp_AAA_3GPP_APN_Configuration := { |
| ts_AVP_3GPP_ContextId(ctx), |
| ts_AVP_3GPP_PdnType(pdn_type), |
| ts_AVP_ServiceSelection(apn), |
| ts_AVP_3GPP_EpsSubscrQosProfile(1, 1) |
| } |
| } |
| } |
| } |
| |
| /* 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), |
| avp_data := { |
| avp_PCC_3GPP_QoS_Information := list |
| } |
| } |
| } |
| |
| 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 (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), |
| avp_data := { |
| avp_PCC_3GPP_QoS_Class_Identifier := int2oct(val, 4) |
| } |
| } |
| } |
| |
| 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), |
| avp_data := { |
| avp_PCC_3GPP_Priority_Level := int2oct(prio, 4) |
| } |
| } |
| } |
| |
| 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 := superset( |
| 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), |
| avp_data := { |
| avp_PCC_3GPP_Allocation_Retention_Priority := { |
| ts_AVP_3GPP_PriorityLevel(prio) |
| /* pre-emption capability */ |
| /* pre-emption vulnerability */ |
| } |
| } |
| } |
| } |
| |
| /* 7.3.37 EPS-Subscribed-QoS-Profile */ |
| 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 := superset( |
| 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), |
| avp_data := { |
| avp_AAA_3GPP_EPS_Subscribed_QoS_Profile := { |
| ts_AVP_PCC_3GPP_QoS_Class_Identifier(qos_class), |
| ts_AVP_PCC_3GPP_AllocRetenPrio(prio) |
| } |
| } |
| } |
| } |
| |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_AMBR := { |
| ts_AVP_3GPP_MaxReqBwUL(ul), |
| ts_AVP_3GPP_MaxReqBwDL(dl) |
| } |
| } |
| } |
| } |
| |
| 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), |
| avp_data := { |
| avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) |
| } |
| } |
| } |
| |
| 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), |
| avp_data := { |
| avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_Reporting_Reason(template (present) DCA_3GPP_Reporting_Reason r := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Reporting_Reason), |
| avp_data := { |
| avp_DCA_3GPP_Reporting_Reason := r |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_AoCRequestType(template (present) DCA_3GPP_AoC_Request_Type t := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_AoC_Request_Type), |
| avp_data := { |
| avp_DCA_3GPP_AoC_Request_Type := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_ServiceInformation(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Service_Information), |
| avp_data := { |
| avp_DCA_3GPP_Service_Information := content |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_PSInformation(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PS_Information), |
| avp_data := { |
| avp_DCA_3GPP_PS_Information := content |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_ChargingId(template (present) AVP_OctetString id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Id), |
| avp_data := { |
| avp_GI_3GPP_3GPP_Charging_Id := id |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_PDPType(template (present) GI_3GPP_3GPP_PDP_Type t := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_PDP_Type), |
| avp_data := { |
| avp_GI_3GPP_3GPP_PDP_Type := t |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_PDPAddress(template (present) DCA_3GPP_PDP_Address addr := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PDP_Address), |
| avp_data := { |
| avp_DCA_3GPP_PDP_Address := addr |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_SGSNAddress(template (present) DCA_3GPP_SGSN_Address addr := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_SGSN_Address), |
| avp_data := { |
| avp_DCA_3GPP_SGSN_Address := addr |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_GGSNAddress(template (present) DCA_3GPP_GGSN_Address addr := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_GGSN_Address), |
| avp_data := { |
| avp_DCA_3GPP_GGSN_Address := addr |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_SelectionMode(template (present) GI_3GPP_3GPP_Selection_Mode sm := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Selection_Mode), |
| avp_data := { |
| avp_GI_3GPP_3GPP_Selection_Mode := sm |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_ChargingCharacteristics(template (present) GI_3GPP_3GPP_Charging_Characteristics cc := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Characteristics), |
| avp_data := { |
| avp_GI_3GPP_3GPP_Charging_Characteristics := cc |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_SGSNMCCMNC(template (present) GI_3GPP_3GPP_SGSN_MCC_MNC smn := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_SGSN_MCC_MNC), |
| avp_data := { |
| avp_GI_3GPP_3GPP_SGSN_MCC_MNC := smn |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_NSAPI(template (present) GI_3GPP_3GPP_NSAPI nsapi := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_NSAPI), |
| avp_data := { |
| avp_GI_3GPP_3GPP_NSAPI := nsapi |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_MS_TimeZone(template (present) GI_3GPP_3GPP_MS_TimeZone ms_tz := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_MS_TimeZone), |
| avp_data := { |
| avp_GI_3GPP_3GPP_MS_TimeZone := ms_tz |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_ULI(template (present) GI_3GPP_3GPP_User_Location_Info uli := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_User_Location_Info), |
| avp_data := { |
| avp_GI_3GPP_3GPP_User_Location_Info := uli |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_UserEquipmentInfo(template (present) DCC_NONE_User_Equipment_Info uei := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info), |
| avp_data := { |
| avp_DCC_NONE_User_Equipment_Info := uei |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_UserEquipmentInfoType(template (present) DCC_NONE_User_Equipment_Info_Type ueit := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Type), |
| avp_data := { |
| avp_DCC_NONE_User_Equipment_Info_Type := ueit |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_UserEquipmentInfoValue(template (present) DCC_NONE_User_Equipment_Info_Value ueiv := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Value), |
| avp_data := { |
| avp_DCC_NONE_User_Equipment_Info_Value := ueiv |
| } |
| } |
| } |
| |
| /* 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), |
| avp_data := { |
| avp_AAA_3GPP_PDN_Type := pdn_type |
| } |
| } |
| } |
| |
| /* RFC4006 8.16 Multiple-Services-Credit-Control AVP */ |
| template (value) GenericAVP ts_AVP_Multiple_Services_Credit_Control(template (value) AVP_list content) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control), |
| avp_data := { |
| avp_DCC_NONE_Multiple_Services_Credit_Control := content |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_Multiple_Services_Credit_Control(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control), |
| avp_data := { |
| avp_DCC_NONE_Multiple_Services_Credit_Control := content |
| } |
| } |
| } |
| |
| /* Requested-Service-Unit AVP */ |
| template (present) GenericAVP tr_AVP_Requested_Service_Unit(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Service_Unit), |
| avp_data := { |
| avp_DCC_NONE_Requested_Service_Unit := content |
| } |
| } |
| } |
| |
| /* Used-Service-Unit AVP */ |
| template (present) GenericAVP tr_AVP_Used_Service_Unit(template (present) AVP_list content := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Used_Service_Unit), |
| avp_data := { |
| avp_DCC_NONE_Used_Service_Unit := content |
| } |
| } |
| } |
| |
| /* RFC4006 8.17 Granted-Service-Unit AVP */ |
| template (value) GenericAVP ts_AVP_Granted_Service_Unit(template (value) AVP_list content) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Granted_Service_Unit), |
| avp_data := { |
| avp_DCC_NONE_Granted_Service_Unit := content |
| } |
| } |
| } |
| |
| /* RFC4006 8.21 CC-Time AVP */ |
| template (value) GenericAVP ts_AVP_CC_Time(uint32_t cc_time_val) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Time), |
| avp_data := { |
| avp_DCC_NONE_CC_Time := int2oct(cc_time_val, 4) |
| } |
| } |
| } |
| |
| /* RFC4006 8.23 CC-Total-Octets AVP */ |
| template (value) GenericAVP ts_AVP_CC_Total_Octets(uint64_t cc_total_octets_val) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Total_Octets), |
| avp_data := { |
| avp_DCC_NONE_CC_Total_Octets := int2oct(cc_total_octets_val, 8) |
| } |
| } |
| } |
| |
| /* RFC4006 8.33 Validity-Time AVP */ |
| template (value) GenericAVP ts_AVP_Validity_Time(uint32_t validity_time_val) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Validity_Time), |
| avp_data := { |
| avp_DCC_NONE_Validity_Time := int2oct(validity_time_val, 4) |
| } |
| } |
| } |
| |
| template (value) GenericAVP ts_AVP_3GPP_VolumeQuotaThreshold(uint32_t volume_quota_thresh_val) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Volume_Quota_Threshold), |
| avp_data := { |
| avp_DCA_3GPP_Volume_Quota_Threshold := int2oct(volume_quota_thresh_val, 4) |
| } |
| } |
| } |
| |
| template (present) GenericAVP tr_AVP_3GPP_CalledStationId(template (present) DNAS_NONE_Called_Station_Id id := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id), |
| avp_data := { |
| avp_DNAS_NONE_Called_Station_Id := id |
| } |
| } |
| } |
| |
| /* RFC6733 8.7. Auth-Request-Type AVP */ |
| template (value) GenericAVP ts_AVP_AuthRequestType(BASE_NONE_Auth_Request_Type auth_req_type) := { |
| avp := { |
| avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Request_Type, '00000000'B), |
| avp_data := { |
| avp_BASE_NONE_Auth_Request_Type := auth_req_type |
| } |
| } |
| } |
| template (present) GenericAVP tr_AVP_AuthRequestType(template (present) BASE_NONE_Auth_Request_Type auth_req_type) := { |
| avp := { |
| avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Request_Type), |
| avp_data := { |
| avp_BASE_NONE_Auth_Request_Type := auth_req_type |
| } |
| } |
| } |
| |
| |
| /* 5.3.1 Capabilities Exchange Request */ |
| template (value) PDU_DIAMETER |
| ts_DIA_CER(octetstring host_ip, uint32_t vendor_app_id, |
| template (value) charstring orig_host := "ttcn3.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '10000000'B, |
| cmd_code := Capabilities_Exchange, |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_HostIpAddr(host_ip), |
| ts_AVP_VendorId(vendor_id_3GPP), |
| ts_AVP_ProductName("TTCN-3 Testsuite"), |
| ts_AVP_FwRevision('00000000'O), |
| ts_AVP_InbSecId('00000000'O), |
| ts_AVP_AuthAppId('FFFFFFFF'O), |
| ts_AVP_VendorSpecAppId(vendor_id_3GPP, vendor_app_id) |
| }); |
| |
| |
| /* 5.3.2 Capabilities Exchange Answer */ |
| template (value) PDU_DIAMETER |
| ts_DIA_CEA_AUTH_APP_ID(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) charstring origin_host, |
| template (value) charstring origin_realm, |
| template (value) octetstring host_ip, uint32_t auth_app_id) |
| := ts_DIAMETER(flags:='00000000'B, cmd_code:=Capabilities_Exchange, hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost(origin_host), |
| ts_AVP_OriginRealm(origin_realm), |
| ts_AVP_HostIpAddr(host_ip), |
| ts_AVP_VendorId(vendor_id_3GPP), |
| ts_AVP_ProductName("TTCN-3 Testsuite"), |
| ts_AVP_OriginStateId('00000001'O), |
| ts_AVP_SuppVendorIdRaw(5535), /* 3GPP2 */ |
| ts_AVP_SuppVendorId(vendor_id_3GPP), |
| ts_AVP_SuppVendorIdRaw(13019), /* ETSI */ |
| ts_AVP_AuthAppId(int2oct(auth_app_id, 4)), |
| ts_AVP_InbSecId('00000000'O) |
| }); |
| template (value) PDU_DIAMETER |
| ts_DIA_CEA_VENDOR_APP_ID(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) charstring origin_host, |
| template (value) charstring origin_realm, |
| template (value) octetstring host_ip, uint32_t vendor_app_id) |
| := ts_DIAMETER(flags:='00000000'B, cmd_code:=Capabilities_Exchange, hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost(origin_host), |
| ts_AVP_OriginRealm(origin_realm), |
| ts_AVP_HostIpAddr(host_ip), |
| ts_AVP_VendorId(vendor_id_3GPP), |
| ts_AVP_ProductName("TTCN-3 Testsuite"), |
| ts_AVP_OriginStateId('00000001'O), |
| ts_AVP_SuppVendorIdRaw(5535), /* 3GPP2 */ |
| ts_AVP_SuppVendorId(vendor_id_3GPP), |
| ts_AVP_SuppVendorIdRaw(13019), /* ETSI */ |
| ts_AVP_InbSecId('00000000'O), |
| ts_AVP_VendorSpecAppId(vendor_id_3GPP, vendor_app_id) |
| }); |
| function f_ts_DIA_CEA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) charstring origin_host, |
| template (value) charstring origin_realm, |
| template (value) octetstring host_ip, template (omit) uint32_t auth_app_id, |
| template (omit) uint32_t vendor_app_id) |
| return template (value) PDU_DIAMETER |
| { |
| var template (value) PDU_DIAMETER diam_pdu; |
| if (istemplatekind(vendor_app_id, "omit")) { |
| diam_pdu := ts_DIA_CEA_AUTH_APP_ID(hbh_id, ete_id, origin_host, origin_realm, host_ip, valueof(auth_app_id)); |
| } else { |
| diam_pdu := ts_DIA_CEA_VENDOR_APP_ID(hbh_id, ete_id, origin_host, origin_realm, host_ip, valueof(vendor_app_id)); |
| } |
| return diam_pdu; |
| } |
| |
| |
| template (value) PDU_DIAMETER |
| ts_DIA_AIR(/* template (value) */ hexstring imsi, |
| template (value) octetstring mcc_mnc := '111F11'O, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "ttcn3.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) charstring dest_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '11000000'B, |
| cmd_code := Authentication_Information, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_DestinationRealm(dest_realm), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_UserNameImsi(imsi), |
| /* Requested EUTRAN Auth Info */ |
| ts_AVP_RequestedEutranAuthInfo, |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_AIR(/* template (present) */ hexstring imsi, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring dest_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '1???????'B, |
| cmd_code := Authentication_Information, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_DestinationRealm(dest_realm), |
| tr_AVP_UserNameImsi(imsi), |
| tr_AVP_3GPP_VisitedPlmnId |
| )); |
| |
| /* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ |
| template (value) PDU_DIAMETER |
| ts_DIA_AIA(template (value) AVP_list auth_info_contents, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "hss.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '01000000'B, |
| cmd_code := Authentication_Information, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_3GPP_AuthInfo(auth_info_contents) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '0???????'B, |
| cmd_code := Authentication_Information, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| tr_AVP_3GPP_AuthInfo(auth_info_contents) |
| )); |
| template (present) PDU_DIAMETER |
| tr_DIA_AIA_ERR(template (present) GenericAVP err_avp := ?, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '0???????'B, |
| cmd_code := Authentication_Information, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| err_avp |
| )); |
| |
| |
| /* TS 29.272 7.2.3 Update Location Request */ |
| template (value) PDU_DIAMETER |
| ts_DIA_ULR(/* template (value) */ hexstring imsi, |
| template (value) octetstring mcc_mnc := '111F11'O, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "ttcn3.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) charstring dest_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '11000000'B, |
| cmd_code := Update_Location, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_UserNameImsi(imsi), |
| ts_AVP_3GPP_UlrFlags('00000000'O), |
| ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), |
| ts_AVP_PCC_3GPP_RatType(EUTRAN), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_DestinationRealm(dest_realm) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_ULR(/* template (present) */ hexstring imsi, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) charstring dest_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '11000000'B, |
| cmd_code := Update_Location, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_AuthSessionState, |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| tr_AVP_DestinationRealm(dest_realm), |
| tr_AVP_UserNameImsi(imsi), |
| tr_AVP_PCC_3GPP_RatType, |
| tr_AVP_3GPP_UlrFlags, |
| tr_AVP_3GPP_VisitedPlmnId |
| )); |
| |
| template (value) PDU_DIAMETER |
| ts_DIA_ULA(template (value) AVP_list sub_data, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "hss.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags:='01000000'B, |
| cmd_code := Update_Location, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_3GPP_UlaFlags('00000002'O), |
| ts_AVP_3GPP_SubscriptionData(sub_data) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_ULA(template (present) AVP_list sub_data := ?, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '0???????'B, |
| cmd_code := Update_Location, |
| app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| tr_AVP_AuthSessionState, |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| tr_AVP_3GPP_UlaFlags, |
| tr_AVP_3GPP_SubscriptionData(sub_data) |
| )); |
| |
| |
| |
| /* RFC 4006 3.1. Credit-Control-Request (CCR) Command */ |
| template (present) PDU_DIAMETER |
| tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) |
| := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| avps := superset( |
| tr_AVP_SessionId, |
| tr_AVP_OriginHost, |
| tr_AVP_OriginRealm, |
| tr_AVP_DestinationRealm, |
| tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| tr_AVP_CcReqType(req_type), |
| tr_AVP_CcReqNum(?) |
| )); |
| template (present) PDU_DIAMETER |
| tr_DIA_Gy_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) |
| := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
| avps := superset( |
| tr_AVP_SessionId, |
| tr_AVP_OriginHost, |
| tr_AVP_OriginRealm, |
| tr_AVP_DestinationRealm, |
| tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| tr_AVP_CcReqType(req_type), |
| tr_AVP_CcReqNum(?) |
| )); |
| |
| |
| |
| /* RFC 4006 3.2. Credit-Control-Answer (CCA) Command */ |
| template (value) PDU_DIAMETER |
| ts_DIA_Gx_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) octetstring sess_id, |
| template (value) DCC_NONE_CC_Request_Type req_type, |
| template (value) AVP_Unsigned32 req_num) |
| := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| app_id:=int2oct(c_DIAMETER_3GPP_Gx_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost("pcrf.localdomain"), |
| ts_AVP_OriginRealm("localdomain"), |
| ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| ts_AVP_CcReqType(req_type), |
| ts_AVP_CcReqNum(req_num), |
| ts_AVP_PCC_3GPP_QoS_Information({ |
| ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL(33554432), |
| ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL(52428800) |
| }), |
| ts_AVP_PCC_3GPP_Default_EPS_Bearer_QoS({ |
| ts_AVP_PCC_3GPP_QoS_Class_Identifier(9), |
| ts_AVP_PCC_3GPP_AllocRetenPrio(2) |
| }) |
| // supported features |
| // origin |
| }); |
| template (value) PDU_DIAMETER |
| ts_DIA_Gy_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) octetstring sess_id, |
| template (value) DCC_NONE_CC_Request_Type req_type, |
| template (value) AVP_Unsigned32 req_num) |
| := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost("ocs.localdomain"), |
| ts_AVP_OriginRealm("localdomain"), |
| ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| ts_AVP_CcReqType(req_type), |
| ts_AVP_CcReqNum(req_num)//, |
| // qos |
| // default eps bearer qos |
| // supported features |
| // origin |
| }); |
| /* Same as ts_DIA_Gy_CCA, but with extra AVP to grant access for limited amount of seconds */ |
| template (value) PDU_DIAMETER |
| ts_DIA_Gy_CCA_ValidityTime(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) octetstring sess_id, |
| template (value) DCC_NONE_CC_Request_Type req_type, |
| template (value) AVP_Unsigned32 req_num, |
| uint32_t validity_time) |
| := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost("ocs.localdomain"), |
| ts_AVP_OriginRealm("localdomain"), |
| ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| ts_AVP_CcReqType(req_type), |
| ts_AVP_CcReqNum(req_num), |
| ts_AVP_Multiple_Services_Credit_Control({ |
| ts_AVP_Validity_Time(validity_time), |
| ts_AVP_Granted_Service_Unit({ |
| //ts_AVP_CC_Time(validity_time*2), |
| ts_AVP_CC_Total_Octets(1000) |
| }) |
| }) |
| //, |
| // qos |
| // default eps bearer qos |
| // supported features |
| // origin |
| }); |
| /* Same as ts_DIA_Gy_CCA_ValidityTime, but with extra AVP to grant access for limited amount of octets */ |
| template (value) PDU_DIAMETER |
| ts_DIA_Gy_CCA_ValidityTimeVolumeThreshold(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| template (value) octetstring sess_id, |
| template (value) DCC_NONE_CC_Request_Type req_type, |
| template (value) AVP_Unsigned32 req_num, |
| uint32_t validity_time, uint32_t volume_threhsold) |
| := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost("ocs.localdomain"), |
| ts_AVP_OriginRealm("localdomain"), |
| ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| ts_AVP_CcReqType(req_type), |
| ts_AVP_CcReqNum(req_num), |
| ts_AVP_Multiple_Services_Credit_Control({ |
| ts_AVP_Validity_Time(validity_time), |
| ts_AVP_Granted_Service_Unit({ |
| ts_AVP_CC_Total_Octets(volume_threhsold*100) |
| }), |
| ts_AVP_3GPP_VolumeQuotaThreshold(volume_threhsold) |
| }) |
| //, |
| // qos |
| // default eps bearer qos |
| // supported features |
| // origin |
| }); |
| |
| /* RFC 6733, section 5.5.1 "Device-Watchdog-Request" */ |
| template (value) PDU_DIAMETER |
| ts_DIA_DWR(template (value) OCTET4 state_id := '00000000'O, |
| template (value) charstring orig_host := "ttcn3.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '10000000'B, |
| cmd_code := Device_Watchdog, |
| app_id := '00000000'O, |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_OriginStateId(state_id) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_DWR(template (present) OCTET4 state_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '1???????'B, |
| cmd_code := Device_Watchdog, |
| app_id := '00000000'O, |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm) |
| /* tr_AVP_OriginStateId(state_id) is optional */ |
| )); |
| |
| /* RFC 6733, section 5.5.2 "Device-Watchdog-Answer" */ |
| template (value) PDU_DIAMETER |
| ts_DIA_DWA(template (value) OCTET4 state_id := '00000000'O, |
| template (value) charstring orig_host := "ttcn3.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '00000000'B, |
| cmd_code := Device_Watchdog, |
| app_id := '00000000'O, |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_OriginStateId(state_id) |
| }); |
| template (present) PDU_DIAMETER |
| tr_DIA_DWA(template (present) OCTET4 state_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '0???????'B, |
| cmd_code := Device_Watchdog, |
| app_id := '00000000'O, |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := superset( |
| tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm) |
| /* tr_AVP_OriginStateId(state_id) is optional */ |
| )); |
| |
| function f_DIAMETER_get_avp(PDU_DIAMETER pdu, template (present) AVP_Code avp_code) |
| return template (omit) AVP |
| { |
| var integer i; |
| |
| for (i := 0; i < lengthof(pdu.avps); i := i+1) { |
| if (not ispresent(pdu.avps[i].avp)) { |
| continue; |
| } |
| var AVP_Header hdr := pdu.avps[i].avp.avp_header; |
| if (match(hdr.avp_code, avp_code)) { |
| return pdu.avps[i].avp; |
| } |
| } |
| return omit; |
| } |
| function f_DIAMETER_get_avp_or_fail(PDU_DIAMETER pdu, template (present) AVP_Code avp_code) |
| return AVP |
| { |
| var template (omit) AVP avp; |
| avp := f_DIAMETER_get_avp(pdu, avp_code); |
| if (istemplatekind(avp, "omit")) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("AVP ", avp_code, " not found in ", pdu)); |
| } |
| return valueof(avp); |
| } |
| |
| function f_AVP_Grouped_get_avp(AVP_Grouped avp_grp, template (present) AVP_Code avp_code) |
| return template (omit) AVP |
| { |
| var integer i; |
| |
| for (i := 0; i < lengthof(avp_grp); i := i+1) { |
| if (not ispresent(avp_grp[i].avp)) { |
| continue; |
| } |
| var AVP_Header hdr := avp_grp[i].avp.avp_header; |
| if (match(hdr.avp_code, avp_code)) { |
| return avp_grp[i].avp; |
| } |
| } |
| return omit; |
| } |
| function f_AVP_Grouped_get_avp_or_fail(AVP_Grouped avp_grp, template (present) AVP_Code avp_code) |
| return AVP |
| { |
| var template (omit) AVP avp; |
| avp := f_AVP_Grouped_get_avp(avp_grp, avp_code); |
| if (istemplatekind(avp, "omit")) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("AVP ", avp_code, " not found in ", avp_grp)); |
| } |
| return valueof(avp); |
| } |
| |
| function f_validate_gy_cc_report(PDU_DIAMETER rx_dia, template (present) DCA_3GPP_Reporting_Reason repreason_exp := ?, |
| template (present) integer cc_time_exp := ?, |
| template (present) integer cc_in_oct_exp := ?, |
| template (present) integer cc_out_oct_exp := ?) |
| { |
| var AVP multi_services_cc, used_service_unit; |
| var AVP_Grouped multi_services_cc_data, used_service_unit_data; |
| var template (omit) AVP repreason_tpl; |
| var AVP repreason, cc_time, cc_in_oct, cc_out_oct; |
| |
| multi_services_cc := f_DIAMETER_get_avp_or_fail(rx_dia, c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control); |
| multi_services_cc_data := valueof(multi_services_cc.avp_data.avp_DCC_NONE_Multiple_Services_Credit_Control); |
| |
| used_service_unit := f_AVP_Grouped_get_avp_or_fail(multi_services_cc_data, c_AVP_Code_DCC_NONE_Used_Service_Unit); |
| used_service_unit_data := valueof(used_service_unit.avp_data.avp_DCC_NONE_Used_Service_Unit); |
| |
| /* Reporting-Reason can be either inside Multiple-Services-Credit-Control or inside Used-Service-Unit */ |
| repreason_tpl := f_AVP_Grouped_get_avp(multi_services_cc_data, c_AVP_Code_DCA_3GPP_Reporting_Reason); |
| if (istemplatekind(repreason_tpl, "omit")) { |
| repreason := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCA_3GPP_Reporting_Reason); |
| } else { |
| repreason := valueof(repreason_tpl); |
| } |
| if (not match(repreason.avp_data.avp_DCA_3GPP_Reporting_Reason, repreason_exp)) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("3GPP-Reporting-Reason mismatch ", repreason, " vs exp ", repreason_exp)); |
| } |
| |
| cc_time := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Time); |
| if (not match(oct2int(cc_time.avp_data.avp_DCC_NONE_CC_Time), cc_time_exp)) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("3GPP-CC-Time mismatch ", cc_time, " vs exp ", cc_time_exp)); |
| } |
| |
| cc_in_oct := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Input_Octets); |
| if (not match(oct2int(cc_in_oct.avp_data.avp_DCC_NONE_CC_Input_Octets), cc_in_oct_exp)) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("3GPP-CC-Input-Octets mismatch ", cc_in_oct, " vs exp ", cc_in_oct_exp)); |
| } |
| |
| cc_out_oct := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Output_Octets); |
| if (not match(oct2int(cc_out_oct.avp_data.avp_DCC_NONE_CC_Output_Octets), cc_out_oct_exp)) { |
| Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| log2str("3GPP-CC-Output-Octets mismatch ", cc_out_oct, " vs exp ", cc_out_oct_exp)); |
| } |
| } |
| |
| |
| /***************************** |
| * 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 |
| } |
| } |
| } |
| |
| /* Server-Assignment-Type, 3GPP TS 29.273 8.2.3.12, 3GPP TS 29.229 6.3.15 */ |
| template (present) GenericAVP tr_AVP_3GPP_ServerAssignmentType(template (present) CxDx_3GPP_Server_Assignment_Type t := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Assignment_Type), |
| avp_data := { |
| avp_CxDx_3GPP_Server_Assignment_Type := t |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_3GPP_ServerAssignmentType(template (value) CxDx_3GPP_Server_Assignment_Type t) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Assignment_Type), |
| avp_data := { |
| avp_CxDx_3GPP_Server_Assignment_Type := t |
| } |
| } |
| } |
| |
| /******************************* |
| * SWx 3GPP TS 29.273 section 8 |
| *******************************/ |
| |
| /* SIP-Auth-Data-Item , 3GPP TS 29.273 8.2.3.9 */ |
| template (present) GenericAVP tr_AVP_3GPP_SIPAuthDataItem(template (present) uint32_t num := ?) := { |
| avp := { |
| avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Auth_Data_Item), |
| avp_data := { |
| avp_CxDx_3GPP_SIP_Auth_Data_Item := superset( |
| //tr_AVP_3GPP_SIPItemNumber(num), /* Optional */ |
| tr_AVP_3GPP_SIPAuthScheme(?)//, /* Optional */ |
| //tr_AVP_3GPP_SIPAuthenticate(?), /* Optional */ |
| //tr_AVP_3GPP_SIPAuthorization(?), /* Optional */ |
| //tr_AVP_3GPP_SIPAuthContext(?), /* Optional */ |
| //tr_AVP_3GPP_ConfidentialityKey(?), /* Optional */ |
| //tr_AVP_3GPP_IntegrityKey(?) /* Optional */ |
| /* TODO: |
| [ SIP-Digest-Authenticate ] |
| [ Framed-IP-Address ] |
| [ Framed-IPv6-Prefix ] |
| [ Framed-Interface-Id ] |
| [ Line-Identifier ] |
| *[AVP] |
| */ |
| ) |
| } |
| } |
| } |
| template (value) GenericAVP ts_AVP_3GPP_SIPAuthDataItem(uint32_t num, OCT16 rand, OCT16 ik, OCT16 ck, OCT16 autn, OCT14 auts) := { |
| avp := { |
| avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_SIP_Auth_Data_Item), |
| avp_data := { |
| avp_CxDx_3GPP_SIP_Auth_Data_Item := { |
| ts_AVP_3GPP_SIPItemNumber(num), |
| ts_AVP_3GPP_SIPAuthScheme(char2oct("Digest-AKAv1-MD5")), |
| ts_AVP_3GPP_SIPAuthenticate(rand & autn), |
| ts_AVP_3GPP_SIPAuthorization(rand & auts), |
| ts_AVP_3GPP_SIPAuthContext(char2oct("foobar")), |
| ts_AVP_3GPP_ConfidentialityKey(ck), |
| ts_AVP_3GPP_IntegrityKey(ik) |
| /* TODO: |
| [ SIP-Digest-Authenticate ] |
| [ Framed-IP-Address ] |
| [ Framed-IPv6-Prefix ] |
| [ Framed-Interface-Id ] |
| [ Line-Identifier ] |
| *[AVP] |
| */ |
| } |
| } |
| } |
| } |
| |
| /* Multimedia-Auth-Request, 3GPP TS 29.273 8.2.2.1 Authentication Procedure */ |
| template (present) PDU_DIAMETER |
| tr_DIA_SWx_MAR(template (present) hexstring imsi := ?, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) charstring dest_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?) := |
| tr_DIAMETER(flags := '1???????'B, |
| cmd_code := Multimedia_Auth, |
| app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| hbh_id := hbh_id, ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_VendorSpecAppId(?, ?), |
| tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| tr_AVP_DestinationRealm(dest_realm), |
| tr_AVP_UserNameImsi(imsi), |
| tr_AVP_3GPP_SIPAuthDataItem(?), |
| tr_AVP_3GPP_SIPNumAuthDataItems(?) |
| )); |
| |
| /* Multimedia-Auth-Answer, 3GPP TS 29.273 8.2.2.1 Authentication Procedure */ |
| template (value) PDU_DIAMETER |
| ts_DIA_SWx_MAA(template (value) hexstring imsi, |
| template (value) GenericAVP sip_auth_data_item, |
| template (value) uint32_t vendor_app_id := c_DIAMETER_3GPP_SWx_AID, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "hss.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '01000000'B, |
| cmd_code := Multimedia_Auth, |
| app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_VendorSpecAppId(vendor_id_3GPP, valueof(vendor_app_id)), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_UserNameImsi(valueof(imsi)), |
| sip_auth_data_item, |
| ts_AVP_3GPP_SIPNumAuthDataItems(1) |
| }); |
| |
| /* Server-Assignment-Request, |
| * 3GPP TS 29.273 8.1.2.2.2 UE/PDN Registration/DeRegistration Notification |
| * 3GPP TS 29.273 8.2.2.3 Non-3GPP IP Access Registration Procedure */ |
| template (present) PDU_DIAMETER |
| tr_DIA_SWx_SAR(template (present) hexstring imsi := ?, |
| template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) charstring dest_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?, |
| template (present) CxDx_3GPP_Server_Assignment_Type server_ass_type := ?, |
| template (present) charstring service_selection := ?) := |
| tr_DIAMETER(flags := '1???????'B, |
| cmd_code := Server_Assignment, |
| app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| hbh_id := hbh_id, ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| tr_AVP_VendorSpecAppId(?, ?), |
| tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm), |
| tr_AVP_DestinationRealm(dest_realm), |
| tr_AVP_UserNameImsi(imsi), |
| tr_AVP_3GPP_ServerAssignmentType(server_ass_type), |
| tr_AVP_ServiceSelection(service_selection) |
| )); |
| |
| /* Server-Assignment-Answer, |
| * 3GPP TS 29.273 8.1.2.2.2 UE/PDN Registration/DeRegistration Notification |
| * 3GPP TS 29.273 8.2.2.3 Non-3GPP IP Access Registration Procedure */ |
| template (value) PDU_DIAMETER |
| ts_DIA_SWx_SAA(template (value) hexstring imsi, |
| template (value) uint32_t vendor_app_id := c_DIAMETER_3GPP_SWx_AID, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "hss.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '01000000'B, |
| cmd_code := Server_Assignment, |
| app_id := int2oct(c_DIAMETER_3GPP_SWx_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| ts_AVP_VendorSpecAppId(vendor_id_3GPP, valueof(vendor_app_id)), |
| ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_UserNameImsi(valueof(imsi)) |
| /* TODO: |
| * [ Non-3GPP-User-Data ] |
| * [ 3GPP-AAA-Server-Name ] |
| * [ OC-Supported-Features ] |
| * [ OC-OLR ] ] |
| * *[ Load ] |
| * *[ Supported-Features ] |
| */ |
| }); |
| |
| /******************************* |
| * S6b 3GPP TS 29.273 section 9 |
| *******************************/ |
| |
| /* TS 29.273 9.2.2.5.1 AA-Request (AAR) */ |
| template (value) PDU_DIAMETER |
| ts_DIA_S6b_AAR(template (value) hexstring imsi, |
| template (value) octetstring sess_id := c_def_sess_id, |
| template (value) charstring orig_host := "pgw.localdomain", |
| template (value) charstring orig_realm := "localdomain", |
| template (value) charstring dest_realm := "localdomain", |
| template (value) UINT32 hbh_id := '00000000'O, |
| template (value) UINT32 ete_id := '00000000'O) := |
| ts_DIAMETER(flags := '11000000'B, |
| cmd_code := Authorize_Authenticate, |
| app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| hbh_id := hbh_id, |
| ete_id := ete_id, |
| avps := { |
| ts_AVP_SessionId(sess_id), |
| /* Optional: DRMP, */ |
| ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| ts_AVP_OriginHost(orig_host), |
| ts_AVP_OriginRealm(orig_realm), |
| ts_AVP_DestinationRealm(dest_realm), |
| ts_AVP_AuthRequestType(AUTHORIZE_ONLY), |
| ts_AVP_UserNameImsi(valueof(imsi)) |
| /* TODO: Lots other optional */ |
| }); |
| |
| /* TS 29.273 9.2.2.2.2 AA-Answer (AAA) */ |
| template (present) PDU_DIAMETER |
| tr_DIA_S6b_AAA(template (present) octetstring sess_id := ?, |
| template (present) charstring orig_host := ?, |
| template (present) charstring orig_realm := ?, |
| template (present) charstring dest_realm := ?, |
| template (present) UINT32 hbh_id := ?, |
| template (present) UINT32 ete_id := ?, |
| template (present) CxDx_3GPP_Server_Assignment_Type server_ass_type := ?, |
| template (present) charstring service_selection := ?) := |
| tr_DIAMETER(flags := '0???????'B, |
| cmd_code := Authorize_Authenticate, |
| app_id := int2oct(c_DIAMETER_3GPP_S6b_AID, 4), |
| hbh_id := hbh_id, ete_id := ete_id, |
| avps := superset( |
| tr_AVP_SessionId(sess_id), |
| /* Optional: DRMP, */ |
| tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_S6b_AID, 4)), |
| tr_AVP_AuthRequestType(AUTHORIZE_ONLY), |
| tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| tr_AVP_OriginHost(orig_host), |
| tr_AVP_OriginRealm(orig_realm) |
| )); |
| |
| } |