summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-16 18:11:31 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-16 20:03:47 +0100
commit158a7ca881927687f23354946cea3a984ef078af (patch)
treed018b7e84e8b02df5ce611d27adab17a38d8b6da
parente5695f5544d99ef71c1b4f09db10dd68aaf45c92 (diff)
Add L3_Common for shared L3 functions between MSC and SGSN testing
-rw-r--r--library/L3_Common.ttcn32
-rw-r--r--msc/BSC_ConnectionHandler.ttcn26
-rw-r--r--msc/MSC_Tests.ttcn1
-rwxr-xr-xmsc/gen_links.sh2
4 files changed, 35 insertions, 26 deletions
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,6 +26,7 @@ import from MobileL3_CommonIE_Types all;
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 {
@@ -33,13 +34,6 @@ type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr
timer g_Tguard := 60.0;
}
-type record AuthVector {
- OCT16 rand,
- OCT4 sres,
- OCT8 kc
- /* FIXME: 3G elements */
-}
-
type record BSC_ConnHdlrNetworkPars {
OCT1 kc_support,
boolean expect_tmsi,
@@ -248,24 +242,6 @@ private function f_build_lu(MobileIdentityLV mi) runs on BSC_ConnHdlr return PDU
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
{
if (g_pars.net.expect_auth) {
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 BSC_ConnectionHandler all;
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 @@ gen_links $DIR $FILES
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 "