Add TC_attach_pdp_act_user_deact_mt for GGSN-originated PDP DEACT

Change-Id: I7eb653694f487f8bbf122146300c93be625b0f87
Related: OS#2961
diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn
index ef7e97b..44d9682 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -456,12 +456,10 @@
 		ts_IPCP(LCP_Configure_Request, identifier,
 			{ tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) });
 
-	function f_teardown_ind_IE(in template BIT1 ind) return template TearDownInd {
-/*
-		if (not isvalue(ind)) {
+	function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd {
+		if (istemplatekind(ind, "omit")) {
 			return omit;
 		}
-*/
 		var TearDownInd ret := {
 			type_gtpc := '13'O,
 			tdInd := valueof(ind),
@@ -470,7 +468,7 @@
 		return ret;
 	}
 
-	template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template BIT1 teardown_ind) := {
+	template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := {
 		deletePDPContextRequest := {
 			cause := omit,
 			tearDownIndicator := f_teardown_ind_IE(teardown_ind),
@@ -489,7 +487,7 @@
 	}
 
 	template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid,
-						 BIT4 nsapi, template BIT1 teardown_ind) := {
+						 BIT4 nsapi, template (omit) BIT1 teardown_ind) := {
 		peer := peer,
 		gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid,
 					valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq)
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index e1947b2..d3e021d 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1937,6 +1937,74 @@
 	}
 }
 
+template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false,
+						  template (omit) ProtocolConfigOptionsV pco := omit
+						) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '1'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextRequest := {
+				messageType := '00000000'B, /* overwritten */
+				smCause := cause,
+				tearDownIndicator := {
+					tearDownIndicatorV := {
+						tdi_flag := bool2bit(tdown),
+						spare := '000'B
+					},
+					elementIdentifier := '1001'B
+				},
+				protocolConfigOpts := ts_PcoTLV(pco),
+				mBMSprotocolConfigOptions := omit,
+				t3396 := omit,
+				wLANOffloadIndication := omit,
+				nBIFOM_Container := omit
+			}
+		}
+	}
+}
+
+template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause,
+						template boolean tdown := false,
+						  template (omit) ProtocolConfigOptionsV pco := omit
+						) := {
+	discriminator := '0000'B, /* overwritten */
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '1'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextRequest := {
+				messageType := '00000000'B, /* overwritten */
+				smCause := cause,
+				tearDownIndicator := {
+					tearDownIndicatorV := {
+						tdi_flag := bool2bit_tmpl(tdown),
+						spare := '000'B
+					},
+					elementIdentifier := '1001'B
+				},
+				protocolConfigOpts := *,
+				mBMSprotocolConfigOptions := *,
+				t3396 := *,
+				wLANOffloadIndication := *,
+				nBIFOM_Container := *
+			}
+		}
+	}
+}
+
+
 template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?)
 := {
 	discriminator := '1010'B,
@@ -1959,6 +2027,50 @@
 	}
 }
 
+template PDU_L3_MS_SGSN tr_SM_DEACT_PDP_ACCEPT_MO(template BIT3 tid := ?)
+:= {
+	discriminator := '1010'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '0'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextAccept := {
+				messageType := '01000111'B,
+				protocolConfigOpts := *,
+				mBMSprotocolConfigOptions := *,
+				nBIFOM_Container := *
+			}
+		}
+	}
+}
+
+template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_ACCEPT_MO(BIT3 tid)
+:= {
+	discriminator := '1010'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := tid,
+			tiFlag := '0'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		gprs_sm := {
+			deactivatePDPContextAccept := {
+				messageType := '01000111'B,
+				protocolConfigOpts := omit,
+				mBMSprotocolConfigOptions := omit,
+				nBIFOM_Container := omit
+			}
+		}
+	}
+}
+
 
 
 private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {