bsc: Add testscase & infra to validate Osmux support BTS<->BSC

New TC_assignment_osmux_bts is added which tests Osmux used only
BTS<->BSC.
Existing TC_assignment_osmux is renamed to TC_assignment_osmux_cn,
and a new TC_assignment_osmux is added which tests using Osmux on both
sides (towards BTS and CN).

Related: SYS#5987
Change-Id: I6e82eb9d995de988b812001e1c4cf6923509de66
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 6c45ca9..3acd619 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -220,9 +220,11 @@
 		RSL_IE_TFO_STATUS		('00111011'B),
 		RSL_IE_LLP_APDU			('00111100'B),
 
+		/* Osmocom extensions */
 		RSL_IE_OSMO_REP_ACCH_CAP	('01100000'B),
 		RSL_IE_OSMO_TRAINING_SEQUENCE	('01100001'B),
 		RSL_IE_OSMO_TOP_ACCH_CAP	('01100010'B),
+		RSL_IE_OSMO_OSMUX_CID		('01100011'B),
 
 		/* ip.access */
 		RSL_IE_IPAC_SRTP_CONFIG		('11100000'B),
@@ -961,6 +963,23 @@
 		overpower_db := overpower
 	};
 
+	type record RSL_IE_OSMO_Osmux_CID {
+		uint8_t			len,
+		uint8_t			cid
+	} with { variant (len) "LENGTHTO(cid)" }
+
+	template (present) RSL_IE_OSMO_Osmux_CID
+	tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
+		len := ?, /* overwritten */
+		cid := osmux_cid
+	};
+	template (value) RSL_IE_OSMO_Osmux_CID
+	ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
+		len := 0, /* overwritten */
+		cid := osmux_cid
+	};
+
+
 	/* union of all IE bodies */
 	type union RSL_IE_Body {
 		RslChannelNr		chan_nr,
@@ -1018,6 +1037,7 @@
 		RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
 		RSL_IE_OSMO_RepAcchCap	rep_acch_cap,
 		RSL_IE_OSMO_TopAcchCap	top_acch_cap,
+		RSL_IE_OSMO_Osmux_CID	osmux_cid,
 
 		RSL_LV		other
 	}
@@ -1083,6 +1103,7 @@
 					osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
 					rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
 					top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
+					osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
 
 					other, OTHERWISE;
 		)" };
@@ -2184,20 +2205,28 @@
 		ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port)
 	}
 
-
-	template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
-							 uint16_t ipa_conn_id, OCT4 local_ip,
-							 uint16_t local_port, uint7_t rtp_pt2) := {
-		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-		msg_type := RSL_MT_IPAC_CRCX_ACK,
-		ies := {
-			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
-			t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-			t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
-			t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
-			t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+	function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
+				     uint16_t ipa_conn_id, OCT4 local_ip,
+				     uint16_t local_port, uint7_t rtp_pt2,
+				     template (omit) uint8_t osmux_cid := omit)
+	return template (value) RSL_Message {
+		var template (value) RSL_Message msg := {
+			msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+			msg_type := RSL_MT_IPAC_CRCX_ACK,
+			ies := {
+				t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+				t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+				t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
+				t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
+				t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+			}
 		}
+		if (not istemplatekind(osmux_cid, "omit")) {
+			msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+		}
+		return msg;
 	}
+
 	template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
 						 template uint16_t ipa_conn_id,
 						 template OCT4 local_ip,
@@ -2258,22 +2287,30 @@
 		}
 	}
 
-	template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
-							 uint16_t ipa_conn_id,
-							 OCT4 local_ip, uint16_t local_port,
-							 uint7_t rtp_pt2) := {
-		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
-		msg_type := RSL_MT_IPAC_MDCX_ACK,
-		ies := {
-			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
-			/* optional */
-			t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
-			t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
-			t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
-			/* optional: RTP Payload Type */
-			t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+	function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
+				     uint16_t ipa_conn_id,
+				     OCT4 local_ip, uint16_t local_port,
+				     uint7_t rtp_pt2,
+				     template (omit) uint8_t osmux_cid := omit)
+		return template (value) RSL_Message {
+			var template (value) RSL_Message msg := {
+				msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+				msg_type := RSL_MT_IPAC_MDCX_ACK,
+				ies := {
+					t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+					/* optional */
+					t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+					t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
+					t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
+					/* optional: RTP Payload Type */
+					t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+				}
+			}
+			if (not istemplatekind(osmux_cid, "omit")) {
+				msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
+			}
+			return msg;
 		}
-	}
 	template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
 						 template uint16_t ipa_conn_id,
 						 template OCT4 local_ip,