summaryrefslogtreecommitdiffstats
path: root/include/osmocore/gsmtap.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-02-20 20:34:29 +0100
committerHarald Welte <laforge@gnumonks.org>2010-02-20 20:34:29 +0100
commitec8b4501c7b0bfb286db7789635168d1b84f9105 (patch)
tree0db0073e589513d803d2b5be80580191e215dbe3 /include/osmocore/gsmtap.h
intial checkin of the libosmocore project
Diffstat (limited to 'include/osmocore/gsmtap.h')
-rw-r--r--include/osmocore/gsmtap.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/osmocore/gsmtap.h b/include/osmocore/gsmtap.h
new file mode 100644
index 00000000..81b9cc06
--- /dev/null
+++ b/include/osmocore/gsmtap.h
@@ -0,0 +1,62 @@
+#ifndef _GSMTAP_H
+#define _GSMTAP_H
+
+/* gsmtap header, pseudo-header in front of the actua GSM payload*/
+
+#include <stdint.h>
+
+#define GSMTAP_VERSION 0x01
+
+#define GSMTAP_TYPE_UM 0x01
+#define GSMTAP_TYPE_ABIS 0x02
+#define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */
+
+#define GSMTAP_BURST_UNKNOWN 0x00
+#define GSMTAP_BURST_FCCH 0x01
+#define GSMTAP_BURST_PARTIAL_SCH 0x02
+#define GSMTAP_BURST_SCH 0x03
+#define GSMTAP_BURST_CTS_SCH 0x04
+#define GSMTAP_BURST_COMPACT_SCH 0x05
+#define GSMTAP_BURST_NORMAL 0x06
+#define GSMTAP_BURST_DUMMY 0x07
+#define GSMTAP_BURST_ACCESS 0x08
+#define GSMTAP_BURST_NONE 0x09
+
+#define GSMTAP_UDP_PORT 4729
+
+struct gsmtap_hdr {
+ 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) */
+
+ uint16_t arfcn; /* ARFCN (frequency) */
+ uint8_t noise_db; /* noise figure in dB */
+ uint8_t signal_db; /* signal level in dB */
+
+ uint32_t frame_number; /* GSM Frame Number (FN) */
+
+ uint8_t burst_type; /* Type of burst, see above */
+ uint8_t antenna_nr; /* Antenna Number */
+ uint16_t res; /* reserved for future use (RFU) */
+
+} __attribute__((packed));
+
+
+/* PCAP related definitions */
+#define TCPDUMP_MAGIC 0xa1b2c3d4
+#ifndef LINKTYPE_GSMTAP
+#define LINKTYPE_GSMTAP 2342
+#endif
+struct pcap_timeval {
+ int32_t tv_sec;
+ int32_t tv_usec;
+};
+
+struct pcap_sf_pkthdr {
+ struct pcap_timeval ts; /* time stamp */
+ uint32_t caplen; /* lenght of portion present */
+ uint32_t len; /* length of this packet */
+};
+
+#endif /* _GSMTAP_H */