libosmocore 1.13.1.1-afb4 Osmocom core library

gsmtap_util.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5#include <osmocom/core/write_queue.h>
6#include <osmocom/core/select.h>
7
12uint8_t chantype_rsl2gsmtap2(uint8_t rsl_chantype, uint8_t rsl_link_id, bool user_plane);
13
14uint8_t chantype_rsl2gsmtap(uint8_t rsl_chantype, uint8_t rsl_link_id)
15 OSMO_DEPRECATED("Use chantype_rsl2gsmtap2() instead");
16
17 void chantype_gsmtap2rsl(uint8_t gsmtap_chantype, uint8_t *rsl_chantype, uint8_t *link_id);
18
19 struct msgb *gsmtap_makemsg_ex(uint8_t type, uint16_t arfcn, uint8_t ts, uint8_t chan_type,
20 uint8_t ss, uint32_t fn, int8_t signal_dbm,
21 int8_t snr, const uint8_t *data, unsigned int len);
22
23 struct msgb *gsmtap_makemsg(uint16_t arfcn, uint8_t ts, uint8_t chan_type,
24 uint8_t ss, uint32_t fn, int8_t signal_dbm,
25 int8_t snr, const uint8_t *data, unsigned int len);
26
28 struct gsmtap_inst;
29
30 int gsmtap_inst_fd(struct gsmtap_inst *gti)
31 OSMO_DEPRECATED("Use gsmtap_inst_fd2() instead");
32
33 int gsmtap_inst_fd2(const struct gsmtap_inst *gti);
34
35 int gsmtap_source_init_fd(const char *host, uint16_t port);
36 int gsmtap_source_init_fd2(const char *local_host, uint16_t local_port, const char *rem_host, uint16_t rem_port);
37
38 int gsmtap_source_add_sink_fd(int gsmtap_fd);
39
40 struct gsmtap_inst *gsmtap_source_init(const char *host, uint16_t port,
41 int ofd_wq_mode);
42 struct gsmtap_inst *gsmtap_source_init2(const char *local_host, uint16_t local_port,
43 const char *rem_host, uint16_t rem_port, int ofd_wq_mode);
44
45 void gsmtap_source_free(struct gsmtap_inst *gti);
46
47 int gsmtap_source_set_nonblock(struct gsmtap_inst *gti, int on);
48 int gsmtap_source_add_sink(struct gsmtap_inst *gti);
49
50 bool gsmtap_source_using_wq(const struct gsmtap_inst *gti);
51
52 int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg);
53 int gsmtap_sendmsg_free(struct gsmtap_inst *gti, struct msgb *msg);
54
55 int gsmtap_send_ex(struct gsmtap_inst *gti, uint8_t type, uint16_t arfcn, uint8_t ts,
56 uint8_t chan_type, uint8_t ss, uint32_t fn,
57 int8_t signal_dbm, int8_t snr, const uint8_t *data,
58 unsigned int len);
59
60 int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts,
61 uint8_t chan_type, uint8_t ss, uint32_t fn,
62 int8_t signal_dbm, int8_t snr, const uint8_t *data,
63 unsigned int len);
64
65 extern const struct value_string gsmtap_gsm_channel_names[];
66 extern const struct value_string gsmtap_type_names[];
67
type
enum osmo_sub_auth_type type
len
static size_t len(const char *str)
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:246
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:137
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:80
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:147
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:199
gsmtap_gsm_channel_names
const struct value_string gsmtap_gsm_channel_names[]
Definition: gsmtap_util.c:586
gsmtap_source_using_wq
bool gsmtap_source_using_wq(const struct gsmtap_inst *gti)
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_set_nonblock
int gsmtap_source_set_nonblock(struct gsmtap_inst *gti, int on)
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:614
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:61
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:69
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)
data
uint8_t data[0]
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
Definition: gsmtap_util.c:51
host
msgb
Osmocom message buffer.
Definition: msgb.h:31
value_string
A mapping between human-readable string and numeric value.
Definition: utils.h:51
write_queue.h
Generic write queue implementation.