[MERGED] osmo-ttcn3-hacks[master]: RSL_Types: Add templates for "BSC side"

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Feb 21 23:28:55 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: RSL_Types: Add templates for "BSC side"
......................................................................


RSL_Types: Add templates for "BSC side"

So far, the RSL templates have been used for BSC testing, i.e.
TTCN3 behaving like a BTS.  Now we want to test the BTS, so we
have to "invert" the receive/send direction and hence also need
the inverse templates.

This doesn't add *all* of them, but a sufficiently large number for our
first testcases against OsmoBTS.

Change-Id: Ica9cfae5a691e4d967d046b04e5bb16a71a89adf
---
M library/RSL_Types.ttcn
1 file changed, 211 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 765a91e..b1716fd 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -405,10 +405,24 @@
 		t2 := fn mod 26
 	}
 
+	function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
+		if (istemplatekind(fn, "?")) {
+			return ?;
+		} else {
+			return ts_RSL_IE_FrameNumber(valueof(fn));
+		}
+	}
+
 	template RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
 		ra := ra,
 		frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
 	}
+
+	template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
+		ra := ra,
+		frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
+	}
+
 
 	/* 9.3.26 */
 	type enumerated RSL_Cause {
@@ -463,6 +477,13 @@
 
 	template RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
 		len := 0, /* overwritten */
+		e := 0,
+		cause := cause,
+		cause_ext := omit
+	}
+
+	template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
+		len := ?,
 		e := 0,
 		cause := cause,
 		cause_ext := omit
@@ -749,6 +770,16 @@
 			t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
 		}
 	}
+	template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
+					     template octetstring l3_info := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
+		msg_type := RSL_MT_DATA_IND,
+		ies :={
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
+			tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
+		}
+	}
 
 	/* 8.3.3 BTS -> BSC */
 	template RSL_Message ts_RSL_ERROR_IND(RslChannelNr chan_nr, RslLinkId link_id, RSL_Cause cause) := {
@@ -760,6 +791,16 @@
 			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
 		}
 	}
+	template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
+						template RSL_Cause cause := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
+		msg_type := RSL_MT_ERROR_IND,
+		ies :={
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
+			tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+		}
+	}
 
 	/* 8.3.6 BTS -> BSC */
 	template RSL_Message ts_RSL_EST_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := {
@@ -769,6 +810,16 @@
 			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
 			t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
 			t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
+		}
+	}
+	template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
+						template octetstring l3_info := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
+		msg_type := RSL_MT_EST_IND,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
+			tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
 		}
 	}
 
@@ -801,6 +852,14 @@
 			t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
 		}
 	}
+	template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
+		msg_type := RSL_MT_REL_CONF,
+		ies :={
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
+		}
+	}
 
 	/* 8.3.9 BTS -> BSC */
 	template RSL_Message ts_RSL_REL_IND(RslChannelNr chan_nr, RslLinkId link_id) := {
@@ -809,6 +868,14 @@
 		ies :={
 			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
 			t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
+		}
+	}
+	template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
+		msg_type := RSL_MT_REL_IND,
+		ies :={
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
 		}
 	}
 
@@ -848,6 +915,14 @@
 			t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
 		}
 	}
+	template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_CHAN_ACTIV_ACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
+		}
+	}
 
 	/* 8.4.3 BTS -> BSC */
 	template RSL_Message ts_RSL_CHAN_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
@@ -856,6 +931,15 @@
 		ies :={
 			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
 			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
+		}
+	}
+	template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
+						  template RSL_Cause cause := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_CHAN_ACTIV_NACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{cause := ?})
 		}
 	}
 
@@ -868,6 +952,15 @@
 			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
 		}
 	}
+	template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
+						  template RSL_Cause cause := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_CONN_FAIL,
+		ies :={
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+		}
+	}
 
 	/* 8.4.5 BSC -> BTS */
 	template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
@@ -877,6 +970,14 @@
 			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
 		}
 	}
+	template RSL_Message ts_RSL_DEACT_SACCH(RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_DEACTIVATE_SACCH,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
+		}
+	}
+
 
 	/* 8.4.6 BSC ->BTS */
 	template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
