library: L1CTL: merge L1ctl{Ul,Dl}Message into L1ctlMessage

Currently we have two variants of the L1CTL PDU:

* L1ctlUlMessage: L23 -> L1 requests (*_REQ),
* L1ctlDlMessage: L1 -> L23 responses (*_IND, *_CONF).

The L1CTL_PT port is defined in a way that one can:

* Tx L1ctl{Ul,Dl}Message PDUs,
* Rx L1ctlDlMessage PDUs.

This means that the testsuite can act as the L23 talking to the L1
(e.g. trxcon or virtphy), but not vice-versa.  Adding an additional
Rx `UD_send_data -> L1ctlUlMessage` mapping is not an option,
because such a mapping would be ambiguous and would cause errors.

By merging the two L1CTL PDU variants into the one, we can achieve
the testsuite acting as the L1.  This will be useful for testing
the L23 applications in osmocom-bb.git, like the modem app.

Take a chance to reorder fields to match the order in L1ctlMsgType.

Change-Id: I1313068c5f02b65d3dbb05a1341a9d7286225f0c
Related: OS#5500
diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn
index c44b2ae..d84cee4 100644
--- a/library/L1CTL_PortType.ttcn
+++ b/library/L1CTL_PortType.ttcn
@@ -46,8 +46,8 @@
 	function f_L1CTL_rx_data(L1CTL_PT pt,
 				 template (present) RslChannelNr chan_nr := ?,
 				 template (present) RslLinkId link_id := ?)
