Change in ...osmo-ttcn3-hacks[master]: BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure

laforge gerrit-no-reply at lists.osmocom.org
Sun Aug 18 17:12:47 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13865 )

Change subject: BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure
......................................................................

BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure

It originally seemed like a great idea to define a custom record
which aggregates the decoded BSSGP, LLC, L3 and/or SNDCP and passes
it to the individual ConnHdlr.  However, particularly with testcase
interoperability for IuPS in mind, this seems bogus.  Also, we
never really took advantage of this.

Let's now decode as far as we can decode any PDU, and then send the
decoded version of that PDU via the ports between the BSSGP_Emulation
and the ConnHdlr component.

Change-Id: I8c1082880902dd9a04935945f0293895f4d0c53a
---
M library/BSSGP_Emulation.ttcn
M pcu/PCU_Tests.ttcn
M pcu/PCU_Tests_RAW.ttcn
M sgsn/SGSN_Tests.ttcn
4 files changed, 112 insertions(+), 165 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn
index 5b5628e..f8b9f06 100644
--- a/library/BSSGP_Emulation.ttcn
+++ b/library/BSSGP_Emulation.ttcn
@@ -53,7 +53,9 @@
 		PDU_LLC,
 		PDU_L3_MS_SGSN,
 		PDU_L3_SGSN_MS;
-	out	BssgpDecoded,
+	out	PDU_BSSGP,
+		PDU_LLC,
+		PDU_SN,
 		NsStatusIndication,
 		BssgpStatusIndication,
 		ASP_Event,
@@ -66,7 +68,9 @@
 	in	ASP_Event,
 		NsStatusIndication,
 		BssgpStatusIndication,
-		BssgpDecoded,
+		PDU_BSSGP,
+		PDU_LLC,
+		PDU_SN,
 		PDU_L3_MS_SGSN,
 		PDU_L3_SGSN_MS;
 	out	PDU_BSSGP,
@@ -492,6 +496,21 @@
 	}
 }
 
+private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt := BSSGP_SP) runs on BSSGP_CT {
+	if (ispresent(dec.l3_mt)) {
+		pt.send(dec.l3_mt) to vc_conn;
+	} else if (ispresent(dec.l3_mo)) {
+		pt.send(dec.l3_mo) to vc_conn;
+	} else if (ispresent(dec.sndcp)) {
+		pt.send(dec.sndcp) to vc_conn;
+	} else if (ispresent(dec.llc)) {
+		pt.send(dec.llc) to vc_conn;
+	} else {
+		pt.send(dec.bssgp) to vc_conn;
+	}
+}
+
+
 altstep as_unblocked() runs on BSSGP_CT {
 	var BSSGP_Client_CT vc_conn;
 	var NsUnitdataIndication udi;
@@ -539,7 +558,7 @@
 	[] BSCP.receive(f_BnsUdInd(tr_BSSGP_PS_PAGING(g_cfg.bvci), g_cfg.bvci)) -> value udi {
 		var hexstring imsi := udi.bssgp.pDU_BSSGP_PAGING_PS.iMSI.digits
 		vc_conn := f_tbl_comp_by_imsi(imsi);
-		BSSGP_SP.send(f_dec_bssgp(udi.bssgp)) to vc_conn;
+		f_send_bssgp_dec(f_dec_bssgp(udi.bssgp), vc_conn);
 	}
 
 	/* Any other PTP BSSGP message: If it has TLLi, route to component; otherwise broadcast */
@@ -548,14 +567,14 @@
 		var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);
 		if (isvalue(tlli)) {
 			vc_conn := f_tbl_comp_by_tlli(valueof(tlli));
-			BSSGP_SP.send(dec) to vc_conn;
+			f_send_bssgp_dec(dec, vc_conn);
 		} else {
 			log("No TLLI: Broadcasting ", dec);
 			/* broadcast this message to all components */
 			// TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"
 			for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
 				if (isbound(ClientTable[i].comp_ref)) {
-					BSSGP_SP.send(dec) to ClientTable[i].comp_ref;
+					f_send_bssgp_dec(dec, ClientTable[i].comp_ref);
 				}
 			}
 		}
