[PATCH] osmo-ttcn3-hacks[master]: Add L3_Common for shared L3 functions between MSC and SGSN t...

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


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

Add L3_Common for shared L3 functions between MSC and SGSN testing

Change-Id: I16e80df610235849180dc946f9457302deafb9d2
---
A library/L3_Common.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
M msc/gen_links.sh
4 files changed, 35 insertions(+), 26 deletions(-)


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

diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn
new file mode 100644
index 0000000..69ab51d
--- /dev/null
+++ b/library/L3_Common.ttcn
@@ -0,0 +1,32 @@
+module L3_Common {
+
+import from Osmocom_Types all;
+import from General_Types all;
+
+type record AuthVector {
+	OCT16 rand,
+	OCT4 sres,
+	OCT8 kc
+	/* FIXME: 3G elements */
+}
+
+private function f_rnd_oct(integer len) return octetstring {
+	var integer i;
+	var octetstring res;
+	for (i := 0; i < len; i := i + 1) {
+		res[i] := int2oct(float2int(rnd()*256.0), 1);
+	}
+	return res;
+}
+
+function f_gen_auth_vec_2g() return AuthVector {
+	var AuthVector vec;
+	vec.rand := f_rnd_oct(16);
+	vec.sres := f_rnd_oct(4);
+	vec.kc := f_rnd_oct(8);
+	return vec;
+}
+
+
+
+}
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index d50c571..6cacff7 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -26,18 +26,12 @@
 import from MobileL3_MM_Types all;
 import from MobileL3_CC_Types all;
 import from L3_Templates all;
+import from L3_Common all;
 
 /* this component represents a single subscriber connection */
 type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr {
 	var BSC_ConnHdlrPars g_pars;
 	timer g_Tguard := 60.0;
-}
-
-type record AuthVector {
-	OCT16 rand,
-	OCT4 sres,
-	OCT8 kc
-	/* FIXME: 3G elements */
 }
 
 type record BSC_ConnHdlrNetworkPars {
@@ -247,24 +241,6 @@
 							      old_lai, mi, g_pars.cm1));
 	return l3_info;
 }
-
-private function f_rnd_oct(integer len) return octetstring {
-	var integer i;
-	var octetstring res;
-	for (i := 0; i < len; i := i + 1) {
-		res[i] := int2oct(float2int(rnd()*256.0), 1);
-	}
-	return res;
-}
-
-function f_gen_auth_vec_2g() return AuthVector {
-	var AuthVector vec;
-	vec.rand := f_rnd_oct(16);
-	vec.sres := f_rnd_oct(4);
-	vec.kc := f_rnd_oct(8);
-	return vec;
-}
-
 
 function f_mm_auth() runs on BSC_ConnHdlr
 {
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 806ea6d..c46ec80 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -45,6 +45,7 @@
 import from MobileL3_Types all;
 import from MobileL3_CommonIE_Types all;
 import from L3_Templates all;
+import from L3_Common all;
 
 
 type component MTC_CT extends CTRL_Adapter_CT {
diff --git a/msc/gen_links.sh b/msc/gen_links.sh
index 12f99a4..9d3c28e 100755
--- a/msc/gen_links.sh
+++ b/msc/gen_links.sh
@@ -77,7 +77,7 @@
 DIR=../library
 FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc "
 FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn "
-FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn "
+FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Common.ttcn "
 FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn IPA_Emulation.ttcn "
 FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc "
 FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc "

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

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