-	return L1ctlDlMessage {
-		var L1ctlDlMessage dl;
+	return L1ctlMessage {
+		var L1ctlMessage dl;
 		timer T := 2.0;
 
 		T.start;
@@ -72,7 +72,7 @@
 	{
 		timer T := 15.0;
 		for (var integer i := 0; i < 10; i := i+1) {
-			var L1ctlDlMessage dl;
+			var L1ctlMessage dl;
 			pt.send(ts_L1CTL_FBSB_REQ(arfcn, valueof(t_L1CTL_FBSB_F_ALL), 0, ccch_mode, rxlev_exp));
 			T.start
 			alt {
@@ -108,7 +108,7 @@
 	}
 
 	function f_L1CTL_TCH_MODE(L1CTL_PT pt,
-				  template (value) L1ctlUlMessage tch_mode_req_tmpl := ts_L1CTL_TCH_MODE_REQ) {
+				  template (value) L1ctlMessage tch_mode_req_tmpl := ts_L1CTL_TCH_MODE_REQ) {
 		timer T := 2.0;
 		pt.send(tch_mode_req_tmpl);
 		T.start;
@@ -126,7 +126,7 @@
 			      template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
 			      template (value) RslLinkId link_id := ts_RslLinkID_DCCH(0))
 	return GsmFrameNumber {
-		var L1ctlDlMessage rc;
+		var L1ctlMessage rc;
 		var GsmFrameNumber fn;
 		timer T := 2.0;
 		T.start
@@ -146,7 +146,7 @@
 		L1CTL_PT pt, uint16_t ra11, L1ctlRachSynchSeq seq,
 		uint8_t combined := 1, uint16_t offset := 0
 	) return GsmFrameNumber {
-		var L1ctlDlMessage rc;
+		var L1ctlMessage rc;
 		var GsmFrameNumber fn;
 		timer T := 2.0;
 
@@ -170,7 +170,7 @@
 
 	function f_L1CTL_WAIT_IMM_ASS(L1CTL_PT pt, uint8_t ra, GsmFrameNumber rach_fn) return ImmediateAssignment {
 		var template GsmRrMessage rr_imm_ass;
-		var L1ctlDlMessage dl;
+		var L1ctlMessage dl;
 		var GsmRrMessage rr;
 		timer T := 10.0;
 
@@ -204,7 +204,7 @@
 	function f_L1CTL_WAIT_IMM_ASS_TBF_DL(L1CTL_PT pt, GprsTlli tlli) return ImmediateAssignment {
 		var template PacketDlAssign dl_ass := tr_PacketDlAssign(tlli);
 		var template IaRestOctets rest := tr_IaRestOctets_DLAss(dl_ass);
-		var L1ctlDlMessage dl;
+		var L1ctlMessage dl;
 		var GsmRrMessage rr;
 		timer T := 10.0;
 		T.start;
@@ -310,36 +310,28 @@
 		pout.err := pin.result.err;
 	} with { extension "prototype(fast)" }
 
-	private function L1CTL_to_UD_ul(in L1ctlUlMessage pin, out UD_send_data pout) {
-		var L1ctlUlMessageLV msg_lv := { msg := pin };
-		pout.data := enc_L1ctlUlMessageLV(msg_lv);
+	private function L1CTL_to_UD(in L1ctlMessage pin, out UD_send_data pout) {
+		var L1ctlMessageLV msg_lv := { msg := pin };
+		pout.data := enc_L1ctlMessageLV(msg_lv);
 		pout.id := 0;
 	} with { extension "prototype(fast)" }
 
-	private function L1CTL_to_UD_dl(in L1ctlDlMessage pin, out UD_send_data pout) {
-		var L1ctlDlMessageLV msg_lv := { msg := pin };
-		pout.data := enc_L1ctlDlMessageLV(msg_lv);
-		pout.id := 0;
-	} with { extension "prototype(fast)" }
-
-	private function UD_to_L1CTL_dl(in UD_send_data pin, out L1ctlDlMessage pout) {
-		var L1ctlDlMessageLV msg_lv := dec_L1ctlDlMessageLV(pin.data);
+	private function UD_to_L1CTL(in UD_send_data pin, out L1ctlMessage pout) {
+		var L1ctlMessageLV msg_lv := dec_L1ctlMessageLV(pin.data);
 		pout:= msg_lv.msg;
 	} with { extension "prototype(fast)" }
 
 	type port L1CTL_PT message {
-		out L1ctlUlMessage
-		out L1ctlDlMessage
+		out L1ctlMessage
 		out L1CTL_connect
-		in L1ctlDlMessage
+		in L1ctlMessage
 		in L1CTL_connect_result
 		in UD_listen_result
 		in UD_connected
 	} with { extension "user UD_PT
-		out(L1ctlUlMessage -> UD_send_data: function(L1CTL_to_UD_ul);
-		    L1ctlDlMessage -> UD_send_data: function(L1CTL_to_UD_dl);
+		out(L1ctlMessage -> UD_send_data: function(L1CTL_to_UD);
 		    L1CTL_connect -> UD_connect: function(L1CTL_to_UD_connect))
-		in(UD_send_data -> L1ctlDlMessage: function(UD_to_L1CTL_dl);
+		in(UD_send_data -> L1ctlMessage: function(UD_to_L1CTL);
 		   UD_connect_result -> L1CTL_connect_result: function(UD_to_L1CTL_connect_result);
 		   UD_listen_result -> UD_listen_result: simple;
 		   UD_connected -> UD_connected: simple
diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn
index c8767e2..9162eea 100644
--- a/library/L1CTL_Types.ttcn
+++ b/library/L1CTL_Types.ttcn
@@ -193,42 +193,6 @@
 		variant (payload) "BYTEORDER(first)"
 	};
 
-	type union L1ctlDlPayload {
-		L1ctlFbsbConf		fbsb_conf,
-		L1ctlCcchModeConf	ccch_mode_conf,
-		L1ctlTchModeConf	tch_mode_conf,
-		L1ctlDataInd		data_ind,
-		L1ctlTrafficReq		traffic_ind,
-		L1ctlTbfCfgReq		tbf_cfg_conf,
-		octetstring		other
-	} with {
-		variant (other) "BYTEORDER(first)"
-	};
-
-	type record L1ctlDlMessage {
-		L1ctlHeader	header,
-		L1ctlDlInfo	dl_info optional,
-		L1ctlDlPayload	payload optional
-	} with { variant (dl_info) "PRESENCE(header.msg_type = L1CTL_FBSB_CONF,
-					     header.msg_type = L1CTL_RACH_CONF,
-					     header.msg_type = L1CTL_DATA_IND,
-					     header.msg_type = L1CTL_DATA_CONF,
-					     header.msg_type = L1CTL_TRAFFIC_IND,
-					     header.msg_type = L1CTL_TRAFFIC_CONF)"
-		 variant (payload) "CROSSTAG(fbsb_conf, header.msg_type = L1CTL_FBSB_CONF;
-					     ccch_mode_conf, header.msg_type = L1CTL_CCCH_MODE_CONF;
-					     tch_mode_conf, header.msg_type = L1CTL_TCH_MODE_CONF;
-					     data_ind, header.msg_type = L1CTL_DATA_IND;
-					     traffic_ind, header.msg_type = L1CTL_TRAFFIC_IND;
-					     tbf_cfg_conf, header.msg_type = L1CTL_TBF_CFG_CONF;
-					     other, OTHERWISE;
-				)" };
-
-	external function enc_L1ctlDlMessage(in L1ctlDlMessage msg) return octetstring
-		with { extension "prototype(convert) encode(RAW)" };
-	external function dec_L1ctlDlMessage(in octetstring stream) return L1ctlDlMessage
-		with { extension "prototype(convert) decode(RAW)" };
-
 
 	type record L1ctlUlInfo {
 		RslChannelNr	chan_nr,
@@ -387,31 +351,46 @@
 		TfiUsfArr	tfi_usf
 	} with { variant (is_uplink) "FIELDLENGTH(8)" };
 
-	type union L1ctlUlPayload {
+	type union L1ctlMsgPayload {
 		L1ctlFbsbReq		fbsb_req,
-		L1ctlCcchModeReq	ccch_mode_req,
-		L1ctlTchModeReq		tch_mode_req,
+		L1ctlFbsbConf		fbsb_conf,
+		L1ctlDataInd		data_ind,
 		L1ctlRachReq		rach_req,
-		L1ctlExtRachReq		ext_rach_req,
-		L1ctlParReq		par_req,
 		L1ctlDmEstReq		dm_est_req,
-		L1ctlReset		reset_req,
-		//L1ctlNeighPmReq		neigh_pm_req,
-		L1CtlCryptoReq		crypto_req,
-		L1ctlTrafficReq		traffic_req,
-		L1ctlTbfCfgReq		tbf_cfg_req,
 		L1ctlDataReq		data_req,
+		/* TODO: L1CTL_RESET_IND */
+		/* TODO: L1CTL_PM_REQ */
+		/* TODO: L1CTL_PM_CONF */
+		L1ctlReset		reset_req,
+		L1ctlCcchModeReq	ccch_mode_req,
+		L1ctlCcchModeConf	ccch_mode_conf,
+		L1ctlParReq		par_req,
+		/* TODO: L1CTL_DM_FREQ_REQ */
+		L1CtlCryptoReq		crypto_req,
+		/* TODO: L1CTL_SIM_REQ */
+		/* TODO: L1CTL_SIM_CONF */
+		L1ctlTchModeReq		tch_mode_req,
+		L1ctlTchModeConf	tch_mode_conf,
+		/* TODO: L1CTL_NEIGH_PM_REQ */
+		/* TODO: L1CTL_NEIGH_PM_IND */
+		L1ctlTrafficReq		traffic_req,
+		L1ctlTrafficReq		traffic_ind,
+		/* TODO: L1CTL_BURST_IND */
+		L1ctlTbfCfgReq		tbf_cfg_req,
+		L1ctlTbfCfgReq		tbf_cfg_conf,
+		L1ctlExtRachReq		ext_rach_req,
 		octetstring		other
 	} with {
 		variant (other) "BYTEORDER(first)"
 	};
 
-	type record L1ctlUlMessage {
+	type record L1ctlMessage {
 		L1ctlHeader	header,
 		L1ctlUlInfo	ul_info optional,
+		L1ctlDlInfo	dl_info optional,
 		L1ctlUlTbfInfo	ul_info_tbf optional,
 		L1ctlUlAbsInfo	ul_info_abs optional,
-		L1ctlUlPayload	payload
+		L1ctlMsgPayload	payload optional
 	} with { variant (ul_info) "PRESENCE(header.msg_type = L1CTL_RACH_REQ,
 					     header.msg_type = L1CTL_EXT_RACH_REQ,
 					     header.msg_type = L1CTL_PARAM_REQ,
@@ -421,56 +400,68 @@
 					     header.msg_type = L1CTL_DM_FREQ_REQ,
 					     header.msg_type = L1CTL_DM_REL_REQ,
 					     header.msg_type = L1CTL_TRAFFIC_REQ)"
+		 variant (dl_info) "PRESENCE(header.msg_type = L1CTL_FBSB_CONF,
+					     header.msg_type = L1CTL_RACH_CONF,
+					     header.msg_type = L1CTL_DATA_IND,
+					     header.msg_type = L1CTL_DATA_CONF,
+					     header.msg_type = L1CTL_TRAFFIC_IND,
+					     header.msg_type = L1CTL_TRAFFIC_CONF)"
 		 variant (ul_info_tbf) "PRESENCE(header.msg_type = L1CTL_DATA_TBF_REQ)"
 		 variant (ul_info_abs) "PRESENCE(header.msg_type = L1CTL_DATA_ABS_REQ)"
 		 variant (payload) "CROSSTAG(fbsb_req, header.msg_type = L1CTL_FBSB_REQ;
-					     ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ;
-					     tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ;
+					     fbsb_conf, header.msg_type = L1CTL_FBSB_CONF;
+					     data_ind, header.msg_type = L1CTL_DATA_IND;
 					     rach_req, header.msg_type = L1CTL_RACH_REQ;
-					     ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ;
-					     par_req, header.msg_type = L1CTL_PARAM_REQ;
 					     dm_est_req, header.msg_type = L1CTL_DM_EST_REQ;
-					     reset_req, header.msg_type = L1CTL_RESET_REQ;
-					     crypto_req, header.msg_type = L1CTL_CRYPTO_REQ;
-					     traffic_req, header.msg_type = L1CTL_TRAFFIC_REQ;
-					     tbf_cfg_req, header.msg_type = L1CTL_TBF_CFG_REQ;
 					     data_req, header.msg_type = L1CTL_DATA_REQ;
+					     /* TODO: reset_ind, header.msg_type = L1CTL_RESET_IND */
+					     /* TODO: pm_req, header.msg_type = L1CTL_PM_REQ */
+					     /* TODO: pm_conf, header.msg_type = L1CTL_PM_CONF */
+					     reset_req, header.msg_type = L1CTL_RESET_REQ;
+					     ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ;
+					     ccch_mode_conf, header.msg_type = L1CTL_CCCH_MODE_CONF;
+					     par_req, header.msg_type = L1CTL_PARAM_REQ;
+					     /* TODO: freq_req, header.msg_type = L1CTL_DM_FREQ_REQ */
+					     crypto_req, header.msg_type = L1CTL_CRYPTO_REQ;
+					     /* TODO: sim_req, header.msg_type = L1CTL_SIM_REQ */
+					     /* TODO: sim_conf, header.msg_type = L1CTL_SIM_CONF */
+					     tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ;
+					     tch_mode_conf, header.msg_type = L1CTL_TCH_MODE_CONF;
+					     /* TODO: neigh_pm_req, header.msg_type = L1CTL_NEIGH_PM_REQ */
+					     /* TODO: neigh_pm_ind, header.msg_type = L1CTL_NEIGH_PM_IND */
+					     traffic_req, header.msg_type = L1CTL_TRAFFIC_REQ;
+					     traffic_ind, header.msg_type = L1CTL_TRAFFIC_IND;
+					     /* TODO: burst_ind, header.msg_type = L1CTL_BURST_IND */
+					     tbf_cfg_req, header.msg_type = L1CTL_TBF_CFG_REQ;
+					     tbf_cfg_conf, header.msg_type = L1CTL_TBF_CFG_CONF;
+					     ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ;
 					     other, OTHERWISE;
 				)" };
 
-	external function enc_L1ctlUlMessage(in L1ctlUlMessage msg) return octetstring
+	external function enc_L1ctlMessage(in L1ctlMessage msg) return octetstring
 		with { extension "prototype(convert) encode(RAW)" };
-	external function dec_L1ctlUlMessage(in octetstring stream) return L1ctlUlMessage
+	external function dec_L1ctlMessage(in octetstring stream) return L1ctlMessage
 		with { extension "prototype(convert) decode(RAW)" };
 
-	type record L1ctlUlMessageLV {
+	type record L1ctlMessageLV {
 		uint16_t	len,
-		L1ctlUlMessage	msg
+		L1ctlMessage	msg
 	} with { variant (len) "LENGTHTO(msg)" };
 
-	external function enc_L1ctlUlMessageLV(in L1ctlUlMessageLV msg) return octetstring
+	external function enc_L1ctlMessageLV(in L1ctlMessageLV msg) return octetstring
 		with { extension "prototype(convert) encode(RAW)" };
-	external function dec_L1ctlUlMessageLV(in octetstring stream) return L1ctlUlMessageLV
-		with { extension "prototype(convert) decode(RAW)" };
-
-	type record L1ctlDlMessageLV {
-		uint16_t	len,
-		L1ctlDlMessage	msg
-	} with { variant (len) "LENGTHTO(msg)" };
-
-	external function enc_L1ctlDlMessageLV(in L1ctlDlMessageLV msg) return octetstring
-		with { extension "prototype(convert) encode(RAW)" };
-	external function dec_L1ctlDlMessageLV(in octetstring stream) return L1ctlDlMessageLV
+	external function dec_L1ctlMessageLV(in octetstring stream) return L1ctlMessageLV
 		with { extension "prototype(convert) decode(RAW)" };
 
 
 
 
 	/* for generating RESET_REQ */
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	t_L1ctlResetReq(template (value) L1ctlResetType rst_type) := {
 		header := ts_L1ctlHeader(L1CTL_RESET_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -482,7 +473,7 @@
 	};
 
 	/* for generating FBSB_REQ */
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_FBSB_REQ(template (value) GsmBandArfcn arfcn,
 			  template (value) L1ctlFbsbFlags flags,
 			  template (value) uint8_t sync_info_idx,
@@ -490,6 +481,7 @@
 			  template (value) GsmRxLev rxlev_exp) := {
 		header := ts_L1ctlHeader(L1CTL_FBSB_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -508,10 +500,13 @@
 	};
 
 	/* for matching against incoming FBSB_CONF */
-	template L1ctlDlMessage
+	template L1ctlMessage
 	tr_L1CTL_FBSB_CONF(template (present) uint8_t result) := {
 		header := tr_L1ctlHeader(L1CTL_FBSB_CONF),
+		ul_info := omit,
 		dl_info := ?,
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := {
 			fbsb_conf := {
 				initial_freq_err := ?,
@@ -521,10 +516,11 @@
 		}
 	};
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_CCCH_MODE_REQ(template (value) L1ctlCcchMode ccch_mode) := {
 		header := ts_L1ctlHeader(L1CTL_CCCH_MODE_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -535,7 +531,7 @@
 		}
 	};
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_TCH_MODE_REQ(template (value) L1ctlTchMode tch_mode := L1CTL_CHAN_MODE_SIGN,
 			      template (value) L1ctlAudioMode audio_mode := t_L1CTL_AudioModeFwd,
 			      template (value) L1ctlLoopMode loop_mode := L1CTL_LOOP_MODE_OPEN,
@@ -543,6 +539,7 @@
 			      template (value) BIT8 amr_codecs_bitmask := '00000000'B) := {
 		header := ts_L1ctlHeader(L1CTL_TCH_MODE_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -559,16 +556,19 @@
 	};
 
 
-	template L1ctlDlMessage
+	template L1ctlMessage
 	tr_L1CTL_MsgType(template (present) L1ctlMsgType msg_type) := {
 		header := tr_L1ctlHeader(msg_type),
+		ul_info := *,
 		dl_info := *,
+		ul_info_tbf := *,
+		ul_info_abs := *,
 		payload := *
 	}
 
-	template L1ctlDlMessage tr_L1CTL_CCCH_MODE_CONF := tr_L1CTL_MsgType(L1CTL_CCCH_MODE_CONF);
+	template L1ctlMessage tr_L1CTL_CCCH_MODE_CONF := tr_L1CTL_MsgType(L1CTL_CCCH_MODE_CONF);
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_RACH_REQ(template (value) uint8_t ra,
 			  template (value) uint8_t combined,
 			  template (value) uint16_t offset,
@@ -580,6 +580,7 @@
 			link_id := link_id,
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -591,7 +592,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_EXT_RACH_REQ(template (value) uint16_t ra11,
 			      template (value) L1ctlRachSynchSeq seq,
 			      template (value) uint8_t combined,
@@ -603,6 +604,7 @@
 			link_id := ts_RslLinkID_DCCH(0),
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -615,7 +617,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_PAR_REQ(template (value) uint8_t ta,
 			 template (value) uint8_t tx_power) := {
 		header := ts_L1ctlHeader(L1CTL_PARAM_REQ),
@@ -624,6 +626,7 @@
 			link_id := ts_RslLinkID_DCCH(0),
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -636,7 +639,7 @@
 	}
 
 	/* Base template to be inherited by ts_L1CTL_DM_EST_REQ_H0 and ts_L1CTL_DM_EST_REQ_H1 */
-	private template (value) L1ctlUlMessage
+	private template (value) L1ctlMessage
 	ts_L1CTL_DM_EST_REQ(template (value) RslChannelNr chan_nr,
 			    template (value) GsmTsc tsc) := {
 		header := ts_L1ctlHeader(L1CTL_DM_EST_REQ),
@@ -645,6 +648,7 @@
 			link_id := ts_RslLinkID_DCCH(0),
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -657,7 +661,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DM_EST_REQ_H0(template (value) RslChannelNr chan_nr,
 			       template (value) GsmTsc tsc,
 			       template (value) GsmArfcn arfcn)
@@ -675,7 +679,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DM_EST_REQ_H1(template (value) RslChannelNr chan_nr,
 			       template (value) GsmTsc tsc,
 			       template (value) uint6_t hsn,
@@ -700,7 +704,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DM_REL_REQ(template (value) RslChannelNr chan_nr) := {
 		header := ts_L1ctlHeader(L1CTL_DM_REL_REQ),
 		ul_info := {
@@ -708,14 +712,13 @@
 			link_id := ts_RslLinkID_DCCH(0),
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
-		payload := {
-			other := ''O
-		}
+		payload := omit
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DATA_REQ(template (value) RslChannelNr chan_nr,
 			  template (value) RslLinkId link_id,
 			  octetstring l2_data) := {
@@ -725,6 +728,7 @@
 			link_id := link_id,
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -735,7 +739,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DATA_REQ_SACCH(template (value) RslChannelNr chan_nr,
 				template (value) RslLinkId link_id,
 				template (value) SacchL1Header l1h,
@@ -746,6 +750,7 @@
 			link_id := link_id,
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -756,7 +761,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_TRAFFIC_REQ(template (value) RslChannelNr chan_nr,
 			     template (value) RslLinkId link_id,
 			     octetstring frame) := {
@@ -766,6 +771,7 @@
 			link_id := link_id,
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -775,11 +781,12 @@
 		}
 	};
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_TBF_CFG_REQ(template (value) boolean is_uplink,
 			     template (value) TfiUsfArr tfi_usf) := {
 		header := ts_L1ctlHeader(L1CTL_TBF_CFG_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
@@ -792,10 +799,13 @@
 		}
 	};
 
-	template L1ctlDlMessage
+	template L1ctlMessage
 	tr_L1CTL_TBF_CFG_CONF(template (present) boolean is_uplink) := {
 		header := tr_L1ctlHeader(L1CTL_TBF_CFG_CONF),
+		ul_info := omit,
 		dl_info := omit,
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := {
 			tbf_cfg_conf := {
 				tbf_nr := 0,
@@ -806,12 +816,13 @@
 		}
 	};
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DATA_TBF_REQ(octetstring l2_data,
 			      template (value) L1ctlGprsCs cs := L1CTL_CS1,
 			      template (value) uint8_t tbf_nr := 0) := {
 		header := ts_L1ctlHeader(L1CTL_DATA_TBF_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := {
 			tbf_nr := tbf_nr,
 			cs := cs,
@@ -823,7 +834,7 @@
 		}
 	}
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DATA_ABS_REQ(octetstring l2_data,
 			      template (value) GsmBandArfcn arfcn,
 			      template (value) uint8_t ts,
@@ -832,6 +843,7 @@
 			      template (value) uint8_t tbf_nr := 0) := {
 		header := ts_L1ctlHeader(L1CTL_DATA_ABS_REQ),
 		ul_info := omit,
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := {
 			tbf_nr := tbf_nr,
@@ -849,14 +861,17 @@
 
 
 	/* for matching against incoming RACH_CONF */
-	template L1ctlDlMessage tr_L1CTL_RACH_CONF := {
+	template L1ctlMessage tr_L1CTL_RACH_CONF := {
 		header := tr_L1ctlHeader(L1CTL_RACH_CONF),
+		ul_info := omit,
 		dl_info := ?,
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := *
 	};
 
 	/* for sending and matching L1CTL_DATA_IND */
-	template (value) L1ctlDlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_DATA_IND(template (value) RslChannelNr chan_nr,
 			  template (value) RslLinkId link_id,
 			  template (value) octetstring l2_data,
@@ -866,6 +881,7 @@
 			  template (value) uint8_t num_biterr := 0,
 			  template (value) uint8_t fire_crc := 0) := {
 		header := ts_L1ctlHeader(L1CTL_DATA_IND),
+		ul_info := omit,
 		dl_info := {
 			chan_nr := chan_nr,
 			link_id := link_id,
@@ -876,19 +892,22 @@
 			num_biterr := num_biterr,
 			fire_crc := fire_crc
 		},
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := {
 			data_ind := {
 				payload := l2_data
 			}
 		}
 	};
-	template L1ctlDlMessage
+	template L1ctlMessage
 	tr_L1CTL_DATA_IND(template (present) RslChannelNr chan_nr,
 			  template (present) RslLinkId link_id := ?,
 			  template (present) octetstring l2_data := ?,
 			  template (present) uint8_t num_biterr := 0,
 			  template (present) uint8_t fire_crc := 0) := {
 		header := tr_L1ctlHeader(L1CTL_DATA_IND),
+		ul_info := omit,
 		dl_info := {
 			chan_nr := chan_nr,
 			link_id := link_id,
@@ -899,6 +918,8 @@
 			num_biterr := num_biterr,
 			fire_crc := fire_crc
 		},
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := {
 			data_ind := {
 				payload := l2_data
@@ -907,13 +928,14 @@
 	};
 
 	/* for matching against incoming TRAFFIC_IND */
-	template L1ctlDlMessage
+	template L1ctlMessage
 	tr_L1CTL_TRAFFIC_IND(template (present) RslChannelNr chan_nr,
 			     template (present) RslLinkId link_id := ?,
 			     template (present) octetstring frame := ?,
 			     template (present) uint8_t num_biterr := ?,
 			     template (present) uint8_t fire_crc := ?) := {
 		header := tr_L1ctlHeader(L1CTL_TRAFFIC_IND),
+		ul_info := omit,
 		dl_info := {
 			chan_nr := chan_nr,
 			link_id := link_id,
@@ -924,6 +946,8 @@
 			num_biterr := num_biterr,
 			fire_crc := fire_crc
 		},
+		ul_info_tbf := omit,
+		ul_info_abs := omit,
 		payload := {
 			traffic_ind := {
 				data := frame
@@ -931,7 +955,7 @@
 		}
 	};
 
-	template (value) L1ctlUlMessage
+	template (value) L1ctlMessage
 	ts_L1CTL_CRYPTO_REQ(template (value) RslChannelNr chan_nr,
 			    template (value) uint8_t algo,
 			    template (value) octetstring key) := {
@@ -941,6 +965,7 @@
 			link_id := ts_RslLinkID_DCCH(0),
 			padding := '0000'O
 		},
+		dl_info := omit,
 		ul_info_tbf := omit,
 		ul_info_abs := omit,
 		payload := {
diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn
index 9630df0..643b7e5 100644
--- a/library/LAPDm_RAW_PT.ttcn
+++ b/library/LAPDm_RAW_PT.ttcn
@@ -389,7 +389,7 @@
 	}
 
 	function ScanEvents() runs on lapdm_CT {
-		var L1ctlDlMessage dl;
+		var L1ctlMessage dl;
 		var BCCH_tune_req bt;
 		var LAPDm_ph_data lpd;
 		var RLCMAC_ph_data_ind rpdi;