@@ -567,14 +586,14 @@
 		var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);
 		if (isvalue(tlli)) {
 			vc_conn := f_tbl_comp_by_tlli(valueof(tlli));
-			BSSGP_SP_SIG.send(dec) to vc_conn;
+			f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);
 		} else {
 			log("No TLLI: Broadcasting ", dec);
 			/* broadcast this message to all components */
 			// TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"
 			for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {
 				if (isbound(ClientTable[i].comp_ref)) {
-					BSSGP_SP_SIG.send(dec) to ClientTable[i].comp_ref;
+					f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);
 				}
 			}
 		}
@@ -731,47 +750,5 @@
 	}
 }
 
-template BssgpDecoded tr_BD_BSSGP(template PDU_BSSGP bg) := {
-	bssgp := bg,
-	llc := *,
-	l3_mo := *,
-	l3_mt := *,
-	sndcp := *
-}
-
-template BssgpDecoded tr_BD_LLC(template PDU_LLC llc) := {
-	bssgp := ?,
-	llc := llc,
-	l3_mo := *,
-	l3_mt := *,
-	sndcp := *
-}
-
-template BssgpDecoded tr_BD_L3_MT(template PDU_L3_SGSN_MS mt) := {
-	bssgp := ?,
-	llc := ?,
-	l3_mo := omit,
-	l3_mt := mt,
-	sndcp := omit
-}
-
-template BssgpDecoded tr_BD_L3_MO(template PDU_L3_MS_SGSN mo) := {
-	bssgp := ?,
-	llc := ?,
-	l3_mo := mo,
-	l3_mt := omit,
-	sndcp := omit
-}
-
-template BssgpDecoded tr_BD_SNDCP(template BIT4 sapi, template PDU_SN sn) := {
-	bssgp := ?,
-	llc := tr_LLC_UI(?, sapi),
-	l3_mo := omit,
-	l3_mt := omit,
-	sndcp := sn
-}
-
-
-
 
 }
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index e00f92b..a88dfed 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -324,15 +324,15 @@
 }
 
 
-function f_bssgp_wait_ul_ud(template BssgpDecoded bd_exp) runs on dummy_CT {
+function f_bssgp_wait_ul_ud(template PDU_BSSGP exp) runs on dummy_CT {
 	timer T := 5.0;
 	T.start;
 	alt {
-	[] BSSGP[0].receive(bd_exp) {
+	[] BSSGP[0].receive(exp) {
 		log("found matching BSSGP UL-UNITDATA PDU");
 		}
 	[] T.timeout {
-		setverdict(fail, "Timeout waiting for ", bd_exp);
+		setverdict(fail, "Timeout waiting for ", exp);
 		mtc.stop;
 		}
 	}
@@ -373,7 +373,7 @@
 	}
 
 	for (var integer i := 0; i < sizeof(us.tbf.llc_pdus_enc); i := i+1) {
-		f_bssgp_wait_ul_ud(tr_BD_BSSGP(tr_BSSGP_UL_UD(g_mmctx.tlli, ?, us.tbf.llc_pdus_enc[i])));
+		f_bssgp_wait_ul_ud(tr_BSSGP_UL_UD(g_mmctx.tlli, ?, us.tbf.llc_pdus_enc[i]));
 	}
 	setverdict(pass);
 
@@ -393,26 +393,6 @@
 }
 
 
-testcase TC_nsem() runs on dummy_CT {
-
-	f_init();
-	f_bssgp_establish();
-
-	while (true) {
-		var BssgpDecoded bd;
-		alt {
-			[] BSSGP[0].receive(tr_BD_BSSGP(?)) -> value bd {
-				log("BSSGP Rx: ", bd);
-				//log("GMM Rx: ", dec_PDU_L3_MS_SGSN(pdu.payload));
-				g_mmctx.tlli := bd.bssgp.pDU_BSSGP_UL_UNITDATA.tLLI;
-				tx_gmm(LLC_CR_DL_CMD, gmm_auth_req);
-			}
-			[] BSSGP[0].receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { repeat; }
-			[] BSSGP[0].receive { repeat; }
-		}
-	}
-}
-
 
 function f_llc_dec_and_log(in octetstring inp) {
 	log("LLC Input: ", inp);
diff --git a/pcu/PCU_Tests_RAW.ttcn b/pcu/PCU_Tests_RAW.ttcn
index 36db225..4732da6 100644
--- a/pcu/PCU_Tests_RAW.ttcn
+++ b/pcu/PCU_Tests_RAW.ttcn
@@ -433,7 +433,7 @@
 
 	f_sleep(1.0);
 	f_pcuif_tx(ts_PCUIF_SUSP_REQ(0, tlli, ra_id, 0));
-	BSSGP_SIG[0].receive(tr_BD_BSSGP(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id)));
+	BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id));
 
 	setverdict(pass);
 }
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 03c9d05..e349719 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -401,12 +401,12 @@
 
 altstep as_mm_identity(integer gb_idx := 0) runs on BSSGP_ConnHdlr {
 	var MobileL3_CommonIE_Types.MobileIdentityLV mi;
-	[] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+	[] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('001'B)) {
 		mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
 		f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
 		repeat;
 	}
