epdg: Test UE-initiated Detach Procedure
Related: OS#6333
Change-Id: I19114c69119e42622f323378dd356217d107cb32
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 82a433c..98ca9bd 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -307,6 +307,15 @@
}
}
+template (value) GenericAVP ts_AVP_TerminationCause(template (value) BASE_NONE_Termination_Cause tc) := {
+ avp := {
+ avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Termination_Cause),
+ avp_data := {
+ avp_BASE_NONE_Termination_Cause := tc
+ }
+ }
+}
+
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),
diff --git a/library/DIAMETER_ts29_273_Templates.ttcn b/library/DIAMETER_ts29_273_Templates.ttcn
index 38355e7..71f6cfc 100644
--- a/library/DIAMETER_ts29_273_Templates.ttcn
+++ b/library/DIAMETER_ts29_273_Templates.ttcn
@@ -257,4 +257,55 @@
tr_AVP_OriginRealm(orig_realm)
));
+ /* TS 29.273 9.2.2.3.1 Session-Termination-Request (STR) Command,
+ * Table 9.1.2.3.1/1: S6b Session Termination Request (STR), based on RFC 6733 8.4.1 */
+template (value) PDU_DIAMETER
+ts_DIA_S6b_STR(template (value) hexstring imsi,
+ template (value) BASE_NONE_Termination_Cause term_cause := DIAMETER_LOGOUT,
+ 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 := Session_Termination,
+ 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_TerminationCause(term_cause),
+ ts_AVP_UserNameImsi(valueof(imsi))
+ /* Optional: OC-Supported-Features */
+ });
+
+/* TS 29.273 9.2.2.3.2 Session-Termination-Answer (STA) Command,
+ * Table 9.1.2.3.1/2: S6b Session Termination Answer (STA), based on RFC 6733 8.4.2 */
+template (present) PDU_DIAMETER
+tr_DIA_S6b_STA(template (present) DIAMETER_Resultcode res_code := ?,
+ 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 := '0???????'B,
+ cmd_code := Session_Termination,
+ 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_ResultCode(res_code),
+ tr_AVP_OriginHost(orig_host),
+ tr_AVP_OriginRealm(orig_realm)
+ /* Lots other Optional */
+ ));
+
}