summaryrefslogtreecommitdiffstats
path: root/library/GSMTAP_Types.ttcn
blob: 32882844c2f168a61ce16d8b4c3ed1184725d797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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" };