-	[] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+	[] BSSGP[gb_idx].receive(tr_GMM_ID_REQ('010'B)) {
 		mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
 		f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi), gb_idx);
 		repeat;
@@ -416,12 +416,9 @@
 /* receive a L3 (GMM/SM) message over whatever is the appropriate lower-layer bearer */
 function f_receive_l3(template PDU_L3_SGSN_MS rx_tpl := ?, integer gb_idx := 0)
 runs on BSSGP_ConnHdlr return PDU_L3_SGSN_MS {
-	var BssgpDecoded bd;
 	var PDU_L3_SGSN_MS l3_mt;
 	alt {
-	[] BSSGP[gb_idx].receive(tr_BD_L3_MT(rx_tpl)) -> value bd {
-		l3_mt := bd.l3_mt;
-		}
+	[] BSSGP[gb_idx].receive(rx_tpl) -> value l3_mt { }
 	}
 	return l3_mt;
 }
@@ -658,14 +655,14 @@
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ(?))) {
+	[] BSSGP[0].receive(tr_GMM_ID_REQ(?)) {
 		/* don't send ID Response */
 		repeat;
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('09'O))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT('09'O)) {
 		setverdict(pass);
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 		setverdict(fail, "Wrong Attach Reject Cause");
 		mtc.stop;
 		}
@@ -688,7 +685,7 @@
 	[] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { }
 	}
 	/* don't send SAI-response from HLR */
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?)));
+	BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?));
 	setverdict(pass);
 }
 testcase TC_attach_auth_sai_timeout() runs on test_CT {
@@ -709,7 +706,7 @@
 		GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 23));
 		}
 	}
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?)));
+	BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?));
 	setverdict(pass);
 }
 testcase TC_attach_auth_sai_reject() runs on test_CT {
@@ -721,7 +718,7 @@
 
 /* HLR never responds to UL REQ, expect ATTACH REJECT */
 private function f_TC_attach_gsup_lu_timeout(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
@@ -730,11 +727,11 @@
 	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi));
 	/* Never follow-up with ISD_REQ or UL_RES */
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 		setverdict(pass);
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+	[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+		f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 		setverdict(fail);
 		mtc.stop;
 		}
@@ -750,7 +747,7 @@
 
 /* HLR rejects UL REQ, expect ATTACH REJECT */
 private function f_TC_attach_gsup_lu_reject(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
@@ -760,11 +757,11 @@
 		GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 0));
 	}
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 		setverdict(pass);
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+	[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+		f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 		setverdict(fail);
 		mtc.stop;
 		}
@@ -781,7 +778,7 @@
 
 /* Attempt of combined GPRS + IMSI attach: network should ACK only GPRS attach  */
 private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit));
