summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-08-30 20:51:41 +0200
committerHarald Welte <laforge@gnumonks.org>2019-08-30 21:12:01 +0200
commit52919fe4d63b3a0d1b4e793692988485c189e750 (patch)
treee3416ee371a348dcdc0b3734594c1c87e6766b8d
parent86b04aefacca36efb191252ab60e8188eca498f1 (diff)
[WIP] DIAMETER_Templates: Add Gx related templateslaforge/dia2gsup
-rw-r--r--library/DIAMETER_Templates.ttcn227
1 files changed, 226 insertions, 1 deletions
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 32a7837..e6eb9bf 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -101,6 +101,7 @@ type enumerated DIAMETER_Resultcode {
};
/* 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;
@@ -317,6 +318,15 @@ template (value) GenericAVP ts_AVP_AuthAppId(template (value) OCTET4 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_SuppVendorIdRaw(uint32_t vendor_id) := {
avp := {
@@ -337,7 +347,7 @@ template (value) GenericAVP ts_AVP_ResultCode(DIAMETER_Resultcode res_code) := {
}
}
}
-template (present) GenericAVP tr_AVP_ResultCode(template (present) octetstring res_code_oct) := {
+template (present) GenericAVP tr_AVP_ResultCode(template (present) octetstring res_code_oct := ?) := {
avp := {
avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code),
avp_data := {
@@ -419,6 +429,159 @@ template (present) GenericAVP tr_AVP_UserName(template (present) octetstring uid
template (value) GenericAVP ts_AVP_UserNameImsi(hexstring imsi) := ts_AVP_UserName(char2oct(hex2str(imsi)));
template (present) GenericAVP tr_AVP_UserNameImsi(hexstring imsi) := tr_AVP_UserName(char2oct(hex2str(imsi)));
+/* RFC4005 4.5 */
+template (value) GenericAVP ts_AVP_CalledStationId(template (value) octetstring data) := {
+ avp := {
+ avp_header:= ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id),
+ avp_data := {
+ avp_DNAS_NONE_Called_Station_Id := data
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_CalledStationId(template (present) octetstring data := ?) := {
+ avp := {
+ avp_header:= ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id),
+ avp_data := {
+ avp_DNAS_NONE_Called_Station_Id := data
+ }
+ }
+}
+
+
+/* RFC4005 6.11.1 */
+template (value) GenericAVP ts_AVP_FramedIpAddr(template (value) octetstring data) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DNAS_NONE_Framed_IP_Address),
+ avp_data := {
+ avp_DNAS_NONE_Framed_IP_Address := data
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_FramedIpAddr(template (present) octetstring data := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DNAS_NONE_Framed_IP_Address),
+ avp_data := {
+ avp_DNAS_NONE_Framed_IP_Address := data
+ }
+ }
+}
+
+
+/* RFC4006 8.2 */
+template (value) GenericAVP ts_AVP_CcReqNum(template (value) UINT32 req_num) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number),
+ avp_data := {
+ avp_DCC_NONE_CC_Request_Number := req_num
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_CcReqNum(template (present) UINT32 req_num := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number),
+ avp_data := {
+ avp_DCC_NONE_CC_Request_Number := req_num
+ }
+ }
+}
+
+
+/* RFC4006 8.3 */
+template (value) GenericAVP ts_AVP_CcReqType(template (value) DCC_NONE_CC_Request_Type cc_req_type) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type),
+ avp_data := {
+ avp_DCC_NONE_CC_Request_Type := cc_req_type
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_CcReqType(template (present) DCC_NONE_CC_Request_Type cc_req_type := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type),
+ avp_data := {
+ avp_DCC_NONE_CC_Request_Type := cc_req_type
+ }
+ }
+}
+
+/* RFC4006 8.47 */
+template (value) GenericAVP ts_AVP_SubscriptionIdType(template (value) DCC_NONE_Subscription_Id_Type id_type) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id_Type := id_type
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_SubscriptionIdType(template (present) DCC_NONE_Subscription_Id_Type id_type) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id_Type := id_type
+ }
+ }
+}
+
+/* RFC4006 8.48 */
+template (value) GenericAVP ts_AVP_SubscriptionIdData(template (value) octetstring data) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id_Data := data
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_SubscriptionIdData(template (present) octetstring data := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id_Data := data
+ }
+ }
+}
+
+/* RFC4006 8.46 */
+template (value) GenericAVP ts_AVP_SubscriptionId(template (value) DCC_NONE_Subscription_Id_Type id_type,
+ template (value) octetstring id_data) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id := {
+ ts_AVP_SubscriptionIdType(id_type),
+ ts_AVP_SubscriptionIdData(id_data)
+ }
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_SubscriptionId(template (present) DCC_NONE_Subscription_Id_Type id_type,
+ template (present) octetstring id_data) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id),
+ avp_data := {
+ avp_DCC_NONE_Subscription_Id := {
+ tr_AVP_SubscriptionIdType(id_type),
+ tr_AVP_SubscriptionIdData(id_data)
+ }
+ }
+ }
+}
+
+template (value) GenericAVP ts_AVP_IpCanType(template (value) PCC_3GPP_IP_CAN_Type ip_can) := {
+ avp := {
+ avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_IP_CAN_Type),
+ avp_data := {
+ avp_PCC_3GPP_IP_CAN_Type := ip_can
+ }
+ }
+}
+template (present) GenericAVP tr_AVP_IpCanType(template (present) PCC_3GPP_IP_CAN_Type ip_can := ?) := {
+ avp := {
+ avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_IP_CAN_Type),
+ avp_data := {
+ avp_PCC_3GPP_IP_CAN_Type := ip_can
+ }
+ }
+}
/* TS 29.262 7.3.53 RAND */
@@ -858,5 +1021,67 @@ ts_DIA_ULA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
});
+template (present) PDU_DIAMETER
+tr_DIA_CCR := tr_DIAMETER('11000000'B, cmd_code:=Credit_Control,
+ app_id:=int2oct(c_DIAMETER_3GPP_GX_AID, 4),
+ 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(INITIAL_REQUEST),
+ tr_AVP_CcReqNum,
+ tr_AVP_SubscriptionId(END_USER_IMSI, ?),
+ /* Supported-Features */
+ /* Network-Request-Support: NETWORK_REQUEST SUPPORTED */
+ tr_AVP_FramedIpAddr,
+ tr_AVP_IpCanType(threeGPP_EPS),
+ tr_AVP_3GPP_RatType(EUTRAN),
+ /* QoS-Information */
+ /* Default-EPS-Bearer-QoS */
+ /* 3GPP-User-Location-Info: TAI + ECGI */
+ /* 3GPP-MS-TimeZone */
+ tr_AVP_CalledStationId
+ ));
+
+template (present) PDU_DIAMETER
+tr_DIA_CCA := tr_DIAMETER('01000000'B, cmd_code:=Credit_Control,
+ app_id:=int2oct(c_DIAMETER_3GPP_GX_AID, 4),
+ avps := superset(
+ tr_AVP_SessionId,
+ /* AuthAppId */
+ tr_AVP_CcReqType(INITIAL_REQUEST),
+ tr_AVP_CcReqNum,
+ /* QoS-Information */
+ /* Default-EPS-Bearer-QoS */
+ /* 3GPP-User-Location-Info: TAI + ECGI */
+ /* Supported-Features */
+ tr_AVP_OriginHost,
+ tr_AVP_OriginRealm,
+ tr_AVP_ResultCode
+ ));
+template (value) PDU_DIAMETER
+ts_DIA_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
+ template (value) octetstring sess_id,
+ template (value) AVP_list sub_data_content,
+ template (value) UINT32 cc_req_num)
+ := ts_DIAMETER('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),
+ /* AuthAppId */
+ ts_AVP_CcReqType(INITIAL_REQUEST),
+ ts_AVP_CcReqNum(cc_req_num),
+ /* QoS-Information */
+ /* Default-EPS-Bearer-QoS */
+ /* 3GPP-User-Location-Info: TAI + ECGI */
+ /* Supported-Features */
+ ts_AVP_OriginHost("pcrf.localhost"),
+ ts_AVP_OriginRealm("localhost"),
+ ts_AVP_ResultCode(DIAMETER_SUCCESS)
+ });
+
}