summaryrefslogtreecommitdiffstats
path: root/sysinfo
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-14 22:26:33 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-14 22:26:33 +0200
commitb622a3dcc2b5f4ecdd7e9aaac6e51bd9c66adb0d (patch)
tree3de6125e8fd4f49f3db477e5417bf7a15c5d80c5 /sysinfo
parent3d4df7f8f14981d4a131ada389740a3f3a14976c (diff)
sysinfo/Test.ttcn: Add GSMTAP receiver example
Diffstat (limited to 'sysinfo')
-rw-r--r--sysinfo/GSMTAP_Types.ttcn2
-rw-r--r--sysinfo/Test.ttcn52
2 files changed, 54 insertions, 0 deletions
diff --git a/sysinfo/GSMTAP_Types.ttcn b/sysinfo/GSMTAP_Types.ttcn
index 9e7d980..3288284 100644
--- a/sysinfo/GSMTAP_Types.ttcn
+++ b/sysinfo/GSMTAP_Types.ttcn
@@ -3,6 +3,8 @@ module GSMTAP_Types {
const uint8_t GSMTAP_VERSION := 2;
+ const uint16_t GSMTAP_PORT := 4729;
+
type enumerated GsmtapMsgType {
GSMTAP_TYPE_UM (1),
GSMTAP_TYPE_ABIS (2),
diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn
index b3506c0..c7ce0f9 100644
--- a/sysinfo/Test.ttcn
+++ b/sysinfo/Test.ttcn
@@ -1,5 +1,8 @@
module Test {
import from GSM_SystemInformation all;
+ import from GSMTAP_Types all;
+ import from GSMTAP_PortType all;
+ import from IPL4_GSMTAP_CtrlFunct all;
const octetstring si1 := '5506198fb38000000000000000000000000000e504002b'O;
const octetstring si2 := '59061a00000000000000000000000000000000ffe50400'O;
@@ -7,6 +10,7 @@ module Test {
const octetstring si4 := '31061c62f22404d25d40e504002b2b2b2b2b2b2b2b2b2b'O;
type component dummy_CT {
+ port GSMTAP_PT GSMTAP;
};
testcase TC_si1() runs on dummy_CT {
@@ -22,7 +26,55 @@ module Test {
log("SI: ", dec_SystemInformation(si4));
}
+ template GsmtapHeader t_GsmtapHeader := {
+ version := GSMTAP_VERSION,
+ hdr_len := 4,
+ msg_type := ?,
+ timeslot := ?,
+ arfcn := ?,
+ signal_dbm := ?,
+ snr_db := ?,
+ frame_number := ?,
+ sub_type := ?,
+ antenna_nr := ?,
+ sub_slot := ?,
+ res := ?
+ }
+
+ template GsmtapHeader t_GsmtapHeaderUm(template GsmtapChannel ch) modifies t_GsmtapHeader := {
+ msg_type := GSMTAP_TYPE_UM,
+ sub_type := ch
+ }
+
+
+ template GsmtapMessage t_bcch := {
+ header := t_GsmtapHeaderUm(GSMTAP_CHANNEL_BCCH),
+ payload := ?
+ }
+
+ template GSMTAP_RecvFrom t_recvfrom(template GsmtapChannel ch) := {
+ connId := ?,
+ remName := ?,
+ remPort := ?,
+ locName := ?,
+ locPort := GSMTAP_PORT,
+ proto := {udp:={}},
+ userData := ?,
+ msg := { header := t_GsmtapHeaderUm(ch), payload := ?}
+ }
+
+ testcase TC_gsmtap() runs on dummy_CT {
+ map(self:GSMTAP, system:GSMTAP);
+ IPL4_GSMTAP_CtrlFunct.f_IPL4_listen(GSMTAP, "0.0.0.0", GSMTAP_PORT, {udp := {}});
+
+ var GSMTAP_RecvFrom rf;
+ GSMTAP.receive(t_recvfrom(GSMTAP_CHANNEL_BCCH)) -> value rf;
+ log("UDP Rx:", rf);
+ log("SI: ", dec_SystemInformation(rf.msg.payload));
+ }
+
control {
execute(TC_si1());
+ execute(TC_gsmtap());
}
}