[PATCH] osmo-ttcn3-hacks[master]: sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_i...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Feb 17 09:17:23 UTC 2018


Review at  https://gerrit.osmocom.org/6560

sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_isd()

Change-Id: I7a43eaa75201fc6c3afba67f6161aef872aca546
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 11 insertions(+), 8 deletions(-)


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

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 755957e..2cf6e28 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -254,6 +254,7 @@
 	}
 }
 
+/* perform GMM authentication (if expected) */
 function f_gmm_auth () runs on BSSGP_ConnHdlr {
 	var BssgpDecoded bd;
 	var PDU_L3_MS_SGSN l3_mo;
@@ -321,6 +322,14 @@
 	}
 }
 
+private function f_gmm_gsup_lu_isd() runs on BSSGP_ConnHdlr {
+	/* Expect MSC to perform LU with HLR */
+	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi));
+	GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn));
+	GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi));
+	GSUP.send(ts_GSUP_UL_RES(g_pars.imsi));
+}
+
 private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr {
 	var BssgpDecoded bd;
 	var RoutingAreaIdentificationV old_ra := f_random_RAI();
@@ -328,10 +337,7 @@
 	BSSGP.send(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));
-	GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn));
-	GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi));
-	GSUP.send(ts_GSUP_UL_RES(g_pars.imsi));
+	f_gmm_gsup_lu_isd();
 
 	BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
 		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
@@ -481,10 +487,7 @@
 	BSSGP.send(ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, true, false, omit, omit));
 	f_gmm_auth();
 	/* Expect MSC to perform LU with HLR */
-	GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi));
-	GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn));
-	GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi));
-	GSUP.send(ts_GSUP_UL_RES(g_pars.imsi));
+	f_gmm_gsup_lu_isd();
 
 	BSSGP.receive(tr_BD_L3(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
 		f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a43eaa75201fc6c3afba67f6161aef872aca546
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list