@@ -789,8 +786,8 @@
 	/* Expect MSC to perform LU with HLR */
 	f_gmm_gsup_lu_isd();
 
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+	BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+		f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 	}
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
@@ -805,15 +802,15 @@
 
 /* Attempt of GPRS ATTACH in 'accept all' mode */
 private function f_TC_attach_accept_all(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
 	g_pars.net.expect_auth := false;
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+	BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+		f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 	}
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
@@ -840,13 +837,13 @@
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
 	[] as_mm_identity();
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT('07'O))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT('07'O)) {
 		setverdict(pass);
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 		setverdict(pass);
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) {
+	[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT(*, *, *)) {
 		setverdict(fail);
 		mtc.stop;
 		}
@@ -871,7 +868,7 @@
 
 	f_send_l3_gmm_llc(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit));
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT('0a'O))) {
+	[] BSSGP[0].receive(tr_GMM_RAU_REJECT('0a'O)) {
 		setverdict(pass);
 		}
 	/* FIXME: Expect XID RESET? */
@@ -887,8 +884,6 @@
 }
 
 private function f_TC_attach_rau(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
-
 	/* first perform regular attach */
 	f_TC_attach(id);
 
@@ -905,7 +900,7 @@
 
 /* general GPRS DETACH helper */
 function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge, integer bssgp_index := 0) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 	timer T := 5.0;
 	f_send_l3_gmm_llc(ts_GMM_DET_REQ_MO(detach_type, power_off), bssgp_index);
 	if (expect_purge) {
@@ -918,7 +913,7 @@
 		setverdict(fail, "Unexpected GSUP PURGE MS for unregistered TLLI");
 		mtc.stop;
 		}
-	[power_off] BSSGP[bssgp_index].receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd {
+	[power_off] BSSGP[bssgp_index].receive(tr_GMM_DET_ACCEPT_MT) -> value l3_mt {
 		g_pars.ra := omit;
 		setverdict(fail, "Unexpected DETACH ACCEPT in power-off DETACH");
 		mtc.stop;
@@ -927,12 +922,12 @@
 	[power_off] T.timeout {
 		setverdict(pass);
 		}
-	[not power_off] BSSGP[bssgp_index].receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd {
+	[not power_off] BSSGP[bssgp_index].receive(tr_GMM_DET_ACCEPT_MT) -> value l3_mt {
 		g_pars.ra := omit;
 		setverdict(pass);
 		/* TODO: check if any PDP contexts are deactivated on network side? */
 		}
-	[] BSSGP[bssgp_index].receive(tr_BD_L3_MT(?)) -> value bd {
+	[] BSSGP[bssgp_index].receive(PDU_L3_SGSN_MS:?) -> value l3_mt {
 		if (power_off) {
 			setverdict(fail, "Unexpected Layer 3 package received in power-off DETACH");
 		} else {
@@ -1056,22 +1051,22 @@
 						omit, recovery));
 	}
 	alt {
-	[exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) {
+	[exp_rej] BSSGP[gb_idx].receive(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause)) {
 		setverdict(pass);
 		}
-	[exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) {
+	[exp_rej] BSSGP[gb_idx].receive(tr_SM_ACT_PDP_ACCEPT) {
 		setverdict(fail, "Unexpected PDP CTX ACT ACC");
 		mtc.stop;
 		}
-	[not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) {
+	[not exp_rej] BSSGP[gb_idx].receive(tr_SM_ACT_PDP_REJ(apars.tid, ?)) {
 		setverdict(fail, "Unexpected PDP CTX ACT FAIL");
 		mtc.stop;
 		}
-	[not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) {
+	[not exp_rej] BSSGP[gb_idx].receive(tr_SM_ACT_PDP_REJ(apars.tid, ?)) {
 		setverdict(fail, "Unexpected PDP CTX ACT FAIL");
 		mtc.stop;
 		}
-	[not exp_rej] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) {
+	[not exp_rej] BSSGP[gb_idx].receive(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi)) {
 		setverdict(pass);
 		}
 	[] as_xid(apars, gb_idx);
@@ -1090,7 +1085,7 @@
 		GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, apars.sgsn_tei_c, '7F'O));
 	}
 	alt {
-	[] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) {
+	[] BSSGP[gb_idx].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)) {
 		setverdict(pass);
 		}
 	[] as_xid(apars, gb_idx);
@@ -1114,7 +1109,7 @@
 	T.start;
 
 	alt {
-	[] BSSGP[gb_idx].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
+	[] BSSGP[gb_idx].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {
 		f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), gb_idx);
 		}
 	[not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {
@@ -1219,7 +1214,7 @@
 }
 
 private altstep as_xid(PdpActPars apars, integer gb_idx := 0) runs on BSSGP_ConnHdlr {
-	[] BSSGP[gb_idx].receive(tr_BD_LLC(tr_LLC_XID_MT_CMD(?, apars.sapi))) {
+	[] BSSGP[gb_idx].receive(tr_LLC_XID_MT_CMD(?, apars.sapi)) {
 		repeat;
 	}
 }
@@ -1265,7 +1260,8 @@
 	/* Expect PDU via BSSGP/LLC on simulated PCU from SGSN */
 	alt {
 	[] as_xid(apars, gb_idx);
-	[] BSSGP[gb_idx].receive(tr_BD_SNDCP(apars.sapi, tr_SN_UD(apars.nsapi, payload)));
+	//[] BSSGP[gb_idx].receive(tr_BD_SNDCP(apars.sapi, tr_SN_UD(apars.nsapi, payload)));
+	[] BSSGP[gb_idx].receive(tr_SN_UD(apars.nsapi, payload));
 	}
 }
 
@@ -1304,14 +1300,14 @@
 				     apars.apn, apars.pco));
 	alt {
 	/* We might want toalso actually expect a PDPC CTX ACT REJ? */
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(?, ?))) {
+	[] BSSGP[0].receive(tr_GMM_DET_REQ_MT(?, ?)) {
 		setverdict(pass);
 		}
 	[] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) {
 		setverdict(fail, "Unexpected GTP PDP CTX ACT");
 		mtc.stop;
 		}
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(?, ?))) {
+	[] BSSGP[0].receive(tr_SM_ACT_PDP_ACCEPT(?, ?)) {
 		setverdict(fail, "Unexpected SM PDP CTX ACT ACK");
 		mtc.stop;
 		}
@@ -1447,7 +1443,7 @@
 	}
 	var OCT1 cause_network_failure := int2oct(38, 1)
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, cause_network_failure, true))) {
+	[] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, cause_network_failure, true)) {
 		f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
 		setverdict(pass);
 		}
