L3_Templates: add GSM 04.80 RELEASE_COMPLETE message

Change-Id: Iaf295aeb4ef475d41d0eeddcca5e864016fd91cc
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 593c990..b346da6 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1318,6 +1318,25 @@
 	facilityInformation := facility
 }
 
+private function f_facility_or_omit(template (omit) OCTN facility)
+return template (omit) Facility_TLV {
+	if (istemplatekind(facility, "omit")) {
+		return omit;
+	} else {
+		return ts_FacTLV(valueof(facility));
+	}
+}
+private function f_facility_or_wc(template OCTN facility)
+return template Facility_TLV {
+	if (istemplatekind(facility, "*")) {
+		return *;
+	} else if (istemplatekind(facility, "?")) {
+		return ?;
+	} else {
+		return tr_FacTLV(facility);
+	}
+}
+
 template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_REGISTER(
 	uint3_t tid, BIT1 ti_flag,
 	OCTN facility,
@@ -1502,6 +1521,104 @@
 	}
 }
 
+template (value) PDU_ML3_MS_NW ts_ML3_MO_SS_RELEASE_COMPLETE(
+	uint3_t tid, BIT1 ti_flag,
+	template (omit) ML3_Cause_TLV cause := omit,
+	template (omit) OCTN facility := omit
+) := {
+	discriminator := '1011'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := int2bit(tid, 3),
+			tiFlag := ti_flag,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		ss := {
+			releaseComplete_MS_NW := {
+				messageType := '101010'B,
+				nsd := '00'B,
+				cause := cause,
+				facility := f_facility_or_omit(facility)
+			}
+		}
+	}
+}
+template PDU_ML3_MS_NW tr_ML3_MO_SS_RELEASE_COMPLETE(
+	template uint3_t tid, template BIT1 ti_flag,
+	template ML3_Cause_TLV cause := *,
+	template OCTN facility := *
+) := {
+	discriminator := '1011'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := f_tid_or_wc(tid),
+			tiFlag := ti_flag,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		ss := {
+			releaseComplete_MS_NW := {
+				messageType := '101010'B,
+				nsd := '00'B,
+				cause := cause,
+				facility := f_facility_or_wc(facility)
+			}
+		}
+	}
+}
+
+template (value) PDU_ML3_NW_MS ts_ML3_MT_SS_RELEASE_COMPLETE(
+	uint3_t tid, BIT1 ti_flag,
+	template (omit) ML3_Cause_TLV cause := omit,
+	template (omit) OCTN facility := omit
+) := {
+	discriminator := '1011'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := int2bit(tid, 3),
+			tiFlag := ti_flag,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		ss := {
+			releaseComplete_NW_MS := {
+				messageType := '101010'B,
+				nsd := '00'B,
+				cause := cause,
+				facility := f_facility_or_omit(facility)
+			}
+		}
+	}
+}
+template PDU_ML3_NW_MS tr_ML3_MT_SS_RELEASE_COMPLETE(
+	template uint3_t tid, template BIT1 ti_flag,
+	template ML3_Cause_TLV cause := *,
+	template OCTN facility := *
+) := {
+	discriminator := '1011'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := f_tid_or_wc(tid),
+			tiFlag := ti_flag,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		ss := {
+			releaseComplete_NW_MS := {
+				messageType := '101010'B,
+				nsd := '00'B,
+				cause := cause,
+				facility := f_facility_or_wc(facility)
+			}
+		}
+	}
+}
+
 /***********************************************************************
  * GPRS Mobility Management
  ***********************************************************************/