sccp: Introduce test TC_cr_timeout_cc_too_late
Related: SYS#6602
Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn
index a87ef5c..6c977ac 100644
--- a/library/SCCP_Templates.ttcn
+++ b/library/SCCP_Templates.ttcn
@@ -113,6 +113,39 @@
return ret;
}
+template (present) PDU_SCCP tr_SCCP_CR(template (present) OCT3 source_lref := ?,
+ template (present) SCCP_PAR_Address called := ?,
+ template (present) SCCP_PAR_Address calling := ?) := {
+ connrequest := {
+ messageType := cr,
+ sourceLocRef := source_lref,
+ protClass := c_class2,
+ pointer1 := ?,
+ pointer2 := ?,
+ calledPAddress := tr_Addr(called),
+ optionalPart := {
+ credit := omit,
+ callingPAddress := tr_Addr_opt(calling),
+ data := omit,
+ hopCounter := *,
+ importance := *
+ },
+ eop := *
+ }
+}
+
+template (value) PDU_SCCP ts_SCCP_CC(OCT3 source_lref, OCT3 dest_lref) := {
+ connconfirm := {
+ messageType := cc,
+ destLocRef := dest_lref,
+ sourceLocRef := source_lref,
+ protClass := c_class2,
+ pointer1 := 0, /* overwritten */
+ optionalPart := omit,
+ eop := { paramName:= con_SCCP_eop }
+ }
+}
+
template (present) PDU_SCCP tr_SCCP_CC(template (present) OCT3 source_lref,
template (present) OCT3 dest_lref) := {
connconfirm := {
@@ -135,6 +168,25 @@
}
}
+private function tr_Addr_opt(template SCCP_PAR_Address addr := *)
+return template SCCP_param_CPartyAddressEnc_opt {
+ if (istemplatekind(addr, "omit")) {
+ return omit;
+ } else if (istemplatekind(addr, "*")) {
+ return *;
+ } else if (istemplatekind(addr, "?")) {
+ return ?;
+ } else {
+ var SCCP_param_CPartyAddressEnc enc := ConvertASPAddressToEncodedAddress_itu(valueof(addr));
+ var SCCP_param_CPartyAddressEnc_opt enc_opt := {
+ paramName := con_SCCP_cgPA,
+ paramLength := enc.paramLength, /* overwritten */
+ addr := enc.addr
+ };
+ return enc_opt;
+ }
+}
+
template (value) PDU_SCCP ts_SCCP_UDT(SCCP_PAR_Address calling, SCCP_PAR_Address called,
template (value) octetstring data,
template (value) BIT4 msg_hdl := '0000'B) := {