Change in osmo-ttcn3-hacks[master]: sgsn: Use f_send_l3() instead of 2G speicific f_send_l3_gmm_llc()

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed May 8 07:50:31 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13905


Change subject: sgsn: Use f_send_l3() instead of 2G speicific f_send_l3_gmm_llc()
......................................................................

sgsn: Use f_send_l3() instead of 2G speicific f_send_l3_gmm_llc()

Change-Id: If80da5a94fd786b90f71121b51742c9f70a693eb
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 39 insertions(+), 40 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/13905/1

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 8bd32b1..d76ae5e 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -450,7 +450,7 @@
 	BSSGP[gb_index].send(ts_BSSGP_UL_UD(g_pars.tlli, g_pars.bssgp_cell_id[gb_index], llc_enc));
 }
 
-function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr {
+private function f_send_l3_gmm_llc(template PDU_L3_MS_SGSN l3_mo, integer gb_index := 0) runs on BSSGP_ConnHdlr {
 	var octetstring l3_enc := enc_PDU_L3_MS_SGSN(valueof(l3_mo));
 	var BIT4 sapi := f_llc_sapi_by_l3_mo(valueof(l3_mo));
 	var integer n_u := f_llc_get_n_u_tx(llc[bit2int(sapi)]);
@@ -786,7 +786,7 @@
 private function f_TC_attach_auth_id_timeout(charstring id) runs on BSSGP_ConnHdlr {
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
 	[] BSSGP[0].receive(tr_GMM_ID_REQ(?)) {
 		/* don't send ID Response */
@@ -812,7 +812,7 @@
 private function f_TC_attach_auth_sai_timeout(charstring id) runs on BSSGP_ConnHdlr {
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
 	[] as_mm_identity();
 	[] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); { }
@@ -832,7 +832,7 @@
 private function f_TC_attach_auth_sai_reject(charstring id) runs on BSSGP_ConnHdlr {
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
 	[] as_mm_identity();
 	[] GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); {
@@ -854,7 +854,7 @@
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
 	/* Expect MSC to perform LU with HLR */
 	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi));
@@ -883,7 +883,7 @@
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
 	/* Expect MSC to perform LU with HLR */
 	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) {
@@ -914,7 +914,7 @@
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit));
 	f_gmm_auth();
 	/* Expect MSC to perform LU with HLR */
 	f_gmm_gsup_lu_isd();
@@ -922,7 +922,7 @@
 	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);
+	f_send_l3(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
 }
 testcase TC_attach_combined() runs on test_CT {
@@ -940,12 +940,12 @@
 
 	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_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
 	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);
+	f_send_l3(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
 }
 testcase TC_attach_accept_all() runs on test_CT {
@@ -967,7 +967,7 @@
 
 	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_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	alt {
 	[] as_mm_identity();
 	[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT('07'O)) {
@@ -999,7 +999,7 @@
 private function f_TC_rau_unknown(charstring id) runs on BSSGP_ConnHdlr {
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
 
-	f_send_l3_gmm_llc(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit));
+	f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, old_ra, false, omit, omit));
 	alt {
 	[] BSSGP[0].receive(tr_GMM_RAU_REJECT('0a'O)) {
 		setverdict(pass);
@@ -1035,7 +1035,7 @@
 function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge, integer bssgp_index := 0) runs on BSSGP_ConnHdlr {
 	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);
+	f_send_l3(ts_GMM_DET_REQ_MO(detach_type, power_off), bssgp_index);
 	if (expect_purge) {
 		GSUP.receive(tr_GSUP_PURGE_MS_REQ(g_pars.imsi, OSMO_GSUP_CN_DOMAIN_PS));
 		GSUP.send(ts_GSUP_PURGE_MS_RES(g_pars.imsi));
@@ -1163,7 +1163,7 @@
 		recovery := ts_Recovery(apars.ggsn_restart_ctr);
 	}
 
-	f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
+	f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
 				     apars.apn, apars.pco), gb_idx);
 	GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) -> value g_ud {
 		f_process_gtp_ctx_act_req(apars, g_ud.gtpc);
@@ -1203,7 +1203,7 @@
 	var boolean exp_rej := ispresent(apars.exp_rej_cause);
 	var Gtp1cUnitdata g_ud;
 
-	f_send_l3_gmm_llc(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), gb_idx);
+	f_send_l3(ts_SM_DEACT_PDP_REQ_MO(apars.tid, cause, false, omit), gb_idx);
 	GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, apars.ggsn_tei_c)) -> value g_ud {
 		var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
 		BSSGP[gb_idx].clear;
@@ -1235,7 +1235,7 @@
 
 	alt {
 	[] 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);
+		f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid), gb_idx);
 		}
 	[not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {
 		repeat;
@@ -1421,7 +1421,7 @@
 /* PDP Context activation for not-attached subscriber; expect fail */
 private function f_TC_pdp_act_unattached(charstring id) runs on BSSGP_ConnHdlr {
 	var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
-	f_send_l3_gmm_llc(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
+	f_send_l3(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr,
 				     apars.apn, apars.pco));
 	alt {
 	/* We might want toalso actually expect a PDPC CTX ACT REJ? */
@@ -1569,7 +1569,7 @@
 	var OCT1 cause_network_failure := int2oct(38, 1)
 	alt {
 	[] 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));
+		f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
 		setverdict(pass);
 		}
 	[] as_xid(apars);
@@ -1650,7 +1650,7 @@
 
 	GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {}
 
-	f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+	f_send_l3(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
 	setverdict(pass);
 }
 testcase TC_attach_pdp_act_deact_mt_t3395_expire() runs on test_CT {
@@ -1733,7 +1733,7 @@
 
 	/* MS: receive a Detach Request */
 	BSSGP[0].receive(tr_GMM_DET_REQ_MT(c_GMM_DTT_MT_IMSI_DETACH, ?, ?));
-	f_send_l3_gmm_llc(ts_GMM_DET_ACCEPT_MO);
+	f_send_l3(ts_GMM_DET_ACCEPT_MO);
 
 	setverdict(pass);
 }
@@ -1824,7 +1824,7 @@
 	var integer count_req := 0;
 	var MobileL3_CommonIE_Types.MobileIdentityLV mi;
 
-	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
 
 	alt {
 		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1832,7 +1832,7 @@
 		}
 		[] 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));
