summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-17 09:40:03 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-18 10:25:56 +0100
commit311ec27f42a4e030ea1e4be758e011119b135f66 (patch)
tree17779b5ad759b09fd515ba47a7362aebcd7aff16 /sgsn
parent23178c590ec1ad931fab36fa177f7135f111a5e8 (diff)
sgsn: Reduce code duplication by introducing f_gmm_gsup_lu_isd()
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn19
1 files changed, 11 insertions, 8 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 248a9c3..70e8124 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -247,6 +247,7 @@ altstep as_mm_identity() runs on BSSGP_ConnHdlr {
}
}
+/* perform GMM authentication (if expected) */
function f_gmm_auth () runs on BSSGP_ConnHdlr {
var BssgpDecoded bd;
var PDU_L3_MS_SGSN l3_mo;
@@ -314,6 +315,14 @@ private function f_mi_get_lv() runs on BSSGP_ConnHdlr return MobileIdentityLV {
}
}
+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();
@@ -321,10 +330,7 @@ private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr {
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_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);
@@ -474,10 +480,7 @@ private function f_TC_attach_combined(charstring id) runs on BSSGP_ConnHdlr {
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_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd {
f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept);