summaryrefslogtreecommitdiffstats
path: root/sgsn
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2018-07-31 04:16:10 +0200
committerHarald Welte <laforge@gnumonks.org>2018-08-14 13:26:47 +0000
commit8950870d40ed0d1fdb976c19b39e9124cbc843bc (patch)
treea6d06dc7e1f7911326eb66758b6aabba3cdaf2a0 /sgsn
parentbfda92144f90ba3380cbc26524b1ad7fd4205478 (diff)
sgsn: add f_cellid_to_RAI()
Returns a RoutingAreaIdentificationV from GbInstance. This will be useful when using multiple BSSGP and the g_pars.ra field is not the needed ra. Change-Id: Ide96213ab2f210590b86deaf370486c8a0a78058
Diffstat (limited to 'sgsn')
-rw-r--r--sgsn/SGSN_Tests.ttcn16
1 files changed, 16 insertions, 0 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index b55da88..6d91738 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -110,6 +110,22 @@ type record BSSGP_ConnHdlrPars {
float t_guard
};
+private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV {
+ var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc;
+
+ var RoutingAreaIdentificationV ret := {
+ mccDigit1 := mcc_mnc[0],
+ mccDigit2 := mcc_mnc[1],
+ mccDigit3 := mcc_mnc[2],
+ mncDigit3 := mcc_mnc[5],
+ mncDigit1 := mcc_mnc[3],
+ mncDigit2 := mcc_mnc[4],
+ lac := int2oct(cell_id.ra_id.lai.lac, 16),
+ rac := int2oct(cell_id.ra_id.rac, 8)
+ }
+ return ret;
+};
+
private function f_init_gb(inout GbInstance gb, charstring id, integer offset) runs on test_CT {
gb.vc_NS := NS_CT.create(id & "-NS" & int2str(offset));
gb.vc_BSSGP := BSSGP_CT.create(id & "-BSSGP" & int2str(offset));