diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-06-30 12:32:00 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-30 12:32:00 +0200 |
commit | f7460f5292e155461f341319c08386223ec58c76 (patch) | |
tree | 5bf590bb7a59abad383738f62896d4cc149b4591 /gsm-receiver/src/lib/decoder/gsmtap.h | |
parent | 674fa86a9a1e36121e517aed841a83a130547c0d (diff) |
[gsm-receiver] Update to new GSMTAP version
In wireshark mainline, there is a UDP-based GSMTAP version which
is much different from our pcap-file / link-type based one.
This commit updates the gsmtap support in gsm-receiver to use
the same format as understood by wireshark mainline.
However, it introduces a build and runtime dependency to
libosmocore (git://git.osmocom.org/libosmocore.git).
Diffstat (limited to 'gsm-receiver/src/lib/decoder/gsmtap.h')
-rw-r--r-- | gsm-receiver/src/lib/decoder/gsmtap.h | 59 |
1 files changed, 45 insertions, 14 deletions
diff --git a/gsm-receiver/src/lib/decoder/gsmtap.h b/gsm-receiver/src/lib/decoder/gsmtap.h index 1022194..dcd64bd 100644 --- a/gsm-receiver/src/lib/decoder/gsmtap.h +++ b/gsm-receiver/src/lib/decoder/gsmtap.h @@ -1,11 +1,20 @@ #ifndef _GSMTAP_H #define _GSMTAP_H -/* gsmtap header, pseudo-header in front of the actua GSM payload*/ +/* gsmtap header, pseudo-header in front of the actua GSM payload */ -#include <sys/types.h> +/* GSMTAP is a generic header format for GSM protocol captures, + * it uses the IANA-assigned UDP port number 4729 and carries + * payload in various formats of GSM interfaces such as Um MAC + * blocks or Um bursts. + * + * Example programs generating GSMTAP data are airprobe + * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/) + */ -#define GSMTAP_VERSION 0x01 +#include <stdint.h> + +#define GSMTAP_VERSION 0x02 #define GSMTAP_TYPE_UM 0x01 #define GSMTAP_TYPE_ABIS 0x02 @@ -20,22 +29,44 @@ #define GSMTAP_BURST_NORMAL 0x06 #define GSMTAP_BURST_DUMMY 0x07 #define GSMTAP_BURST_ACCESS 0x08 +#define GSMTAP_BURST_NONE 0x09 + +#define GSMTAP_CHANNEL_UNKNOWN 0x00 +#define GSMTAP_CHANNEL_BCCH 0x01 +#define GSMTAP_CHANNEL_CCCH 0x02 +#define GSMTAP_CHANNEL_RACH 0x03 +#define GSMTAP_CHANNEL_AGCH 0x04 +#define GSMTAP_CHANNEL_PCH 0x05 +#define GSMTAP_CHANNEL_SDCCH 0x06 +#define GSMTAP_CHANNEL_SDCCH4 0x07 +#define GSMTAP_CHANNEL_SDCCH8 0x08 +#define GSMTAP_CHANNEL_TCH_F 0x09 +#define GSMTAP_CHANNEL_TCH_H 0x0a +#define GSMTAP_CHANNEL_ACCH 0x80 + +#define GSMTAP_ARFCN_F_PCS 0x8000 +#define GSMTAP_ARFCN_F_UPLINK 0x4000 +#define GSMTAP_ARFCN_MASK 0x3fff + +#define GSMTAP_UDP_PORT 4729 struct gsmtap_hdr { - u_int8_t version; /* version, set to 0x01 currently */ - u_int8_t hdr_len; /* length in number of 32bit words */ - u_int8_t type; /* see GSMTAP_TYPE_* */ - u_int8_t timeslot; /* timeslot (0..7 on Um) */ + uint8_t version; /* version, set to 0x01 currently */ + uint8_t hdr_len; /* length in number of 32bit words */ + uint8_t type; /* see GSMTAP_TYPE_* */ + uint8_t timeslot; /* timeslot (0..7 on Um) */ - u_int16_t arfcn; /* ARFCN (frequency) */ - u_int8_t noise_db; /* noise figure in dB */ - u_int8_t signal_db; /* signal level in dB */ + uint16_t arfcn; /* ARFCN (frequency) */ + int8_t signal_dbm; /* signal level in dBm */ + int8_t snr_db; /* signal/noise ratio in dB */ - u_int32_t frame_number; /* GSM Frame Number (FN) */ + uint32_t frame_number; /* GSM Frame Number (FN) */ - u_int8_t burst_type; /* Type of burst, see above */ - u_int8_t antenna_nr; /* Antenna Number */ - u_int16_t res; /* reserved for future use (RFU) */ + uint8_t sub_type; /* Type of burst/channel, see above */ + uint8_t antenna_nr; /* Antenna Number */ + uint8_t sub_slot; /* sub-slot within timeslot */ + uint8_t res; /* reserved for future use (RFU) */ } __attribute__((packed)); + #endif /* _GSMTAP_H */ |