aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2023-11-13 02:19:53 +0100
committerAlexander Couzens <lynxis@fe80.eu>2023-11-13 01:21:12 +0000
commit428e4d049d2e6d3c0a6f03ba8a53b13a8f4d5c1b (patch)
treec95ae8c7c9dc5d91456a95083b15791aa54ed5e4
parentc583dea1408b37761981f20c745aa310668480f1 (diff)
step 29_229 / Cx
-rwxr-xr-xdia2gsup/gen_links.sh2
-rw-r--r--library/DIAMETER_Templates.ttcn41
-rw-r--r--library/DIAMETER_ts29_229_Templates.ttcn98
3 files changed, 140 insertions, 1 deletions
diff --git a/dia2gsup/gen_links.sh b/dia2gsup/gen_links.sh
index d0002ebb..2cd93f27 100755
--- a/dia2gsup/gen_links.sh
+++ b/dia2gsup/gen_links.sh
@@ -36,7 +36,7 @@ DIR=../library
FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc "
FILES+="Osmocom_CTRL_Types.ttcn "
FILES+="L3_Common.ttcn "
-FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn "
+FILES+="DIAMETER_Types.ttcn DIAMETER_CodecPort.ttcn DIAMETER_CodecPort_CtrlFunct.ttcn DIAMETER_CodecPort_CtrlFunctDef.cc DIAMETER_Emulation.ttcn DIAMETER_Templates.ttcn DIAMETER_ts29_229_Templates.ttcn "
FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc
IPA_Emulation.ttcnpp "
FILES+="GSUP_Types.ttcn GSUP_Emulation.ttcn "
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 9a3e7398..63ce484d 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -547,6 +547,29 @@ template (present) GenericAVP tr_AVP_ExperimentalResult(template (present) Vendo
}
}
+template (value) GenericAVP ts_AVP_ExperimentalResultCode(template (value) AVP_Unsigned32 n) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Experimental_Result_Code),
+ avp_data := {
+ avp_BASE_NONE_Experimental_Result_Code := n
+ }
+ }
+}
+
+template (value) GenericAVP ts_AVP_ExperimentalResult(template (value) Vendor_Id vendor_id
+ template (value) AVP_Unsigned32 err_code
+ ) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Experimental_Result),
+ avp_data := {
+ avp_BASE_NONE_Experimental_Result := {
+ ts_AVP_VendorId(vendor_id),
+ ts_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),
@@ -2130,6 +2153,24 @@ function f_validate_gy_cc_report(PDU_DIAMETER rx_dia, template (present) DCA_3GP
/*****************************
* Cx, Dx, 3GPP TS 29.229
*****************************/
+/* Server-Name, 3GPP TS 29.229 6.3.3 */
+template (present) GenericAVP tr_AVP_3GPP_ServerName(template (present) CxDx_3GPP_Server_Name server_name := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Name),
+ avp_data := {
+ avp_CxDx_3GPP_Server_Name := server_name
+ }
+ }
+}
+template (value) GenericAVP ts_AVP_3GPP_ServerName(CxDx_3GPP_Server_Name server_name) := {
+ avp := {
+ avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_CxDx_3GPP_Server_Name),
+ avp_data := {
+ avp_CxDx_3GPP_Server_Name := server_name
+ }
+ }
+}
+
/* SIP-Auth-Data-Item, 3GPP TS 29.229 6.3.8 */
template (present) GenericAVP tr_AVP_3GPP_SIPNumAuthDataItems(template (present) uint32_t num := ?) := {
avp := {
diff --git a/library/DIAMETER_ts29_229_Templates.ttcn b/library/DIAMETER_ts29_229_Templates.ttcn
new file mode 100644
index 00000000..fd941e95
--- /dev/null
+++ b/library/DIAMETER_ts29_229_Templates.ttcn
@@ -0,0 +1,98 @@
+module DIAMETER_ts29_229_Templates {
+
+/* (C) 2023 by Alexander Couzens <lynxis@fe80.eu>
+ * 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
+ *
+ * Templates for AVPs and messages for TS 29.229
+ */
+
+/* Multimedia-Auth-Request, 3GPP TS 29.229 8.2.2.1 Authentication Procedure */
+template (present) PDU_DIAMETER
+tr_DIA_Cx_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) charstring server_name := ?,
+ 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(?)
+ tr_AVP_3GPP_ServerName(server_name),
+ ));
+
+/* Multimedia-Auth-Answer, 3GPP TS 29.273 8.2.2.1 Authentication Procedure */
+template (value) PDU_DIAMETER
+ts_DIA_Cx_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_t result_code := 2001,
+ 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_ExperimentalResult(vendor_id_3GPP, exp_result),
+ 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,
+ tr_AVP_3GPP_ServerName(server_name),
+ 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)
+ ));
+