@@ -1522,7 +1518,7 @@
 
 	for (i := 0; i < 5; i := i+1) {
 		alt {
-			[] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {}
+			[] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {}
 			[] as_xid(apars);
 		}
 	}
@@ -1567,7 +1563,7 @@
 						apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id,
 						omit, omit));
 	}
-	BSSGP[0].receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) {}
+	BSSGP[0].receive(tr_SM_ACT_PDP_ACCEPT) {}
 
 	/* Now the same with Deact */
 	f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, '00'O, false, omit), 0);
@@ -1583,7 +1579,7 @@
 		GTP.send(ts_GTPC_DeletePdpResp(g_ud_second.peer, seq_nr, apars.sgsn_tei_c, '7F'O));
 	}
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid))) {
+	[] BSSGP[0].receive(tr_SM_DEACT_PDP_ACCEPT_MT(apars.tid)) {
 		setverdict(pass);
 		}
 	[] as_xid(apars, 0);
@@ -1614,7 +1610,7 @@
 	g_delete_req := ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B);
 	GTP.send(g_delete_req);
 	alt {
-	[] BSSGP[0].receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {
+	[] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) {
 			f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), 0);
 		}
 	[] as_xid(apars, 0);
@@ -1669,7 +1665,7 @@
 	timer T := 5.0;
 	T.start;
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(*, *, *))) {
+		[] BSSGP[0].receive(tr_GMM_DET_REQ_MT(*, *, *)) {
 			T.stop;
 			setverdict(fail, "Unexpected GMM Detach Request");
 			mtc.stop;
@@ -1728,7 +1724,7 @@
 	GSUP.send(ts_GSUP_UL_RES(g_pars.imsi));
 
 	/* MS: receive a Detach Request */
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(c_GMM_DTT_MT_IMSI_DETACH, ?, ?)));
+	BSSGP[0].receive(tr_GMM_DET_REQ_MT(c_GMM_DTT_MT_IMSI_DETACH, ?, ?));
 	f_send_l3_gmm_llc(ts_GMM_DET_ACCEPT_MO);
 
 	setverdict(pass);
@@ -1823,15 +1819,15 @@
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
 
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 			/* break */
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
 			mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
 			f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
 			/* ignore ID REQ IMEI */
 			count_req := count_req + 1;
 			repeat;
