GNU Radio's GSM Package: gsmtap.h Source File

GNU Radio's GSM Package

gsmtap.h
Go to the documentation of this file.
1 #ifndef _GSMTAP_H
2 #define _GSMTAP_H
3
4 /* gsmtap header, pseudo-header in front of the actua GSM payload */
5
6 /* GSMTAP is a generic header format for GSM protocol captures,
7 * it uses the IANA-assigned UDP port number 4729 and carries
8 * payload in various formats of GSM interfaces such as Um MAC
9 * blocks or Um bursts.
10 *
11 * Example programs generating GSMTAP data are airprobe
12 * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/)
13 */
14
15 #include <stdint.h>
16
17 #define GSMTAP_VERSION 0x02
18
19 #define GSMTAP_TYPE_UM 0x01 /* A Layer 2 MAC block (23 bytes) */
20 #define GSMTAP_TYPE_ABIS 0x02
21 #define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */
22
23 #define GSMTAP_BURST_UNKNOWN 0x00
24 #define GSMTAP_BURST_FCCH 0x01
25 #define GSMTAP_BURST_PARTIAL_SCH 0x02
26 #define GSMTAP_BURST_SCH 0x03
27 #define GSMTAP_BURST_CTS_SCH 0x04
28 #define GSMTAP_BURST_COMPACT_SCH 0x05
29 #define GSMTAP_BURST_NORMAL 0x06
30 #define GSMTAP_BURST_DUMMY 0x07
31 #define GSMTAP_BURST_ACCESS 0x08
32 #define GSMTAP_BURST_NONE 0x09
33
34 #define GSMTAP_CHANNEL_UNKNOWN 0x00
35 #define GSMTAP_CHANNEL_BCCH 0x01
36 #define GSMTAP_CHANNEL_CCCH 0x02
37 #define GSMTAP_CHANNEL_RACH 0x03
38 #define GSMTAP_CHANNEL_AGCH 0x04
39 #define GSMTAP_CHANNEL_PCH 0x05
40 #define GSMTAP_CHANNEL_SDCCH 0x06
41 #define GSMTAP_CHANNEL_SDCCH4 0x07
42 #define GSMTAP_CHANNEL_SDCCH8 0x08
43 #define GSMTAP_CHANNEL_TCH_F 0x09
44 #define GSMTAP_CHANNEL_TCH_H 0x0a
45 #define GSMTAP_CHANNEL_ACCH 0x80
46
47 #define GSMTAP_ARFCN_F_PCS 0x8000
48 #define GSMTAP_ARFCN_F_UPLINK 0x4000
49 #define GSMTAP_ARFCN_MASK 0x3fff
50
51 #define GSMTAP_UDP_PORT 4729 /* officially registered with IANA */
52
53 struct gsmtap_hdr {
54 uint8_t version; /* version, set to GSMTAP_VERSION */
55 uint8_t hdr_len; /* length in number of 32bit words */
56 uint8_t type; /* see GSMTAP_TYPE_* */
57 uint8_t timeslot; /* timeslot (0..7 on Um) */
58
59 uint16_t arfcn; /* ARFCN (frequency) */
60 int8_t signal_dbm; /* signal level in dBm */
61 int8_t snr_db; /* signal/noise ratio in dB */
62
63 uint32_t frame_number; /* GSM Frame Number (FN) */
64
65 uint8_t sub_type; /* Type of burst/channel, see above */
66 uint8_t antenna_nr; /* Antenna Number */
67 uint8_t sub_slot; /* sub-slot within timeslot */
68 uint8_t res; /* reserved for future use (RFU) */
69
70 } __attribute__((packed));
71
72 #endif /* _GSMTAP_H */
gsmtap_hdr::arfcn
uint16_t arfcn
Definition: gsmtap.h:59
gsmtap_hdr::hdr_len
uint8_t hdr_len
Definition: gsmtap.h:55
gsmtap_hdr::version
uint8_t version
Definition: gsmtap.h:54
gsmtap_hdr::signal_dbm
int8_t signal_dbm
Definition: gsmtap.h:60
gsmtap_hdr::frame_number
uint32_t frame_number
Definition: gsmtap.h:63
gsmtap_hdr::sub_slot
uint8_t sub_slot
Definition: gsmtap.h:67
gsmtap_hdr::timeslot
uint8_t timeslot
Definition: gsmtap.h:57
gsmtap_hdr::sub_type
uint8_t sub_type
Definition: gsmtap.h:65
gsmtap_hdr::type
uint8_t type
Definition: gsmtap.h:56
gsmtap_hdr::antenna_nr
uint8_t antenna_nr
Definition: gsmtap.h:66
gsmtap_hdr
Definition: gsmtap.h:53
gsmtap_hdr::res
uint8_t res
Definition: gsmtap.h:68
__attribute__
struct gsmtap_hdr __attribute__((packed))
gsmtap_hdr::snr_db
int8_t snr_db
Definition: gsmtap.h:61