libosmocore  1.9.0
Osmocom core library
osmo_io_internal.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <unistd.h>
6 #include <stdbool.h>
7 
8 #include <osmocom/core/osmo_io.h>
10 #include <osmocom/core/msgb.h>
11 #include <osmocom/core/select.h>
12 #include <osmocom/core/socket.h>
13 
14 #include "../config.h"
15 
16 #define OSMO_IO_DEFAULT_MSGB_SIZE 1024
17 #define OSMO_IO_DEFAULT_MSGB_HEADROOM 128
18 
19 extern const struct iofd_backend_ops iofd_poll_ops;
20 #define OSMO_IO_BACKEND_DEFAULT "POLL"
21 
22 #if defined(HAVE_URING)
23 extern const struct iofd_backend_ops iofd_uring_ops;
24 #endif
25 
27  int (*register_fd)(struct osmo_io_fd *iofd);
28  int (*unregister_fd)(struct osmo_io_fd *iofd);
29  int (*close)(struct osmo_io_fd *iofd);
30  void (*write_enable)(struct osmo_io_fd *iofd);
31  void (*write_disable)(struct osmo_io_fd *iofd);
32  void (*read_enable)(struct osmo_io_fd *iofd);
33  void (*read_disable)(struct osmo_io_fd *iofd);
34 };
35 
36 #define IOFD_FLAG_CLOSED (1<<0)
37 #define IOFD_FLAG_IN_CALLBACK (1<<1)
38 #define IOFD_FLAG_TO_FREE (1<<2)
39 #define IOFD_FLAG_NOTIFY_CONNECTED (1<<3)
40 
41 #define IOFD_FLAG_SET(iofd, flag) \
42  (iofd)->flags |= (flag)
43 
44 #define IOFD_FLAG_UNSET(iofd, flag) \
45  (iofd)->flags &= ~(flag)
46 
47 #define IOFD_FLAG_ISSET(iofd, flag) ((iofd)->flags & (flag))
48 
49 struct osmo_io_fd {
51  struct llist_head list;
53  int fd;
56 
58  uint32_t flags;
59 
61  char *name;
62 
66  struct msgb *pending;
67 
69  void *data;
71  unsigned int priv_nr;
72 
73  struct {
75  const void *ctx;
77  unsigned int size;
79  unsigned int headroom;
80  } msgb_alloc;
81 
82  struct {
84  unsigned int max_length;
86  unsigned int current_length;
89  } tx_queue;
90 
91  union {
92  struct {
93  struct osmo_fd ofd;
94  } poll;
95  struct {
98  void *read_msghdr;
99  void *write_msghdr;
100  /* TODO: index into array of registered fd's? */
101  } uring;
102  } u;
103 };
104 
110  // TODO: SCTP_*
111 };
112 
113 
114 /* serialized version of 'struct msghdr' employed by sendmsg/recvmsg */
115 struct iofd_msghdr {
116  struct llist_head list;
118  struct msghdr hdr;
120  struct iovec iov[1];
121  int flags;
122 
123  struct msgb *msg;
124  struct osmo_io_fd *iofd;
125 };
126 
131 };
132 
134 void iofd_msghdr_free(struct iofd_msghdr *msghdr);
135 
136 struct msgb *iofd_msgb_alloc(struct osmo_io_fd *iofd);
137 struct msgb *iofd_msgb_pending(struct osmo_io_fd *iofd);
138 struct msgb *iofd_msgb_pending_or_alloc(struct osmo_io_fd *iofd);
139 
140 void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *msghdr);
141 void iofd_handle_segmented_read(struct osmo_io_fd *iofd, struct msgb *msg, int rc);
142 
143 int iofd_txqueue_enqueue(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr);
144 void iofd_txqueue_enqueue_front(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr);
OSMO_IO_DEFAULT_MSGB_SIZE
#define OSMO_IO_DEFAULT_MSGB_SIZE
Definition: osmo_io_internal.h:16
OSMO_FSM_TERM_ERROR
@ OSMO_FSM_TERM_ERROR
erroneous termination of process
Definition: fsm.h:29
IOFD_ACT_WRITE
@ IOFD_ACT_WRITE
Definition: osmo_io_internal.h:107
gsmtap_inst::ofd_wq_mode
int ofd_wq_mode
wait queue mode?
Definition: gsmtap_util.h:28
osmo_isdnhdlc_decode
int osmo_isdnhdlc_decode(struct osmo_isdnhdlc_vars *hdlc, const uint8_t *src, int slen, int *count, uint8_t *dst, int dsize)
decodes HDLC frames from a transparent bit stream.
Definition: isdnhdlc.c:116
osmo_fsm_event_name
const char * osmo_fsm_event_name(const struct osmo_fsm *fsm, uint32_t event)
get human-readable name of FSM event
Definition: fsm.c:579
osmo_strrb_elements
size_t osmo_strrb_elements(const struct osmo_strrb *rb)
Count the number of log messages in an osmo_strrb.
Definition: strrb.c:132
osmo_gettimeofday
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
shim around gettimeofday to be able to set the time manually.
Definition: timer_gettimeofday.c:56
RSL_CHAN_OSMO_CBCH4
#define RSL_CHAN_OSMO_CBCH4
HDLC_SEND_FAST_IDLE
@ HDLC_SEND_FAST_IDLE
Definition: isdnhdlc.c:37
LLIST_HEAD
LLIST_HEAD(osmo_g_fsms)
osmo_macaddr_parse
int osmo_macaddr_parse(uint8_t *out, const char *in)
Parse a MAC address from human-readable notation This function parses an ethernet MAC address in the ...
Definition: macaddr.c:42
msgb_hexdump_buf
char * msgb_hexdump_buf(char *buf, size_t buf_len, const struct msgb *msg)
fill user-provided buffer with hexdump of the msg.
Definition: msgb.c:461
osmo_io_fd_mode
osmo_io_fd_mode
Definition: osmo_io.h:19
fsm_term_safely_enabled
static bool fsm_term_safely_enabled
See osmo_fsm_term_safely().
Definition: fsm.c:90
osmo_netdev_set_netns_name
int osmo_netdev_set_netns_name(struct osmo_netdev *netdev, const char *netns_name)
Set (specify) name of the network namespace where the network interface to manage is located.
Definition: netdev.c:831
msgb::l3h
unsigned char * l3h
pointer to Layer 3 header.
Definition: msgb.h:45
iofd_msghdr::osa
struct osmo_sockaddr osa
Definition: osmo_io_internal.h:119
OSMO_SOCK_F_CONNECT
#define OSMO_SOCK_F_CONNECT
connect the socket to a remote peer
Definition: socket.h:88
osmo_sockaddr::sa
struct sockaddr sa
Definition: socket.h:28
log_target_type
log_target_type
Type of logging target.
Definition: logging.h:276
GSMTAP_UDP_PORT
#define GSMTAP_UDP_PORT
Definition: gsmtap.h:195
LOGPIO
#define LOGPIO(iofd, level, fmt, args...)
Definition: osmo_io.h:14
loggingrb.h
gsmtap_hdr::frame_number
uint32_t frame_number
GSM Frame Number (FN)
Definition: gsmtap.h:314
netdev.h
tall_ctr_ctx
void * tall_ctr_ctx
Global talloc context for all osmo_counter allocations.
Definition: counter.c:31
osmo_io_fd::priv_nr
unsigned int priv_nr
private number, extending data
Definition: osmo_io_internal.h:71
logging_gsmtap_tid
static __thread uint32_t logging_gsmtap_tid
Definition: logging_gsmtap.c:54
osmo_iofd_set_data
void osmo_iofd_set_data(struct osmo_io_fd *iofd, void *data)
osmo_config_entry::list
struct llist_head list
Definition: msgfile.h:27
log_add_target
void log_add_target(struct log_target *target)
Register a new log target with the logging core.
Definition: logging.c:786
osmo_iofd_free
void osmo_iofd_free(struct osmo_io_fd *iofd)
isdnhdlc.h
log_category_name
const char * log_category_name(int subsys)
Definition: logging.c:457
iofd_msghdr::iov
struct iovec iov[1]
Definition: osmo_io_internal.h:120
time
char time[12]
osmo_iofd_setup
struct osmo_io_fd * osmo_iofd_setup(const void *ctx, int fd, const char *name, enum osmo_io_fd_mode mode, const struct osmo_io_ops *ioops, void *data)
link_id
uint8_t link_id
osmo_fsm_inst::priv
void * priv
some private data of this instance
Definition: fsm.h:97
color
static const char * color(int subsys)
Definition: logging.c:432
msgb_hexdump_l1
static const char * msgb_hexdump_l1(const struct msgb *msg)
Definition: msgb.h:748
log_info_cat::enabled
uint8_t enabled
is this category enabled or not
Definition: logging.h:191
osmo_fsm_state
description of a rule in the FSM
Definition: fsm.h:42
osmo_io_fd::msg_queue
struct llist_head msg_queue
actual linked list implementing the transmit queue
Definition: osmo_io_internal.h:88
OSMO_HDLC_CRC_ERROR
#define OSMO_HDLC_CRC_ERROR
Definition: isdnhdlc.h:66
NETDEV_NETNS_ENTER
#define NETDEV_NETNS_ENTER(netdev, switch_state, str_prefix)
Definition: netdev.c:300
NETDEV_NETNS_EXIT
#define NETDEV_NETNS_EXIT(netdev, switch_state, str_prefix)
Definition: netdev.c:314
crc8gen.h
_output
static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
Definition: logging.c:631
osmo_mnl_destroy
void osmo_mnl_destroy(struct osmo_mnl *omnl)
destroy an existing osmocom-wrapped mnl netlink socket: Unregister + close + free.
Definition: mnl.c:103
log_target::tgt_gsmtap
struct log_target::@8::@14 tgt_gsmtap
log_set_print_filename2
void log_set_print_filename2(struct log_target *target, enum log_filename_type lft)
Enable or disable printing of the filename while logging.
Definition: logging.c:903
LOGL_FATAL
#define LOGL_FATAL
fatal, program aborted
Definition: logging.h:126
str_in_list
static bool str_in_list(const char **list, const char *key)
Definition: exec.c:56
OSMO_LOGCOLOR_END
#define OSMO_LOGCOLOR_END
Definition: logging.h:177
_osmo_fsm_inst_dispatch
int _osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data, const char *file, int line)
dispatch an event to an osmocom finite state machine instance
Definition: fsm.c:833
osmo_sock_init
int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, unsigned int flags)
log_info_cat::color
const char * color
color string for cateyory
Definition: logging.h:188
osmo_it_q::list
struct llist_head list
Definition: it_q.h:21
log_parse_level
int log_parse_level(const char *lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE
Parse a human-readable log level into a numeric value.
Definition: logging.c:343
iofd_txqueue_dequeue
struct iofd_msghdr * iofd_txqueue_dequeue(struct osmo_io_fd *iofd)
osmo_iofd_register
int osmo_iofd_register(struct osmo_io_fd *iofd, int fd)
OSMO_FSM_TERM_REGULAR
@ OSMO_FSM_TERM_REGULAR
regular termination of process
Definition: fsm.h:27
osmo_config_entry::mnc
char * mnc
Definition: msgfile.h:34
osmo_netdev_set_ifindex
int osmo_netdev_set_ifindex(struct osmo_netdev *netdev, unsigned int ifindex)
Set (specify) interface index identifying the network interface to manage.
Definition: netdev.c:801
log_info_cat::loglevel
uint8_t loglevel
currently selected log-level
Definition: logging.h:190
iofd_backend_ops::write_disable
void(* write_disable)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:31
loglevel_strs
const struct value_string loglevel_strs[]
Definition: logging.c:145
osmo_netdev_unregister
int osmo_netdev_unregister(struct osmo_netdev *netdev)
Unregister the netdev object (stop managing /moniutoring the interface)
Definition: netdev.c:714
GSMTAP_CHANNEL_FACCH_H
#define GSMTAP_CHANNEL_FACCH_H
Definition: gsmtap.h:88
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
get human-readable string for given value
Definition: utils.c:54
alloc_entry
static struct osmo_config_entry * alloc_entry(struct osmo_config_list *entries, const char *mcc, const char *mnc, const char *option, const char *text)
Definition: msgfile.c:34
fsm_dealloc_ctx
void * fsm_dealloc_ctx
See osmo_fsm_set_dealloc_ctx()
Definition: fsm.c:101
GSMTAP_TYPE_LTE_MAC_FRAMED
#define GSMTAP_TYPE_LTE_MAC_FRAMED
Definition: gsmtap.h:47
osmo_fsm_inst_term
#define osmo_fsm_inst_term(fi, cause, data)
Terminate FSM instance with given cause.
Definition: fsm.h:310
DLNSSIGNAL
#define DLNSSIGNAL
Osmocom NS layer signal pdus.
Definition: logging.h:151
fsm_term_safely
static __thread struct @35 fsm_term_safely
Internal state for FSM instance termination cascades.
cause
uint8_t cause
osmo_fsm::name
const char * name
human readable name
Definition: fsm.h:64
msgb_hexdump_l2
static const char * msgb_hexdump_l2(const struct msgb *msg)
Definition: msgb.h:755
len
static size_t len(const char *str)
osmo_netdev::mtu_chg_cb
osmo_netdev_mtu_chg_cb_t mtu_chg_cb
Definition: netdev.c:287
GSMTAP_TYPE_GSM_RLP
#define GSMTAP_TYPE_GSM_RLP
Definition: gsmtap.h:52
log_target_file_switch_to_wqueue
int log_target_file_switch_to_wqueue(struct log_target *tgt)
switch from blocking + buffered file output to non-blocking write-queue based output.
Definition: logging.c:1187
netdev_netns_ctx::entry
struct llist_head entry
Definition: netdev.c:116
osmo_io_fd::headroom
unsigned int headroom
headroom to allocate when allocating msgb's
Definition: osmo_io_internal.h:79
n
write Write running configuration to or terminal n Write configuration to the copy running config startup Copy configuration n Copy running config to n Copy running config to startup write Write running configuration to or terminal n Write to terminal n
log_category
Configuration of single log category / sub-system.
Definition: logging.h:180
osmo_iofd_close
int osmo_iofd_close(struct osmo_io_fd *iofd)
log_target_file_switch_to_stream
int log_target_file_switch_to_stream(struct log_target *tgt)
switch from non-blocking/write-queue to blocking + buffered stream output
Definition: logging.c:1135
osmo_crc64gen_code
structure describing a given CRC code of max 64 bits
Definition: crc64gen.h:30
GSMTAP_TYPE_GB_SNDCP
#define GSMTAP_TYPE_GB_SNDCP
Definition: gsmtap.h:41
gsmtap_osmocore_log_hdr::level
uint8_t level
logging level
Definition: gsmtap.h:331
LOG_FILENAME_PATH
@ LOG_FILENAME_PATH
Definition: logging.h:289
LLIST_HEAD_INIT
#define LLIST_HEAD_INIT(name)
Define a new llist_head pointing to a given llist_head.
Definition: linuxlist.h:54
hdr
struct gsm48_hdr hdr
OSMO_ASSERT
#define OSMO_ASSERT(exp)
Helper macro to terminate when an assertion fails.
Definition: utils.h:113
RSL_CHAN_BCCH
#define RSL_CHAN_BCCH
IOFD_SEG_ACT_DEFER
@ IOFD_SEG_ACT_DEFER
Definition: osmo_io_internal.h:130
log_parse_category_mask
void log_parse_category_mask(struct log_target *target, const char *mask)
parse the log category mask
Definition: logging.c:384
osmo_netdev_get_name
const char * osmo_netdev_get_name(const struct osmo_netdev *netdev)
Get name used to identify the netdev object.
Definition: netdev.c:784
write_queue.h
LOG_FILENAME_BASENAME
@ LOG_FILENAME_BASENAME
Definition: logging.h:290
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
append data to end of message buffer
Definition: msgb.h:240
gsmtap_util.h
log_target_create
struct log_target * log_target_create(void)
Create a new log target skeleton.
Definition: logging.c:1044
_osmo_fsm_inst_state_chg_ms
int _osmo_fsm_inst_state_chg_ms(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_ms, int T, const char *file, int line)
Definition: fsm.c:748
subsys
char subsys[16]
logging sub-system
Definition: gsmtap.h:11
osmo_it_q::mutex
pthread_mutex_t mutex
Definition: it_q.h:23
msgb_copy_c
struct msgb * msgb_copy_c(const void *ctx, const struct msgb *msg, const char *name)
Copy an msgb.
Definition: msgb.c:383
osmo_isdnhdlc_rcv_init
void osmo_isdnhdlc_rcv_init(struct osmo_isdnhdlc_vars *hdlc, uint32_t features)
Definition: isdnhdlc.c:43
crc64gen.h
msgb::data
unsigned char * data
start of message in buffer
Definition: msgb.h:55
osmo_netdev_set_mtu_chg_cb
void osmo_netdev_set_mtu_chg_cb(struct osmo_netdev *netdev, osmo_netdev_mtu_chg_cb_t mtu_chg_cb)
Set mtu_chg_cb callback, called when a change in the network name is detected.
Definition: netdev.c:775
osmo_strrb::size
uint16_t size
max number of messages to store
Definition: strrb.h:35
iofd_handle_segmented_read
void iofd_handle_segmented_read(struct osmo_io_fd *iofd, struct msgb *msg, int rc)
osmo_identifier_sanitize_buf
void osmo_identifier_sanitize_buf(char *str, const char *sep_chars, char replace_with)
Replace characters in the given string buffer so that it is guaranteed to pass osmo_separated_identif...
Definition: utils.c:683
gsmtap_hdr::arfcn
uint16_t arfcn
ARFCN (frequency)
Definition: gsmtap.h:310
osmo_wqueue::write_cb
int(* write_cb)(struct osmo_fd *fd, struct msgb *msg)
call-back in case qeueue is writable.
Definition: write_queue.h:44
iofd_msghdr::iofd
struct osmo_io_fd * iofd
Definition: osmo_io_internal.h:124
_rb_output
static void _rb_output(struct log_target *target, unsigned int level, const char *log)
Definition: loggingrb.c:36
iofd_msghdr::msg
struct msgb * msg
Definition: osmo_io_internal.h:123
osmo_log_backtrace
void osmo_log_backtrace(int subsys, int level)
Generate and log a call back-trace.
Definition: backtrace.c:75
log_info::filter_fn
log_filter * filter_fn
Definition: logging.h:260
MAXPATHLEN
#define MAXPATHLEN
log_target_create_file_stream
struct log_target * log_target_create_file_stream(const char *fname)
Create a new file-based log target using buffered, blocking stream output.
Definition: logging.c:1110
osmo_config_list_parse
struct osmo_config_list * osmo_config_list_parse(void *ctx, const char *filename)
Definition: msgfile.c:97
LOG_TGT_TYPE_STDERR
@ LOG_TGT_TYPE_STDERR
stderr logging
Definition: logging.h:280
log_target_find
struct log_target * log_target_find(enum log_target_type type, const char *fname)
Find a registered log target.
Definition: logging.c:1295
osmo_netdev_get_dev_name
const char * osmo_netdev_get_dev_name(const struct osmo_netdev *netdev)
Get name used to name the network interface created by the netdev object.
Definition: netdev.c:855
osmo_fd_register
int osmo_fd_register(struct osmo_fd *fd)
osmo_crc16_ccitt
uint16_t osmo_crc16_ccitt(uint16_t crc, const uint8_t *buffer, size_t len)
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer.
Definition: crc16.c:108
gsmtap_source_init_fd
int gsmtap_source_init_fd(const char *host, uint16_t port)
osmo_isdnhdlc_vars
Definition: isdnhdlc.h:29
log_target::print_filename_pos
enum log_filename_pos print_filename_pos
Definition: logging.h:394
osmo_fsm_inst_update_id_f
int osmo_fsm_inst_update_id_f(struct osmo_fsm_inst *fi, const char *fmt,...)
Change id of the FSM instance using a string format.
Definition: fsm.c:372
osmo_fsm_inst::children
struct llist_head children
a list of children processes
Definition: fsm.h:115
osmo_fd::cb
int(* cb)(struct osmo_fd *fd, unsigned int what)
call-back function to be called once file descriptor becomes available
Definition: select.h:41
crc16.h
osmo_isdnhdlc_vars::ffvalue
uint8_t ffvalue
Definition: isdnhdlc.h:41
iofd_seg_act
iofd_seg_act
Definition: osmo_io_internal.h:127
osmo_io_fd::fd
int fd
actual operating-system level file decriptor
Definition: osmo_io_internal.h:53
log_target_rb_get
const char * log_target_rb_get(struct log_target const *target, size_t logindex)
Return the nth log entry in a target.
Definition: loggingrb.c:71
GSMTAP_CHANNEL_FACCH_F
#define GSMTAP_CHANNEL_FACCH_F
Definition: gsmtap.h:87
GSMTAP_VERSION
#define GSMTAP_VERSION
Definition: gsmtap.h:31
log_info_cat::name
const char * name
name of category
Definition: logging.h:187
msgb_l4len
static unsigned int msgb_l4len(const struct msgb *msgb)
determine length of L4 message
Definition: msgb.h:186
level_colors
static const struct value_string level_colors[]
Definition: logging.c:440
log_set_print_category_hex
void log_set_print_category_hex(struct log_target *target, int)
Enable or disable printing of the category number in hex ('<000b>').
Definition: logging.c:934
osmo_io_fd::u
union osmo_io_fd::@40 u
log_info_cat
Information regarding one logging category.
Definition: logging.h:186
osmo_iofd_write_msgb
int osmo_iofd_write_msgb(struct osmo_io_fd *iofd, struct msgb *msg)
osmo_fsm_inst_alloc
struct osmo_fsm_inst * osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id)
allocate a new instance of a specified FSM
Definition: fsm.c:437
msg
uint8_t msg[0]
log_info
Logging configuration, passed to log_init.
Definition: logging.h:258
_osmo_fsm_inst_state_chg
int _osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_secs, int T, const char *file, int line)
perform a state change of the given FSM instance
Definition: fsm.c:742
osmo_config_list
Definition: msgfile.h:39
llist_for_each_entry_safe
#define llist_for_each_entry_safe(pos, n, head, member)
Iterate over llist of given type, safe against removal of llist entry.
Definition: linuxlist.h:337
osmo_static_assert
osmo_static_assert(_LOG_CTX_COUNT<=ARRAY_SIZE(((struct log_context *) NULL) ->ctx), enum_logging_ctx_items_fit_in_struct_log_context)
gsmtap_osmocore_log_hdr::subsys
char subsys[16]
logging sub-system
Definition: gsmtap.h:334
osmo_iofd_set_name
void osmo_iofd_set_name(struct osmo_io_fd *iofd, const char *name)
log_target_create_stderr
struct log_target * log_target_create_stderr(void)
Create the STDERR log target.
Definition: logging.c:1086
GSMTAP_TYPE_LTE_NAS
#define GSMTAP_TYPE_LTE_NAS
Definition: gsmtap.h:50
gsmtap_source_add_sink_fd
int gsmtap_source_add_sink_fd(int gsmtap_fd)
osmo_fsm_inst::proc
struct osmo_fsm_inst::@0 proc
support for fsm-based procedures
osmo_sockaddr
Definition: socket.h:26
osmo_fsm_inst::child
struct llist_head child
llist_head linked to parent->proc.children
Definition: fsm.h:117
get_string_value
int get_string_value(const struct value_string *vs, const char *str)
get numeric value for given human-readable string
Definition: utils.c:93
netdev_netns_ctx
Definition: netdev.c:115
osmo_iofd_set_alloc_info
void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom)
llist_head::next
struct llist_head * next
Pointer to next and previous item.
Definition: linuxlist.h:48
osmo_it_q::entry
struct llist_head entry
Definition: it_q.h:18
msgb_hexdump_l3
static const char * msgb_hexdump_l3(const struct msgb *msg)
Definition: msgb.h:762
osmo_talloc_replace_string
static void osmo_talloc_replace_string(void *ctx, char **dst, const char *newstr)
duplicate a string using talloc and release its prior content (if any)
Definition: utils.h:124
osmo_fd_setup
void osmo_fd_setup(struct osmo_fd *ofd, int fd, unsigned int when, int(*cb)(struct osmo_fd *fd, unsigned int what), void *data, unsigned int priv_nr)
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:222
DLLAPD
#define DLLAPD
LAPD implementation.
Definition: logging.h:130
GSMTAP_TYPE_ABIS
#define GSMTAP_TYPE_ABIS
Definition: gsmtap.h:34
osmo_netdev_register
int osmo_netdev_register(struct osmo_netdev *netdev)
Start managing the network device referenced by the netdev object.
Definition: netdev.c:674
osmo_it_q
One instance of an inter-thread queue.
Definition: it_q.h:16
_file_wq_write_cb
static int _file_wq_write_cb(struct osmo_fd *ofd, struct msgb *msg)
Definition: logging.c:977
msgb_alloc_c
struct msgb * msgb_alloc_c(const void *ctx, uint16_t size, const char *name)
Allocate a new message buffer from given talloc context.
Definition: msgb.c:73
fsm_free_or_steal
static void fsm_free_or_steal(void *talloc_object)
Internal call to free an FSM instance, which redirects to the context set by osmo_fsm_set_dealloc_ctx...
Definition: fsm.c:106
msgb_tailroom
static int msgb_tailroom(const struct msgb *msgb)
determine how much tail room is left in msgb
Definition: msgb.h:211
log_set_print_category
void log_set_print_category(struct log_target *target, int)
Enable or disable printing of the category name.
Definition: logging.c:925
LLIST_HEAD
LLIST_HEAD(osmo_log_target_list)
get_value_string_or_null
const char * get_value_string_or_null(const struct value_string *vs, uint32_t val)
get human-readable string or NULL for given value
Definition: utils.c:70
_osmo_it_q_enqueue
int _osmo_it_q_enqueue(struct osmo_it_q *queue, struct llist_head *item)
msgb_set_talloc_ctx
void msgb_set_talloc_ctx(void *ctx) OSMO_DEPRECATED("Use msgb_talloc_ctx_init() instead")
Set the talloc context for msgb_alloc Deprecated, use msgb_talloc_ctx_init() instead.
Definition: msgb.c:294
GSMTAP_CHANNEL_SDCCH4
#define GSMTAP_CHANNEL_SDCCH4
Definition: gsmtap.h:85
name
const char * name
should_log_to_target
static bool should_log_to_target(struct log_target *tar, int subsys, int level)
Definition: logging.c:667
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:113
osmo_fd_unregister
void osmo_fd_unregister(struct osmo_fd *fd)
osmo_fsm_inst_name
const char * osmo_fsm_inst_name(const struct osmo_fsm_inst *fi)
get human-readable name of FSM instance
Definition: fsm.c:593
HDLC_SENDFLAG_B1A6
@ HDLC_SENDFLAG_B1A6
Definition: isdnhdlc.c:38
DLOAP
#define DLOAP
Osmocom Authentication Protocol.
Definition: logging.h:140
log_set_print_timestamp
void log_set_print_timestamp(struct log_target *target, int)
Enable or disable printing of timestamps while logging.
Definition: logging.c:855
osmo_netdev_mtu_chg_cb_t
int(* osmo_netdev_mtu_chg_cb_t)(struct osmo_netdev *netdev, unsigned int new_mtu)
Definition: netdev.h:17
log_target::print_filename2
enum log_filename_type print_filename2
Definition: logging.h:392
osmo_fsm_term_cause
osmo_fsm_term_cause
Definition: fsm.h:21
osmo_netdev_get_netns_name
const char * osmo_netdev_get_netns_name(const struct osmo_netdev *netdev)
Get name of network namespace used when opening the netdev interface.
Definition: netdev.c:843
signal_dbm
int8_t signal_dbm
signal level in dBm
Definition: gsmtap.h:8
osmo_isdnhdlc_vars::hdlc_bits1
int hdlc_bits1
Definition: isdnhdlc.h:31
OSMO_NUM_DLIB
#define OSMO_NUM_DLIB
Number of logging sub-systems in libraries.
Definition: logging.h:158
osmo_isdnhdlc_vars::do_adapt56
uint32_t do_adapt56
Definition: isdnhdlc.h:48
OSMO_FD_READ
#define OSMO_FD_READ
Indicate interest in reading from the file descriptor.
Definition: select.h:17
log_target::print_filename
unsigned int print_filename
DEPRECATED: use print_filename2 instead.
Definition: logging.h:320
MAX_LOG_SIZE
#define MAX_LOG_SIZE
Definition: logging.c:75
HDLC_SEND_CRC1
@ HDLC_SEND_CRC1
Definition: isdnhdlc.c:35
osmo_netdev::netns_name
char * netns_name
Definition: netdev.c:272
log_enable_multithread
void log_enable_multithread(void)
Enable multithread support (mutex) in libosmocore logging system.
Definition: logging.c:107
iofd_backend_ops
Definition: osmo_io_internal.h:26
DLNSDATA
#define DLNSDATA
Osmocom NS layer data pdus.
Definition: logging.h:150
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
Initialize a llist_head to point back to itself.
Definition: linuxlist.h:65
osmo_netdev::priv_data
void * priv_data
Definition: netdev.c:275
crc32gen.h
IOFD_FLAG_TO_FREE
#define IOFD_FLAG_TO_FREE
Definition: osmo_io_internal.h:38
IOFD_ACT_READ
@ IOFD_ACT_READ
Definition: osmo_io_internal.h:106
alloc_entries
static struct osmo_config_list * alloc_entries(void *ctx)
Definition: msgfile.c:52
GSMTAP_CHANNEL_SDCCH8
#define GSMTAP_CHANNEL_SDCCH8
Definition: gsmtap.h:86
osmo_fsm::allstate_event_mask
uint32_t allstate_event_mask
bit-mask of events permitted in all states
Definition: fsm.h:70
osmo_sockaddr::sin6
struct sockaddr_in6 sin6
Definition: socket.h:31
LOG_FILENAME_NONE
@ LOG_FILENAME_NONE
Definition: logging.h:288
osmo_netdev_ifupdown_ind_cb_t
int(* osmo_netdev_ifupdown_ind_cb_t)(struct osmo_netdev *netdev, bool ifupdown)
Definition: netdev.h:15
osmo_io_fd::size
unsigned int size
size of msgb to allocate (excluding headroom)
Definition: osmo_io_internal.h:77
gsmtap_osmocore_log_hdr::ts
struct gsmtap_osmocore_log_hdr::@4 ts
osmo_io_fd::tx_queue
struct osmo_io_fd::@39 tx_queue
HDLC_SENDFLAG_ONE
@ HDLC_SENDFLAG_ONE
Definition: isdnhdlc.c:38
netdev_netns_ctx_find_by_netns_name
static struct netdev_netns_ctx * netdev_netns_ctx_find_by_netns_name(const char *netns_name)
Definition: netdev.c:212
osmo_sockaddr_size
static socklen_t osmo_sockaddr_size(const struct osmo_sockaddr *addr)
Return the size of the variant used in the address NOTE: This does not return the size of the in{,...
Definition: socket.h:46
GSMTAP_LOG_MAX_SIZE
#define GSMTAP_LOG_MAX_SIZE
Definition: logging_gsmtap.c:52
gsmtap_inst::sink_ofd
struct osmo_fd sink_ofd
file descriptor
Definition: gsmtap_util.h:30
osmo_crc16gen_code::poly
uint16_t poly
Polynom (normal representation, MSB omitted.
Definition: crc16gen.h:32
iofd_poll_ops
const struct iofd_backend_ops iofd_poll_ops
start
uint32_t start
exec.h
msgb::len
uint16_t len
length of bytes used in msgb
Definition: msgb.h:51
GSMTAP_TYPE_QC_DIAG
#define GSMTAP_TYPE_QC_DIAG
Definition: gsmtap.h:49
netdev_netns_ctx_get
static struct netdev_netns_ctx * netdev_netns_ctx_get(const char *netns_name)
Definition: netdev.c:225
log_target_create_gsmtap
struct log_target * log_target_create_gsmtap(const char *host, uint16_t port, const char *ident, bool ofd_wq_mode, bool add_sink)
Create a new logging target for GSMTAP logging.
Definition: logging_gsmtap.c:130
log_target_create_file
struct log_target * log_target_create_file(const char *fname)
Create a new file-based log target using non-blocking write_queue.
Definition: logging.c:1244
iofd_backend_ops::read_enable
void(* read_enable)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:32
osmo_mnl_destroy
void osmo_mnl_destroy(struct osmo_mnl *omnl)
destroy an existing osmocom-wrapped mnl netlink socket: Unregister + close + free.
Definition: mnl.c:103
osmo_netdev_set_dev_name_chg_cb
void osmo_netdev_set_dev_name_chg_cb(struct osmo_netdev *netdev, osmo_netdev_dev_name_chg_cb_t dev_name_chg_cb)
Set dev_name_chg_cb callback, called when a change in the network name is detected.
Definition: netdev.c:766
osmo_quote_str
const char * osmo_quote_str(const char *str, int in_len)
Like osmo_quote_str_buf() but returns the result in a static buffer.
Definition: utils.c:951
osmo_isdnhdlc_vars::data_received
uint32_t data_received
Definition: isdnhdlc.h:44
osmo_fsm_log_addr
void osmo_fsm_log_addr(bool log_addr)
specify if FSM instance addresses should be logged or not
Definition: fsm.c:122
RSL_CHAN_SDCCH8_ACCH
#define RSL_CHAN_SDCCH8_ACCH
log_target_create_rb
struct log_target * log_target_create_rb(size_t size)
Create a new logging target for ringbuffer-backed logging.
Definition: loggingrb.c:80
osmo_io_fd::poll
struct osmo_io_fd::@40::@41 poll
osmo_fsm_inst
a single instanceof an osmocom finite state machine
Definition: fsm.h:87
log_set_print_filename
void log_set_print_filename(struct log_target *target, int) OSMO_DEPRECATED("Use log_set_print_filename2() instead")
Use log_set_print_filename2() instead.
Definition: logging.c:891
msgb_talloc_ctx_init
void * msgb_talloc_ctx_init(void *root_ctx, unsigned int pool_size)
Initialize a msgb talloc context for msgb_alloc.
Definition: msgb.c:307
osmo_counter::previous
unsigned long previous
previous value
Definition: counter.h:14
osmo_iofd_get_name
const char * osmo_iofd_get_name(const struct osmo_io_fd *iofd)
osmo_it_q::name
const char * name
Definition: it_q.h:30
LOG_TGT_TYPE_SYSLOG
@ LOG_TGT_TYPE_SYSLOG
syslog based logging
Definition: logging.h:278
osmo_crc8gen_code::poly
uint8_t poly
Polynom (normal representation, MSB omitted.
Definition: crc8gen.h:32
log_target::entry
struct llist_head entry
linked list
Definition: logging.h:301
osmo_netdev::ifupdown_ind_cb
osmo_netdev_ifupdown_ind_cb_t ifupdown_ind_cb
Definition: netdev.c:281
log_category::loglevel
uint8_t loglevel
configured log-level
Definition: logging.h:181
HDLC_SEND_CRC2
@ HDLC_SEND_CRC2
Definition: isdnhdlc.c:36
osmo_fsm_state::onleave
void(* onleave)(struct osmo_fsm_inst *fi, uint32_t next_state)
function to be called just before leaving the state
Definition: fsm.h:54
IFINDEX_UNUSED
#define IFINDEX_UNUSED
Definition: netdev.c:104
length
uint8_t length
HDLC_FAST_FLAG
@ HDLC_FAST_FLAG
Definition: isdnhdlc.c:31
log_target::use_color
unsigned int use_color
should color be used when printing log messages?
Definition: logging.h:314
osmo_sockaddr::u
union osmo_sockaddr::@28 u
osmo_crc64gen_code::init
uint64_t init
Initialization value of the CRC state.
Definition: crc64gen.h:33
osmo_io_fd::write_msghdr
void * write_msghdr
Definition: osmo_io_internal.h:99
osmo_counter
Structure representing a single counter.
Definition: counter.h:9
osmo_fsm_inst_update_id_f_sanitize
int osmo_fsm_inst_update_id_f_sanitize(struct osmo_fsm_inst *fi, char replace_with, const char *fmt,...)
Change id of the FSM instance using a string format, and ensuring a valid id.
Definition: fsm.c:409
msgb_l1
#define msgb_l1(m)
obtain L1 header of msgb
Definition: msgb.h:130
osmo_fsm
a description of an osmocom finite state machine
Definition: fsm.h:58
msgb_length
uint16_t msgb_length(const struct msgb *msg)
get length of message buffer
Definition: msgb.c:285
LOGPFSM
#define LOGPFSM(fi, fmt, args...)
Log using FSM instance's context.
Definition: fsm.h:185
log_targets_reopen
int log_targets_reopen(void)
close and re-open all log files (for log file rotation)
Definition: logging.c:1405
llist_del
static void llist_del(struct llist_head *entry)
Delete a single entry from a linked list.
Definition: linuxlist.h:128
DLM3UA
#define DLM3UA
Osmocom M3UA.
Definition: logging.h:144
osmo_get_macaddr
int osmo_get_macaddr(uint8_t *mac_out, const char *dev_name)
Obtain the MAC address of a given network device.
Definition: macaddr.c:120
IOFD_FLAG_ISSET
#define IOFD_FLAG_ISSET(iofd, flag)
Definition: osmo_io_internal.h:47
osmo_io_fd::max_length
unsigned int max_length
maximum length of write queue
Definition: osmo_io_internal.h:84
level
uint8_t level
logging level
Definition: gsmtap.h:8
handle_line
static void handle_line(struct osmo_config_list *entries, char *line)
Definition: msgfile.c:67
DLRSPRO
#define DLRSPRO
Osmocom Remote SIM Protocol.
Definition: logging.h:147
INT2IDX
#define INT2IDX(x)
Definition: logging.c:155
gsmtap_hdr::signal_dbm
int8_t signal_dbm
signal level in dBm
Definition: gsmtap.h:311
osmo_io_ops::read_cb
void(* read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg)
call-back function when something was read from fd
Definition: osmo_io.h:42
osmo_crc16gen_compute_bits
uint16_t osmo_crc16gen_compute_bits(const struct osmo_crc16gen_code *code, const ubit_t *in, int len)
Compute the CRC value of a given array of hard-bits.
Definition: crc16gen.c:40
tall_log_ctx
void * tall_log_ctx
Definition: logging.c:90
GSMTAP_CHANNEL_PTCCH
#define GSMTAP_CHANNEL_PTCCH
Definition: gsmtap.h:94
osmo_mnl::priv
void * priv
opaque data provided by user
Definition: mnl.h:18
osmo_it_q_alloc
struct osmo_it_q * osmo_it_q_alloc(void *ctx, const char *name, unsigned int max_length, void(*read_cb)(struct osmo_it_q *q, struct llist_head *item), void *data)
bits.h
osmo_strrb_create
struct osmo_strrb * osmo_strrb_create(void *talloc_ctx, size_t rb_size)
Create an empty, initialized osmo_strrb.
Definition: strrb.c:55
OSMO_IO_FD_MODE_SCTP_RECVMSG_SENDMSG
@ OSMO_IO_FD_MODE_SCTP_RECVMSG_SENDMSG
emulate sctp_recvmsg() and sctp_sendmsg()
Definition: osmo_io.h:25
msgb_hexdump_c
char * msgb_hexdump_c(const void *ctx, const struct msgb *msg)
Return a dynamically allocated buffer containing a hexdump of the msg.
Definition: msgb.c:553
osmo_io_fd::io_ops
struct osmo_io_ops io_ops
send/recv (msg) callback functions
Definition: osmo_io_internal.h:64
osmo_fsm_inst::terminating
bool terminating
Indicator whether osmo_fsm_inst_term() was already invoked on this instance.
Definition: fsm.h:119
GSMTAP_TYPE_UM
#define GSMTAP_TYPE_UM
Definition: gsmtap.h:33
osmo_io_backend_names
const struct value_string osmo_io_backend_names[]
subsys_lib2index
static int subsys_lib2index(int subsys)
Definition: logging.c:334
log_set_print_level
void log_set_print_level(struct log_target *target, int)
Enable or disable printing of the log level name.
Definition: logging.c:945
GSMTAP_TYPE_E1T1
#define GSMTAP_TYPE_E1T1
Definition: gsmtap.h:51
log_target::print_ext_timestamp
unsigned int print_ext_timestamp
should log messages be prefixed with an extended timestamp?
Definition: logging.h:324
log_target::loglevel
uint8_t loglevel
global log level
Definition: logging.h:312
data
uint8_t data[0]
gsmtap_hdr::sub_type
uint8_t sub_type
Type of burst/channel, see above.
Definition: gsmtap.h:316
LLIST_HEAD
static LLIST_HEAD(counters)
DLBSSGP
#define DLBSSGP
Osmocom BSSGP layer.
Definition: logging.h:149
log_set_context
int log_set_context(uint8_t ctx, void *value)
Set the logging context.
Definition: logging.c:816
GSMTAP_CHANNEL_AGCH
#define GSMTAP_CHANNEL_AGCH
Definition: gsmtap.h:82
osmo_fsm::allstate_action
void(* allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data)
function pointer to be called for allstate events
Definition: fsm.h:72
osmo_crc32gen_set_bits
void osmo_crc32gen_set_bits(const struct osmo_crc32gen_code *code, const ubit_t *in, int len, ubit_t *crc_bits)
Computes and writes the CRC value of a given array of bits.
Definition: crc32gen.c:100
OSMO_LOGCOLOR_BLUE
#define OSMO_LOGCOLOR_BLUE
Definition: logging.h:165
IOFD_ACT_RECVFROM
@ IOFD_ACT_RECVFROM
Definition: osmo_io_internal.h:108
GSMTAP_CHANNEL_SDCCH
#define GSMTAP_CHANNEL_SDCCH
Definition: gsmtap.h:84
HDLC_SEND_DATA
@ HDLC_SEND_DATA
Definition: isdnhdlc.c:35
gsmtap_type_names
const struct value_string gsmtap_type_names[]
Definition: gsmtap_util.c:581
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)
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:175
log_info::num_cat_user
unsigned int num_cat_user
total number of user categories (not library)
Definition: logging.h:267
osmo_netdev::dev_name_chg_cb
osmo_netdev_dev_name_chg_cb_t dev_name_chg_cb
Definition: netdev.c:284
osmo_crc32gen_check_bits
int osmo_crc32gen_check_bits(const struct osmo_crc32gen_code *code, const ubit_t *in, int len, const ubit_t *crc_bits)
Checks the CRC value of a given array of hard-bits.
Definition: crc32gen.c:75
msgb
Osmocom message buffer.
Definition: msgb.h:31
gsmtap_source_init
struct gsmtap_inst * gsmtap_source_init(const char *host, uint16_t port, int ofd_wq_mode)
GSMTAP_CHANNEL_PDCH
#define GSMTAP_CHANNEL_PDCH
Definition: gsmtap.h:93
LOGL_INFO
#define LOGL_INFO
general information
Definition: logging.h:123
_file_output_stream
static void _file_output_stream(struct log_target *target, unsigned int level, const char *log)
Definition: logging.c:994
DLMI
#define DLMI
ISDN-layer below input sub-system.
Definition: logging.h:133
log_target
structure representing a logging target
Definition: logging.h:300
osmo_io_fd::msgb_alloc
struct osmo_io_fd::@38 msgb_alloc
strrb.h
osmo_crc64gen_code::poly
uint64_t poly
Polynom (normal representation, MSB omitted.
Definition: crc64gen.h:32
log_info::cat
const struct log_info_cat * cat
per-category information
Definition: logging.h:263
osmo_strrb_add
int osmo_strrb_add(struct osmo_strrb *rb, const char *data)
Add a string to the osmo_strrb.
Definition: strrb.c:148
STOPPED
@ STOPPED
Definition: isdnhdlc.c:38
osmo_crc8gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc8gen.h:31
flags
uint16_t flags
gsmtap_inst
one gsmtap instance
Definition: gsmtap_util.h:27
osmo_crc32gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc32gen.h:31
LOGNETDEV
#define LOGNETDEV(netdev, lvl, fmt, args ...)
Definition: netdev.c:106
log_target::sd_journal
struct log_target::@8::@15 sd_journal
osmo_io.h
OSMO_IO_DEFAULT_MSGB_HEADROOM
#define OSMO_IO_DEFAULT_MSGB_HEADROOM
Definition: osmo_io_internal.h:17
gsmtap_hdr::type
uint8_t type
see GSMTAP_TYPE_*
Definition: gsmtap.h:307
res
uint8_t res[16]
msgb_l3len
static unsigned int msgb_l3len(const struct msgb *msgb)
determine length of L3 message
Definition: msgb.h:173
log_target::raw_output
void(* raw_output)(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
alternative call-back function to which the logging framework passes the unfortmatted input arguments...
Definition: logging.h:383
osmo_fsm_inst_free
void osmo_fsm_inst_free(struct osmo_fsm_inst *fi)
delete a given instance of a FSM
Definition: fsm.c:536
msgb_resize_area
int msgb_resize_area(struct msgb *msg, uint8_t *area, int old_size, int new_size)
Resize an area within an msgb.
Definition: msgb.c:414
osmo_mnl_fd_cb
static int osmo_mnl_fd_cb(struct osmo_fd *ofd, unsigned int what)
Definition: mnl.c:37
OSMO_LOGCOLOR_GREEN
#define OSMO_LOGCOLOR_GREEN
Definition: logging.h:163
IOFD_FLAG_CLOSED
#define IOFD_FLAG_CLOSED
Definition: osmo_io_internal.h:36
osmo_netdev_set_ifupdown_ind_cb
void osmo_netdev_set_ifupdown_ind_cb(struct osmo_netdev *netdev, osmo_netdev_ifupdown_ind_cb_t ifupdown_ind_cb)
Set data_ind_cb callback, called when a new packet is received on the network interface.
Definition: netdev.c:757
log_target::facility
int facility
Definition: logging.h:340
RSL_CHAN_PCH_AGCH
#define RSL_CHAN_PCH_AGCH
msgb::l1h
unsigned char * l1h
pointer to Layer1 header (if any)
Definition: msgb.h:43
log_target::print_tid
unsigned int print_tid
should log messages be prefixed with the logger Thread ID?
Definition: logging.h:318
gsm_04_08.h
log_target::print_level
bool print_level
Definition: logging.h:388
utils.h
osmo_iofd_notify_connected
void osmo_iofd_notify_connected(struct osmo_io_fd *iofd)
osmo_crc16_ccitt_table
const uint16_t osmo_crc16_ccitt_table[256]
CRC table for the CCITT CRC-6.
Definition: crc16.c:67
osmo_fsm_unregister
void osmo_fsm_unregister(struct osmo_fsm *fsm)
unregister a FSM from the core
Definition: fsm.c:305
osmo_fsm_find_by_name
struct osmo_fsm * osmo_fsm_find_by_name(const char *name)
Definition: fsm.c:235
GSMTAP_CHANNEL_RACH
#define GSMTAP_CHANNEL_RACH
Definition: gsmtap.h:81
GSMTAP_TYPE_LTE_MAC
#define GSMTAP_TYPE_LTE_MAC
Definition: gsmtap.h:46
osmo_fsm_inst_dispatch
#define osmo_fsm_inst_dispatch(fi, event, data)
dispatch an event to an osmocom finite state machine instance
Definition: fsm.h:299
osmo_io_fd::pending
struct msgb * pending
Pending msgb to keep partial data during segmentation.
Definition: osmo_io_internal.h:66
HDLC_GETFLAG_B7
@ HDLC_GETFLAG_B7
Definition: isdnhdlc.c:30
OSMO_STRLCPY_ARRAY
#define OSMO_STRLCPY_ARRAY(array, src)
Copy a C-string into a sized buffer using sizeof to detect buffer's size.
Definition: utils.h:39
osmo_fsm::states
const struct osmo_fsm_state * states
table of state transition rules
Definition: fsm.h:66
osmo_crc8gen_set_bits
void osmo_crc8gen_set_bits(const struct osmo_crc8gen_code *code, const ubit_t *in, int len, ubit_t *crc_bits)
Computes and writes the CRC value of a given array of bits.
Definition: crc8gen.c:100
log_info::num_cat
unsigned int num_cat
total number of categories
Definition: logging.h:265
_osmo_fsm_inst_term_children
void _osmo_fsm_inst_term_children(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause, void *data, const char *file, int line)
Terminate all child FSM instances of an FSM instance.
Definition: fsm.c:986
netdev_netns_ctx::netns_fd
int netns_fd
Definition: netdev.c:119
osmo_netdev
Definition: netdev.c:255
log_target_create_systemd
struct log_target * log_target_create_systemd(bool raw)
Create a new logging target for systemd journal logging.
Definition: logging_systemd.c:86
osmo_netdev::entry
struct llist_head entry
Definition: netdev.c:257
log_target::tgt_file
struct log_target::@8::@10 tgt_file
GSMTAP_TYPE_UMTS_RLC_MAC
#define GSMTAP_TYPE_UMTS_RLC_MAC
Definition: gsmtap.h:43
DLCSN1
#define DLCSN1
CSN.1 (Concrete Syntax Notation 1) codec.
Definition: logging.h:154
map_subsys
static int map_subsys(int subsys)
Definition: logging.c:649
osmo_iofd_txqueue_len
unsigned int osmo_iofd_txqueue_len(struct osmo_io_fd *iofd)
HDLC_GET_FLAG_B0
@ HDLC_GET_FLAG_B0
Definition: isdnhdlc.c:30
iofd_msghdr::hdr
struct msghdr hdr
Definition: osmo_io_internal.h:118
_osmo_fsm_inst_state_chg_keep_timer
int _osmo_fsm_inst_state_chg_keep_timer(struct osmo_fsm_inst *fi, uint32_t new_state, const char *file, int line)
perform a state change while keeping the current timer running.
Definition: fsm.c:774
msgb_free
void msgb_free(struct msgb *m)
Release given message buffer.
Definition: msgb.c:117
msgb_copy_resize
struct msgb * msgb_copy_resize(const struct msgb *msg, uint16_t new_len, const char *name)
Copy an msgb with memory reallocation.
Definition: msgb.c:369
LOG_FILENAME_POS_LINE_END
@ LOG_FILENAME_POS_LINE_END
Definition: logging.h:296
log_set_use_color
void log_set_use_color(struct log_target *target, int)
Enable or disable the use of colored output.
Definition: logging.c:846
netdev_netns_ctx_put
static void netdev_netns_ctx_put(struct netdev_netns_ctx *netns_ctx)
Definition: netdev.c:246
LOG_FILENAME_POS_HEADER_END
@ LOG_FILENAME_POS_HEADER_END
Definition: logging.h:295
fsm_log_addr
static bool fsm_log_addr
Definition: fsm.c:87
OSMO_IO_BACKEND_IO_URING
@ OSMO_IO_BACKEND_IO_URING
Definition: osmo_io.h:30
GSMTAP_TYPE_TETRA_I1_BURST
#define GSMTAP_TYPE_TETRA_I1_BURST
Definition: gsmtap.h:38
OSMO_FSM_TERM_PARENT
@ OSMO_FSM_TERM_PARENT
terminate because parent terminated
Definition: fsm.h:23
HDLC_SEND_CLOSING_FLAG
@ HDLC_SEND_CLOSING_FLAG
Definition: isdnhdlc.c:36
osmo_fd_close
void osmo_fd_close(struct osmo_fd *fd)
RSL_CHAN_Lm_ACCHs
#define RSL_CHAN_Lm_ACCHs
GSMTAP_TYPE_OSMOCORE_LOG
#define GSMTAP_TYPE_OSMOCORE_LOG
Definition: gsmtap.h:48
log_set_print_tid
void log_set_print_tid(struct log_target *target, int)
Enable or disable printing of timestamps while logging.
Definition: logging.c:877
gsmtap_sendmsg_free
int gsmtap_sendmsg_free(struct gsmtap_inst *gti, struct msgb *msg)
osmo_iofd_set_priv_nr
void osmo_iofd_set_priv_nr(struct osmo_io_fd *iofd, unsigned int priv_nr)
log_del_target
void log_del_target(struct log_target *target)
Unregister a log target from the logging core.
Definition: logging.c:794
osmo_wqueue_enqueue_quiet
int osmo_wqueue_enqueue_quiet(struct osmo_wqueue *queue, struct msgb *data)
Enqueue a new Message buffers into a write queue (without logging full queue events)
Definition: write_queue.c:107
_gsmtap_raw_output
static void _gsmtap_raw_output(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
Definition: logging_gsmtap.c:56
RSL_CHAN_OSMO_VAMOS_Lm_ACCHs
#define RSL_CHAN_OSMO_VAMOS_Lm_ACCHs
LOGPFSMSRC
#define LOGPFSMSRC(fi, caller_file, caller_line, fmt, args...)
Log using FSM instance's context, with explicit source file and line info.
Definition: fsm.h:197
osmo_netdev::registered
bool registered
Definition: netdev.c:278
osmo_crc32gen_code::remainder
uint32_t remainder
Remainder of the CRC (final XOR)
Definition: crc32gen.h:34
osmo_mnl::ofd
struct osmo_fd ofd
osmo-wrapped netlink file descriptor
Definition: mnl.h:12
iofd_backend_ops::unregister_fd
int(* unregister_fd)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:28
rsl.h
LOGPFSMLSRC
#define LOGPFSMLSRC(fi, level, caller_file, caller_line, fmt, args...)
Log using FSM instance's context, on explicit logging level, and with explicit source file and line i...
Definition: fsm.h:174
osmo_isdnhdlc_vars::cbin
uint8_t cbin
Definition: isdnhdlc.h:39
iofd_msghdr::list
struct llist_head list
Definition: osmo_io_internal.h:116
osmo_wqueue_enqueue
int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data)
Enqueue a new Message buffers into a write queue.
Definition: write_queue.c:123
DLCTRL
#define DLCTRL
Control Interface.
Definition: logging.h:136
osmo_fsm_inst::parent
struct osmo_fsm_inst * parent
the parent FSM that has created us
Definition: fsm.h:111
timer.h
log_filename_pos
log_filename_pos
Where on a log line source file and line should be logged.
Definition: logging.h:294
osmo_timer_schedule
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
schedule a timer at a given future relative time
Definition: timer.c:99
GSMTAP_CHANNEL_VOICE_H
#define GSMTAP_CHANNEL_VOICE_H
Definition: gsmtap.h:97
logp
void logp(int subsys, const char *file, int line, int cont, const char *format,...) OSMO_DEPRECATED("Use DEBUGP* macros instead")
logging function used by DEBUGP() macro
Definition: logging.c:743
osmo_sockaddr_is_local
int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen)
OSMO_IO_FD_MODE_READ_WRITE
@ OSMO_IO_FD_MODE_READ_WRITE
use read() / write() calls
Definition: osmo_io.h:21
osmo_it_q::current_length
unsigned int current_length
Definition: it_q.h:25
osmo_crc32gen_compute_bits
uint32_t osmo_crc32gen_compute_bits(const struct osmo_crc32gen_code *code, const ubit_t *in, int len)
Compute the CRC value of a given array of hard-bits.
Definition: crc32gen.c:40
crc16gen.h
netdev_netns_ctx_alloc
static struct netdev_netns_ctx * netdev_netns_ctx_alloc(void *ctx, const char *netns_name)
Definition: netdev.c:125
GSMTAP_CHANNEL_BCCH
#define GSMTAP_CHANNEL_BCCH
Definition: gsmtap.h:79
osmo_close_all_fds_above
int osmo_close_all_fds_above(int last_fd_to_keep)
Definition: exec.c:164
osmo_htonl
#define osmo_htonl(x)
Definition: byteswap.h:43
osmo_wqueue
write queue instance
Definition: write_queue.h:30
osmo_fsm_term_cause_names
const struct value_string osmo_fsm_term_cause_names[]
Definition: fsm.c:1037
HDLC_SEND_IDLE1
@ HDLC_SEND_IDLE1
Definition: isdnhdlc.c:37
HDLC_SENDFLAG_B0
@ HDLC_SENDFLAG_B0
Definition: isdnhdlc.c:37
osmo_isdnhdlc_vars::data_bits
int data_bits
Definition: isdnhdlc.h:32
gsmtap_hdr::sub_slot
uint8_t sub_slot
sub-slot within timeslot
Definition: gsmtap.h:318
osmo_iofd_sendto_msgb
int osmo_iofd_sendto_msgb(struct osmo_io_fd *iofd, struct msgb *msg, int sendto_flags, const struct osmo_sockaddr *dest)
osmo_environment_whitelist
const char * osmo_environment_whitelist[]
suggested list of environment variables to pass (if they exist) to a sub-process/script
Definition: exec.c:38
osmo_sock_init2
int osmo_sock_init2(uint16_t family, uint16_t type, uint8_t proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags)
msgb_l1len
static unsigned int msgb_l1len(const struct msgb *msgb)
determine length of L1 message
Definition: msgb.h:147
RSL_CHAN_OSMO_VAMOS_Bm_ACCHs
#define RSL_CHAN_OSMO_VAMOS_Bm_ACCHs
osmo_isdnhdlc_vars::bit_shift
int bit_shift
Definition: isdnhdlc.h:30
environ
char ** environ
gsmtap_osmocore_log_hdr::src_file
struct gsmtap_osmocore_log_hdr::@5 src_file
osmo_it_q_by_name
struct osmo_it_q * osmo_it_q_by_name(const char *name)
osmo_fd::when
unsigned int when
bit-mask or of OSMO_FD_READ, OSMO_FD_WRITE and/or OSMO_FD_EXCEPT
Definition: select.h:38
g_netdev_netns_ctx_list
static struct llist_head g_netdev_netns_ctx_list
Definition: netdev.c:111
DLMIB
#define DLMIB
ISDN layer B-channel.
Definition: logging.h:134
osmo_isdnhdlc_vars::crc
uint16_t crc
Definition: isdnhdlc.h:37
gsmtap_source_add_sink
int gsmtap_source_add_sink(struct gsmtap_inst *gti)
msgb::tail
unsigned char * tail
end of message in buffer
Definition: msgb.h:54
osmo_iofd_txqueue_clear
void osmo_iofd_txqueue_clear(struct osmo_io_fd *iofd)
osmo_fsm_inst_unlink_parent
void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx)
unlink child FSM from its parent FSM.
Definition: fsm.c:500
osmo_fsm::cleanup
void(* cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
clean-up function, called during termination
Definition: fsm.h:74
osmo_netdev_free
void osmo_netdev_free(struct osmo_netdev *netdev)
Free an allocated netdev object.
Definition: netdev.c:660
depth
unsigned int depth
2 if a secondary FSM terminates, 3 if a secondary FSM causes a tertiary FSM to terminate,...
Definition: fsm.c:97
OSMO_LOGCOLOR_RED
#define OSMO_LOGCOLOR_RED
Definition: logging.h:162
osmo_crc16gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc16gen.h:31
assert_loginfo
void assert_loginfo(const char *src)
Definition: logging.c:324
OSMO_HDLC_LENGTH_ERROR
#define OSMO_HDLC_LENGTH_ERROR
Definition: isdnhdlc.h:67
msgb::l4h
unsigned char * l4h
pointer to layer 4 header
Definition: msgb.h:46
osmo_fsm_inst::name
const char * name
human readable fully-qualified name
Definition: fsm.h:95
OSMO_IO_BACKEND_POLL
@ OSMO_IO_BACKEND_POLL
Definition: osmo_io.h:29
osmo_fsm_inst::state
uint32_t state
current state of the FSM
Definition: fsm.h:101
IOFD_FLAG_UNSET
#define IOFD_FLAG_UNSET(iofd, flag)
Definition: osmo_io_internal.h:44
osmo_config_entry
One message in the list.
Definition: msgfile.h:26
log_target::print_category
unsigned int print_category
should log messages be prefixed with a category name?
Definition: logging.h:322
ts
struct @6 ts
osmo_io_ops::recvfrom_cb
void(* recvfrom_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg, const struct osmo_sockaddr *saddr)
call-back function emulating recvfrom
Definition: osmo_io.h:61
osmo_environment_filter
int osmo_environment_filter(char **out, size_t out_len, char **in, const char **whitelist)
filtered a process environment by whitelist; only copying pointers, no actual strings.
Definition: exec.c:82
buffer
RSL_CHAN_OSMO_CBCH8
#define RSL_CHAN_OSMO_CBCH8
osmo_io_fd::read_msghdr
void * read_msghdr
Definition: osmo_io_internal.h:98
iofd_txqueue_enqueue_front
void iofd_txqueue_enqueue_front(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr)
_systemd_raw_output
static void _systemd_raw_output(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
Definition: logging_systemd.c:57
root_fi
struct osmo_fsm_inst * root_fi
The first FSM instance that invoked osmo_fsm_inst_term() in the current cascade.
Definition: fsm.c:95
event
event
osmo_fsm::timer_cb
int(* timer_cb)(struct osmo_fsm_inst *fi)
timer call-back for states with time-out.
Definition: fsm.h:77
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)
osmo_it_q::data
void * data
Definition: it_q.h:36
IOFD_FLAG_SET
#define IOFD_FLAG_SET(iofd, flag)
Definition: osmo_io_internal.h:41
byteswap.h
DLPFCP
#define DLPFCP
Osmocom Packet Forwarding Control Protocol.
Definition: logging.h:153
_LOG_CTX_COUNT
@ _LOG_CTX_COUNT
Definition: logging.h:203
osmo_revbytebits_8
uint32_t osmo_revbytebits_8(uint8_t x)
reverse the bit order in a byte
Definition: bits.c:294
gsmtap_sendmsg
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
osmo_counters_count
int osmo_counters_count(void)
Counts the registered counter.
Definition: counter.c:78
osmo_identifier_valid
bool osmo_identifier_valid(const char *str)
Determine if a given identifier is valid, i.e.
Definition: utils.c:671
osmo_iofd_set_ioops
void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops)
osmo_netdev_add_route
int osmo_netdev_add_route(struct osmo_netdev *netdev, const struct osmo_sockaddr *dst_addr, uint8_t dst_prefixlen, const struct osmo_sockaddr *gw_addr)
Add IP route to netdev interface.
Definition: netdev.c:930
talloc.h
log_target::type
enum log_target_type type
the type of this log taget
Definition: logging.h:327
log_target::print_category_hex
bool print_category_hex
Definition: logging.h:390
OSMO_HDLC_F_BITREVERSE
#define OSMO_HDLC_F_BITREVERSE
Definition: isdnhdlc.h:58
osmo_netdev::dev_name
char * dev_name
Definition: netdev.c:269
llist_head
(double) linked list header structure
Definition: linuxlist.h:46
osmo_io_fd::current_length
unsigned int current_length
current length of write queue
Definition: osmo_io_internal.h:86
_output_buf
static int _output_buf(char *buf, int buf_len, struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
main output formatting function for log lines.
Definition: logging.c:485
osmo_isdnhdlc_vars::state
int state
Definition: isdnhdlc.h:34
GSMTAP_CHANNEL_CBCH51
#define GSMTAP_CHANNEL_CBCH51
Definition: gsmtap.h:95
OSMO_IO_FD_MODE_RECVFROM_SENDTO
@ OSMO_IO_FD_MODE_RECVFROM_SENDTO
use recvfrom() / sendto() calls
Definition: osmo_io.h:23
osmo_netdev_set_priv_data
void osmo_netdev_set_priv_data(struct osmo_netdev *netdev, void *priv_data)
Set private user data pointer on the netdev object.
Definition: netdev.c:739
osmo_crc8gen_check_bits
int osmo_crc8gen_check_bits(const struct osmo_crc8gen_code *code, const ubit_t *in, int len, const ubit_t *crc_bits)
Checks the CRC value of a given array of hard-bits.
Definition: crc8gen.c:75
if
if(vty->type==VTY_SHELL_SERV)
signal.h
c
struct abis_rsl_common_hdr c
gsmtap_inst::wq
struct osmo_wqueue wq
the wait queue
Definition: gsmtap_util.h:29
GSMTAP_TYPE_WMX_BURST
#define GSMTAP_TYPE_WMX_BURST
Definition: gsmtap.h:39
osmo_netdev::if_up
bool if_up
Definition: netdev.c:290
log_target_file_reopen
int log_target_file_reopen(struct log_target *tgt)
close and re-open a log file (for log file rotation)
Definition: logging.c:1370
OSMO_LOGCOLOR_YELLOW
#define OSMO_LOGCOLOR_YELLOW
Definition: logging.h:164
osmo_iofd_unregister
int osmo_iofd_unregister(struct osmo_io_fd *iofd)
log_tgt_mutex_lock
#define log_tgt_mutex_lock()
Definition: logging.h:465
LOG_TGT_TYPE_FILE
@ LOG_TGT_TYPE_FILE
text file logging
Definition: logging.h:279
log_reset_context
void log_reset_context(void)
Reset (clear) the logging context.
Definition: logging.c:800
l
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead u l))
osmo_fsm_inst::T
int T
timer number for states with time-out
Definition: fsm.h:104
osmo_netdev_ifupdown
int osmo_netdev_ifupdown(struct osmo_netdev *netdev, bool ifupdown)
Bring netdev interface UP or DOWN.
Definition: netdev.c:865
DLIO
#define DLIO
Osmocom IO sub-system.
Definition: logging.h:157
osmo_isdnhdlc_out_init
void osmo_isdnhdlc_out_init(struct osmo_isdnhdlc_vars *hdlc, uint32_t features)
Definition: isdnhdlc.c:53
log_set_print_extended_timestamp
void log_set_print_extended_timestamp(struct log_target *target, int)
Enable or disable printing of extended timestamps while logging.
Definition: logging.c:868
osmo_fsm_log_timeouts
void osmo_fsm_log_timeouts(bool log_timeouts)
Enable or disable logging of timeout values for FSM instance state changes.
Definition: fsm.c:142
msgb_trim
static int msgb_trim(struct msgb *msg, int len)
Trim the msgb to a given absolute length.
Definition: msgb.h:495
osmo_io_internal.h
DLMUX
#define DLMUX
Osmocom Multiplex (Osmux)
Definition: logging.h:132
iofd_backend_ops::close
int(* close)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:29
osmo_wqueue_init
void osmo_wqueue_init(struct osmo_wqueue *queue, int max_length)
Initialize a osmo_wqueue structure.
Definition: write_queue.c:91
msgb_l2len
static unsigned int msgb_l2len(const struct msgb *msgb)
determine length of L2 message
Definition: msgb.h:160
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:123
OSMO_IO_BACKEND_DEFAULT
#define OSMO_IO_BACKEND_DEFAULT
Definition: osmo_io_internal.h:20
osmo_config_list::entry
struct llist_head entry
Definition: msgfile.h:40
GSMTAP_TYPE_GB_LLC
#define GSMTAP_TYPE_GB_LLC
Definition: gsmtap.h:40
osmo_io_fd::uring
struct osmo_io_fd::@40::@42 uring
DLSUA
#define DLSUA
Osmocom SUA.
Definition: logging.h:143
gsmtap_hdr::timeslot
uint8_t timeslot
timeslot (0..7 on Um)
Definition: gsmtap.h:308
iofd_msgb_pending
struct msgb * iofd_msgb_pending(struct osmo_io_fd *iofd)
osmo_timer_setup
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
set up timer callback and data
Definition: timer.c:70
iofd_txqueue_enqueue
int iofd_txqueue_enqueue(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr)
_systemd_output
static void _systemd_output(struct log_target *target, unsigned int level, const char *log)
Definition: logging_systemd.c:50
OSMO_FSM_TERM_REQUEST
@ OSMO_FSM_TERM_REQUEST
terminate on explicit user request
Definition: fsm.h:25
msgb.h
LOG_TGT_TYPE_GSMTAP
@ LOG_TGT_TYPE_GSMTAP
GSMTAP network logging.
Definition: logging.h:282
_file_raw_output
static void _file_raw_output(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
Definition: logging.c:1003
TRACE
#define TRACE(probe)
Definition: logging.c:51
GSMTAP_CHANNEL_ACCH
#define GSMTAP_CHANNEL_ACCH
Definition: gsmtap.h:108
handle_fast_flag
#define handle_fast_flag(h)
OSMO_VALUE_STRING
#define OSMO_VALUE_STRING(x)
Make a value_string entry from an enum value name.
Definition: utils.h:34
osmo_isdnhdlc_encode
int osmo_isdnhdlc_encode(struct osmo_isdnhdlc_vars *hdlc, const uint8_t *src, uint16_t slen, int *count, uint8_t *dst, int dsize)
encodes HDLC frames to a transparent bit stream.
Definition: isdnhdlc.c:337
LOG_WQUEUE_LEN
#define LOG_WQUEUE_LEN
Definition: logging.c:78
collect_ctx
void * collect_ctx
Talloc context to collect all deferred deallocations (FSM instances, and talloc objects if any).
Definition: fsm.c:99
osmo_isdnhdlc_vars::dchannel
uint32_t dchannel
Definition: isdnhdlc.h:46
OSMO_SOCK_F_UDP_REUSEADDR
#define OSMO_SOCK_F_UDP_REUSEADDR
use SO_REUSEADDR on UDP ports (required for multicast)
Definition: socket.h:98
osmo_crc16
uint16_t osmo_crc16(uint16_t crc, const uint8_t *buffer, size_t len)
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer.
Definition: crc16.c:59
osmo_fsm::num_states
unsigned int num_states
number of entries in states
Definition: fsm.h:68
osmo_mnl
osmocom wrapper around libmnl abstraction of netlink socket
Definition: mnl.h:10
OSMO_HDLC_F_56KBIT
#define OSMO_HDLC_F_56KBIT
Definition: isdnhdlc.h:56
osmo_fsm_state::action
void(* action)(struct osmo_fsm_inst *fi, uint32_t event, void *data)
function to be called for events arriving in this state
Definition: fsm.h:50
gsmtap_osmocore_log_hdr::pid
uint32_t pid
process ID
Definition: gsmtap.h:330
msgb_alloc_headroom_c
static struct msgb * msgb_alloc_headroom_c(const void *ctx, uint16_t size, uint16_t headroom, const char *name)
Allocate message buffer with specified headroom from specified talloc context.
Definition: msgb.h:529
osmo_netdev::if_mtu
uint32_t if_mtu
Definition: netdev.c:295
osmo_io_fd::ofd
struct osmo_fd ofd
Definition: osmo_io_internal.h:93
llist_count
static unsigned int llist_count(const struct llist_head *head)
Count number of llist items by iterating.
Definition: linuxlist.h:393
log_target::fname
const char * fname
Definition: logging.h:333
osmo_isdnhdlc_vars::dstpos
int dstpos
Definition: isdnhdlc.h:35
msgfile.h
osmo_io_fd::ctx
const void * ctx
talloc context from which to allocate msgb when reading
Definition: osmo_io_internal.h:75
log_set_log_level
void log_set_log_level(struct log_target *target, int log_level)
Set the global log level for a given log target.
Definition: logging.c:954
osmo_netdev_alloc
struct osmo_netdev * osmo_netdev_alloc(void *ctx, const char *name)
Allocate a new netdev object.
Definition: netdev.c:643
llist_for_each_entry
#define llist_for_each_entry(pos, head, member)
Iterate over a linked list of a given type.
Definition: linuxlist.h:299
update_name
static void update_name(struct osmo_fsm_inst *fi)
Definition: fsm.c:348
HDLC_SEND_FIRST_FLAG
@ HDLC_SEND_FIRST_FLAG
Definition: isdnhdlc.c:36
osmo_it_q_flush
void osmo_it_q_flush(struct osmo_it_q *q)
__attribute__
enum gsm0808_assignment_requirement __attribute__
fls64 - find last set bit in a 64-bit word @x: the word to search
Definition: log2.h:61
osmo_crc64gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc64gen.h:31
DLIUUP
#define DLIUUP
Osmocom IuUP layer.
Definition: logging.h:152
osmo_netdev_get_priv_data
void * osmo_netdev_get_priv_data(struct osmo_netdev *netdev)
Get private user data pointer from the netdev object.
Definition: netdev.c:748
osmo_fsm_inst::id
const char * id
human readable identifier
Definition: fsm.h:93
osmo_fsm_term_cause_name
static const char * osmo_fsm_term_cause_name(enum osmo_fsm_term_cause cause)
Definition: fsm.h:35
osmo_counters_for_each
int osmo_counters_for_each(int(*handle_counter)(struct osmo_counter *, void *), void *data)
Iterate over all counters; call handle_cunter call-back for each.
Definition: counter.c:61
OSMO_FSM_TERM_TIMEOUT
@ OSMO_FSM_TERM_TIMEOUT
termination due to time-out
Definition: fsm.h:31
_msgb_eq
bool _msgb_eq(const char *file, size_t line, const char *func, uint8_t level, const struct msgb *msg, const uint8_t *data, size_t len, bool print)
Compare and print: check data in msgb against given data and print errors if any.
Definition: msgb.c:202
LOGL_NOTICE
#define LOGL_NOTICE
abnormal/unexpected condition
Definition: logging.h:124
_LOG_FLT_COUNT
@ _LOG_FLT_COUNT
Definition: logging.h:217
osmo_netdev::if_up_known
bool if_up_known
Definition: netdev.c:292
osmo_mnl_init
struct osmo_mnl * osmo_mnl_init(void *ctx, int bus, unsigned int groups, mnl_cb_t mnl_cb, void *priv)
create an osmocom-wrapped limnl netlink socket.
Definition: mnl.c:63
gsmtap_osmocore_log_hdr::sec
uint32_t sec
Definition: gsmtap.h:326
osmo_config_entry::mcc
char * mcc
Definition: msgfile.h:33
iofd_handle_recv
void iofd_handle_recv(struct osmo_io_fd *iofd, struct msgb *msg, int rc, struct iofd_msghdr *msghdr)
llist_add
static void llist_add(struct llist_head *_new, struct llist_head *head)
Add a new entry into a linked list (at head).
Definition: linuxlist.h:92
osmo_sockaddr::sin
struct sockaddr_in sin
Definition: socket.h:30
iofd_msgb_alloc
struct msgb * iofd_msgb_alloc(struct osmo_io_fd *iofd)
osmo_io_ops
Definition: osmo_io.h:37
netdev_netns_ctx_free
static void netdev_netns_ctx_free(struct netdev_netns_ctx *netns_ctx)
Definition: netdev.c:142
osmo_config_entry::option
char * option
Definition: msgfile.h:35
host
value_string
A mapping between human-readable string and numeric value.
Definition: utils.h:51
osmo_netdev::netns_ctx
struct netdev_netns_ctx * netns_ctx
Definition: netdev.c:260
_osmo_fsm_inst_broadcast_children
void _osmo_fsm_inst_broadcast_children(struct osmo_fsm_inst *fi, uint32_t event, void *data, const char *file, int line)
Broadcast an event to all the FSMs children.
Definition: fsm.c:1027
msgb_copy
struct msgb * msgb_copy(const struct msgb *msg, const char *name)
Copy an msgb.
Definition: msgb.c:396
log_target_systemd_set_raw
void log_target_systemd_set_raw(struct log_target *target, bool raw)
Change meta information handling of an existing logging target.
Definition: logging_systemd.c:105
OSMO_T_FMT_ARGS
#define OSMO_T_FMT_ARGS(T)
Definition: fsm.h:203
osmo_io_fd::list
struct llist_head list
linked list for internal management
Definition: osmo_io_internal.h:51
osmo_counter_free
void osmo_counter_free(struct osmo_counter *ctr)
Release/Destroy a given counter.
Definition: counter.c:51
msgb_hexdump_l4
static const char * msgb_hexdump_l4(const struct msgb *msg)
Definition: msgb.h:769
log_set_category_filter
void log_set_category_filter(struct log_target *target, int category, int enable, int level)
Set a category filter on a given log target.
Definition: logging.c:965
msgb_reset
void msgb_reset(struct msgb *m)
Re-set all message buffer pointers.
Definition: msgb.c:164
state_chg
static int state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, bool keep_timer, unsigned long timeout_ms, int T, const char *file, int line)
Definition: fsm.c:619
fsm.h
msgb_hexdump
const char * msgb_hexdump(const struct msgb *msg)
Return a (static) buffer containing a hexdump of the msg.
Definition: msgb.c:542
GSMTAP_TYPE_SIM
#define GSMTAP_TYPE_SIM
Definition: gsmtap.h:36
iofd_backend_ops::read_disable
void(* read_disable)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:33
iofd_msg_action
iofd_msg_action
Definition: osmo_io_internal.h:105
osmo_strrb_get_nth
const char * osmo_strrb_get_nth(const struct osmo_strrb *rb, unsigned int string_index)
Return a pointer to the Nth string in the osmo_strrb.
Definition: strrb.c:102
gsmtap_osmocore_log_hdr::line_nr
uint32_t line_nr
line number
Definition: gsmtap.h:337
osmo_log_tgt_mutex
static pthread_mutex_t osmo_log_tgt_mutex
This mutex must be held while using osmo_log_target_list or any of its log_targets in a multithread p...
Definition: logging.c:100
osmo_fsm_inst::fsm
struct osmo_fsm * fsm
back-pointer to the FSM of which we are an instance
Definition: fsm.h:91
GSMTAP_CHANNEL_PACCH
#define GSMTAP_CHANNEL_PACCH
Definition: gsmtap.h:89
GSMTAP_CHANNEL_CCCH
#define GSMTAP_CHANNEL_CCCH
Definition: gsmtap.h:80
log_target_rb_used_size
size_t log_target_rb_used_size(struct log_target const *target)
Return the number of log strings in the osmo_strrb-backed target.
Definition: loggingrb.c:47
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)
logp2
void logp2(int subsys, unsigned int level, const char *file, int line, int cont, const char *format,...) __attribute__((format(printf
logging function used by LOGP() macro
Definition: logging.c:760
osmo_fsm::pre_term
void(* pre_term)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
graceful exit function, called at the beginning of termination
Definition: fsm.h:83
log_target_destroy
void log_target_destroy(struct log_target *target)
Unregister, close and delete a log target.
Definition: logging.c:1320
llist_add_tail
static void llist_add_tail(struct llist_head *_new, struct llist_head *head)
Add a new entry into a linked list (at tail).
Definition: linuxlist.h:104
ubit_t
uint8_t ubit_t
unpacked bit (0 or 1): 1 bit per byte
Definition: bits.h:24
iofd_msghdr::action
enum iofd_msg_action action
Definition: osmo_io_internal.h:117
check_frame
static int check_frame(struct osmo_isdnhdlc_vars *hdlc)
Definition: isdnhdlc.c:75
osmo_netdev::if_mtu_known
bool if_mtu_known
Definition: netdev.c:297
log_tgt_mutex_lock_impl
void log_tgt_mutex_lock_impl(void)
Acquire the osmo_log_tgt_mutex.
Definition: logging.c:117
ARRAY_SIZE
#define ARRAY_SIZE(x)
Determine number of elements in an array of static size.
Definition: utils.h:19
osmo_fsm_state::onenter
void(* onenter)(struct osmo_fsm_inst *fi, uint32_t prev_state)
function to be called just after entering the state
Definition: fsm.h:52
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)
log_check_level
int log_check_level(int subsys, unsigned int level)
Check whether a log entry will be generated.
Definition: logging.c:1513
HDLC_GET_DATA
@ HDLC_GET_DATA
Definition: isdnhdlc.c:31
osmo_it_q::max_length
unsigned int max_length
Definition: it_q.h:32
osmo_io_ops::segmentation_cb
int(* segmentation_cb)(struct msgb *msg)
call-back function to segment the data at message boundaries.
Definition: osmo_io.h:55
osmo_log_target_list
struct llist_head osmo_log_target_list
osmo_fsm::instances
struct llist_head instances
list of instances of this FSM
Definition: fsm.h:62
osmo_wqueue::bfd
struct osmo_fd bfd
osmocom file descriptor
Definition: write_queue.h:32
RSL_CHAN_RACH
#define RSL_CHAN_RACH
gsmtap_osmocore_log_hdr
Structure of the GSMTAP libosmocore logging header.
Definition: gsmtap.h:324
DLJIBUF
#define DLJIBUF
Osmocom Jitter Buffer.
Definition: logging.h:146
fsm_log_timeouts
static bool fsm_log_timeouts
Definition: fsm.c:88
HDLC_GETFLAG_B1A6
@ HDLC_GETFLAG_B1A6
Definition: isdnhdlc.c:30
iofd_backend_ops::write_enable
void(* write_enable)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:30
msgb_l4
#define msgb_l4(m)
obtain L4 header of msgb
Definition: msgb.h:136
log_set_print_filename_pos
void log_set_print_filename_pos(struct log_target *target, enum log_filename_pos pos)
Set the position where on a log line the source file info should be logged.
Definition: logging.c:914
osmo_fsm_inst_change_parent
void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, struct osmo_fsm_inst *new_parent, uint32_t new_parent_term_event)
change parent instance of an FSM.
Definition: fsm.c:517
RSL_CHAN_Bm_ACCHs
#define RSL_CHAN_Bm_ACCHs
gsmtap_gsm_channel_names
const struct value_string gsmtap_gsm_channel_names[]
Definition: gsmtap_util.c:553
log_target::output
void(* output)(struct log_target *target, unsigned int level, const char *string)
call-back function to be called when the logging framework wants to log a fully formatted string
Definition: logging.h:368
osmo_timer_pending
int osmo_timer_pending(const struct osmo_timer_list *timer)
check if given timer is still pending
Definition: timer.c:134
logp2syslog_level
static int logp2syslog_level(unsigned int level)
Definition: logging_systemd.c:36
IOFD_FLAG_IN_CALLBACK
#define IOFD_FLAG_IN_CALLBACK
Definition: osmo_io_internal.h:37
log_target::categories
struct log_category * categories
logging categories
Definition: logging.h:309
osmo_timer_del
void osmo_timer_del(struct osmo_timer_list *timer)
delete a timer from timer management
Definition: timer.c:116
osmo_fsm_register
int osmo_fsm_register(struct osmo_fsm *fsm)
register a FSM with the core
Definition: fsm.c:282
osmo_fsm_set_dealloc_ctx
void osmo_fsm_set_dealloc_ctx(void *ctx)
Instead of deallocating FSM instances, move them to the given talloc context.
Definition: fsm.c:193
msgb_l3
#define msgb_l3(m)
obtain L3 header of msgb
Definition: msgb.h:134
GSMTAP_CHANNEL_CBCH52
#define GSMTAP_CHANNEL_CBCH52
Definition: gsmtap.h:90
osmo_counter::name
const char * name
human-readable name
Definition: counter.h:11
llist_entry
#define llist_entry(ptr, type, member)
Get the struct containing this list entry.
Definition: linuxlist.h:218
LOGPSRC
#define LOGPSRC(ss, level, caller_file, caller_line, fmt, args...)
Log through the Osmocom logging framework with explicit source.
Definition: logging.h:84
msgb::l2h
unsigned char * l2h
pointer to A-bis layer 2 header: OML, RSL(RLL), NS
Definition: msgb.h:44
logging.h
GSMTAP_CHANNEL_UNKNOWN
#define GSMTAP_CHANNEL_UNKNOWN
Definition: gsmtap.h:78
osmo_crc16gen_code::remainder
uint16_t remainder
Remainder of the CRC (final XOR)
Definition: crc16gen.h:34
osmo_crc16gen_code
structure describing a given CRC code of max 16 bits
Definition: crc16gen.h:30
osmo_system_nowait
int osmo_system_nowait(const char *command, const char **env_whitelist, char **addl_env)
call an external shell command without waiting for it.
Definition: exec.c:295
osmo_fsm_inst_update_id
int osmo_fsm_inst_update_id(struct osmo_fsm_inst *fi, const char *id)
Change id of the FSM instance.
Definition: fsm.c:340
DLSTATS
#define DLSTATS
Statistics.
Definition: logging.h:138
osmo_counter_alloc
struct osmo_counter * osmo_counter_alloc(const char *name)
Allocate a new counter with given name.
Definition: counter.c:36
osmo_gettid
pid_t osmo_gettid(void)
Wrapper around Linux's gettid() to make it easily accessible on different system versions.
Definition: thread.c:46
OSMO_FD_WRITE
#define OSMO_FD_WRITE
Indicate interest in writing to the file descriptor.
Definition: select.h:19
log_target::raw
bool raw
Definition: logging.h:358
GSMTAP_TYPE_GMR1_UM
#define GSMTAP_TYPE_GMR1_UM
Definition: gsmtap.h:42
crc_ccitt_byte
#define crc_ccitt_byte
Definition: isdnhdlc.c:41
osmo_netdev::name
char * name
Definition: netdev.c:263
osmo_counter_difference
int osmo_counter_difference(struct osmo_counter *ctr)
Compute difference between current and previous counter value.
Definition: counter.c:102
LLIST_HEAD
#define LLIST_HEAD(name)
Define a statically-initialized variable of type llist_head.
Definition: linuxlist.h:59
iofd_msghdr::flags
int flags
Definition: osmo_io_internal.h:121
GSMTAP_CHANNEL_PCH
#define GSMTAP_CHANNEL_PCH
Definition: gsmtap.h:83
file
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
log_target::ident
const char * ident
Definition: logging.h:353
socket.h
osmo_io_fd::name
char * name
human-readable name to associte with fd
Definition: osmo_io_internal.h:61
iofd_backend_ops::register_fd
int(* register_fd)(struct osmo_io_fd *iofd)
Definition: osmo_io_internal.h:27
osmo_store32be
static void osmo_store32be(uint32_t x, void *p)
store unaligned 32-bit integer (big-endian encoding)
Definition: bit32gen.h:121
IOFD_SEG_ACT_HANDLE_ONE
@ IOFD_SEG_ACT_HANDLE_ONE
Definition: osmo_io_internal.h:128
msgb_pull
static unsigned char * msgb_pull(struct msgb *msgb, unsigned int len)
remove (pull) a header from the front of the message buffer
Definition: msgb.h:404
gsmtap_hdr::snr_db
int8_t snr_db
signal/noise ratio in dB
Definition: gsmtap.h:312
log_target_rb_avail_size
size_t log_target_rb_avail_size(struct log_target const *target)
Return the capacity of the osmo_strrb-backed target.
Definition: loggingrb.c:59
msgb_data
uint8_t * msgb_data(const struct msgb *msg)
get pointer to data section of message buffer
Definition: msgb.c:184
select.h
osmo_g_fsms
struct llist_head osmo_g_fsms
MSGB_ABORT
#define MSGB_ABORT(msg, fmt, args ...)
Definition: msgb.h:122
LOG_TGT_TYPE_SYSTEMD
@ LOG_TGT_TYPE_SYSTEMD
systemd journal logging
Definition: logging.h:283
osmo_fsm_inst_alloc_child
struct osmo_fsm_inst * osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event)
allocate a new instance of a specified FSM as child of other FSM instance
Definition: fsm.c:472
osmo_fsm_inst::parent_term_event
uint32_t parent_term_event
the event we should send upon termination
Definition: fsm.h:113
log_target::tgt_syslog
struct log_target::@8::@11 tgt_syslog
RSL_CHAN_OSMO_PDCH
#define RSL_CHAN_OSMO_PDCH
gsmtap_source_free
void gsmtap_source_free(struct gsmtap_inst *gti)
const_basename
static const char * const_basename(const char *path)
Definition: logging.c:465
osmo_timer_list::active
unsigned int active
is it active?
Definition: timer.h:56
DLGLOBAL
#define DLGLOBAL
global logging
Definition: logging.h:129
osmo_isdnhdlc_vars::do_bitreverse
uint32_t do_bitreverse
Definition: isdnhdlc.h:52
osmo_fsm_inst_find_by_name
struct osmo_fsm_inst * osmo_fsm_inst_find_by_name(const struct osmo_fsm *fsm, const char *name)
Definition: fsm.c:245
log_tgt_mutex_unlock
#define log_tgt_mutex_unlock()
Definition: logging.h:466
osmo_isdnhdlc_vars::shift_reg
uint8_t shift_reg
Definition: isdnhdlc.h:40
osmo_io_fd
Definition: osmo_io_internal.h:49
OSMO_HDLC_FRAMING_ERROR
#define OSMO_HDLC_FRAMING_ERROR
Definition: isdnhdlc.h:65
osmo_mnl::mnls
struct mnl_socket * mnls
libmnl socket abstraction
Definition: mnl.h:14
gsmtap_hdr
Structure of the GSMTAP pseudo-header.
Definition: gsmtap.h:304
osmo_crc8gen_code::init
uint8_t init
Initialization value of the CRC state.
Definition: crc8gen.h:33
osmo_fd
Structure representing a file dsecriptor.
Definition: select.h:31
log_level_str
const char * log_level_str(unsigned int lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE
convert a numeric log level into human-readable string
Definition: logging.c:352
osmo_fsm_state::in_event_mask
uint32_t in_event_mask
bit-mask of permitted input events for this state
Definition: fsm.h:44
log_parse_category
int log_parse_category(const char *category)
parse a human-readable log category into numeric form
Definition: logging.c:361
msgb_l2
#define msgb_l2(m)
obtain L2 header of msgb
Definition: msgb.h:132
log_init
int log_init(const struct log_info *inf, void *talloc_ctx)
Initialize the Osmocom logging core.
Definition: logging.c:1435
osmo_config_entry::text
char * text
Definition: msgfile.h:36
osmo_counter_get_by_name
struct osmo_counter * osmo_counter_get_by_name(const char *name)
Find a counter by its name.
Definition: counter.c:86
gsmtap_osmocore_log_hdr::usec
uint32_t usec
Definition: gsmtap.h:327
level_color
static const char * level_color(int level)
Definition: logging.c:449
osmo_io_fd::data
void * data
data pointer passed through to call-back function
Definition: osmo_io_internal.h:69
osmo_iofd_get_priv_nr
unsigned int osmo_iofd_get_priv_nr(const struct osmo_io_fd *iofd)
log_category::enabled
uint8_t enabled
is logging enabled?
Definition: logging.h:182
logging_tid
static __thread long int logging_tid
Definition: logging.c:93
LOG_MAX_CTX
#define LOG_MAX_CTX
Maximum number of logging contexts.
Definition: logging.h:221
LOGP
#define LOGP(ss, level, fmt, args...)
Log a new message through the Osmocom logging framework.
Definition: logging.h:49
osmo_it_q_destroy
void osmo_it_q_destroy(struct osmo_it_q *q)
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:56
msgb_alloc
struct msgb * msgb_alloc(uint16_t size, const char *name)
Allocate a new message buffer from tall_msgb_ctx.
Definition: msgb.c:108
llist_empty
static int llist_empty(const struct llist_head *head)
Test whether a linked list is empty.
Definition: linuxlist.h:169
osmo_netdev_dev_name_chg_cb_t
int(* osmo_netdev_dev_name_chg_cb_t)(struct osmo_netdev *netdev, const char *new_dev_name)
Definition: netdev.h:16
osmo_netdev_is_registered
bool osmo_netdev_is_registered(struct osmo_netdev *netdev)
Retrieve whether the netdev object is in "registered" state.
Definition: netdev.c:731
iofd_msgb_pending_or_alloc
struct msgb * iofd_msgb_pending_or_alloc(struct osmo_io_fd *iofd)
osmo_crc8gen_compute_bits
uint8_t osmo_crc8gen_compute_bits(const struct osmo_crc8gen_code *code, const ubit_t *in, int len)
Compute the CRC value of a given array of hard-bits.
Definition: crc8gen.c:40
type
enum osmo_sub_auth_type type
tall_msgb_ctx
void * tall_msgb_ctx
Definition: msgb.c:97
osmo_fsm_term_safely
void osmo_fsm_term_safely(bool term_safely)
Enable safer way to deallocate cascades of terminating FSM instances.
Definition: fsm.c:168
log_target::print_timestamp
unsigned int print_timestamp
should log messages be prefixed with a timestamp?
Definition: logging.h:316
OSMO_HDLC_F_DCHANNEL
#define OSMO_HDLC_F_DCHANNEL
Definition: isdnhdlc.h:57
log_tgt_mutex_unlock_impl
void log_tgt_mutex_unlock_impl(void)
Release the osmo_log_tgt_mutex.
Definition: logging.c:133
osmo_crc32gen_code
structure describing a given CRC code of max 32 bits
Definition: crc32gen.h:30
iofd_msghdr_alloc
struct iofd_msghdr * iofd_msghdr_alloc(struct osmo_io_fd *iofd, enum iofd_msg_action action, struct msgb *msg)
log_target::tgt_rb
struct log_target::@8::@13 tgt_rb
osmo_fsm_state_name
const char * osmo_fsm_state_name(const struct osmo_fsm *fsm, uint32_t state)
get human-readable name of FSM state
Definition: fsm.c:609
iofd_msghdr
Definition: osmo_io_internal.h:115
osmo_fsm::event_names
const struct value_string * event_names
human-readable names of events
Definition: fsm.h:81
DLSS7
#define DLSS7
Osmocom SS7.
Definition: logging.h:141
netdev_netns_ctx::refcount
unsigned int refcount
Definition: netdev.c:117
osmo_fsm_state::out_state_mask
uint32_t out_state_mask
bit-mask to which other states this state may transiton
Definition: fsm.h:46
osmo_crc8gen_code::remainder
uint8_t remainder
Remainder of the CRC (final XOR)
Definition: crc8gen.h:34
osmo_htons
#define osmo_htons(x)
Definition: byteswap.h:44
osmo_hexdump
char * osmo_hexdump(const unsigned char *buf, int len)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:392
HDLC_SEND_FAST_FLAG
@ HDLC_SEND_FAST_FLAG
Definition: isdnhdlc.c:35
counter.h
logp_stub
void void logp_stub(const char *file, int line, int cont, const char *format,...)
Definition: logging.c:773
gsmtap_hdr::hdr_len
uint8_t hdr_len
length in number of 32bit words
Definition: gsmtap.h:306
DLNS
#define DLNS
Osmocom NS layer.
Definition: logging.h:148
iofd_msghdr_free
void iofd_msghdr_free(struct iofd_msghdr *msghdr)
DLGSUP
#define DLGSUP
Generic Subscriber Update Protocol.
Definition: logging.h:139
_osmo_it_q_dequeue
struct llist_head * _osmo_it_q_dequeue(struct osmo_it_q *queue)
gsmtap_inst_fd
static int gsmtap_inst_fd(struct gsmtap_inst *gti)
obtain the file descriptor associated with a gsmtap instance
Definition: gsmtap_util.h:36
logging.h
osmo_system_nowait2
int osmo_system_nowait2(const char *command, const char **env_whitelist, char **addl_env, const char *user)
call an external shell command as 'user' without waiting for it.
Definition: exec.c:208
OSMO_T_FMT
#define OSMO_T_FMT
Definition: fsm.h:202
osmo_mnl::mnl_cb
mnl_cb_t mnl_cb
call-back called for received netlink messages
Definition: mnl.h:16
_osmo_fsm_inst_term
void _osmo_fsm_inst_term(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause, void *data, const char *file, int line)
Terminate FSM instance with given cause.
Definition: fsm.c:896
osmo_fsm_state::name
const char * name
human-readable name of this state
Definition: fsm.h:48
msgb_dequeue
struct msgb * msgb_dequeue(struct llist_head *queue)
Dequeue message buffer from head of queue.
Definition: msgb.c:141
linuxlist.h
osmo_iofd_get_data
void * osmo_iofd_get_data(const struct osmo_io_fd *iofd)
list
struct llist_head list
GSMTAP_CHANNEL_VOICE_F
#define GSMTAP_CHANNEL_VOICE_F
Definition: gsmtap.h:96
osmo_fsm_defer_free
static void osmo_fsm_defer_free(void *talloc_object)
talloc_free() the given object immediately, or once ongoing FSM terminations are done.
Definition: fsm.c:218
osmo_sock_init_sa
int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type, uint8_t proto, unsigned int flags)
log_context
Log context information, passed to filter.
Definition: logging.h:226
arfcn
uint16_t arfcn
ARFCN (frequency)
Definition: gsmtap.h:7
DLSCCP
#define DLSCCP
Osmocom SCCP.
Definition: logging.h:142
GSMTAP_TYPE_UM_BURST
#define GSMTAP_TYPE_UM_BURST
Definition: gsmtap.h:35
log_target::filter_map
int filter_map
Internal data for filtering.
Definition: logging.h:304
handle_abort
#define handle_abort(h)
internal_cat
static const struct log_info_cat internal_cat[OSMO_NUM_DLIB]
Definition: logging.c:156
osmo_timer_remaining
int osmo_timer_remaining(const struct osmo_timer_list *timer, const struct timeval *now, struct timeval *remaining)
compute the remaining time of a timer
Definition: timer.c:148
osmo_crc16_byte
static uint16_t osmo_crc16_byte(uint16_t crc, const uint8_t data)
CRC-16 polynome 0x8005 (x^16 + x^15 + x^2 + 1)
Definition: crc16.h:32
GSMTAP_TYPE_LTE_RRC
#define GSMTAP_TYPE_LTE_RRC
Definition: gsmtap.h:45
RSL_CHAN_SDCCH4_ACCH
#define RSL_CHAN_SDCCH4_ACCH
IOFD_ACT_SENDTO
@ IOFD_ACT_SENDTO
Definition: osmo_io_internal.h:109
OSMO_SNPRINTF_RET
#define OSMO_SNPRINTF_RET(ret, rem, offset, len)
Definition: utils.h:99
osmo_wqueue::msg_queue
struct llist_head msg_queue
actual linked list implementing the queue
Definition: write_queue.h:39
osmo_mnl_init
struct osmo_mnl * osmo_mnl_init(void *ctx, int bus, unsigned int groups, mnl_cb_t mnl_cb, void *priv)
create an osmocom-wrapped limnl netlink socket.
Definition: mnl.c:63
log_context::ctx
void * ctx[LOG_MAX_CTX+1]
Definition: logging.h:227
osmo_crc64gen_set_bits
void osmo_crc64gen_set_bits(const struct osmo_crc64gen_code *code, const ubit_t *in, int len, ubit_t *crc_bits)
Computes and writes the CRC value of a given array of bits.
Definition: crc64gen.c:100
osmo_environment_append
int osmo_environment_append(char **out, size_t out_len, char **in)
append one environment to another; only copying pointers, not actual strings.
Definition: exec.c:138
osmo_fd::fd
int fd
actual operating-system level file decriptor
Definition: select.h:35
thread.h
osmo_strrb
Definition: strrb.h:32
GSMTAP_TYPE_UMTS_RRC
#define GSMTAP_TYPE_UMTS_RRC
Definition: gsmtap.h:44
OSMO_MIN
#define OSMO_MIN(a, b)
Return the minimum of two specified values.
Definition: utils.h:24
osmo_crc32gen_code::poly
uint32_t poly
Polynom (normal representation, MSB omitted.
Definition: crc32gen.h:32
log_target_create_syslog
struct log_target * log_target_create_syslog(const char *ident, int option, int facility)
osmo_counter::value
unsigned long value
current value
Definition: counter.h:13
osmo_iofd_set_txqueue_max_length
void osmo_iofd_set_txqueue_max_length(struct osmo_io_fd *iofd, unsigned int size)
g_netdev_list
static struct llist_head g_netdev_list
Definition: netdev.c:112
msgb_copy_resize_c
struct msgb * msgb_copy_resize_c(const void *ctx, const struct msgb *msg, uint16_t new_len, const char *name)
Copy an msgb with memory reallocation.
Definition: msgb.c:326
osmo_io_fd::read_enabled
bool read_enabled
Definition: osmo_io_internal.h:96
IOFD_SEG_ACT_HANDLE_MORE
@ IOFD_SEG_ACT_HANDLE_MORE
Definition: osmo_io_internal.h:129
osmo_netdev_get_ifindex
unsigned int osmo_netdev_get_ifindex(const struct osmo_netdev *netdev)
Get interface index identifying the interface managed by netdev.
Definition: netdev.c:813
gsmtap_hdr::antenna_nr
uint8_t antenna_nr
Antenna Number.
Definition: gsmtap.h:317
DLGTP
#define DLGTP
GTP (GPRS Tunneling Protocol.
Definition: logging.h:137
gsmtap_osmocore_log_hdr::name
char name[32]
source file name
Definition: gsmtap.h:336
LOGPC
#define LOGPC(ss, level, fmt, args...)
Continue a log message through the Osmocom logging framework.
Definition: logging.h:59
LOGL_DEBUG
#define LOGL_DEBUG
different log levels
Definition: logging.h:122
osmo_crc16gen_set_bits
void osmo_crc16gen_set_bits(const struct osmo_crc16gen_code *code, const ubit_t *in, int len, ubit_t *crc_bits)
Computes and writes the CRC value of a given array of bits.
Definition: crc16gen.c:100
msgb::head
unsigned char * head
start of underlying memory buffer
Definition: msgb.h:53
osmo_io_fd::mode
enum osmo_io_fd_mode mode
type of read/write mode to use
Definition: osmo_io_internal.h:55
OSMO_SOCK_F_BIND
#define OSMO_SOCK_F_BIND
bind the socket to a local address/port
Definition: socket.h:90
osmo_crc64gen_code::remainder
uint64_t remainder
Remainder of the CRC (final XOR)
Definition: crc64gen.h:34
msgb_enqueue
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
Enqueue message buffer to tail of a queue.
Definition: msgb.c:129
osmo_vlogp
void osmo_vlogp(int subsys, int level, const char *file, int line, int cont, const char *format, va_list ap)
vararg version of logging function
Definition: logging.c:708
osmo_log_tgt_mutex_on
static bool osmo_log_tgt_mutex_on
Definition: logging.c:101
osmo_fd::data
void * data
data pointer passed through to call-back function
Definition: select.h:43
netdev_netns_ctx_init
static int netdev_netns_ctx_init(struct netdev_netns_ctx *netns_ctx)
Definition: netdev.c:167
fsm_tmr_cb
static void fsm_tmr_cb(void *data)
Definition: fsm.c:311
LOGL_ERROR
#define LOGL_ERROR
error condition, requires user action
Definition: logging.h:125
osmo_netdev::ifindex
unsigned int ifindex
Definition: netdev.c:266
gsmtap_hdr::version
uint8_t version
version, set to 0x01 currently
Definition: gsmtap.h:305
osmo_iofd_get_fd
int osmo_iofd_get_fd(const struct osmo_io_fd *iofd)
msgb_printf
int msgb_printf(struct msgb *msgb, const char *format,...)
Print a string to the end of message buffer.
Definition: msgb.c:579
GSMTAP_TYPE_TETRA_I1
#define GSMTAP_TYPE_TETRA_I1
Definition: gsmtap.h:37
LOG_TGT_TYPE_STRRB
@ LOG_TGT_TYPE_STRRB
osmo_strrb-backed logging
Definition: logging.h:281
it_q.h
osmo_crc64gen_check_bits
int osmo_crc64gen_check_bits(const struct osmo_crc64gen_code *code, const ubit_t *in, int len, const ubit_t *crc_bits)
Checks the CRC value of a given array of hard-bits.
Definition: crc64gen.c:75
gsmtap_osmocore_log_hdr::proc_name
char proc_name[16]
name of process
Definition: gsmtap.h:329
log_set_all_filter
void log_set_all_filter(struct log_target *target, int)
Enable the LOG_FLT_ALL log filter.
Definition: logging.c:834
gsmtap.h
osmo_io_backend
osmo_io_backend
Definition: osmo_io.h:28
osmo_fsm_inst::timer
struct osmo_timer_list timer
timer back-end for states with time-out
Definition: fsm.h:106
osmo_fsm::list
struct llist_head list
global list
Definition: fsm.h:60
osmo_isdnhdlc_vars::ffbit_shift
int ffbit_shift
Definition: isdnhdlc.h:33
osmo_io_fd::write_enabled
bool write_enabled
Definition: osmo_io_internal.h:97
msgb::_data
unsigned char _data[0]
optional immediate data array
Definition: msgb.h:56
osmo_fsm_inst_find_by_id
struct osmo_fsm_inst * osmo_fsm_inst_find_by_id(const struct osmo_fsm *fsm, const char *id)
Definition: fsm.c:262
LOG_FLT_ALL
@ LOG_FLT_ALL
Definition: logging.h:210
mnl.h
osmo_netdev_add_addr
int osmo_netdev_add_addr(struct osmo_netdev *netdev, const struct osmo_sockaddr *addr, uint8_t prefixlen)
Add IP address to netdev interface.
Definition: netdev.c:897
osmo_sockaddr_ntop
const char * osmo_sockaddr_ntop(const struct sockaddr *sa, char *dst)
osmo_crc16_ccitt_byte
static uint16_t osmo_crc16_ccitt_byte(uint16_t crc, const uint8_t data)
CCITT polynome 0x8408 (x^0 + x^5 + x^12)
Definition: crc16.h:44
osmo_it_q::event_ofd
struct osmo_fd event_ofd
Definition: it_q.h:27
osmo_crc16_table
const uint16_t osmo_crc16_table[256]
CRC table for the CRC-16.
Definition: crc16.c:18
HDLC_FAST_IDLE
@ HDLC_FAST_IDLE
Definition: isdnhdlc.c:30
osmo_it_q::read_cb
void(* read_cb)(struct osmo_it_q *q, struct llist_head *item)
Definition: it_q.h:34
log_filename_type
log_filename_type
Whether/how to log the source filename (and line number).
Definition: logging.h:287
netdev_netns_ctx::netns_name
const char * netns_name
Definition: netdev.c:118
ENOTSUP
#define ENOTSUP
osmo_crc16gen_code::init
uint16_t init
Initialization value of the CRC state.
Definition: crc16gen.h:33
_osmo_fsm_inst_state_chg_keep_or_start_timer_ms
int _osmo_fsm_inst_state_chg_keep_or_start_timer_ms(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_ms, int T, const char *file, int line)
Definition: fsm.c:808
osmo_crc64gen_compute_bits
uint64_t osmo_crc64gen_compute_bits(const struct osmo_crc64gen_code *code, const ubit_t *in, int len)
Compute the CRC value of a given array of hard-bits.
Definition: crc64gen.c:40
log_fini
void log_fini(void)
Definition: logging.c:1494
osmo_fsm_inst::log_level
int log_level
logging level for this FSM
Definition: fsm.h:99
handle_counter
static int handle_counter(struct osmo_counter *counter, void *vctx_)
DLMGCP
#define DLMGCP
Osmocom MGCP.
Definition: logging.h:145
osmo_isdnhdlc_vars::do_closing
uint32_t do_closing
Definition: isdnhdlc.h:50
osmo_crc16gen_check_bits
int osmo_crc16gen_check_bits(const struct osmo_crc16gen_code *code, const ubit_t *in, int len, const ubit_t *crc_bits)
Checks the CRC value of a given array of hard-bits.
Definition: crc16gen.c:75
osmo_wqueue_clear
void osmo_wqueue_clear(struct osmo_wqueue *queue)
Clear a osmo_wqueue.
Definition: write_queue.c:139
DLSMS
#define DLSMS
SMS sub-system.
Definition: logging.h:135
osmo_io_fd::flags
uint32_t flags
flags to guard closing/freeing of iofd
Definition: osmo_io_internal.h:58
osmo_counter::list
struct llist_head list
internal list head
Definition: counter.h:10
HDLC_SENDFLAG_B7
@ HDLC_SENDFLAG_B7
Definition: isdnhdlc.c:38
osmo_fsm_inst::list
struct llist_head list
member in the fsm->instances list
Definition: fsm.h:89
osmo_log_info
struct log_info * osmo_log_info
Definition: logging.c:87
osmo_crc32gen_code::init
uint32_t init
Initialization value of the CRC state.
Definition: crc32gen.h:33
DLINP
#define DLINP
(A-bis) Input sub-system
Definition: logging.h:131
netns.h
osmo_crc8gen_code
structure describing a given CRC code of max 8 bits
Definition: crc8gen.h:30
_osmo_fsm_inst_state_chg_keep_or_start_timer
int _osmo_fsm_inst_state_chg_keep_or_start_timer(struct osmo_fsm_inst *fi, uint32_t new_state, unsigned long timeout_secs, int T, const char *file, int line)
perform a state change while keeping the current timer if running, or starting a timer otherwise.
Definition: fsm.c:802