@@ -1871,15 +1867,15 @@
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
 
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 			/* break */
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
 			/* ignore ID REQ IMSI */
 			count_req := count_req + 1;
 			repeat;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
 			mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
 			f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
 			repeat;
@@ -1931,7 +1927,7 @@
 
 private function f_TC_attach_closed_imsi_added(charstring id) runs on BSSGP_ConnHdlr {
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 
 	/* unregister the old IMSI */
 	f_bssgp_client_unregister(g_pars.imsi);
@@ -1945,12 +1941,12 @@
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 			setverdict(fail, "Received unexpected GMM Attach REJECT");
 			mtc.stop;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> value bd {
-			f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+		[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT(*, *, *)) -> value l3_mt {
+			f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 			f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
 			setverdict(pass);
 		}
@@ -2004,7 +2000,7 @@
 		[] T.timeout {
 			/* break */
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT(*, *, *)) {
 			/* ignore */
 			count_req := count_req + 1;
 			T.start;
@@ -2032,17 +2028,17 @@
 }
 
 private function f_routing_area_update(RoutingAreaIdentificationV ra, integer bssgp := 0) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 
 	/* then send RAU */
 	f_send_l3_gmm_llc(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit), bssgp);
 	alt {
-	[] BSSGP[bssgp].receive(tr_BD_L3_MT(tr_GMM_RAU_ACCEPT)) -> value bd {
-		f_process_rau_accept(bd.l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, bssgp);
+	[] BSSGP[bssgp].receive(tr_GMM_RAU_ACCEPT) -> value l3_mt {
+		f_process_rau_accept(l3_mt.msgs.gprs_mm.routingAreaUpdateAccept, bssgp);
 		f_send_l3_gmm_llc(ts_GMM_RAU_COMPL, bssgp);
 		setverdict(pass);
 		}
-	[] BSSGP[bssgp].receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) {
+	[] BSSGP[bssgp].receive(tr_GMM_RAU_REJECT) {
 		setverdict(fail, "Unexpected RAU Reject");
 		mtc.stop;
 		}
@@ -2051,8 +2047,6 @@
 }
 
 private function f_TC_attach_rau_a_a(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
-
 	/* first perform regular attach */
 	f_TC_attach(id);
 
@@ -2081,8 +2075,6 @@
 }
 
 private function f_TC_attach_rau_a_b(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
-
 	f_TC_attach(id);
 
 	log("attach complete sending rau");
@@ -2117,21 +2109,21 @@
 	var integer count_req := 0;
 	var MobileL3_CommonIE_Types.MobileIdentityLV mi;
 	var RoutingAreaIdentificationV rand_rai := f_random_RAI();
-	var BssgpDecoded bd;
+	var PDU_L3_SGSN_MS l3_mt;
 
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
 
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 			setverdict(fail, "Unexpected GMM ATTACH REJECT");
 			mtc.stop;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
 			mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
 			f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
 			/* send out a second GMM_Attach Request.
 			 * If the SGSN follows the rules, this 2nd ATTACH REQ should be ignored, because
 			 * of the same content */
@@ -2144,21 +2136,21 @@
 
 	/* we've sent already a IMEI answer, we should NOT asked again for IMEI */
 	alt {
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('001'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('001'B)) {
 			mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
 			f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ID_REQ('010'B))) {
+		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
 			setverdict(fail, "Unexpected GMM ID REQ (IMEI).");
 			mtc.stop;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) {
+		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
 			setverdict(fail, "Unexpected GMM ATTACH REJECT");
 			mtc.stop;
 		}
-		[] BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-			f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+		[] BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+			f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 			f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
 			setverdict(pass);
 			/* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */
@@ -2186,7 +2178,6 @@
 }
 
 private function f_TC_attach_usim_resync(charstring id) runs on BSSGP_ConnHdlr {
-	var BssgpDecoded bd;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
 	var template PDU_L3_MS_SGSN attach_req := ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit);
@@ -2227,7 +2218,7 @@
 
 	var template PDU_L3_SGSN_MS auth_ciph_req := tr_GMM_AUTH_REQ(g_pars.vec.rand);
 	auth_ciph_req.msgs.gprs_mm.authenticationAndCipheringRequest.authenticationParameterAUTN := autn;
-	BSSGP[0].receive(tr_BD_L3_MT(auth_ciph_req)) -> value bd;
+	BSSGP[0].receive(auth_ciph_req) -> value l3_mt;
 
 	/* send the gmm auth failure with resync IE */
 	f_send_l3_gmm_llc(ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(g_pars.vec.auts));
@@ -2259,8 +2250,7 @@
 	/* wait for the new Auth Request */
 	auth_ciph_req := tr_GMM_AUTH_REQ(g_pars.vec.rand);
 	auth_ciph_req.msgs.gprs_mm.authenticationAndCipheringRequest.authenticationParameterAUTN := autn;
-	BSSGP[0].receive(tr_BD_L3_MT(auth_ciph_req)) -> value bd;
-	l3_mt := bd.l3_mt;
+	BSSGP[0].receive(auth_ciph_req) -> value l3_mt;
 	var BIT4 ac_ref := l3_mt.msgs.gprs_mm.authenticationAndCipheringRequest.acReferenceNumber.valueField;
 	var template PDU_L3_MS_SGSN auth_ciph_resp := ts_GMM_AUTH_RESP_2G(ac_ref, g_pars.vec.sres);
 	auth_ciph_resp := ts_GMM_AUTH_RESP_2G(ac_ref, g_pars.vec.sres);
@@ -2284,8 +2274,8 @@
 	/* Expect SGSN to perform LU with HLR */
 	f_gmm_gsup_lu_isd();
 
-	BSSGP[0].receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
-		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
+	BSSGP[0].receive(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?)) -> value l3_mt {
+		f_process_attach_accept(l3_mt.msgs.gprs_mm.attachAccept);
 	}
 	f_send_l3_gmm_llc(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
@@ -2337,7 +2327,7 @@
 	f_gmm_attach(false, false);
 	f_sleep(1.0);
 	f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LLGMM, LLC_CR_UL_CMD));
