[PATCH] osmo-ttcn3-hacks[master]: msc: move f_gen_{imei, imsi, msisdn} to L3_Templates.ttcn

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Feb 16 17:21:18 UTC 2018


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

msc: move f_gen_{imei,imsi,msisdn} to L3_Templates.ttcn

This allows them to be reused in upcoming SGSN tests.

Change-Id: I0459eeb44e58342da656f2312560466698374b72
---
M library/L3_Templates.ttcn
M msc/MSC_Tests.ttcn
2 files changed, 21 insertions(+), 20 deletions(-)


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

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 @@
 	}
 }
 
+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 @@
 
 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;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0459eeb44e58342da656f2312560466698374b72
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