diff options
Diffstat (limited to 'include/osmocore')
41 files changed, 0 insertions, 5540 deletions
diff --git a/include/osmocore/Makefile.am b/include/osmocore/Makefile.am deleted file mode 100644 index b65589a6..00000000 --- a/include/osmocore/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h bits.h \ - tlv.h bitvec.h comp128.h statistics.h gsm_utils.h utils.h \ - gsmtap.h write_queue.h rsl.h gsm48.h rxlev_stat.h mncc.h \ - gsm48_ie.h logging.h gsm0808.h rate_ctr.h gsmtap_util.h \ - plugin.h crc16.h panic.h process.h gsm0480.h msgfile.h \ - backtrace.h - -if ENABLE_TALLOC -osmocore_HEADERS += talloc.h -endif - -osmocoredir = $(includedir)/osmocore - -SUBDIRS = protocol diff --git a/include/osmocore/backtrace.h b/include/osmocore/backtrace.h deleted file mode 100644 index bbbb2c28..00000000 --- a/include/osmocore/backtrace.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _OSMO_BACKTRACE_H_ -#define _OSMO_BACKTRACE_H_ - -void generate_backtrace(); - -#endif diff --git a/include/osmocore/bits.h b/include/osmocore/bits.h deleted file mode 100644 index 8d4a0789..00000000 --- a/include/osmocore/bits.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _OSMO_BITS_H -#define _OSMO_BITS_H - -#include <stdint.h> - -typedef uint8_t sbit_t; /* soft bit (-127...127) */ -typedef uint8_t ubit_t; /* unpacked bit (0 or 1) */ -typedef uint8_t pbit_t; /* packed bis (8 bits in a byte) */ - -/* - NOTE on the endianess of pbit_t: - Bits in a pbit_t are ordered MSB first, i.e. 0x80 is the first bit. - Bit i in a pbit_t array is array[i/8] & (1<<(7-i%8)) -*/ - -/* determine how many bytes we would need for 'num_bits' packed bits */ -static inline unsigned int osmo_pbit_bytesize(unsigned int num_bits) -{ - unsigned int pbit_bytesize = num_bits / 8; - - if (num_bits % 8) - pbit_bytesize++; - - return pbit_bytesize; -} - -/* convert unpacked bits to packed bits, return length in bytes */ -int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits); - -/* convert packed bits to unpacked bits, return length in bytes */ -int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); - -/* convert unpacked bits to packed bits (extended options but slower), - * return length in bytes (max written ofs of output buffer + 1) */ -int osmo_ubit2pbit_ext(pbit_t *out, unsigned int out_ofs, - const ubit_t *in, unsigned int in_ofs, - unsigned int num_bits, int lsb_mode); - -/* convert packed bits to unpacked bits (extended options but slower), - * return length in bytes (max written ofs of output buffer + 1) */ -int osmo_pbit2ubit_ext(ubit_t *out, unsigned int out_ofs, - const pbit_t *in, unsigned int in_ofs, - unsigned int num_bits, int lsb_mode); - -#endif diff --git a/include/osmocore/bitvec.h b/include/osmocore/bitvec.h deleted file mode 100644 index 42977fb2..00000000 --- a/include/osmocore/bitvec.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _BITVEC_H -#define _BITVEC_H - -/* bit vector utility routines */ - -/* (C) 2009 by Harald Welte <laforge@gnumonks.org> - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - - -/* In GSM mac blocks, every bit can be 0 or 1, or L or H. L/H are - * defined relative to the 0x2b padding pattern */ -enum bit_value { - ZERO = 0, - ONE = 1, - L = 2, - H = 3, -}; - -struct bitvec { - unsigned int cur_bit; /* curser to the next unused bit */ - unsigned int data_len; /* length of data array in bytes */ - uint8_t *data; /* pointer to data array */ -}; - -/* check if the bit is 0 or 1 for a given position inside a bitvec */ -enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr); - -/* check if the bit is L or H for a given position inside a bitvec */ -enum bit_value bitvec_get_bit_pos_high(const struct bitvec *bv, - unsigned int bitnr); - -/* get the Nth set bit inside the bit vector */ -unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n); - -/* Set a bit at given position */ -int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum, - enum bit_value bit); - -/* Set the next bit in the vector */ -int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); - -/* get the next bit (low/high) inside a bitvec */ -int bitvec_get_bit_high(struct bitvec *bv); - -/* Set multiple bits at the current position */ -int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, int count); - -/* Add an unsigned integer (of length count bits) to current position */ -int bitvec_set_uint(struct bitvec *bv, unsigned int in, int count); - -/* get multiple bits (based on numeric value) from current pos */ -int bitvec_get_uint(struct bitvec *bv, int num_bits); - - -/* Pad the bit vector up to a certain bit position */ -int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit); - -#endif /* _BITVEC_H */ diff --git a/include/osmocore/comp128.h b/include/osmocore/comp128.h deleted file mode 100644 index c37808f0..00000000 --- a/include/osmocore/comp128.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * COMP128 header - * - * See comp128.c for details - */ - -#ifndef __COMP128_H__ -#define __COMP128_H__ - -#include <stdint.h> - -/* - * Performs the COMP128 algorithm (used as A3/A8) - * ki : uint8_t [16] - * srand : uint8_t [16] - * sres : uint8_t [4] - * kc : uint8_t [8] - */ -void comp128(uint8_t *ki, uint8_t *srand, uint8_t *sres, uint8_t *kc); - -#endif /* __COMP128_H__ */ - diff --git a/include/osmocore/crc16.h b/include/osmocore/crc16.h deleted file mode 100644 index 7a512490..00000000 --- a/include/osmocore/crc16.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This was copied from the linux kernel and adjusted for our types. - */ -/* - * crc16.h - CRC-16 routine - * - * Implements the standard CRC-16: - * Width 16 - * Poly 0x8005 (x^16 + x^15 + x^2 + 1) - * Init 0 - * - * Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com> - * - * This source code is licensed under the GNU General Public License, - * Version 2. See the file COPYING for more details. - */ - -#ifndef __CRC16_H -#define __CRC16_H - -#include <stdint.h> - -#include <sys/types.h> - -extern uint16_t const crc16_table[256]; - -extern uint16_t crc16(uint16_t crc, const uint8_t *buffer, size_t len); - -static inline uint16_t crc16_byte(uint16_t crc, const uint8_t data) -{ - return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff]; -} - -#endif /* __CRC16_H */ diff --git a/include/osmocore/gsm0480.h b/include/osmocore/gsm0480.h deleted file mode 100644 index b504332e..00000000 --- a/include/osmocore/gsm0480.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef gsm0480_h -#define gsm0480_h - -#include "msgb.h" -#include "protocol/gsm_04_08.h" -#include "protocol/gsm_04_80.h" - -#define MAX_LEN_USSD_STRING 31 - -struct ussd_request { - char text[MAX_LEN_USSD_STRING + 1]; - uint8_t transaction_id; - uint8_t invoke_id; -}; - -int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, - struct ussd_request *request); - -struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); -struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); -struct msgb *gsm0480_create_notifySS(const char *text); - -int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); -int gsm0480_wrap_facility(struct msgb *msg); - -#endif diff --git a/include/osmocore/gsm0808.h b/include/osmocore/gsm0808.h deleted file mode 100644 index 1d853775..00000000 --- a/include/osmocore/gsm0808.h +++ /dev/null @@ -1,46 +0,0 @@ -/* (C) 2009,2010 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2009,2010 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -#ifndef OSMOCORE_GSM0808_H -#define OSMOCORE_GSM0808_H - -#include "tlv.h" - -struct msgb; - -struct msgb *gsm0808_create_layer3(struct msgb *msg, uint16_t netcode, uint16_t countrycode, int lac, uint16_t ci); -struct msgb *gsm0808_create_reset(void); -struct msgb *gsm0808_create_clear_command(uint8_t reason); -struct msgb *gsm0808_create_clear_complete(void); -struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); -struct msgb *gsm0808_create_cipher_reject(uint8_t cause); -struct msgb *gsm0808_create_classmark_update(const uint8_t *classmark, uint8_t length); -struct msgb *gsm0808_create_sapi_reject(uint8_t link_id); -struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, - uint8_t chosen_channel, uint8_t encr_alg_id, - uint8_t speech_mode); -struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause); -struct msgb *gsm0808_create_clear_rqst(uint8_t cause); - -struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id); -void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id); - -const struct tlv_definition *gsm0808_att_tlvdef(); - -#endif diff --git a/include/osmocore/gsm48.h b/include/osmocore/gsm48.h deleted file mode 100644 index ffe0399b..00000000 --- a/include/osmocore/gsm48.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _OSMOCORE_GSM48_H -#define _OSMOCORE_GSM48_H - -#include <osmocore/tlv.h> -#include <osmocore/protocol/gsm_04_08.h> -#include <osmocore/gsm48_ie.h> - -/* A parsed GPRS routing area */ -struct gprs_ra_id { - uint16_t mnc; - uint16_t mcc; - uint16_t lac; - uint8_t rac; -}; - -extern const struct tlv_definition gsm48_att_tlvdef; -extern const struct tlv_definition gsm48_rr_att_tlvdef; -extern const struct tlv_definition gsm48_mm_att_tlvdef; -const char *gsm48_cc_state_name(uint8_t state); -const char *gsm48_cc_msg_name(uint8_t msgtype); -const char *rr_cause_name(uint8_t cause); - -void gsm48_generate_lai(struct gsm48_loc_area_id *lai48, uint16_t mcc, - uint16_t mnc, uint16_t lac); -int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi); -int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi); - -/* Convert Mobile Identity (10.5.1.4) to string */ -int gsm48_mi_to_string(char *string, const int str_len, - const uint8_t *mi, const int mi_len); - -/* Parse Routeing Area Identifier */ -void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); -int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); - -#endif diff --git a/include/osmocore/gsm48_ie.h b/include/osmocore/gsm48_ie.h deleted file mode 100644 index fa66159f..00000000 --- a/include/osmocore/gsm48_ie.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef _OSMOCORE_GSM48_IE_H -#define _OSMOCORE_GSM48_IE_H - -#include <stdint.h> -#include <string.h> -#include <errno.h> - -#include <osmocore/msgb.h> -#include <osmocore/tlv.h> -#include <osmocore/mncc.h> -#include <osmocore/protocol/gsm_04_08.h> - -/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */ -int gsm48_decode_bcd_number(char *output, int output_len, - const uint8_t *bcd_lv, int h_len); - -/* convert a ASCII phone number to 'called/calling/connect party BCD number' */ -int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len, - int h_len, const char *input); -/* decode 'bearer capability' */ -int gsm48_decode_bearer_cap(struct gsm_mncc_bearer_cap *bcap, - const uint8_t *lv); -/* encode 'bearer capability' */ -int gsm48_encode_bearer_cap(struct msgb *msg, int lv_only, - const struct gsm_mncc_bearer_cap *bcap); -/* decode 'call control cap' */ -int gsm48_decode_cccap(struct gsm_mncc_cccap *ccap, const uint8_t *lv); -/* encode 'call control cap' */ -int gsm48_encode_cccap(struct msgb *msg, - const struct gsm_mncc_cccap *ccap); -/* decode 'called party BCD number' */ -int gsm48_decode_called(struct gsm_mncc_number *called, - const uint8_t *lv); -/* encode 'called party BCD number' */ -int gsm48_encode_called(struct msgb *msg, - const struct gsm_mncc_number *called); -/* decode callerid of various IEs */ -int gsm48_decode_callerid(struct gsm_mncc_number *callerid, - const uint8_t *lv); -/* encode callerid of various IEs */ -int gsm48_encode_callerid(struct msgb *msg, int ie, int max_len, - const struct gsm_mncc_number *callerid); -/* decode 'cause' */ -int gsm48_decode_cause(struct gsm_mncc_cause *cause, - const uint8_t *lv); -/* encode 'cause' */ -int gsm48_encode_cause(struct msgb *msg, int lv_only, - const struct gsm_mncc_cause *cause); -/* decode 'calling number' */ -int gsm48_decode_calling(struct gsm_mncc_number *calling, - const uint8_t *lv); -/* encode 'calling number' */ -int gsm48_encode_calling(struct msgb *msg, - const struct gsm_mncc_number *calling); -/* decode 'connected number' */ -int gsm48_decode_connected(struct gsm_mncc_number *connected, - const uint8_t *lv); -/* encode 'connected number' */ -int gsm48_encode_connected(struct msgb *msg, - const struct gsm_mncc_number *connected); -/* decode 'redirecting number' */ -int gsm48_decode_redirecting(struct gsm_mncc_number *redirecting, - const uint8_t *lv); -/* encode 'redirecting number' */ -int gsm48_encode_redirecting(struct msgb *msg, - const struct gsm_mncc_number *redirecting); -/* decode 'facility' */ -int gsm48_decode_facility(struct gsm_mncc_facility *facility, - const uint8_t *lv); -/* encode 'facility' */ -int gsm48_encode_facility(struct msgb *msg, int lv_only, - const struct gsm_mncc_facility *facility); -/* decode 'notify' */ -int gsm48_decode_notify(int *notify, const uint8_t *v); -/* encode 'notify' */ -int gsm48_encode_notify(struct msgb *msg, int notify); -/* decode 'signal' */ -int gsm48_decode_signal(int *signal, const uint8_t *v); -/* encode 'signal' */ -int gsm48_encode_signal(struct msgb *msg, int signal); -/* decode 'keypad' */ -int gsm48_decode_keypad(int *keypad, const uint8_t *lv); -/* encode 'keypad' */ -int gsm48_encode_keypad(struct msgb *msg, int keypad); -/* decode 'progress' */ -int gsm48_decode_progress(struct gsm_mncc_progress *progress, - const uint8_t *lv); -/* encode 'progress' */ -int gsm48_encode_progress(struct msgb *msg, int lv_only, - const struct gsm_mncc_progress *p); -/* decode 'user-user' */ -int gsm48_decode_useruser(struct gsm_mncc_useruser *uu, - const uint8_t *lv); -/* encode 'useruser' */ -int gsm48_encode_useruser(struct msgb *msg, int lv_only, - const struct gsm_mncc_useruser *uu); -/* decode 'ss version' */ -int gsm48_decode_ssversion(struct gsm_mncc_ssversion *ssv, - const uint8_t *lv); -/* encode 'ss version' */ -int gsm48_encode_ssversion(struct msgb *msg, - const struct gsm_mncc_ssversion *ssv); -/* decode 'more data' does not require a function, because it has no value */ -/* encode 'more data' */ -int gsm48_encode_more(struct msgb *msg); - -/* structure of one frequency */ -struct gsm_sysinfo_freq { - /* if the frequency included in the sysinfo */ - uint8_t mask; -}; - -/* decode "Cell Channel Description" (10.5.2.1b) and other frequency lists */ -int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd, - uint8_t len, uint8_t mask, uint8_t frqt); - -#endif diff --git a/include/osmocore/gsm_utils.h b/include/osmocore/gsm_utils.h deleted file mode 100644 index 19adb70a..00000000 --- a/include/osmocore/gsm_utils.h +++ /dev/null @@ -1,117 +0,0 @@ -/* GSM utility functions, e.g. coding and decoding */ -/* - * (C) 2008 by Daniel Willmann <daniel@totalueberwachung.de> - * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org> - * (C) 2009-2010 by Harald Welte <laforge@gnumonks.org> - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef GSM_UTILS_H -#define GSM_UTILS_H - -#include <stdint.h> - -#define ADD_MODULO(sum, delta, modulo) do { \ - if ((sum += delta) >= modulo) \ - sum -= modulo; \ - } while (0) - -#define GSM_MAX_FN (26*51*2048) - -struct gsm_time { - uint32_t fn; /* FN count */ - uint16_t t1; /* FN div (26*51) */ - uint8_t t2; /* FN modulo 26 */ - uint8_t t3; /* FN modulo 51 */ - uint8_t tc; -}; - -enum gsm_band { - GSM_BAND_850 = 1, - GSM_BAND_900 = 2, - GSM_BAND_1800 = 4, - GSM_BAND_1900 = 8, - GSM_BAND_450 = 0x10, - GSM_BAND_480 = 0x20, - GSM_BAND_750 = 0x40, - GSM_BAND_810 = 0x80, -}; - -const char *gsm_band_name(enum gsm_band band); -enum gsm_band gsm_band_parse(const char *mhz); - -int gsm_7bit_decode(char *decoded, const uint8_t *user_data, uint8_t length); -int gsm_7bit_encode(uint8_t *result, const char *data); - -int ms_pwr_ctl_lvl(enum gsm_band band, unsigned int dbm); -int ms_pwr_dbm(enum gsm_band band, uint8_t lvl); - -/* According to TS 08.05 Chapter 8.1.4 */ -int rxlev2dbm(uint8_t rxlev); -uint8_t dbm2rxlev(int dbm); - -/* According to GSM 04.08 Chapter 10.5.1.6 */ -static inline int ms_cm2_a5n_support(uint8_t *cm2, int n) { - switch (n) { - case 0: return 1; - case 1: return (cm2[0] & (1<<3)) ? 0 : 1; - case 2: return (cm2[2] & (1<<0)) ? 1 : 0; - case 3: return (cm2[2] & (1<<1)) ? 1 : 0; - default: - return 0; - } -} - -/* According to GSM 04.08 Chapter 10.5.2.29 */ -static inline int rach_max_trans_val2raw(int val) { return (val >> 1) & 3; } -static inline int rach_max_trans_raw2val(int raw) { - const int tbl[4] = { 1, 2, 4, 7 }; - return tbl[raw & 3]; -} - -#define ARFCN_PCS 0x8000 -#define ARFCN_UPLINK 0x4000 -#define ARFCN_FLAG_MASK 0xf000 /* Reserve the upper 5 bits for flags */ - -enum gsm_band gsm_arfcn2band(uint16_t arfcn); - -/* Convert an ARFCN to the frequency in MHz * 10 */ -uint16_t gsm_arfcn2freq10(uint16_t arfcn, int uplink); - -/* Convert from frame number to GSM time */ -void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn); - -/* Convert from GSM time to frame number */ -uint32_t gsm_gsmtime2fn(struct gsm_time *time); - -/* GSM TS 03.03 Chapter 2.6 */ -enum gprs_tlli_type { - TLLI_LOCAL, - TLLI_FOREIGN, - TLLI_RANDOM, - TLLI_AUXILIARY, - TLLI_RESERVED, -}; - -/* TS 03.03 Chapter 2.6 */ -int gprs_tlli_type(uint32_t tlli); - -uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type); - -#endif diff --git a/include/osmocore/gsmtap.h b/include/osmocore/gsmtap.h deleted file mode 100644 index 236b25ac..00000000 --- a/include/osmocore/gsmtap.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _GSMTAP_H -#define _GSMTAP_H - -/* gsmtap header, pseudo-header in front of the actua GSM payload */ - -/* 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/) - */ - -#include <stdint.h> - -#define GSMTAP_VERSION 0x02 - -#define GSMTAP_TYPE_UM 0x01 -#define GSMTAP_TYPE_ABIS 0x02 -#define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */ -#define GSMTAP_TYPE_SIM 0x04 -#define GSMTAP_TYPE_TETRA_I1 0x05 /* tetra air interface */ -#define GSMTAP_TYPE_TETRA_I1_BURST 0x06 /* tetra air interface */ - -/* sub-types for TYPE_UM_BURST */ -#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 - -/* sub-types for TYPE_UM */ -#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 - -/* sub-types for TYPE_TETRA_AIR */ -#define GSMTAP_TETRA_BSCH 0x01 -#define GSMTAP_TETRA_AACH 0x02 -#define GSMTAP_TETRA_SCH_HU 0x03 -#define GSMTAP_TETRA_SCH_HD 0x04 -#define GSMTAP_TETRA_SCH_F 0x05 -#define GSMTAP_TETRA_BNCH 0x06 -#define GSMTAP_TETRA_STCH 0x07 -#define GSMTAP_TETRA_TCH_F 0x08 - -/* flags for the ARFCN */ -#define GSMTAP_ARFCN_F_PCS 0x8000 -#define GSMTAP_ARFCN_F_UPLINK 0x4000 -#define GSMTAP_ARFCN_MASK 0x3fff - -/* IANA-assigned well-known UDP port for GSMTAP messages */ -#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) */ - int8_t signal_dbm; /* signal level in dBm */ - int8_t snr_db; /* signal/noise ratio in dB */ - - uint32_t frame_number; /* GSM Frame Number (FN) */ - - 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 */ diff --git a/include/osmocore/gsmtap_util.h b/include/osmocore/gsmtap_util.h deleted file mode 100644 index 96449443..00000000 --- a/include/osmocore/gsmtap_util.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _GSMTAP_UTIL_H -#define _GSMTAP_UTIL_H - -#include <stdint.h> - -/* convert RSL channel number to GSMTAP channel type */ -uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id); - -/* receive a message from L1/L2 and put it in GSMTAP */ -struct msgb *gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type, - uint8_t ss, uint32_t fn, int8_t signal_dbm, - uint8_t snr, const uint8_t *data, unsigned int len); - -/* receive a message from L1/L2 and put it in GSMTAP */ -int gsmtap_sendmsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, - u |
