summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-16 14:46:15 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-16 20:03:47 +0100
commite5695f5544d99ef71c1b4f09db10dd68aaf45c92 (patch)
tree70b74ac45ec2a160c00ce76bf3efe4fdb0ea1b24
parent38575a753b155d26fb6ba1ddd51983273833caca (diff)
msc: move f_gen_{imei,imsi,msisdn} to L3_Templates.ttcn
This allows them to be reused in upcoming SGSN tests. Change-Id: I0459eeb44e58342da656f2312560466698374b72
-rw-r--r--library/L3_Templates.ttcn21
-rw-r--r--msc/MSC_Tests.ttcn20
2 files changed, 21 insertions, 20 deletions
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index a3db409..76725fc 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1472,5 +1472,26 @@ template (value) PDU_L3_MS_SGSN ts_GMM_DET_REQ_MO(BIT3 dtt := c_GMM_DTT_MO_GPRS)
}
}
+private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {
+ var integer suffix_len := tot_len - lengthof(prefix);
+ var charstring suffix_ch := int2str(suffix);
+ var integer pad_len := suffix_len - lengthof(suffix_ch);
+
+ return prefix & int2hex(0, pad_len) & str2hex(suffix_ch);
+}
+
+function f_gen_imei(integer suffix) return hexstring {
+ return f_concat_pad(15, '49999'H, suffix);
+}
+
+function f_gen_imsi(integer suffix) return hexstring {
+ return f_concat_pad(15, '26242'H, suffix);
+}
+
+function f_gen_msisdn(integer suffix) return hexstring {
+ return f_concat_pad(12, '49123'H, suffix);
+}
+
+
}
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 7a42f05..806ea6d 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -336,26 +336,6 @@ modifies ts_BSSAP_BSSMAP := {
type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr;
-private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring {
- var integer suffix_len := tot_len - lengthof(prefix);
- var charstring suffix_ch := int2str(suffix);
- var integer pad_len := suffix_len - lengthof(suffix_ch);
-
- return prefix & int2hex(0, pad_len) & str2hex(suffix_ch);
-}
-
-function f_gen_imei(integer suffix) return hexstring {
- return f_concat_pad(15, '49999'H, suffix);
-}
-
-function f_gen_imsi(integer suffix) return hexstring {
- return f_concat_pad(15, '26242'H, suffix);
-}
-
-function f_gen_msisdn(integer suffix) return hexstring {
- return f_concat_pad(12, '49123'H, suffix);
-}
-
/* FIXME: move into BSC_ConnectionHandler? */
function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr {
var BSC_ConnHdlr vc_conn;