Loading...
Searching...
No Matches
gsmtap_util.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/select.h>
uint8_t chantype_rsl2gsmtap2(uint8_t rsl_chantype, uint8_t rsl_link_id, bool user_plane);
uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id)
OSMO_DEPRECATED("Use chantype_rsl2gsmtap2() instead");
void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id);
struct msgb *gsmtap_makemsg_ex(uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type,
uint8_t ss, uint32_t fn, int8_t signal_dbm,
int8_t snr, const uint8_t *data, unsigned int len);
struct msgb *gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type,
uint8_t ss, uint32_t fn, int8_t signal_dbm,
int8_t snr, const uint8_t *data, unsigned int len);
struct gsmtap_inst;
int gsmtap_inst_fd(struct gsmtap_inst *gti)
OSMO_DEPRECATED("Use gsmtap_inst_fd2() instead");
int gsmtap_inst_fd2(const struct gsmtap_inst *gti);
int gsmtap_source_init_fd(const char *host, uint16_t port);
int gsmtap_source_init_fd2(const char *local_host, uint16_t local_port, const char *rem_host, uint16_t rem_port);
int gsmtap_source_add_sink_fd(int gsmtap_fd);
struct gsmtap_inst *gsmtap_source_init(const char *host, uint16_t port,
int ofd_wq_mode);
struct gsmtap_inst *gsmtap_source_init2(const char *local_host, uint16_t local_port,
const char *rem_host, uint16_t rem_port, int ofd_wq_mode);
void gsmtap_source_free(struct gsmtap_inst *gti);
int gsmtap_source_add_sink(struct gsmtap_inst *gti);
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg);
int gsmtap_sendmsg_free(struct gsmtap_inst *gti, struct msgb *msg);
int gsmtap_send_ex(struct gsmtap_inst *gti, uint8_t type, uint16_t arfcn, uint8_t ts,
uint8_t chan_type, uint8_t ss, uint32_t fn,
int8_t signal_dbm, int8_t snr, const uint8_t *data,
unsigned int len);
int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts,
uint8_t chan_type, uint8_t ss, uint32_t fn,
int8_t signal_dbm, int8_t snr, const uint8_t *data,
unsigned int len);
extern const struct value_string gsmtap_gsm_channel_names[];
extern const struct value_string gsmtap_type_names[];
gsmtap_makemsg
struct msgb * gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, int8_t snr, const uint8_t *data, unsigned int len)
create L1/L2 data and put it into GSMTAP
Definition gsmtap_util.c:260
gsmtap_source_add_sink
int gsmtap_source_add_sink(struct gsmtap_inst *gti)
gsmtap_source_add_sink_fd
int gsmtap_source_add_sink_fd(int gsmtap_fd)
chantype_rsl2gsmtap
uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id) OSMO_DEPRECATED("Use chantype_rsl2gsmtap2() instead")
convert RSL channel number to GSMTAP channel type
Definition gsmtap_util.c:151
chantype_rsl2gsmtap2
uint8_t chantype_rsl2gsmtap2(uint8_t rsl_chantype, uint8_t rsl_link_id, bool user_plane)
convert RSL channel number to GSMTAP channel type
Definition gsmtap_util.c:94
chantype_gsmtap2rsl
void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id)
convert GSMTAP channel type to RSL channel number + Link ID
Definition gsmtap_util.c:161
gsmtap_source_init2
struct gsmtap_inst * gsmtap_source_init2(const char *local_host, uint16_t local_port, const char *rem_host, uint16_t rem_port, int ofd_wq_mode)
gsmtap_sendmsg
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
gsmtap_makemsg_ex
struct msgb * gsmtap_makemsg_ex(uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, int8_t snr, const uint8_t *data, unsigned int len)
create an arbitrary type GSMTAP message
Definition gsmtap_util.c:213
gsmtap_gsm_channel_names
const struct value_string gsmtap_gsm_channel_names[]
Definition gsmtap_util.c:547
gsmtap_source_init
struct gsmtap_inst * gsmtap_source_init(const char *host, uint16_t port, int ofd_wq_mode)
gsmtap_sendmsg_free
int gsmtap_sendmsg_free(struct gsmtap_inst *gti, struct msgb *msg)
gsmtap_send_ex
int gsmtap_send_ex(struct gsmtap_inst *gti, uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, int8_t snr, const uint8_t *data, unsigned int len)
gsmtap_source_init_fd2
int gsmtap_source_init_fd2(const char *local_host, uint16_t local_port, const char *rem_host, uint16_t rem_port)
gsmtap_source_free
void gsmtap_source_free(struct gsmtap_inst *gti)
gsmtap_type_names
const struct value_string gsmtap_type_names[]
Definition gsmtap_util.c:575
gsmtap_inst_fd
int gsmtap_inst_fd(struct gsmtap_inst *gti) OSMO_DEPRECATED("Use gsmtap_inst_fd2() instead")
Deprecated, use gsmtap_inst_fd2() instead.
Definition gsmtap_util.c:75
gsmtap_source_init_fd
int gsmtap_source_init_fd(const char *host, uint16_t port)
gsmtap_inst_fd2
int gsmtap_inst_fd2(const struct gsmtap_inst *gti)
obtain the file descriptor associated with a gsmtap instance
Definition gsmtap_util.c:83
gsmtap_send
int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts, uint8_t chan_type, uint8_t ss, uint32_t fn, int8_t signal_dbm, int8_t snr, const uint8_t *data, unsigned int len)
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)
Set the deprecated attribute with a message.
Definition defs.h:41
ts
struct @6 ts
arfcn
uint16_t arfcn
ARFCN (frequency)
Definition gsmtap.h:5
signal_dbm
int8_t signal_dbm
signal level in dBm
Definition gsmtap.h:6
select.h
libmnl integration
gsmtap_inst
one gsmtap instance Until gsmtap_inst_fd() is removed from the API at some point in the future,...
Definition gsmtap_util.c:55
host
msgb
Osmocom message buffer.
Definition msgb.h:31
msgb::len
uint16_t len
length of bytes used in msgb
Definition msgb.h:51
msgb::data
unsigned char * data
start of message in buffer
Definition msgb.h:55
value_string
A mapping between human-readable string and numeric value.
Definition utils.h:51
write_queue.h
Generic write queue implementation.