aboutsummaryrefslogtreecommitdiffstats
path: root/library/DIAMETER_Templates.ttcn
diff options
context:
space:
mode:
Diffstat (limited to 'library/DIAMETER_Templates.ttcn')
-rw-r--r--library/DIAMETER_Templates.ttcn86
1 files changed, 86 insertions, 0 deletions
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index b27d144e..fd4683eb 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -244,6 +244,14 @@ template (value) GenericAVP ts_AVP_OriginStateId(template (value) OCTET4 state_i
}
}
}
+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 (value) GenericAVP ts_AVP_HostIpAddr(template (value) OCTET4 ipv4_addr) := {
avp := {
@@ -391,6 +399,14 @@ template (value) GenericAVP ts_AVP_ResultCode(DIAMETER_Resultcode res_code) := {
}
}
}
+template (present) GenericAVP tr_AVP_ResultCode(DIAMETER_Resultcode res_code) := {
+ avp := {
+ avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code),
+ avp_data := {
+ avp_BASE_NONE_Result_Code := int2oct(enum2int(res_code), 4)
+ }
+ }
+}
template (value) GenericAVP ts_AVP_AuthSessionState(template (value) BASE_NONE_Auth_Session_State ass := NO_STATE_MAINTAINED) := {
avp := {
@@ -963,4 +979,74 @@ ts_DIA_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
// 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)
+ ));
+
+/* 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)
+ ));
+
}