+			f_send_l3(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
 		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
@@ -1872,7 +1872,7 @@
 	/* set p_tmsi to use it in Attach Req via f_mi_get_lv() */
 	g_pars.p_tmsi := 'c0000035'O;
 
-	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
 
 	alt {
 		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1885,7 +1885,7 @@
 		}
 		[] 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));
+			f_send_l3(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
 	}
@@ -1946,7 +1946,7 @@
 	/* there is no auth */
 	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_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit));
 	f_gmm_auth();
 	alt {
 		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -1955,7 +1955,7 @@
 		}
 		[] 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);
+			f_send_l3(ts_GMM_ATTACH_COMPL);
 			setverdict(pass);
 		}
 	}
@@ -1999,7 +1999,7 @@
 private function f_TC_attach_check_complete_resend(charstring id) runs on BSSGP_ConnHdlr {
 	var integer count_req := 0;
 
-	f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), f_random_RAI(), true, false, omit, omit));
 	f_gmm_auth();
 
 	timer T := 10.0;
@@ -2039,11 +2039,11 @@
 	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);
+	f_send_l3(ts_GMM_RAU_REQ(f_mi_get_lv(), GPRS_UPD_T_RA, g_pars.ra, false, omit, omit), bssgp);
 	alt {
 	[] 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);
+		f_send_l3(ts_GMM_RAU_COMPL, bssgp);
 		setverdict(pass);
 		}
 	[] BSSGP[bssgp].receive(tr_GMM_RAU_REJECT) {
@@ -2119,7 +2119,7 @@
 	var RoutingAreaIdentificationV rand_rai := f_random_RAI();
 	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));
+	f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
 
 	alt {
 		[] BSSGP[0].receive(tr_GMM_ATTACH_REJECT(?)) {
@@ -2128,16 +2128,16 @@
 		}
 		[] 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));
+			f_send_l3(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
 		[] 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 */
-			f_send_l3_gmm_llc(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
+			f_send_l3(ts_GMM_ATTACH_REQ(f_mi_get_lv(), rand_rai, true, false, omit, omit));
 			mi := valueof(ts_MI_IMEI_LV(g_pars.imei));
-			f_send_l3_gmm_llc(ts_GMM_ID_RESP(mi));
+			f_send_l3(ts_GMM_ID_RESP(mi));
 		}
 	}
 	f_sleep(1.0);
@@ -2146,7 +2146,7 @@
 	alt {
 		[] 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));
+			f_send_l3(ts_GMM_ID_RESP(mi));
 			repeat;
 		}
 		[] BSSGP[0].receive(tr_GMM_ID_REQ('010'B)) {
@@ -2159,7 +2159,7 @@
 		}
 		[] 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);
+			f_send_l3(ts_GMM_ATTACH_COMPL);
 			setverdict(pass);
 			/* FIXME: Extract P-TMSI, if any. Only send Complete if necessary */
 		}
@@ -2197,7 +2197,7 @@
 	/* The thing is, if the solSACapability is 'omit', then the
 	 * revisionLevelIndicatior is at the wrong place! */
 	attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.solSACapability := '0'B;
-	f_send_l3_gmm_llc(attach_req);
+	f_send_l3(attach_req);
 
 	/* do the auth */
 	var PDU_L3_MS_SGSN l3_mo;
@@ -2229,7 +2229,7 @@
 	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));
+	f_send_l3(ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC(g_pars.vec.auts));
 
 	/* wait for the GSUP resync request */
 	GSUP.receive(tr_GSUP_SAI_REQ_UMTS_AKA_RESYNC(
@@ -2276,7 +2276,7 @@
 		l3_mo.msgs.gprs_mm.authenticationAndCipheringResponse.imeisv :=
 					valueof(ts_MI_IMEISV_TLV(g_pars.imei & '0'H));
 	}
-	f_send_l3_gmm_llc(l3_mo);
+	f_send_l3(l3_mo);
 	deactivate(di);
 
 	/* Expect SGSN to perform LU with HLR */
@@ -2285,7 +2285,7 @@
 	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);
+	f_send_l3(ts_GMM_ATTACH_COMPL);
 	setverdict(pass);
 }
 
@@ -2420,7 +2420,6 @@
 }
 
 
-
 control {
 	execute( TC_attach() );
 	execute( TC_attach_mnc3() );

-- 
To view, visit https://gerrit.osmocom.org/13905
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If80da5a94fd786b90f71121b51742c9f70a693eb
Gerrit-Change-Number: 13905
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190508/eb0260c6/attachment.html>


More information about the gerrit-log mailing list