epdg: Expect GSUP CancelLocationReq as consequence of DeleteBearerReq

Change-Id: Ibc37a9ef53315edab18f7b97a55cf504a40a4bf1
diff --git a/library/GSUP_Templates.ttcn b/library/GSUP_Templates.ttcn
index 291b59a..3a616a6 100644
--- a/library/GSUP_Templates.ttcn
+++ b/library/GSUP_Templates.ttcn
@@ -403,6 +403,14 @@
 template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) :=
 	tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi);
 
+template (present) GSUP_PDU tr_GSUP_CL_REQ(template (present) hexstring imsi := ?,
+					   template GSUP_CnDomain dom := omit,
+					   template GSUP_CancelType ctype := omit) :=
+	tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST,
+		f_gen_tr_ies(imsi,
+			     cancel_type := ctype,
+			     cn_domain := dom));
+
 template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType ctype) :=
 	ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, {
 		valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CancelType(ctype)) });
@@ -410,6 +418,9 @@
 template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) :=
 	tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi);
 
+template (value) GSUP_PDU ts_GSUP_CL_RES(template (value) hexstring imsi) :=
+	ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, {valueof(ts_GSUP_IE_IMSI(imsi))});
+
 template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer cause := ?) :=
 	tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, {
 			tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause), * });
@@ -548,7 +559,7 @@
 	val := val
 }
 
-template (value) GSUP_IE ts_GSUP_IE_IMSI(hexstring imsi) := {
+template (value) GSUP_IE ts_GSUP_IE_IMSI(template (value) hexstring imsi) := {
 	tag := OSMO_GSUP_IMSI_IE,
 	len := 0, /* overwritten */
 	val := {
@@ -1184,8 +1195,10 @@
 			      template GSUP_IEs pdp_info := omit,
 			      template GSUP_Message_Class message_class := omit,
 			      template integer cause := omit,
+			      template GSUP_CancelType cancel_type := omit,
 			      template hexstring msisdn := omit,
 			      template GSUP_IMEIResult imei_result := omit,
+			      template GSUP_CnDomain cn_domain := omit,
 			      template octetstring source_name := omit,
 			      template octetstring destination_name := omit
 			     ) return template GSUP_IEs {
@@ -1204,6 +1217,11 @@
 		idx := idx + 1;
 	}
 
+	if (not istemplatekind(cancel_type, "omit")) {
+		ies[idx] := tr_GSUP_IE_CancelType(cancel_type);
+		idx := idx + 1;
+	}
+
 	if (not istemplatekind(pdp_info_compl, "omit")) {
 		ies[idx] := tr_GSUP_IE_PdpInfoCompl;
 		idx := idx + 1;
@@ -1214,6 +1232,11 @@
 		idx := idx + 1;
 	}
 
+	if (not istemplatekind(cn_domain, "omit")) {
+		ies[idx] := tr_GSUP_IE_CnDomain(cn_domain);
+		idx := idx + 1;
+	}
+
 	if (not istemplatekind(imei_result, "omit")) {
 		ies[idx] := tr_GSUP_IE_IMEI_Result(imei_result);
 		idx := idx + 1;