@@ -893,6 +994,18 @@
 			tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
 		}
 	}
+	template RSL_Message ts_RSL_ENCR_CMD(RslChannelNr chan_nr, RslLinkId link_id,
+					     OCT1 alg, octetstring key,
+					     octetstring l3_info) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_ENCR_CMD,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+			t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
+			t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
+			t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
+		}
+	}
 
 	/* 8.4.10 BTS -> BSC */
 	template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := {
@@ -902,12 +1015,33 @@
 			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
 		}
 	}
+	template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_MODE_MODIFY_ACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
+		}
+	}
 
 	/* 8.4.11 BTS -> BSC */
-	template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause)
-	modifies ts_RSL_CHAN_ACT_NACK := {
-		msg_type := RSL_MT_MODE_MODIFY_NACK
+	template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_MODE_MODIFY_NACK,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
+			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
+		}
 	}
+	template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
+							template RSL_Cause cause) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_MODE_MODIFY_NACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+		}
+	}
+
 
 	/* 8.4.14: BTS <- BSC */
 	template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
@@ -917,12 +1051,27 @@
 			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
 		}
 	}
+	template RSL_Message ts_RSL_RF_CHAN_REL(RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_RF_CHAN_REL,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
+		}
+	}
 
 	/* 8.4.19 BTS -> BSC */
 	template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) :=
 		ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
 				   RSL_MT_RF_CHAN_REL_ACK,
 				   { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
+
+	template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+		msg_type := RSL_MT_RF_CHAN_REL_ACK,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
+		}
+	}
 
 	/* COMMON CHANNEL MANAGEMENT MESSAGES */
 
@@ -954,6 +1103,16 @@
 			t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
 		}
 	}
+	template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
+						template uint8_t acc_del := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
+		msg_type := RSL_MT_CHAN_RQD,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
+			tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
+			tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
+		}
+	}
 
 	/* 8.5.4 BTS -> BSC */
 	template RSL_Message ts_DELETE_IND(RslChannelNr chan_nr, octetstring imm_ass) := {
@@ -976,6 +1135,15 @@
 			* /* opt: channel needed, eMLPP prio */
 		}
 	}
+	template RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
+		msg_type := RSL_MT_PAGING_CMD,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
+			t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
+			t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)})
+		}
+	}
 
 	/* 8.5.6 BSC -> BTS */
 	template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
@@ -986,7 +1154,14 @@
 			tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
 		}
 	}
-
+	template RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
+		msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
+			t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
+		}
+	}
 
 	/* 8.6.4 BTS -> BSC */
 	template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
@@ -1008,6 +1183,14 @@
 			*
 		}
 	}
+	template RSL_Message ts_RSL_IPA_CRCX(RslChannelNr chan_nr) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+		msg_type := RSL_MT_IPAC_CRCX,
+		ies := {
+			t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
+		}
+	}
+
 
 	template RSL_Message ts_RSL_IPA_CRCX_ACK(RslChannelNr chan_nr,
 						 uint16_t ipa_conn_id, uint32_t local_ip,
@@ -1022,6 +1205,21 @@
 			t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
 		}
 	}
+	template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
+						 template uint16_t ipa_conn_id,
+						 template uint32_t local_ip,
+						 template uint16_t local_port,
+						 template uint7_t rtp_pt2) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+		msg_type := RSL_MT_IPAC_CRCX_ACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
+			tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
+			tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
+			tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
+		}
+	}
 
 	template RSL_Message ts_RSL_IPA_CRCX_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
 		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
@@ -1031,6 +1229,15 @@
 			t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
 		}
 	}
+	template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
+						  template RSL_Cause cause := ?) := {
+		msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
+		msg_type := RSL_MT_IPAC_CRCX_NACK,
+		ies := {
+			tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
+			tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
+		}
+	}
 
 	template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
 					     template uint16_t ipa_conn_id) := {

-- 
To view, visit https://gerrit.osmocom.org/6607
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ica9cfae5a691e4d967d046b04e5bb16a71a89adf
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list