summaryrefslogtreecommitdiffstats
path: root/library/GSMTAP_Types.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-19 19:57:26 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-19 19:57:26 +0200
commit3b8bdd63580a10b74c7556bd8fb6e2629e6b5734 (patch)
tree3938ad8f3c0887b654b4a5b856dcfe9fe328ef56 /library/GSMTAP_Types.ttcn
parent599faa1d1882cc35114c88727714e51a6a1bad95 (diff)
Introduce 'library' directory for modules shared by multiple test cases
Diffstat (limited to 'library/GSMTAP_Types.ttcn')
-rw-r--r--library/GSMTAP_Types.ttcn77
1 files changed, 77 insertions, 0 deletions
diff --git a/library/GSMTAP_Types.ttcn b/library/GSMTAP_Types.ttcn
new file mode 100644
index 0000000..3288284
--- /dev/null
+++ b/library/GSMTAP_Types.ttcn
@@ -0,0 +1,77 @@
+module GSMTAP_Types {
+ import from Osmocom_Types all;
+
+ const uint8_t GSMTAP_VERSION := 2;
+
+ const uint16_t GSMTAP_PORT := 4729;
+
+ type enumerated GsmtapMsgType {
+ GSMTAP_TYPE_UM (1),
+ GSMTAP_TYPE_ABIS (2),
+ GSMTAP_TYPE_UM_BURST (3),
+ GSMTAP_TYPE_SIM (4),
+ GSMTAP_TYPE_TETRA_I1 (5),
+ GSMTAP_TYPE_TETRA_I1_BURST (6),
+ GSMTAP_TYPE_WMX_BURST (7),
+ GSMTAP_TYPE_GB_LLC (8),
+ GSMTAP_TYPE_GB_SNDCP (9),
+ GSMTAP_TYPE_GMR1_UM (10),
+ GSMTAP_TYPE_UMTS_RLC_MAC (11),
+ GSMTAP_TYPE_UMTS_RRC (12),
+ GSMTAP_TYPE_LTE_RRC (13),
+ GSMTAP_TYPE_LTE_MAC (14),
+ GSMTAP_TYPE_LTE_MAC_FRAMED (15),
+ GSMTAP_TYPE_OSMOCORE_LOG (16),
+ GSMTAP_TYPE_QC_DIAG (17)
+ } with { variant "FIELDLENGTH(8)" };
+
+ type enumerated GsmtapChannel {
+ GSMTAP_CHANNEL_UNKNOWN (0),
+ GSMTAP_CHANNEL_BCCH (1),
+ GSMTAP_CHANNEL_CCCH (2),
+ GSMTAP_CHANNEL_RACH (3),
+ GSMTAP_CHANNEL_AGCH (4),
+ GSMTAP_CHANNEL_PCH (5),
+ GSMTAP_CHANNEL_SDCCH (6),
+ GSMTAP_CHANNEL_SDCCH4 (7),
+ GSMTAP_CHANNEL_SDCCH8 (8),
+ GSMTAP_CHANNEL_TCH_F (9),
+ GSMTAP_CHANNEL_TCH_H (10),
+ GSMTAP_CHANNEL_PACCH (11),
+ GSMTAP_CHANNEL_CBCH52 (12),
+ GSMTAP_CHANNEL_PDCH (13),
+ GSMTAP_CHANNEL_PTCCH (14),
+ GSMTAP_CHANNEL_CBCH51 (15)
+ } with { variant "FIELDLENGTH(8)" };
+
+ type record GsmtapHeader {
+ uint8_t version,
+ uint8_t hdr_len,
+ GsmtapMsgType msg_type,
+ uint8_t timeslot,
+ Arfcn arfcn,
+ int8_t signal_dbm,
+ int8_t snr_db,
+ uint32_t frame_number,
+ GsmtapChannel sub_type,
+ uint8_t antenna_nr,
+ uint8_t sub_slot,
+ uint8_t res
+ } with { variant (hdr_len) "LENGTHTO(version, hdr_len, msg_type, timeslot, arfcn, signal_dbm, snr_db, frame_number, sub_type, antenna_nr, sub_slot, res), UNIT(dword32)" }
+
+ external function enc_GsmtapHeader(in GsmtapHeader si) return octetstring
+ with { extension "prototype(convert) encode(RAW)" };
+ external function dec_GsmtapHeader(in octetstring stream) return GsmtapHeader
+ with { extension "prototype(convert) decode(RAW)" };
+
+ type record GsmtapMessage {
+ GsmtapHeader header,
+ octetstring payload optional
+ } with { variant "" };
+
+ external function enc_GsmtapMessage(in GsmtapMessage si) return octetstring
+ with { extension "prototype(convert) encode(RAW)" };
+ external function dec_GsmtapMessage(in octetstring stream) return GsmtapMessage
+ with { extension "prototype(convert) decode(RAW)" };
+
+} with { encode "RAW" };