summaryrefslogtreecommitdiffstats
path: root/sysinfo
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-14 18:58:07 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-14 18:58:07 +0200
commitddeaa5769c7ba11aa3519186be0c701260132029 (patch)
treea7f81021e6adb5495a70799e62b4010327ec500f /sysinfo
parent615bd54fbe1bdd8fce796f3212572305fad3aeb4 (diff)
Add GSMTAP header and message definition
Diffstat (limited to 'sysinfo')
-rw-r--r--sysinfo/GSMTAP_Types.ttcn75
-rw-r--r--sysinfo/Osmocom_Types.ttcn17
2 files changed, 90 insertions, 2 deletions
diff --git a/sysinfo/GSMTAP_Types.ttcn b/sysinfo/GSMTAP_Types.ttcn
new file mode 100644
index 0000000..9e7d980
--- /dev/null
+++ b/sysinfo/GSMTAP_Types.ttcn
@@ -0,0 +1,75 @@
+module GSMTAP_Types {
+ import from Osmocom_Types all;
+
+ const uint8_t GSMTAP_VERSION := 2;
+
+ 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" };
diff --git a/sysinfo/Osmocom_Types.ttcn b/sysinfo/Osmocom_Types.ttcn
index 9368626..6fe1b57 100644
--- a/sysinfo/Osmocom_Types.ttcn
+++ b/sysinfo/Osmocom_Types.ttcn
@@ -1,15 +1,28 @@
module Osmocom_Types {
- type integer uint32_t (0..4294967295) with { variant "unsigned 32 bit" };
+ type integer uint8_t (0..255) with { variant "unsigned 8 bit" };
type integer uint16_t (0..65535) with { variant "unsigned 16 bit" };
+ type integer uint32_t (0..4294967295) with { variant "unsigned 32 bit" };
+
+ type integer int8_t (-128..127) with { variant "8 bit" };
+ type integer int16_t (-32768..32767) with { variant "16 bit" };
+
type integer uint2_t (0..3) with { variant "unsigned 2 bit" };
type integer uint3_t (0..7) with { variant "unsigned 3 bit" };
type integer uint4_t (0..15) with { variant "unsigned 4 bit" };
type integer uint5_t (0..31) with { variant "unsigned 5 bit" };
type integer uint6_t (0..63) with { variant "unsigned 6 bit" };
type integer uint7_t (0..127) with { variant "unsigned 7 bit" };
- type integer uint8_t (0..255) with { variant "unsigned 8 bit" };
type integer uint9_t (0..511) with { variant "unsigned 9 bit" };
type integer uint10_t (0..1023) with { variant "unsigned 10 bit" };
type integer uint11_t (0..2047) with { variant "unsigned 11 bit" };
type integer uint12_t (0..4095) with { variant "unsigned 12 bit" };
+ type integer uint13_t (0..8191) with { variant "unsigned 13 bit" };
+ type integer uint14_t (0..16383) with { variant "unsigned 14 bit" };
+ type integer uint15_t (0..32767) with { variant "unsigned 15 bit" };
+
+ type record Arfcn {
+ boolean pcs,
+ uint15_t arfcn
+ } with { variant "" };
+
} with { encode "RAW"; variant "FIELDORDER(msb)" }