-	BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LLGMM, LLC_CR_DL_RSP)));
+	BSSGP[0].receive(tr_LLC_DM(?, c_LLC_SAPI_LLGMM, LLC_CR_DL_RSP));
 	setverdict(pass);
 }
 testcase TC_llc_sabm_dm_llgmm() runs on test_CT {
@@ -2353,7 +2343,7 @@
 	f_gmm_attach(false, false);
 	f_sleep(1.0);
 	f_send_llc(ts_LLC_SABM({}, '1'B, c_LLC_SAPI_LL5, LLC_CR_UL_CMD));
-	BSSGP[0].receive(tr_BD_LLC(tr_LLC_DM(?, c_LLC_SAPI_LL5, LLC_CR_DL_RSP)));
+	BSSGP[0].receive(tr_LLC_DM(?, c_LLC_SAPI_LL5, LLC_CR_DL_RSP));
 	setverdict(pass);
 }
 testcase TC_llc_sabm_dm_ll5() runs on test_CT {
@@ -2380,7 +2370,7 @@
 	xid_rx := { tr_XID_L3(''O) };
 	f_send_llc(ts_LLC_XID_MO_CMD(xid, apars.sapi));
 	alt {
-	[] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID(xid_rx, apars.sapi)));
+	[] BSSGP[0].receive(tr_LLC_XID(xid_rx, apars.sapi));
 	[] as_xid(apars);
 	}
 	setverdict(pass);
@@ -2408,7 +2398,7 @@
 	xid_rx := { tr_XID_N201U(1234) };
 	f_send_llc(ts_LLC_XID_MO_CMD(xid, apars.sapi));
 	alt {
-	[] BSSGP[0].receive(tr_BD_LLC(tr_LLC_XID_MT_RSP(xid_rx, apars.sapi)));
+	[] BSSGP[0].receive(tr_LLC_XID_MT_RSP(xid_rx, apars.sapi));
 	[] as_xid(apars);
 	}
 	setverdict(pass);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/13865
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8c1082880902dd9a04935945f0293895f4d0c53a
Gerrit-Change-Number: 13865
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190818/2d56fab7/attachment.html>


More information about the gerrit-log mailing list