libosmocore  1.5.1
Osmocom core library
application.h File Reference

Go to the source code of this file.

Functions

void osmo_init_ignore_signals (void)
 Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO. More...
 
int osmo_init_logging (const struct log_info *) OSMO_DEPRECATED("use osmo_init_logging2() instead to avoid a NULL talloc ctx")
 Initialize the osmocom logging framework. More...
 
int osmo_init_logging2 (void *ctx, const struct log_info *log_info)
 
int osmo_daemonize (void)
 Turn the current process into a background daemon. More...
 

Variables

struct log_targetosmo_stderr_target
 the default logging target, logging to stderr More...
 

Detailed Description

Routines for helping with the osmocom application setup.

Function Documentation

◆ osmo_daemonize()

int osmo_daemonize ( void  )

Turn the current process into a background daemon.

This function will fork the process, exit the parent and set umask, create a new session, close stdin/stdout/stderr and chdir to /tmp

References pid.

◆ osmo_init_ignore_signals()

void osmo_init_ignore_signals ( void  )

Ignore SIGPIPE, SIGALRM, SIGHUP and SIGIO.

References sighup_hdlr().

◆ osmo_init_logging()

int osmo_init_logging ( const struct log_info log_info)

Initialize the osmocom logging framework.

Parameters
[in]log_infoArray of available logging sub-systems
Returns
0 on success, -1 in case of error

This function initializes the osmocom logging systems. It also creates the default (stderr) logging target.

References osmo_init_logging2().

◆ osmo_init_logging2()

int osmo_init_logging2 ( void *  ctx,
const struct log_info log_info 
)

Variable Documentation

◆ osmo_stderr_target

struct log_target* osmo_stderr_target

the default logging target, logging to stderr

Referenced by osmo_init_logging2().

osmo_select_init
void osmo_select_init(void)
initialize the osmocom select abstraction for the current thread
Definition: select.c:456
osmo_plugin_load_all
int osmo_plugin_load_all(const char *directory)
Load all plugins available in given directory.
Definition: plugin.c:46
OSMO_FSM_TERM_ERROR
@ OSMO_FSM_TERM_ERROR
erroneous termination of process
Definition: fsm.h:29
osmo_generate_backtrace
void osmo_generate_backtrace(void)
Generate and print a call back-trace.
Definition: backtrace.c:67
osmo_sock_mcast_loop_set
int osmo_sock_mcast_loop_set(int fd, bool enable)
Activate or de-activate local loop-back of transmitted multicast packets.
Definition: socket.c:1470
osmo_sercomm_drv_rx_char
int osmo_sercomm_drv_rx_char(struct osmo_sercomm_inst *sercomm, uint8_t ch)
the driver has received one byte, pass it into sercomm layer
Definition: sercomm.c:276
timer_ticks
static uint64_t timer_ticks
Definition: rate_ctr.c:298
gsmtap_inst::ofd_wq_mode
int ofd_wq_mode
wait queue mode?
Definition: gsmtap_util.h:28
osmo_stats_reporter::have_net_config
unsigned int have_net_config
Definition: stats.h:67
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:121
osmo_prbs_state::prbs
const struct osmo_prbs * prbs
Definition: prbs.h:14
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:136
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:60
osmo_strrb::buffer
char ** buffer
storage for messages
Definition: strrb.h:42
osmo_prbs::name
const char * name
human-readable name
Definition: prbs.h:7
RSL_CHAN_OSMO_CBCH4
#define RSL_CHAN_OSMO_CBCH4
osmo_counter_difference
int osmo_counter_difference(struct osmo_counter *ctr)
Compute difference between current and previous counter value.
Definition: counter.c:106
osmo_timer_list
A structure representing a single instance of a timer.
Definition: timer.h:56
osmo_tdef_unit_names
const struct value_string osmo_tdef_unit_names[]
Definition: tdef.c:360
HDLC_SENDFLAG_B1A6
@ HDLC_SENDFLAG_B1A6
Definition: isdnhdlc.c:42
flush_all_reporters
static void flush_all_reporters()
Definition: stats.c:769
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:46
osmo_prim_event_map
single entry in a SAP/PRIM/OP -> EVENT map
Definition: prim.h:82
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:431
osmo_stats_reporter_disable
int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep)
Disable the given stats_reporter.
Definition: stats.c:440
_osmo_strrb_is_bufindex_valid
bool _osmo_strrb_is_bufindex_valid(const struct osmo_strrb *rb, unsigned int bufi)
Definition: strrb.c:119
osmo_strrb::start
uint16_t start
index of the first slot
Definition: strrb.h:39
OSMO_STATS_CLASS_GLOBAL
@ OSMO_STATS_CLASS_GLOBAL
global counter/stat_item
Definition: stats.h:49
HDLC_ESCAPE
#define HDLC_ESCAPE
Definition: sercomm.c:58
fsm_term_safely_enabled
static bool fsm_term_safely_enabled
See osmo_fsm_term_safely().
Definition: fsm.c:95
osmo_use_count_repurpose_zero_entry
static struct osmo_use_count_entry * osmo_use_count_repurpose_zero_entry(struct osmo_use_count *uc, const char *use)
Find a use count entry that currently has zero count, and re-use that for this new use token.
Definition: use_count.c:181
rate_ctr_for_each_counter
int rate_ctr_for_each_counter(struct rate_ctr_group *ctrg, rate_ctr_handler_t handle_counter, void *data)
Iterate over each counter in group and call function.
Definition: rate_ctr.c:393
osmo_stats_reporter::dest_port
int dest_port
destination (UDP) port
Definition: stats.h:74
TRACE
#define TRACE(probe)
Definition: stats.c:100
HDLC_SENDFLAG_ONE
@ HDLC_SENDFLAG_ONE
Definition: isdnhdlc.c:42
msgb::l3h
unsigned char * l3h
pointer to Layer 3 header.
Definition: msgb.h:49
osmo_sockaddr_ntop
const char * osmo_sockaddr_ntop(const struct sockaddr *sa, char *dst)
inet_ntop() wrapper for a struct sockaddr.
Definition: socket.c:1177
OSMO_SOCK_F_CONNECT
#define OSMO_SOCK_F_CONNECT
connect the socket to a remote peer
Definition: socket.h:35
osmo_stats_reporter_free
void osmo_stats_reporter_free(struct osmo_stats_reporter *srep)
Destroy a given stats_reporter.
Definition: stats.c:232
osmo_sockaddr::sa
struct sockaddr sa
Definition: socket.h:26
GSMTAP_UDP_PORT
#define GSMTAP_UDP_PORT
Definition: gsmtap.h:189
RATE_CTR_INTV_HOUR
@ RATE_CTR_INTV_HOUR
last hour
Definition: rate_ctr.h:18
timerclear
#define timerclear(tvp)
Definition: timer_compat.h:43
loggingrb.h
osmo_sockaddr_str_to_32
int osmo_sockaddr_str_to_32(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip)
rate_ctr_group_desc::ctr_desc
const struct rate_ctr_desc * ctr_desc
Pointer to array of counter names.
Definition: rate_ctr.h:53
gsmtap_hdr::frame_number
uint32_t frame_number
GSM Frame Number (FN)
Definition: gsmtap.h:308
osmo_panic_handler
static osmo_panic_handler_t osmo_panic_handler
Definition: panic.c:37
rate_ctr_desc
rate counter description
Definition: rate_ctr.h:37
rate_ctr_timer
static struct osmo_timer_list rate_ctr_timer
Definition: rate_ctr.c:297
tall_ctr_ctx
void * tall_ctr_ctx
Global talloc context for all osmo_counter allocations.
Definition: counter.c:35
osmo_sockaddr_str_is_set
bool osmo_sockaddr_str_is_set(const struct osmo_sockaddr_str *sockaddr_str)
logging_gsmtap_tid
static __thread uint32_t logging_gsmtap_tid
Definition: logging_gsmtap.c:58
osmo_config_entry::list
struct llist_head list
Definition: msgfile.h:31
log_add_target
void log_add_target(struct log_target *target)
Register a new log target with the logging core.
Definition: logging.c:705
isdnhdlc.h
OSMO_SOCK_MAX_ADDRS
#define OSMO_SOCK_MAX_ADDRS
maximum number of local or remote addresses supported by an osmo_sock instance
Definition: socket.h:48
log_category_name
const char * log_category_name(int subsys)
Definition: logging.c:415
osmo_is_hexstr
bool osmo_is_hexstr(const char *str, int min_digits, int max_digits, bool require_even)
Validate that a given string is a hex string within given size limits.
Definition: utils.c:621
time
char time[12]
osmo_panic_default
static void osmo_panic_default(const char *fmt, va_list args)
Definition: panic.c:45
osmo_sockaddr_cmp
int osmo_sockaddr_cmp(const struct osmo_sockaddr *a, const struct osmo_sockaddr *b)
Compare two osmo_sockaddr.
Definition: socket.c:1693
osmo_strrb_add
int osmo_strrb_add(struct osmo_strrb *rb, const char *data)
Add a string to the osmo_strrb.
Definition: strrb.c:152
link_id
uint8_t link_id
osmo_fsm_inst::priv
void * priv
some private data of this instance
Definition: fsm.h:97
osmo_it_q_flush
void osmo_it_q_flush(struct osmo_it_q *q)
Flush all messages currently present in queue.
Definition: it_q.c:199
color
static const char * color(int subsys)
Definition: logging.c:390
osmo_stats_reporter_alloc
struct osmo_stats_reporter * osmo_stats_reporter_alloc(enum osmo_stats_reporter_type type, const char *name)
Definition: stats.c:214
msgb_hexdump_l1
static const char * msgb_hexdump_l1(const struct msgb *msg)
Definition: msgb.h:746
osmo_sock_init_osa
int osmo_sock_init_osa(uint16_t type, uint8_t proto, const struct osmo_sockaddr *local, const struct osmo_sockaddr *remote, unsigned int flags)
Initialize a socket (including bind and/or connect)
Definition: socket.c:491
osmo_prbs11
const struct osmo_prbs osmo_prbs11
PRBS-11 according ITU-T O.150.
Definition: prbs.c:30
log_info_cat::enabled
uint8_t enabled
is this category enabled or not
Definition: logging.h:158
osmo_fsm_state
description of a rule in the FSM
Definition: fsm.h:42
OSMO_TDEF_S
@ OSMO_TDEF_S
most T are in seconds, keep 0 as default.
Definition: tdef.h:39
OSMO_HDLC_CRC_ERROR
#define OSMO_HDLC_CRC_ERROR
Definition: isdnhdlc.h:71
osmo_serial_speed_t
int osmo_serial_speed_t(unsigned int baudrate, speed_t *speed)
Convert unsigned integer value to speed_t.
Definition: serial.c:254
osmo_stats_reporter_sanitize_name
static void osmo_stats_reporter_sanitize_name(char *buf)
Replace all illegal ':' in the stats name, but not when used as value seperator.
Definition: stats_statsd.c:75
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:431
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:108
osmo_fd_disp_fds
int osmo_fd_disp_fds(void *readset, void *writeset, void *exceptset)
Definition: select.c:232
OSMO_SOCK_NAME_MAXLEN
#define OSMO_SOCK_NAME_MAXLEN
maximum length of a socket name ("r=1.2.3.4:123<->l=5.6.7.8:987")
Definition: socket.h:18
rate_ctr_init
int rate_ctr_init(void *tall_ctx)
Initialize the counter module.
Definition: rate_ctr.c:335
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:822
osmo_char2bcd
uint8_t osmo_char2bcd(char c)
Convert number in ASCII to BCD value.
Definition: utils.c:126
timeradd
#define timeradd(a, b, result)
Definition: timer_compat.h:54
LOGL_FATAL
#define LOGL_FATAL
fatal, program aborted
Definition: logging.h:101
str_in_list
static bool str_in_list(const char **list, const char *key)
Definition: exec.c:60
OSMO_LOGCOLOR_END
#define OSMO_LOGCOLOR_END
Definition: logging.h:144
osmo_stats_reporter::running
int running
is this reporter running
Definition: stats.h:83
osmo_stats_reporter::flush_period
unsigned int flush_period
period between regular flushes
Definition: stats.h:76
_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:835
osmo_wqueue::current_length
unsigned int current_length
current length of write queue
Definition: write_queue.h:40
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)
Initialize a socket (including bind/connect)
Definition: socket.c:868
log_info_cat::color
const char * color
color string for cateyory
Definition: logging.h:155
osmo_it_q::list
struct llist_head list
Definition: it_q.h:21
osmo_str2lower
void osmo_str2lower(char *out, const char *in) OSMO_DEPRECATED("Use osmo_str_tolower() or osmo_str_tolower_buf() instead
Convert an entire string to lower case.
Definition: utils.c:479
fsm_term_safely
static __thread struct @23 fsm_term_safely
Internal state for FSM instance termination cascades.
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:301
__attribute__
static __attribute__((constructor))
Definition: select.c:462
osmo_sock_get_remote_ip
int osmo_sock_get_remote_ip(int fd, char *host, size_t len)
Get remote IP address on socket.
Definition: socket.c:1361
osmo_stat_item_handler_t
int(* osmo_stat_item_handler_t)(struct osmo_stat_item_group *, struct osmo_stat_item *, void *)
Definition: stat_item.h:103
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:38
osmo_ubit_dump_buf
char * osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, unsigned int len)
Convert a sequence of unpacked bits to ASCII string, in user-supplied buffer.
Definition: utils.c:345
log_info_cat::loglevel
uint8_t loglevel
currently selected log-level
Definition: logging.h:157
loglevel_strs
const struct value_string loglevel_strs[]
Definition: logging.c:139
GSMTAP_CHANNEL_FACCH_H
#define GSMTAP_CHANNEL_FACCH_H
Definition: gsmtap.h:87
osmo_stats_reporter::bind_addr_len
int bind_addr_len
length of bind_addr in bytes
Definition: stats.h:87
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:58
osmo_prim_event_map::sap
unsigned int sap
SAP to match.
Definition: prim.h:83
rate_ctr_add
void rate_ctr_add(struct rate_ctr *ctr, int inc)
Increment the counter by inc.
Definition: rate_ctr.c:267
osmo_tdef_get_state_timeout
const struct osmo_tdef_state_timeout * osmo_tdef_get_state_timeout(uint32_t state, const struct osmo_tdef_state_timeout *timeouts_array)
Using osmo_tdef for osmo_fsm_inst: find a given state's osmo_tdef_state_timeout entry.
Definition: tdef.c:318
SC_DLCI_ECHO
@ SC_DLCI_ECHO
Definition: sercomm.h:21
sockaddr_equal
static int sockaddr_equal(const struct sockaddr *a, const struct sockaddr *b, unsigned int len)
Definition: socket.c:1068
osmo_serial_set_custom_baudrate
int osmo_serial_set_custom_baudrate(int fd, int baudrate)
Change current baudrate to a custom one using OS specific method.
Definition: serial.c:176
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:38
osmo_quote_cstr_buf
size_t osmo_quote_cstr_buf(char *buf, size_t bufsize, const char *str, int in_len)
Like osmo_escape_str_buf2(), but returns double-quotes around a string, or "NULL" for a NULL string.
Definition: utils.c:992
fsm_dealloc_ctx
void * fsm_dealloc_ctx
See osmo_fsm_set_dealloc_ctx()
Definition: fsm.c:106
node
uint16_t node
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
rate_ctr_group::desc
const struct rate_ctr_group_desc * desc
Pointer to the counter group class.
Definition: rate_ctr.h:61
log_target_find
struct log_target * log_target_find(int type, const char *fname)
Find a registered log target.
Definition: logging.c:1004
osmo_stat_item_reset
void osmo_stat_item_reset(struct osmo_stat_item *item)
Remove all values of a stat item.
Definition: stat_item.c:363
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:753
len
static size_t len(const char *str)
osmo_sock_init_osa_ofd
int osmo_sock_init_osa_ofd(struct osmo_fd *ofd, int type, int proto, const struct osmo_sockaddr *local, const struct osmo_sockaddr *remote, unsigned int flags)
Definition: socket.c:1015
rate_ctrl_group_desc_validate
static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc)
Definition: rate_ctr.c:76
osmo_stats_reporter::dest_addr
struct sockaddr dest_addr
destination address of socket
Definition: stats.h:84
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
osmo_timer_add
void osmo_timer_add(struct osmo_timer_list *timer)
add a new timer to the timer management
Definition: timer.c:84
log_category
Configuration of single log category / sub-system.
Definition: logging.h:147
osmo_fd::priv_nr
unsigned int priv_nr
private number, extending data
Definition: select.h:45
OSMO_STATS_REPORTER_LOG
@ OSMO_STATS_REPORTER_LOG
libosmocore logging
Definition: stats.h:56
osmo_crc64gen_code
structure describing a given CRC code of max 64 bits
Definition: crc64gen.h:34
osmo_stats_reporter_statsd_send_counter
static int osmo_stats_reporter_statsd_send_counter(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta)
Definition: stats_statsd.c:160
gsmtap_osmocore_log_hdr::level
uint8_t level
logging level
Definition: gsmtap.h:325
rate_ctr_get_unused_name_idx
static unsigned int rate_ctr_get_unused_name_idx(const char *name)
Find an unused index for this rate counter group.
Definition: rate_ctr.c:190
osmo_sockaddr_str_from_sockaddr_in
int osmo_sockaddr_str_from_sockaddr_in(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in *src)
poll_disp_fds
static int poll_disp_fds(int n_fd)
Definition: select.c:314
osmo_quote_str_buf2
char * osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len)
Like osmo_escape_str_buf2(), but returns double-quotes around a string, or "NULL" for a NULL string.
Definition: utils.c:905
LOG_FILENAME_PATH
@ LOG_FILENAME_PATH
Definition: logging.h:256
rate_ctr_group_free
void rate_ctr_group_free(struct rate_ctr_group *grp)
Free the memory for the specified group of counters.
Definition: rate_ctr.c:256
osmo_stat_item_group_desc::item_desc
const struct osmo_stat_item_desc * item_desc
Pointer to array of value names, length as per num_items.
Definition: stat_item.h:54
OSMO_ASSERT
#define OSMO_ASSERT(exp)
Helper macro to terminate when an assertion fails.
Definition: utils.h:104
osmo_stats_class
osmo_stats_class
Statistics Class definitions.
Definition: stats.h:47
RSL_CHAN_BCCH
#define RSL_CHAN_BCCH
osmo_stat_item_get_by_name
const struct osmo_stat_item * osmo_stat_item_get_by_name(const struct osmo_stat_item_group *statg, const char *name)
Search for item based on group + item name.
Definition: stat_item.c:301
DEBUGP
#define DEBUGP(ss, fmt, args...)
Log a debug message through the Osmocom logging framework.
Definition: logging.h:24
osmo_stats_reporter_log_send_item
static int osmo_stats_reporter_log_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value)
Definition: stats.c:612
log_parse_category_mask
void log_parse_category_mask(struct log_target *target, const char *mask)
parse the log category mask
Definition: logging.c:342
osmo_stat_item_group
One instance of a counter group class.
Definition: stat_item.h:58
osmo_prim_hdr
Osmocom primitive header.
Definition: prim.h:43
DEFAULT_RX_MSG_SIZE
#define DEFAULT_RX_MSG_SIZE
Definition: sercomm.c:41
write_queue.h
LOG_FILENAME_BASENAME
@ LOG_FILENAME_BASENAME
Definition: logging.h:257
count_safe
static bool count_safe(int32_t *val_p, int32_t add)
Add two int32_t but make sure to min- and max-clamp at INT32_MIN and INT32_MAX, respectively.
Definition: use_count.c:47
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
append data to end of message buffer
Definition: msgb.h:238
__add_timer
static void __add_timer(struct osmo_timer_list *timer)
Definition: timer.c:48
gsmtap_util.h
osmo_stat_item_group_free
void osmo_stat_item_group_free(struct osmo_stat_item_group *statg)
Free the memory for the specified group of stat items.
Definition: stat_item.c:147
osmo_stat_item_desc::num_values
unsigned int num_values
number of values to store in FIFO
Definition: stat_item.h:39
log_target_create
struct log_target * log_target_create(void)
Create a new log target skeleton.
Definition: logging.c:909
rate_ctr_group_desc::class_id
int class_id
The class to which this group belongs.
Definition: rate_ctr.h:49
rate_ctr_group_handler
static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_)
Definition: stats.c:673
osmo_signalfd
Definition: select.h:98
OSMO_NO_EVENT
#define OSMO_NO_EVENT
magic value to be used as final record of osmo_prim_event_map
Definition: prim.h:79
timer_root
static __thread struct rb_root timer_root
Definition: timer.c:46
_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:750
subsys
char subsys[16]
logging sub-system
Definition: gsmtap.h:9
LLIST_HEAD
static LLIST_HEAD(it_queues)
osmo_it_q::mutex
pthread_mutex_t mutex
Definition: it_q.h:23
osmo_prbs_get_ubit
ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state)
Get the next bit out of given PRBS instance.
Definition: prbs.c:61
msgb_copy_c
struct msgb * msgb_copy_c(const void *ctx, const struct msgb *msg, const char *name)
Copy an msgb.
Definition: msgb.c:329
osmo_isdnhdlc_rcv_init
void osmo_isdnhdlc_rcv_init(struct osmo_isdnhdlc_vars *hdlc, uint32_t features)
Definition: isdnhdlc.c:47
osmo_stat_item_group::idx
unsigned int idx
The index of this value group within its class.
Definition: stat_item.h:64
crc64gen.h
osmo_wqueue::max_length
unsigned int max_length
maximum length of write queue
Definition: write_queue.h:38
osmo_sercomm_init
void osmo_sercomm_init(struct osmo_sercomm_inst *sercomm)
Initialize an Osmocom sercomm instance.
Definition: sercomm.c:78
msgb::data
unsigned char * data
start of message in buffer
Definition: msgb.h:59
osmo_strrb::size
uint16_t size
max number of messages to store
Definition: strrb.h:41
alias
char alias("osmo_hexdump_nospc")))
osmo_stat_item_group_handler_t
int(* osmo_stat_item_group_handler_t)(struct osmo_stat_item_group *, void *)
Definition: stat_item.h:106
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:693
gsmtap_hdr::arfcn
uint16_t arfcn
ARFCN (frequency)
Definition: gsmtap.h:304
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:48
osmo_tdef::val
unsigned long val
Currently active timeout value, e.g.
Definition: tdef.h:80
osmo_sock_get_name2_c
char * osmo_sock_get_name2_c(const void *ctx, int fd)
Get address/port information on socket in static string, like "r=1.2.3.4:5<->l=6.7....
Definition: socket.c:1437
osmo_stats_reporter_send_buffer
int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep)
_rb_output
static void _rb_output(struct log_target *target, unsigned int level, const char *log)
Definition: loggingrb.c:40
osmo_escape_cstr_buf
size_t osmo_escape_cstr_buf(char *buf, size_t bufsize, const char *str, int in_len)
Return the string with all non-printable characters escaped.
Definition: utils.c:962
osmo_log_backtrace
void osmo_log_backtrace(int subsys, int level)
Generate and log a call back-trace.
Definition: backtrace.c:79
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:136
log_info::filter_fn
log_filter * filter_fn
Definition: logging.h:227
osmo_config_list_parse
struct osmo_config_list * osmo_config_list_parse(void *ctx, const char *filename)
Definition: msgfile.c:101
osmo_stats_reporter_set_local_addr
int osmo_stats_reporter_set_local_addr(struct osmo_stats_reporter *srep, const char *addr)
rate_ctr_per_intv::rate
uint64_t rate
counter rate
Definition: rate_ctr.h:25
osmo_use_count::use_counts
struct llist_head use_counts
List of use tokens.
Definition: use_count.h:179
LOG_TGT_TYPE_STDERR
@ LOG_TGT_TYPE_STDERR
stderr logging
Definition: logging.h:247
osmo_stat_item
data we keep for each actual item
Definition: stat_item.h:23
osmo_fd_register
int osmo_fd_register(struct osmo_fd *fd)
Register a new file descriptor with select loop abstraction.
Definition: select.c:120
osmo_stat_item_desc::default_value
int32_t default_value
default value
Definition: stat_item.h:40
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)
Create a new (sending) GSMTAP source socket.
Definition: gsmtap_util.c:247
osmo_isdnhdlc_vars
Definition: isdnhdlc.h:34
log_target::print_filename_pos
enum log_filename_pos print_filename_pos
Definition: logging.h:358
osmo_escape_str
const char * osmo_escape_str(const char *str, int len)
Return the string with all non-printable characters escaped.
Definition: utils.c:853
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:377
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
osmo_signalfd::sigset
sigset_t sigset
Definition: select.h:100
crc16.h
osmo_stats_reporter::send_item
int(* send_item)(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value)
Definition: stats.h:101
STATS_DEFAULT_BUFLEN
#define STATS_DEFAULT_BUFLEN
Definition: stats.c:105
osmo_use_count_create
static struct osmo_use_count_entry * osmo_use_count_create(struct osmo_use_count *uc, const char *use)
Allocate a new use count entry, happens implicitly in osmo_use_count_get_put().
Definition: use_count.c:196
osmo_isdnhdlc_vars::ffvalue
uint8_t ffvalue
Definition: isdnhdlc.h:46
__rb_erase_color
static void __rb_erase_color(struct rb_node *node, struct rb_node *parent, struct rb_root *root)
Definition: rbtree.c:139
osmo_stat_item_group_desc::num_items
const unsigned int num_items
The number of values in this group (size of item_desc)
Definition: stat_item.h:52
rb_set_black
#define rb_set_black(r)
Definition: linuxrbtree.h:120
PRIM_OP_INDICATION
@ PRIM_OP_INDICATION
indication
Definition: prim.h:29
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:75
GSMTAP_CHANNEL_FACCH_F
#define GSMTAP_CHANNEL_FACCH_F
Definition: gsmtap.h:86
rb_replace_node
void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root)
Definition: rbtree.c:365
GSMTAP_VERSION
#define GSMTAP_VERSION
Definition: gsmtap.h:31
osmo_stat_item_value
Individual entry in value FIFO.
Definition: stat_item.h:17
mangle_identifier_ifneeded
static char * mangle_identifier_ifneeded(const void *ctx, const char *in)
Definition: rate_ctr.c:109
osmo_stat_item_group_reset
void osmo_stat_item_group_reset(struct osmo_stat_item_group *statg)
Reset all osmo stat items in a group.
Definition: stat_item.c:379
log_info_cat::name
const char * name
name of category
Definition: logging.h:154
msgb_l4len
static unsigned int msgb_l4len(const struct msgb *msgb)
determine length of L4 message
Definition: msgb.h:185
level_colors
static const struct value_string level_colors[]
Definition: logging.c:398
osmo_sercomm_inst::dlci_queues
struct llist_head dlci_queues[_SC_DLCI_MAX]
per-DLC queue of pending transmit msgbs
Definition: sercomm.h:42
osmo_sockaddr_port
uint16_t osmo_sockaddr_port(const struct sockaddr *sa)
Get sockaddr port content (in host byte order)
Definition: socket.c:1191
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:853
osmo_sockaddr_str_to_in6_addr
int osmo_sockaddr_str_to_in6_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in6_addr *dst)
log_info_cat
Information regarding one logging category.
Definition: logging.h:153
osmo_decode_big_endian
uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len)
Generic retrieval of 1..8 bytes as big-endian uint64_t.
Definition: utils.c:534
osmo_clock_gettime
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
osmo_stats_reporter::fd
int fd
file descriptor of socket
Definition: stats.h:88
__attribute__
struct gsm48_classmark3 __attribute__
fls64 - find last set bit in a 64-bit word @x: the word to search
Definition: log2.h:61
osmo_separated_identifiers_valid
bool osmo_separated_identifiers_valid(const char *str, const char *sep_chars)
Determine if a given identifier is valid, i.e.
Definition: utils.c:651
RB_ROOT
#define RB_ROOT
Definition: linuxrbtree.h:131
osmo_timers_nearest_ms
int osmo_timers_nearest_ms(void)
Determine time between now and the nearest timer in milliseconds.
Definition: timer.c:190
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:442
backtrace.h
msg
uint8_t msg[0]
log_info
Logging configuration, passed to log_init.
Definition: logging.h:225
_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:744
osmo_stat_item_inc
void osmo_stat_item_inc(struct osmo_stat_item *item, int32_t value)
Increase the stat_item to the given value.
Definition: stat_item.c:159
osmo_config_list
Definition: msgfile.h:43
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 non-consecutive(!) llist entries.
Definition: linuxlist.h:332
osmo_sockaddr_str_to_sockaddr_in6
int osmo_sockaddr_str_to_sockaddr_in6(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in6 *dst)
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:328
HDLC_GET_DATA
@ HDLC_GET_DATA
Definition: isdnhdlc.c:35
log_target_create_stderr
struct log_target * log_target_create_stderr(void)
Create the STDERR log target.
Definition: logging.c:951
_syslog_output
static void _syslog_output(struct log_target *target, unsigned int level, const char *log)
Definition: logging_syslog.c:61
PRIM_OP_REQUEST
@ PRIM_OP_REQUEST
request
Definition: prim.h:27
gsmtap_source_add_sink_fd
int gsmtap_source_add_sink_fd(int gsmtap_fd)
Add a local sink to an existing GSMTAP source and return fd.
Definition: gsmtap_util.c:270
osmo_fsm_inst::proc
struct osmo_fsm_inst::@0 proc
support for fsm-based procedures
osmo_sockaddr
Definition: socket.h:24
llist_for_each
#define llist_for_each(pos, head)
Iterate over a linked list.
Definition: linuxlist.h:255
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:97
gsmtap_source_init
struct gsmtap_inst * gsmtap_source_init(const char *host, uint16_t port, int ofd_wq_mode)
Open GSMTAP source socket, connect and register osmo_fd.
Definition: gsmtap_util.c:447
RATE_CTR_INTV_MIN
@ RATE_CTR_INTV_MIN
last minute
Definition: rate_ctr.h:17
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:760
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)
Set up an osmo-fd.
Definition: select.c:80
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:224
DLLAPD
#define DLLAPD
LAPD implementation.
Definition: logging.h:105
GSMTAP_TYPE_ABIS
#define GSMTAP_TYPE_ABIS
Definition: gsmtap.h:34
osmo_it_q
One instance of an inter-thread queue.
Definition: it_q.h:16
osmo_str_tolower_c
char * osmo_str_tolower_c(const void *ctx, const char *src)
Convert a string to lowercase, dynamically allocating the output from given talloc context See also o...
Definition: utils.c:1099
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:77
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:111
msgb_tailroom
static int msgb_tailroom(const struct msgb *msgb)
determine how much tail room is left in msgb
Definition: msgb.h:209
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:844
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:74
osmo_escape_cstr_c
char * osmo_escape_cstr_c(void *ctx, const char *str, int in_len)
Return the string with all non-printable characters escaped, in dynamically-allocated buffer.
Definition: utils.c:974
HDLC_FLAG
#define HDLC_FLAG
Definition: sercomm.c:57
_osmo_it_q_by_name
static struct osmo_it_q * _osmo_it_q_by_name(const char *name)
Definition: it_q.c:72
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:106
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:298
osmo_stat_item_group_desc
Description of a statistics item group.
Definition: stat_item.h:44
osmo_stats_reporter_statsd_send
static int osmo_stats_reporter_statsd_send(struct osmo_stats_reporter *srep, const char *name1, unsigned int index1, const char *name2, int64_t value, const char *unit)
Definition: stats_statsd.c:91
GSMTAP_CHANNEL_SDCCH4
#define GSMTAP_CHANNEL_SDCCH4
Definition: gsmtap.h:84
name
const char * name
osmo_stat_item_handler
static int osmo_stat_item_handler(struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_)
Definition: stats.c:693
should_log_to_target
static bool should_log_to_target(struct log_target *tar, int subsys, int level)
Definition: logging.c:598
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:115
plugin.h
osmo_fd_unregister
void osmo_fd_unregister(struct osmo_fd *fd)
Unregister a file descriptor from select loop abstraction.
Definition: select.c:174
osmo_sockaddr_to_str
const char * osmo_sockaddr_to_str(const struct osmo_sockaddr *sockaddr)
string-format a given osmo_sockaddr address
Definition: socket.c:1722
osmo_timers_update
int osmo_timers_update(void)
fire all timers...
Definition: timer.c:237
DLOAP
#define DLOAP
Osmocom Authentication Protocol.
Definition: logging.h:115
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:774
osmo_stats_reporter::type
enum osmo_stats_reporter_type type
Type of the reporter (log, statsd)
Definition: stats.h:63
log_target::print_filename2
enum log_filename_type print_filename2
Definition: logging.h:356
osmo_fsm_term_cause
osmo_fsm_term_cause
Definition: fsm.h:21
llist_del_init
static void llist_del_init(struct llist_head *entry)
Delete a single entry from a linked list and reinitialize it.
Definition: linuxlist.h:138
signal_dbm
int8_t signal_dbm
signal level in dBm
Definition: gsmtap.h:6
osmo_sockaddr_str_is_nonzero
bool osmo_sockaddr_str_is_nonzero(const struct osmo_sockaddr_str *sockaddr_str)
osmo_isdnhdlc_vars::hdlc_bits1
int hdlc_bits1
Definition: isdnhdlc.h:36
OSMO_NUM_DLIB
#define OSMO_NUM_DLIB
Number of logging sub-systems in libraries.
Definition: logging.h:125
osmo_isdnhdlc_vars::do_adapt56
uint32_t do_adapt56
Definition: isdnhdlc.h:53
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:287
rb_prev
struct rb_node * rb_prev(const struct rb_node *node)
Definition: rbtree.c:341
MAX_LOG_SIZE
#define MAX_LOG_SIZE
Definition: logging.c:72
osmo_fd_is_registered
bool osmo_fd_is_registered(struct osmo_fd *fd)
Check if a file descriptor is already registered.
Definition: select.c:104
HDLC_SEND_IDLE1
@ HDLC_SEND_IDLE1
Definition: isdnhdlc.c:41
osmo_sockaddr_str::ip
char ip[INET6_ADDRSTRLEN]
NUL terminated string of the IPv4 or IPv6 address.
Definition: sockaddr_str.h:53
osmo_tdefs_reset
void osmo_tdefs_reset(struct osmo_tdef *tdefs)
Set all osmo_tdef values to the default_val.
Definition: tdef.c:154
log_enable_multithread
void log_enable_multithread(void)
Enable multithread support (mutex) in libosmocore logging system.
Definition: logging.c:101
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
Initialize a llist_head to point back to itself.
Definition: linuxlist.h:65
osmo_gettimeofday_override_add
void osmo_gettimeofday_override_add(time_t secs, suseconds_t usecs)
convenience function to advance the fake time.
Definition: timer_gettimeofday.c:72
crc32gen.h
osmo_stats_reporter_create_statsd
struct osmo_stats_reporter * osmo_stats_reporter_create_statsd(const char *name)
Create a stats_reporter reporting to statsd.
Definition: stats_statsd.c:57
osmo_strlcpy
size_t osmo_strlcpy(char *dst, const char *src, size_t siz)
Copy a C-string into a sized buffer.
Definition: utils.c:575
osmo_signalfd::data
void * data
Definition: select.h:102
osmo_stats_reporter::flush_period_counter
unsigned int flush_period_counter
count sends between forced flushes
Definition: stats.h:92
osmo_ntohs
#define osmo_ntohs(x)
Definition: byteswap.h:42
osmo_fsm_event_name
const char * osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event)
get human-readable name of FSM event
Definition: fsm.c:584
alloc_entries
static struct osmo_config_list * alloc_entries(void *ctx)
Definition: msgfile.c:56
update_nearest
static void update_nearest(struct timeval *cand, struct timeval *current)
Definition: timer.c:203
OSMO_STATS_REPORTER_STATSD
@ OSMO_STATS_REPORTER_STATSD
statsd backend
Definition: stats.h:57
rb_color
#define rb_color(r)
Definition: linuxrbtree.h:116
GSMTAP_CHANNEL_SDCCH8
#define GSMTAP_CHANNEL_SDCCH8
Definition: gsmtap.h:85
tall_rate_ctr_ctx
static void * tall_rate_ctr_ctx
Definition: rate_ctr.c:73
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:29
LOG_FILENAME_NONE
@ LOG_FILENAME_NONE
Definition: logging.h:255
osmo_tdef
Define a GSM timer of the form Tnnn, with unit, default value and doc string.
Definition: tdef.h:65
osmo_use_count_total
int32_t osmo_use_count_total(const struct osmo_use_count *uc)
Return the sum of all use counts, min- and max-clamped at INT32_MIN and INT32_MAX.
Definition: use_count.c:71
osmo_stats_reporter
One statistics reporter instance.
Definition: stats.h:61
gsmtap_osmocore_log_hdr::ts
struct gsmtap_osmocore_log_hdr::@4 ts
OTC_GLOBAL
#define OTC_GLOBAL
Definition: talloc.h:26
container_of
#define container_of(ptr, type, member)
Cast a member of a structure out to the containing structure.
Definition: linuxlist.h:32
addrinfo_has_v4v6addr
static void addrinfo_has_v4v6addr(const struct addrinfo **result, size_t result_count, bool *has_v4, bool *has_v6)
Definition: socket.c:592
signal_handler::cbfn
osmo_signal_cbfn * cbfn
Definition: signal.c:45
osmo_stats_reporter::close
int(* close)(struct osmo_stats_reporter *srep)
Definition: stats.h:96
GSMTAP_LOG_MAX_SIZE
#define GSMTAP_LOG_MAX_SIZE
Definition: logging_gsmtap.c:56
osmo_sock_unix_init
int osmo_sock_unix_init(uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags)
Initialize a unix domain socket (including bind/connect)
Definition: socket.c:1217
gsmtap_inst::sink_ofd
struct osmo_fd sink_ofd
file descriptor
Definition: gsmtap_util.h:30
RX_ST_ADDR
@ RX_ST_ADDR
Definition: sercomm.c:66
osmo_crc16gen_code::poly
uint16_t poly
Polynom (normal representation, MSB omitted.
Definition: crc16gen.h:36
start
uint32_t start
osmo_tdef_state_timeout::keep_timer
bool keep_timer
If true, call osmo_fsm_inst_state_chg_keep_timer().
Definition: tdef.h:118
exec.h
msgb::len
uint16_t len
length of bytes used in msgb
Definition: msgb.h:55
osmo_sockaddr_str_from_32n
int osmo_sockaddr_str_from_32n(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port) OSMO_DEPRECATED("osmo_sockaddr_str_from_32n() actually uses *host* byte order. Use osmo_sockaddr_str_from_32h() instead")
osmo_sercomm_inst::initialized
int initialized
Has this instance been initialized?
Definition: sercomm.h:35
timersub
#define timersub(a, b, result)
Definition: timer_compat.h:67
GSMTAP_TYPE_QC_DIAG
#define GSMTAP_TYPE_QC_DIAG
Definition: gsmtap.h:49
rb_left
struct rb_node * rb_left
Definition: linuxrbtree.h:4
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:134
log_target_create_file
struct log_target * log_target_create_file(const char *fname)
Create a new file-based log target.
Definition: logging.c:975
osmo_sock_mcast_all_set
int osmo_sock_mcast_all_set(int fd, bool enable)
Enable/disable receiving all multicast packets, even for non-subscribed groups.
Definition: socket.c:1538
log_target_create_syslog
struct log_target * log_target_create_syslog(const char *ident, int option, int facility)
Create a new logging target for syslog logging.
Definition: logging_syslog.c:73
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:935
osmo_isdnhdlc_vars::data_received
uint32_t data_received
Definition: isdnhdlc.h:49
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:127
RSL_CHAN_SDCCH8_ACCH
#define RSL_CHAN_SDCCH8_ACCH
flags
uint16_t flags
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:84
osmo_fsm_inst
a single instanceof an osmocom finite state machine
Definition: fsm.h:87
RB_BLACK
#define RB_BLACK
Definition: linuxrbtree.h:2
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:810
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:311
HDLC_SEND_FAST_FLAG
@ HDLC_SEND_FAST_FLAG
Definition: isdnhdlc.c:39
osmo_counter::previous
unsigned long previous
previous value
Definition: counter.h:14
osmo_it_q::name
const char * name
Definition: it_q.h:30
rb_first
struct rb_node * rb_first(const struct rb_root *root)
Definition: rbtree.c:289
osmo_stat_item_group::list
struct llist_head list
Linked list of all value groups in the system.
Definition: stat_item.h:60
LOG_TGT_TYPE_SYSLOG
@ LOG_TGT_TYPE_SYSLOG
syslog based logging
Definition: logging.h:245
osmo_crc8gen_code::poly
uint8_t poly
Polynom (normal representation, MSB omitted.
Definition: crc8gen.h:36
OSMO_NAME_C_IMPL
#define OSMO_NAME_C_IMPL(CTX, INITIAL_BUFSIZE, ON_ERROR, FUNC_BUF, FUNC_BUF_ARGS...)
Translate a buffer function to a talloc context function.
Definition: utils.h:310
rate_ctr_handler
static int rate_ctr_handler(struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *sctx_)
Definition: stats.c:646
log_target::entry
struct llist_head entry
linked list
Definition: logging.h:268
log_category::loglevel
uint8_t loglevel
configured log-level
Definition: logging.h:148
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
msgb_enqueue_count
static void msgb_enqueue_count(struct llist_head *queue, struct msgb *msg, unsigned int *count)
Enqueue message buffer to tail of a queue and increment queue size counter.
Definition: msgb.h:97
length
uint8_t length
rate_ctr_desc::description
const char * description
description of the counter
Definition: rate_ctr.h:39
osmo_signal_unregister_handler
void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Unregister signal handler.
Definition: signal.c:90
osmo_tdef::unit
enum osmo_tdef_unit unit
Definition: tdef.h:74
log_target::use_color
unsigned int use_color
should color be used when printing log messages?
Definition: logging.h:281
osmo_crc64gen_code::init
uint64_t init
Initialization value of the CRC state.
Definition: crc64gen.h:37
osmo_sercomm_drv_pull
int osmo_sercomm_drv_pull(struct osmo_sercomm_inst *sercomm, uint8_t *ch)
fetch one octet of to-be-transmitted serial data
Definition: sercomm.c:183
osmo_sockaddr_to_str_buf
char * osmo_sockaddr_to_str_buf(char *buf, size_t buf_len, const struct osmo_sockaddr *sockaddr)
string-format a given osmo_sockaddr address into a user-supplied buffer
Definition: socket.c:1736
osmo_stat_item_get_next
int osmo_stat_item_get_next(const struct osmo_stat_item *item, int32_t *idx, int32_t *value)
Retrieve the next value from the osmo_stat_item object.
Definition: stat_item.c:213
osmo_counter
Structure representing a single counter.
Definition: counter.h:9
osmo_stat_item::values
struct osmo_stat_item_value values[0]
value FIFO
Definition: stat_item.h:31
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:414
msgb_l1
#define msgb_l1(m)
obtain L1 header of msgb
Definition: msgb.h:132
osmo_prbs9
const struct osmo_prbs osmo_prbs9
PRBS-9 according ITU-T O.150.
Definition: prbs.c:22
maxfd
static __thread int maxfd
Definition: select.c:56
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:289
osmo_sock_get_local_ip_port
int osmo_sock_get_local_ip_port(int fd, char *port, size_t len)
Get local port on socket.
Definition: socket.c:1350
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:1075
osmo_identifier_illegal_chars
static const char osmo_identifier_illegal_chars[]
Definition: utils.c:644
osmo_serial_set_baudrate
int osmo_serial_set_baudrate(int fd, speed_t baudrate)
Change current baudrate.
Definition: serial.c:162
llist_del
static void llist_del(struct llist_head *entry)
Delete a single entry from a linked list.
Definition: linuxlist.h:128
osmo_strbuf::chars_needed
size_t chars_needed
After all OSMO_STRBUF_APPEND operations, reflects the total number of characters that would be writte...
Definition: utils.h:183
DLM3UA
#define DLM3UA
Osmocom M3UA.
Definition: logging.h:119
osmo_stats_reporter_find
struct osmo_stats_reporter * osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name)
Find a stats_reporter of given type and name.
Definition: stats.c:254
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:124
osmo_tdef::default_val
const unsigned long default_val
Timeout duration (according to unit), default value; type corresponds to osmo_fsm_inst_state_chg()'s ...
Definition: tdef.h:73
stats_start
probe stats_start()
level
uint8_t level
logging level
Definition: gsmtap.h:6
proto
uint8_t proto
handle_line
static void handle_line(struct osmo_config_list *entries, char *line)
Definition: msgfile.c:71
osmo_stats_reporter::force_single_flush
int force_single_flush
set to 1 to force a flush (send even unchanged stats values)
Definition: stats.h:91
osmo_ctx
__thread struct osmo_talloc_contexts * osmo_ctx
Definition: context.c:29
osmo_sock_unix_init_ofd
int osmo_sock_unix_init_ofd(struct osmo_fd *ofd, uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags)
Initialize a unix domain socket and fill osmo_fd.
Definition: socket.c:1294
DLRSPRO
#define DLRSPRO
Osmocom Remote SIM Protocol.
Definition: logging.h:122
INT2IDX
#define INT2IDX(x)
Definition: logging.c:149
gsmtap_hdr::signal_dbm
int8_t signal_dbm
signal level in dBm
Definition: gsmtap.h:305
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:44
_SOCKADDR_TO_STR
#define _SOCKADDR_TO_STR(dest, sockaddr)
Definition: socket.c:460
tall_log_ctx
void * tall_log_ctx
Definition: logging.c:84
GSMTAP_CHANNEL_PTCCH
#define GSMTAP_CHANNEL_PTCCH
Definition: gsmtap.h:93
osmo_mnl::priv
void * priv
opaque data provided by user
Definition: mnl.h:18
osmo_timer_list::timeout
struct timeval timeout
expiration time
Definition: timer.h:59
osmo_prim_hdr::operation
enum osmo_prim_operation operation
Definition: prim.h:46
osmo_stat_item_set
void osmo_stat_item_set(struct osmo_stat_item *item, int32_t value)
Set the a given stat_item to the given value.
Definition: stat_item.c:183
OSMO_SOCK_F_NONBLOCK
#define OSMO_SOCK_F_NONBLOCK
switch socket to non-blocking mode
Definition: socket.h:39
bits.h
_osmo_select_main
static int _osmo_select_main(int polling)
Definition: select.c:357
rate_ctr_timer_cb
static void rate_ctr_timer_cb(void *data)
Definition: rate_ctr.c:318
osmo_ntohl
#define osmo_ntohl(x)
Definition: byteswap.h:41
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:523
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
HDLC_SENDFLAG_B7
@ HDLC_SENDFLAG_B7
Definition: isdnhdlc.c:42
subsys_lib2index
static int subsys_lib2index(int subsys)
Definition: logging.c:292
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:864
log_target::print_ext_timestamp
unsigned int print_ext_timestamp
should log messages be prefixed with an extended timestamp?
Definition: logging.h:291
log_target::loglevel
uint8_t loglevel
global log level
Definition: logging.h:279
data
uint8_t data[0]
osmo_use_count_entry::use
const char * use
Use token string that was passed to osmo_use_count_get_put().
Definition: use_count.h:200
sercomm_drv_baudrate_chg
int sercomm_drv_baudrate_chg(struct osmo_sercomm_inst *sercomm, uint32_t bdrt)
low-level driver routine to execute baud-rate change
dispatch_rx_msg
static void dispatch_rx_msg(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struct msgb *msg)
Definition: sercomm.c:262
gsmtap_hdr::sub_type
uint8_t sub_type
Type of burst/channel, see above.
Definition: gsmtap.h:310
LLIST_HEAD
static LLIST_HEAD(counters)
DLBSSGP
#define DLBSSGP
Osmocom BSSGP layer.
Definition: logging.h:124
log_set_context
int log_set_context(uint8_t ctx, void *value)
Set the logging context.
Definition: logging.c:735
GSMTAP_CHANNEL_AGCH
#define GSMTAP_CHANNEL_AGCH
Definition: gsmtap.h:81
osmo_stat_item_discard_all
int osmo_stat_item_discard_all(int32_t *idx)
Skip all values of all items and update idx accordingly.
Definition: stat_item.c:260
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:104
OSMO_LOGCOLOR_BLUE
#define OSMO_LOGCOLOR_BLUE
Definition: logging.h:132
osmo_stats_config
Definition: stats.h:107
BACKSLASH_CASE
#define BACKSLASH_CASE(c, repr)
GSMTAP_CHANNEL_SDCCH
#define GSMTAP_CHANNEL_SDCCH
Definition: gsmtap.h:83
osmo_sercomm_inst::next_char
uint8_t * next_char
next to-be-transmitted char in msg
Definition: sercomm.h:48
gsmtap_type_names
const struct value_string gsmtap_type_names[]
Definition: gsmtap_util.c:507
osmo_sock_init_ofd
int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *host, uint16_t port, unsigned int flags)
Initialize a socket and fill osmo_fd.
Definition: socket.c:986
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)
send a message from L1/L2 through GSMTAP.
Definition: gsmtap_util.c:352
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:177
log_info::num_cat_user
unsigned int num_cat_user
total number of user categories (not library)
Definition: logging.h:234
osmo_sock_mcast_ttl_set
int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl)
Set the TTL of outbound multicast packets.
Definition: socket.c:1495
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:79
osmo_stat_item::last_value_index
int32_t last_value_index
the index of the freshest value
Definition: stat_item.h:27
msgb
Osmocom message buffer.
Definition: msgb.h:35
msgb_push
static unsigned char * msgb_push(struct msgb *msgb, unsigned int len)
prepend (push) some data to start of message
Definition: msgb.h:339
rb_insert_color
void rb_insert_color(struct rb_node *, struct rb_root *)
Definition: rbtree.c:74
osmo_clock_override_add
void osmo_clock_override_add(clockid_t clk_id, time_t secs, long nsecs)
timer_compat.h
GSMTAP_CHANNEL_PDCH
#define GSMTAP_CHANNEL_PDCH
Definition: gsmtap.h:92
osmo_prbs7
const struct osmo_prbs osmo_prbs7
PRBS-7 according ITU-T O.150.
Definition: prbs.c:14
osmo_stats_reporter_send_counter
static int osmo_stats_reporter_send_counter(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta)
Definition: stats.c:635
LOGL_INFO
#define LOGL_INFO
general information
Definition: logging.h:98
HDLC_GETFLAG_B1A6
@ HDLC_GETFLAG_B1A6
Definition: isdnhdlc.c:34
osmo_stat_item_discard
int osmo_stat_item_discard(const struct osmo_stat_item *item, int32_t *idx)
Skip/discard all values of this item and update idx accordingly.
Definition: stat_item.c:251
DLMI
#define DLMI
ISDN-layer below input sub-system.
Definition: logging.h:108
log_target
structure representing a logging target
Definition: logging.h:267
strrb.h
osmo_crc64gen_code::poly
uint64_t poly
Polynom (normal representation, MSB omitted.
Definition: crc64gen.h:36
poll_state
Definition: select.c:61
osmo_prbs_state_init
void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs)
Initialize the given caller-allocated PRBS state.
Definition: prbs.c:46
log_info::cat
const struct log_info_cat * cat
per-category information
Definition: logging.h:230
nearest_p
static __thread struct timeval * nearest_p
Definition: timer.c:44
osmo_strrb_add
int osmo_strrb_add(struct osmo_strrb *rb, const char *data)
Add a string to the osmo_strrb.
Definition: strrb.c:152
osmo_crc8gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc8gen.h:35
osmo_use_count
Use counter state for one used object, managing N distinct named counters.
Definition: use_count.h:172
osmo_sercomm_inst::ctrl
uint8_t ctrl
CTRL of currently received msgb.
Definition: sercomm.h:64
rate_ctr_get_by_name
const struct rate_ctr * rate_ctr_get_by_name(const struct rate_ctr_group *ctrg, const char *name)
Search for counter based on group + name.
Definition: rate_ctr.c:369
__rb_rotate_left
static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
Definition: rbtree.c:28
osmo_use_count_entry
One named counter in the list managed by osmo_use_count.
Definition: use_count.h:194
rb_root
Definition: linuxrbtree.h:110
osmo_signal_register_handler
int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data)
Register a new signal handler.
Definition: signal.c:65
gsmtap_inst
one gsmtap instance
Definition: gsmtap_util.h:27
_osmo_serial_set_baudrate
static int _osmo_serial_set_baudrate(int fd, speed_t baudrate)
Definition: serial.c:131
osmo_fds
static __thread struct llist_head osmo_fds
Definition: select.c:57
osmo_stats_ctx
static void * osmo_stats_ctx
Definition: stats.c:108
OSMO_CMP
#define OSMO_CMP(a, b)
Return a typical cmp result for comparable entities a and b.
Definition: utils.h:26
osmo_crc32gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc32gen.h:35
osmo_wqueue::read_cb
int(* read_cb)(struct osmo_fd *fd)
call-back in case qeueue is readable.
Definition: write_queue.h:46
osmo_sockaddr_str_to_sockaddr_in
int osmo_sockaddr_str_to_sockaddr_in(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_in *dst)
log_target::sd_journal
struct log_target::@8::@15 sd_journal
gsmtap_hdr::type
uint8_t type
see GSMTAP_TYPE_*
Definition: gsmtap.h:301
msgb_l3len
static unsigned int msgb_l3len(const struct msgb *msgb)
determine length of L3 message
Definition: msgb.h:173
osmo_fd::list
struct llist_head list
linked list for internal management
Definition: select.h:33
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:347
osmo_fsm_inst_free
void osmo_fsm_inst_free(struct osmo_fsm_inst *fi)
delete a given instance of a FSM
Definition: fsm.c:541
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:384
osmo_mnl_fd_cb
static int osmo_mnl_fd_cb(struct osmo_fd *ofd, unsigned int what)
Definition: mnl.c:42
osmo_stats_reporter::dest_addr_len
int dest_addr_len
length of dest_addr in bytes
Definition: stats.h:85
OSMO_LOGCOLOR_GREEN
#define OSMO_LOGCOLOR_GREEN
Definition: logging.h:130
rb_next
struct rb_node * rb_next(const struct rb_node *node)
Definition: rbtree.c:313
log_target::facility
int facility
Definition: logging.h:304
poll_state::poll
struct pollfd * poll
Definition: select.c:63
osmo_counters_count
int osmo_counters_count()
Counts the registered counter.
Definition: counter.c:82
RSL_CHAN_PCH_AGCH
#define RSL_CHAN_PCH_AGCH
msgb::l1h
unsigned char * l1h
pointer to Layer1 header (if any)
Definition: msgb.h:47
log_target::print_tid
unsigned int print_tid
should log messages be prefixed with the logger Thread ID?
Definition: logging.h:285
gsm_04_08.h
stats.h
log_target::print_level
bool print_level
Definition: logging.h:352
utils.h
osmo_fd_update_when
void osmo_fd_update_when(struct osmo_fd *ofd, unsigned int when_mask, unsigned int when)
Update the 'when' field of osmo_fd.
Definition: select.c:94
osmo_fsm_unregister
void osmo_fsm_unregister(struct osmo_fsm *fsm)
unregister a FSM from the core
Definition: fsm.c:310
osmo_fsm_find_by_name
struct osmo_fsm * osmo_fsm_find_by_name(const char *name)
Definition: fsm.c:240
GSMTAP_CHANNEL_RACH
#define GSMTAP_CHANNEL_RACH
Definition: gsmtap.h:80
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_stat_item::desc
const struct osmo_stat_item_desc * desc
back-reference to the item description
Definition: stat_item.h:25
rb_set_red
#define rb_set_red(r)
Definition: linuxrbtree.h:119
osmo_stats_reporter::dest_addr_str
char * dest_addr_str
destination IP address
Definition: stats.h:72
sock_get_domain
static int sock_get_domain(int fd)
Definition: socket.c:1446
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_sockaddr_str_from_in6_addr
int osmo_sockaddr_str_from_in6_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in6_addr *addr, uint16_t port)
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:104
log_info::num_cat
unsigned int num_cat
total number of categories
Definition: logging.h:232
rate_ctr_group
One instance of a counter group class.
Definition: rate_ctr.h:57
_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:988
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:90
osmo_escape_str_buf
const char * osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize)
Like osmo_escape_str_buf2, but with unusual ordering of arguments, and may sometimes return string co...
Definition: utils.c:716
_osmo_it_q_flush
static void _osmo_it_q_flush(struct osmo_it_q *q)
Flush all messages currently present in queue.
Definition: it_q.c:189
rate_ctr_group_desc::group_description
const char * group_description
The human-readable description of the group.
Definition: rate_ctr.h:47
osmo_tdef_state_timeout::T
int T
Timer number to match struct osmo_tdef.T, and to pass to osmo_fsm_inst_state_chg().
Definition: tdef.h:115
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
osmo_tdef_val_in_range
bool osmo_tdef_val_in_range(struct osmo_tdef *tdef, unsigned long new_val)
Check if value new_val is in range of valid possible values for timer entry tdef.
Definition: tdef.c:261
rb_node::rb_left
struct rb_node * rb_left
Definition: linuxrbtree.h:105
map_subsys
static int map_subsys(int subsys)
Definition: logging.c:580
LLIST_HEAD
static LLIST_HEAD(osmo_stats_reporter_list)
osmo_stats_reporter_send_item
static int osmo_stats_reporter_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int32_t value)
Definition: stats.c:682
s_stats_config
static struct osmo_stats_config s_stats_config
Definition: stats.c:112
rb_first
struct rb_node * rb_first(const struct rb_root *)
Definition: rbtree.c:289
osmo_panic
void osmo_panic(const char *fmt,...) __attribute__((noreturn))
Terminate the current program with a panic.
Definition: panic.c:75
osmo_stats_reporter_udp_open
int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep)
HDLC_SEND_FAST_IDLE
@ HDLC_SEND_FAST_IDLE
Definition: isdnhdlc.c:41
rate_ctr_group_desc_mangle
static struct rate_ctr_group_desc * rate_ctr_group_desc_mangle(void *ctx, const struct rate_ctr_group_desc *desc)
Definition: rate_ctr.c:140
_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:776
poll_fill_fds
static unsigned int poll_fill_fds(void)
Definition: select.c:281
msgb_free
void msgb_free(struct msgb *m)
Release given message buffer.
Definition: msgb.c:121
osmo_prim_event_map::event
uint32_t event
event as result if above match
Definition: prim.h:86
osmo_sock_mcast_subscribe
int osmo_sock_mcast_subscribe(int fd, const char *grp_addr)
Subscribe to the given IP multicast group.
Definition: socket.c:1570
LOG_FILENAME_POS_LINE_END
@ LOG_FILENAME_POS_LINE_END
Definition: logging.h:263
osmo_sercomm_initialized
int osmo_sercomm_initialized(struct osmo_sercomm_inst *sercomm)
Determine if a given Osmocom sercomm instance has been initialized.
Definition: sercomm.c:96
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:765
OSMO_TDEF_M
@ OSMO_TDEF_M
minutes
Definition: tdef.h:41
osmo_signal_talloc_ctx_init
void * osmo_signal_talloc_ctx_init(void *root_ctx)
Initialize a signal_handler talloc context for osmo_signal_register_handler.
Definition: signal.c:54
LOG_FILENAME_POS_HEADER_END
@ LOG_FILENAME_POS_HEADER_END
Definition: logging.h:262
fsm_log_addr
static bool fsm_log_addr
Definition: fsm.c:92
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
osmo_tdef_unit
osmo_tdef_unit
Definition: tdef.h:38
rb_insert_color
void rb_insert_color(struct rb_node *node, struct rb_root *root)
Definition: rbtree.c:74
osmo_fd_close
void osmo_fd_close(struct osmo_fd *fd)
Close a file descriptor, mark it as closed + unregister from select loop abstraction.
Definition: select.c:192
rate_ctr_get_group_by_name_idx
struct rate_ctr_group * rate_ctr_get_group_by_name_idx(const char *name, const unsigned int idx)
Search for counter group based on group name and index.
Definition: rate_ctr.c:348
RSL_CHAN_Lm_ACCHs
#define RSL_CHAN_Lm_ACCHs
poll_state::poll_size
unsigned int poll_size
Definition: select.c:65
osmo_stats_reporter_statsd_send_item
static int osmo_stats_reporter_statsd_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value)
Definition: stats_statsd.c:176
HDLC_SEND_CRC1
@ HDLC_SEND_CRC1
Definition: isdnhdlc.c:39
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:796
osmo_hexdump_c
char * osmo_hexdump_c(const void *ctx, const unsigned char *buf, int len)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:414
osmo_sock_init_tail
static int osmo_sock_init_tail(int fd, uint16_t type, unsigned int flags)
Definition: socket.c:213
eventfd_increment
static int eventfd_increment(int fd, uint64_t inc)
Definition: it_q.c:56
log_del_target
void log_del_target(struct log_target *target)
Unregister a log target from the logging core.
Definition: logging.c:713
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:111
_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:60
osmo_use_count_to_str_buf
int osmo_use_count_to_str_buf(char *buf, size_t buf_len, const struct osmo_use_count *uc)
Write a comprehensive listing of use counts to a string buffer.
Definition: use_count.c:121
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_timer_list::data
void * data
user data for callback
Definition: timer.h:63
tall_sigh_ctx
void * tall_sigh_ctx
Definition: signal.c:39
_osmo_it_q_dequeue
struct llist_head * _osmo_it_q_dequeue(struct osmo_it_q *queue)
Thread-safe de-queue from an inter-thread message queue.
Definition: it_q.c:255
osmo_crc32gen_code::remainder
uint32_t remainder
Remainder of the CRC (final XOR)
Definition: crc32gen.h:38
osmo_mnl::ofd
struct osmo_fd ofd
osmo-wrapped netlink file descriptor
Definition: mnl.h:12
libosmocore
provider libosmocore
Definition: probes.d:1
osmo_use_count_by
int32_t osmo_use_count_by(const struct osmo_use_count *uc, const char *use)
Return use count by a single use token.
Definition: use_count.c:90
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_ubit_dump
char * osmo_ubit_dump(const uint8_t *bits, unsigned int len)
Convert a sequence of unpacked bits to ASCII string, in static buffer.
Definition: utils.c:380
osmo_tdef::min_val
unsigned long min_val
Minimum timer value (in this tdef unit), checked if set (not zero).
Definition: tdef.h:82
osmo_isdnhdlc_vars::cbin
uint8_t cbin
Definition: isdnhdlc.h:44
osmo_stats_reporter_set_max_class
int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep, enum osmo_stats_class class_id)
Definition: stats.c:368
osmo_use_count_name_buf
const char * osmo_use_count_name_buf(char *buf, size_t buf_len, const struct osmo_use_count *uc)
Write a comprehensive listing of use counts to a string buffer.
Definition: use_count.c:108
value_string::str
const char * str
human-readable string
Definition: utils.h:44
value_string::value
int value
numeric value
Definition: utils.h:43
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:127
osmo_sockaddr_in_to_str_and_uint
size_t osmo_sockaddr_in_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port, const struct sockaddr_in *sin)
Convert sockaddr_in to IP address as char string and port as uint16_t.
Definition: socket.c:1131
DLCTRL
#define DLCTRL
Control Interface.
Definition: logging.h:111
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:261
rate_ctr_group::list
struct llist_head list
Linked list of all counter groups in the system.
Definition: rate_ctr.h:59
rate_ctr_handler_t
int(* rate_ctr_handler_t)(struct rate_ctr_group *, struct rate_ctr *, const struct rate_ctr_desc *, void *)
Definition: rate_ctr.h:108
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:103
interval_expired
static void interval_expired(struct rate_ctr *ctr, enum rate_ctr_intv intv)
Definition: rate_ctr.c:284
osmo_tdef_round
static unsigned long osmo_tdef_round(unsigned long val, enum osmo_tdef_unit from_unit, enum osmo_tdef_unit to_unit)
Definition: tdef.c:129
GSMTAP_CHANNEL_VOICE_H
#define GSMTAP_CHANNEL_VOICE_H
Definition: gsmtap.h:96
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:674
osmo_sockaddr_is_local
int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen)
Determine if the given address is a local address.
Definition: socket.c:1101
osmo_it_q::current_length
unsigned int current_length
Definition: it_q.h:25
tdefs
struct osmo_tdef * tdefs
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:44
osmo_sercomm_inst::dlci_handler
dlci_cb_t dlci_handler[_SC_DLCI_MAX]
per-DLC handler call-back functions
Definition: sercomm.h:54
crc16gen.h
osmo_sockaddr_str_from_str2
int osmo_sockaddr_str_from_str2(struct osmo_sockaddr_str *sockaddr_str, const char *ip)
unregistered_count
static __thread int unregistered_count
Definition: select.c:58
osmo_clock_override_enable
void osmo_clock_override_enable(clockid_t clk_id, bool enable)
GSMTAP_CHANNEL_BCCH
#define GSMTAP_CHANNEL_BCCH
Definition: gsmtap.h:78
osmo_close_all_fds_above
int osmo_close_all_fds_above(int last_fd_to_keep)
Definition: exec.c:168
osmo_select_main_ctx
int osmo_select_main_ctx(int polling)
select main loop integration with temporary select-dispatch talloc context
Definition: select.c:432
rate_ctr_group_intv
static void rate_ctr_group_intv(struct rate_ctr_group *grp)
Definition: rate_ctr.c:301
osmo_htonl
#define osmo_htonl(x)
Definition: byteswap.h:43
osmo_wqueue
write queue instance
Definition: write_queue.h:34
osmo_signal_dispatch
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
dispatch (deliver) a new signal to all registered handlers
Definition: signal.c:110
stats_done
probe stats_done()
osmo_fsm_term_cause_names
const struct value_string osmo_fsm_term_cause_names[]
Definition: fsm.c:1039
osmo_gettimeofday_override
bool osmo_gettimeofday_override
Definition: timer_gettimeofday.c:48
osmo_isdnhdlc_vars::data_bits
int data_bits
Definition: isdnhdlc.h:37
rate_ctr_group_desc::num_ctr
unsigned int num_ctr
The number of counters in this group.
Definition: rate_ctr.h:51
gsmtap_hdr::sub_slot
uint8_t sub_slot
sub-slot within timeslot
Definition: gsmtap.h:312
osmo_str_tolower_buf
size_t osmo_str_tolower_buf(char *dest, size_t dest_len, const char *src)
Convert a string to lowercase, while checking buffer size boundaries.
Definition: utils.c:1061
osmo_use_count_entry::count
int32_t count
Current use count amount for only this use token string.
Definition: use_count.h:203
osmo_int_to_float_str_buf
int osmo_int_to_float_str_buf(char *buf, size_t buflen, int64_t val, unsigned int precision)
Convert an integer to a floating point string using a decimal quotient (fixed-point precision).
Definition: utils.c:1349
osmo_tdef::T
const int T
T1234 or X1234 number, corresponding to struct osmo_fsm_inst::T.
Definition: tdef.h:70
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:42
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)
Initialize a socket (including bind and/or connect)
Definition: socket.c:282
osmo_stats_reporter_log_send_counter
static int osmo_stats_reporter_log_send_counter(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta)
Definition: stats.c:596
msgb_l1len
static unsigned int msgb_l1len(const struct msgb *msgb)
determine length of L1 message
Definition: msgb.h:149
osmo_timers_prepare
void osmo_timers_prepare(void)
Find the nearest time and update nearest_p.
Definition: timer.c:219
LLIST_HEAD
static LLIST_HEAD(signal_handler_list)
rate_ctr_group_handler_t
int(* rate_ctr_group_handler_t)(struct rate_ctr_group *, void *)
Definition: rate_ctr.h:111
osmo_isdnhdlc_vars::bit_shift
int bit_shift
Definition: isdnhdlc.h:35
environ
char ** environ
gsmtap_osmocore_log_hdr::src_file
struct gsmtap_osmocore_log_hdr::@5 src_file
HDLC_FAST_FLAG
@ HDLC_FAST_FLAG
Definition: isdnhdlc.c:35
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
osmo_stats_timer
static struct osmo_fd osmo_stats_timer
Definition: stats.c:117
DLMIB
#define DLMIB
ISDN layer B-channel.
Definition: logging.h:109
osmo_isdnhdlc_vars::crc
uint16_t crc
Definition: isdnhdlc.h:42
osmo_stats_reporter::send_counter
int(* send_counter)(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta)
Definition: stats.h:97
gsmtap_source_add_sink
int gsmtap_source_add_sink(struct gsmtap_inst *gti)
Add a local sink to an existing GSMTAP source and return fd.
Definition: gsmtap_util.c:410
osmo_stats_reporter::open
int(* open)(struct osmo_stats_reporter *srep)
Definition: stats.h:95
msgb::tail
unsigned char * tail
end of message in buffer
Definition: msgb.h:58
addrinfo_has_in6addr_any
static bool addrinfo_has_in6addr_any(const struct addrinfo **result, size_t result_count)
Definition: socket.c:607
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:505
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
depth
unsigned int depth
2 if a secondary FSM terminates, 3 if a secondary FSM causes a tertiary FSM to terminate,...
Definition: fsm.c:102
OSMO_STRBUF_APPEND
#define OSMO_STRBUF_APPEND(STRBUF, func, args...)
Append a string to a buffer, as printed by an snprintf()-like function and with similar bounds checki...
Definition: utils.h:222
OSMO_LOGCOLOR_RED
#define OSMO_LOGCOLOR_RED
Definition: logging.h:129
osmo_prbs_process_bit
static void osmo_prbs_process_bit(struct osmo_prbs_state *state, ubit_t bit)
Definition: prbs.c:53
osmo_prbs15
const struct osmo_prbs osmo_prbs15
PRBS-15 according ITU-T O.150.
Definition: prbs.c:38
osmo_stat_item_for_each_group
int osmo_stat_item_for_each_group(osmo_stat_item_group_handler_t handle_group, void *data)
Iterate over all stat_item groups in system, call user-supplied function on each.
Definition: stat_item.c:345
osmo_stat_item_dec
void osmo_stat_item_dec(struct osmo_stat_item *item, int32_t value)
Descrease the stat_item to the given value.
Definition: stat_item.c:171
osmo_tdef_state_timeout
Using osmo_tdef for osmo_fsm_inst: array entry for a mapping of state numbers to timeout definitions.
Definition: tdef.h:111
osmo_crc16gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc16gen.h:35
osmo_stats_reporter_udp_close
int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep)
osmo_timers_nearest
struct timeval * osmo_timers_nearest(void)
Determine time between now and the nearest timer.
Definition: timer.c:179
osmo_sercomm_inst::msg
struct msgb * msg
msgb currently being transmitted
Definition: sercomm.h:44
sercomm.h
assert_loginfo
void assert_loginfo(const char *src)
Definition: logging.c:282
OSMO_HDLC_LENGTH_ERROR
#define OSMO_HDLC_LENGTH_ERROR
Definition: isdnhdlc.h:72
osmo_serial_init
int osmo_serial_init(const char *dev, speed_t baudrate)
Open serial device and does base init.
Definition: serial.c:58
osmo_panic_handler_t
void(* osmo_panic_handler_t)(const char *fmt, va_list args)
panic handler callback function type
Definition: panic.h:10
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:65
osmo_sock_init2_multiaddr
int osmo_sock_init2_multiaddr(uint16_t family, uint16_t type, uint8_t proto, const char **local_hosts, size_t local_hosts_cnt, uint16_t local_port, const char **remote_hosts, size_t remote_hosts_cnt, uint16_t remote_port, unsigned int flags)
Initialize a socket (including bind and/or connect) with multiple local or remote addresses.
Definition: socket.c:695
msgb::l4h
unsigned char * l4h
pointer to layer 4 header
Definition: msgb.h:50
osmo_fsm_inst::name
const char * name
human readable fully-qualified name
Definition: fsm.h:95
rate_ctr_group::ctr
struct rate_ctr ctr[0]
Actual counter structures below.
Definition: rate_ctr.h:65
osmo_prbs
definition of a PRBS sequence
Definition: prbs.h:6
rate_ctr_group_alloc
struct rate_ctr_group * rate_ctr_group_alloc(void *ctx, const struct rate_ctr_group_desc *desc, unsigned int idx)
Allocate a new group of counters according to description.
Definition: rate_ctr.c:213
osmo_fsm_inst::state
uint32_t state
current state of the FSM
Definition: fsm.h:101
osmo_config_entry
One message in the list.
Definition: msgfile.h:30
poll_state::num_registered
unsigned int num_registered
Definition: select.c:67
osmo_tdef_set
int osmo_tdef_set(struct osmo_tdef *tdefs, int T, unsigned long val, enum osmo_tdef_unit val_unit)
Set value in entry matching T, converting val from val_unit to unit of T.
Definition: tdef.c:241
log_target::print_category
unsigned int print_category
should log messages be prefixed with a category name?
Definition: logging.h:289
msgb_dequeue_count
static struct msgb * msgb_dequeue_count(struct llist_head *queue, unsigned int *count)
Dequeue message buffer from head of queue and decrement queue size counter.
Definition: msgb.h:113
it_queues_rwlock
static pthread_rwlock_t it_queues_rwlock
Definition: it_q.c:69
ts
struct @6 ts
osmo_stat_item_get_last
static int32_t osmo_stat_item_get_last(const struct osmo_stat_item *item)
Get the last (freshest) value.
Definition: stat_item.h:113
osmo_set_panic_handler
void osmo_set_panic_handler(osmo_panic_handler_t h)
Set the panic handler.
Definition: panic.c:102
HDLC_SEND_DATA
@ HDLC_SEND_DATA
Definition: isdnhdlc.c:39
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:86
osmo_stat_item::last_offs
int16_t last_offs
offset to the freshest value in the value FIFO
Definition: stat_item.h:29
buffer
osmo_int_to_float_str_c
char * osmo_int_to_float_str_c(void *ctx, int64_t val, unsigned int precision)
Convert an integer with a factor of a million to a floating point string.
Definition: utils.c:1403
RSL_CHAN_OSMO_CBCH8
#define RSL_CHAN_OSMO_CBCH8
rate_ctr_desc::name
const char * name
name of the counter
Definition: rate_ctr.h:38
osmo_strrb_create
struct osmo_strrb * osmo_strrb_create(TALLOC_CTX *ctx, size_t rb_size)
Create an empty, initialized osmo_strrb.
Definition: strrb.c:59
osmo_bcd2str
int osmo_bcd2str(char *dst, size_t dst_size, const uint8_t *bcd, int start_nibble, int end_nibble, bool allow_hex)
Convert BCD to string.
Definition: utils.c:152
_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:61
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:100
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
OSMO_STAT_ITEM_NOVALUE_ID
#define OSMO_STAT_ITEM_NOVALUE_ID
Definition: stat_item.h:13
STOPPED
@ STOPPED
Definition: isdnhdlc.c:42
update_srep_config
static int update_srep_config(struct osmo_stats_reporter *srep)
Definition: stats.c:127
rb_next
struct rb_node * rb_next(const struct rb_node *)
Definition: rbtree.c:313
osmo_hexdump_buf
const char * osmo_hexdump_buf(char *out_buf, size_t out_buf_size, const unsigned char *buf, int len, const char *delim, bool delim_after_last)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:303
osmo_stats_reporter::bind_addr_str
char * bind_addr_str
local bind IP address
Definition: stats.h:73
osmo_it_q::data
void * data
Definition: it_q.h:36
h
struct gad_raw_head h
osmo_sockaddr_to_str_and_uint
unsigned int osmo_sockaddr_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port, const struct sockaddr *sa)
Convert sockaddr to IP address as char string and port as uint16_t.
Definition: socket.c:1150
osmo_float_str_to_int
int osmo_float_str_to_int(int64_t *val, const char *str, unsigned int precision)
Convert a string of a floating point number to a signed int, with a decimal factor (fixed-point preci...
Definition: utils.c:1224
byteswap.h
_LOG_CTX_COUNT
@ _LOG_CTX_COUNT
Definition: logging.h:170
osmo_revbytebits_8
uint32_t osmo_revbytebits_8(uint8_t x)
reverse the bit order in a byte
Definition: bits.c:298
osmo_quote_str_buf
const char * osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize)
Like osmo_quote_str_buf2, but with unusual ordering of arguments, and may sometimes return string con...
Definition: utils.c:919
RX_ST_ESCAPE
@ RX_ST_ESCAPE
Definition: sercomm.c:69
osmo_event_for_prim
uint32_t osmo_event_for_prim(const struct osmo_prim_hdr *oph, const struct osmo_prim_event_map *maps)
resolve the (fsm) event for a given primitive using a map
Definition: prim.c:28
osmo_print_n
int osmo_print_n(char *buf, size_t bufsize, const char *str, size_t n)
Copy N characters to a buffer with a function signature useful for OSMO_STRBUF_APPEND().
Definition: utils.c:733
gsmtap_sendmsg
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
Send a Message buffers through a GSMTAP source.
Definition: gsmtap_util.c:300
timercmp
#define timercmp(a, b, CMP)
Definition: timer_compat.h:47
osmo_identifier_valid
bool osmo_identifier_valid(const char *str)
Determine if a given identifier is valid, i.e.
Definition: utils.c:681
signal_handler::data
void * data
Definition: signal.c:46
osmo_timerfd_disable
int osmo_timerfd_disable(struct osmo_fd *ofd)
disable the osmocom-wrapped timerfd
Definition: select.c:471
addrinfo_helper_multi
static int addrinfo_helper_multi(struct addrinfo **addrinfo, uint16_t family, uint16_t type, uint8_t proto, const char **hosts, size_t host_cnt, uint16_t port, bool passive)
Retrieve an array of addrinfo with specified hints, one for each host in the hosts array.
Definition: socket.c:118
osmo_bcd2char
char osmo_bcd2char(uint8_t bcd)
Convert BCD-encoded digit into printable character.
Definition: utils.c:114
osmo_sockaddr_str_from_32h
int osmo_sockaddr_str_from_32h(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port)
talloc.h
log_target::type
enum log_target_type type
the type of this log taget
Definition: logging.h:294
_osmo_use_count_get_put
int _osmo_use_count_get_put(struct osmo_use_count *uc, const char *use, int32_t change, const char *file, int line)
Implementation for osmo_use_count_get_put(), which can also be directly invoked to pass source file i...
Definition: use_count.c:237
log_target::print_category_hex
bool print_category_hex
Definition: logging.h:354
osmo_wqueue::except_cb
int(* except_cb)(struct osmo_fd *fd)
call-back in case qeueue has exceptions.
Definition: write_queue.h:50
OSMO_HDLC_F_BITREVERSE
#define OSMO_HDLC_F_BITREVERSE
Definition: isdnhdlc.h:63
llist_head
(double) linked list header structure
Definition: linuxlist.h:46
osmo_isdnhdlc_vars::state
int state
Definition: isdnhdlc.h:39
GSMTAP_CHANNEL_CBCH51
#define GSMTAP_CHANNEL_CBCH51
Definition: gsmtap.h:94
OSMO_TDEF_MS
@ OSMO_TDEF_MS
milliseconds
Definition: tdef.h:40
osmo_sockaddr_str_from_sockaddr_in6
int osmo_sockaddr_str_from_sockaddr_in6(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_in6 *src)
osmo_stats_reporter_set_remote_addr
int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const char *addr)
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:79
if
if(vty->type==VTY_SHELL_SERV)
socket_helper_osa
static int socket_helper_osa(const struct osmo_sockaddr *addr, uint16_t type, uint8_t proto, unsigned int flags)
Definition: socket.c:157
signal.h
osmo_fd_init_ofd
static int osmo_fd_init_ofd(struct osmo_fd *ofd, int sfd)
fill osmo_fd for a give sfd
Definition: socket.c:954
tall_stat_item_ctx
static void * tall_stat_item_ctx
talloc context from which we allocate
Definition: stat_item.c:70
c
struct abis_rsl_common_hdr c
gsmtap_inst::wq
struct osmo_wqueue wq
the wait queue
Definition: gsmtap_util.h:29
osmo_stats_reporter::bind_addr
struct sockaddr bind_addr
local bind address of socket
Definition: stats.h:86
rb_node::rb_parent_color
unsigned long rb_parent_color
Definition: linuxrbtree.h:101
osmo_sock_get_ip_and_port
int osmo_sock_get_ip_and_port(int fd, char *ip, size_t ip_len, char *port, size_t port_len, bool local)
Get the IP and/or port number on socket in separate string buffers.
Definition: socket.c:1309
GSMTAP_TYPE_WMX_BURST
#define GSMTAP_TYPE_WMX_BURST
Definition: gsmtap.h:39
osmo_prim_op_names
const struct value_string osmo_prim_op_names[5]
human-readable string mapping for osmo_prim_operation
Definition: prim.c:16
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:1060
OSMO_LOGCOLOR_YELLOW
#define OSMO_LOGCOLOR_YELLOW
Definition: logging.h:131
osmo_stats_reporter_set_flush_period
int osmo_stats_reporter_set_flush_period(struct osmo_stats_reporter *srep, unsigned int period)
Set the regular flush period for a given stats_reporter.
Definition: stats.c:402
osmo_signal_cbfn
int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
signal callback function type
Definition: signal.h:33
osmo_stat_item_group_alloc
struct osmo_stat_item_group * osmo_stat_item_group_alloc(void *ctx, const struct osmo_stat_item_group_desc *desc, unsigned int idx)
Allocate a new group of counters according to description.
Definition: stat_item.c:79
osmo_timer_list::list
struct llist_head list
internal list header
Definition: timer.h:58
log_tgt_mutex_lock
#define log_tgt_mutex_lock()
Definition: logging.h:426
osmo_stats_reporter::max_class
enum osmo_stats_class max_class
Maximum class/index to report.
Definition: stats.h:79
LLIST_HEAD
static LLIST_HEAD(osmo_stat_item_groups)
global list of stat_item groups
LOG_TGT_TYPE_FILE
@ LOG_TGT_TYPE_FILE
text file logging
Definition: logging.h:246
log_reset_context
void log_reset_context(void)
Reset (clear) the logging context.
Definition: logging.c:719
OSMO_SOCK_F_NO_MCAST_LOOP
#define OSMO_SOCK_F_NO_MCAST_LOOP
disable multiast loop (IP_MULTICAST_LOOP)
Definition: socket.h:41
_file_output
static void _file_output(struct log_target *target, unsigned int level, const char *log)
Definition: logging.c:895
l
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead u l))
osmo_hexparse
int osmo_hexparse(const char *str, uint8_t *b, int max_len)
Parse a string containing hexadecimal digits.
Definition: utils.c:244
osmo_fsm_inst::T
int T
timer number for states with time-out
Definition: fsm.h:104
osmo_isdnhdlc_out_init
void osmo_isdnhdlc_out_init(struct osmo_isdnhdlc_vars *hdlc, uint32_t features)
Definition: isdnhdlc.c:57
osmo_timer_pending
int osmo_timer_pending(struct osmo_timer_list *timer)
check if given timer is still pending
Definition: timer.c:138
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:787
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:147
msgb_trim
static int msgb_trim(struct msgb *msg, int len)
Trim the msgb to a given absolute length.
Definition: msgb.h:493
_osmo_tdef_fsm_inst_state_chg
int _osmo_tdef_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t state, const struct osmo_tdef_state_timeout *timeouts_array, const struct osmo_tdef *tdefs, unsigned long default_timeout, const char *file, int line)
See invocation macro osmo_tdef_fsm_inst_state_chg() instead.
Definition: tdef.c:332
osmo_sockaddr::u
union osmo_sockaddr::@22 u
osmo_stats_reporter::list
struct llist_head list
Definition: stats.h:94
DLMUX
#define DLMUX
Osmocom Multiplex (Osmux)
Definition: logging.h:107
osmo_wqueue_init
void osmo_wqueue_init(struct osmo_wqueue *queue, int max_length)
Initialize a osmo_wqueue structure.
Definition: write_queue.c:95
msgb_l2len
static unsigned int msgb_l2len(const struct msgb *msgb)
determine length of L2 message
Definition: msgb.h:161
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:125
osmo_config_list::entry
struct llist_head entry
Definition: msgfile.h:44
DLSUA
#define DLSUA
Osmocom SUA.
Definition: logging.h:118
osmo_timer_list::node
struct rb_node node
rb-tree node header
Definition: timer.h:57
gsmtap_hdr::timeslot
uint8_t timeslot
timeslot (0..7 on Um)
Definition: gsmtap.h:302
prbs.h
osmo_prim_event_map::operation
enum osmo_prim_operation operation
operation to match
Definition: prim.h:85
rx_state
rx_state
Definition: sercomm.c:64
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:74
_systemd_output
static void _systemd_output(struct log_target *target, unsigned int level, const char *log)
Definition: logging_systemd.c:54
tdef.h
OSMO_FSM_TERM_REQUEST
@ OSMO_FSM_TERM_REQUEST
terminate on explicit user request
Definition: fsm.h:25
msgb.h
namebuf
static __thread char namebuf[255]
Definition: utils.c:45
LOG_TGT_TYPE_GSMTAP
@ LOG_TGT_TYPE_GSMTAP
GSMTAP network logging.
Definition: logging.h:249
stat_item.h
TRACE
#define TRACE(probe)
Definition: logging.c:54
osmo_stats_reporter_set_name_prefix
int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix)
Set the name prefix of a given stats_reporter.
Definition: stats.c:417
GSMTAP_CHANNEL_ACCH
#define GSMTAP_CHANNEL_ACCH
Definition: gsmtap.h:107
osmo_prbs::coeff
uint64_t coeff
coefficients
Definition: prbs.h:9
osmo_sockaddr_str_from_in_addr
int osmo_sockaddr_str_from_in_addr(struct osmo_sockaddr_str *sockaddr_str, const struct in_addr *addr, uint16_t port)
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
__rb_rotate_right
static void __rb_rotate_right(struct rb_node *node, struct rb_root *root)
Definition: rbtree.c:51
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:342
osmo_tdef_get
unsigned long osmo_tdef_get(const struct osmo_tdef *tdefs, int T, enum osmo_tdef_unit as_unit, long val_if_not_present)
Return the value of a T timer from a list of osmo_tdef, in the given unit.
Definition: tdef.c:206
collect_ctx
void * collect_ctx
Talloc context to collect all deferred deallocations (FSM instances, and talloc objects if any).
Definition: fsm.c:104
osmo_stats_reporter_enable
int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep)
Enable the given stats_reporter.
Definition: stats.c:430
osmo_isdnhdlc_vars::dchannel
uint32_t dchannel
Definition: isdnhdlc.h:51
OSMO_SOCK_F_UDP_REUSEADDR
#define OSMO_SOCK_F_UDP_REUSEADDR
use SO_REUSEADDR on UDP ports (required for multicast)
Definition: socket.h:45
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_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)
Allocate a new inter-thread message queue.
Definition: it_q.c:126
osmo_sockaddr_str::af
int af
AF_INET for IPv4 address, or AF_INET6 for IPv6 address.
Definition: sockaddr_str.h:51
addrinfo_to_sockaddr
static int addrinfo_to_sockaddr(uint16_t family, const struct addrinfo **result, const char **hosts, int host_cont, uint8_t *addrs_buf, size_t addrs_buf_len)
Definition: socket.c:646
HDLC_SEND_CLOSING_FLAG
@ HDLC_SEND_CLOSING_FLAG
Definition: isdnhdlc.c:40
osmo_tdef_range_str_buf
int osmo_tdef_range_str_buf(char *buf, size_t buf_len, struct osmo_tdef *t)
Write string representation of osmo_tdef range into buf.
Definition: tdef.c:274
rb_root::rb_node
struct rb_node * rb_node
Definition: linuxrbtree.h:111
osmo_fsm::num_states
unsigned int num_states
number of entries in states
Definition: fsm.h:68
HDLC_C_UI
#define HDLC_C_UI
Definition: sercomm.c:60
osmo_mnl
osmocom wrapper around libmnl abstraction of netlink socket
Definition: mnl.h:10
STATS_DEFAULT_INTERVAL
#define STATS_DEFAULT_INTERVAL
Definition: stats.c:104
osmo_isqrt32
uint32_t osmo_isqrt32(uint32_t x)
perform an integer square root operation on unsigned 32bit integer.
Definition: utils.c:1014
osmo_timerfd_setup
int osmo_timerfd_setup(struct osmo_fd *ofd, int(*cb)(struct osmo_fd *, unsigned int), void *data)
setup osmocom-wrapped timerfd
Definition: select.c:513
OSMO_HDLC_F_56KBIT
#define OSMO_HDLC_F_56KBIT
Definition: isdnhdlc.h:61
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
osmo_fd_fill_fds
int osmo_fd_fill_fds(void *readset, void *writeset, void *exceptset)
Populate the fd_sets and return the highest fd number.
Definition: select.c:209
sercomm_drv_start_tx
void sercomm_drv_start_tx(struct osmo_sercomm_inst *sercomm)
low-level driver routine to request start of transmission The Sercomm code calls this function to inf...
serial.h
gsmtap_osmocore_log_hdr::pid
uint32_t pid
process ID
Definition: gsmtap.h:324
osmo_sock_local_ip
int osmo_sock_local_ip(char *local_ip, const char *remote_ip)
Determine the matching local IP-address for a given remote IP-Address.
Definition: socket.c:1609
llist_count
static unsigned int llist_count(const struct llist_head *head)
Count number of llist items by iterating.
Definition: linuxlist.h:388
osmo_stats_reporter::mtu
int mtu
Maximum Transmission Unit.
Definition: stats.h:75
osmo_str_toupper
const char * osmo_str_toupper(const char *src)
Convert a string to uppercase, using a static buffer.
Definition: utils.c:1145
rate_ctr_group_reset
void rate_ctr_group_reset(struct rate_ctr_group *ctrg)
Reset all counters in a group.
Definition: rate_ctr.c:440
log_target::fname
const char * fname
Definition: logging.h:299
osmo_isdnhdlc_vars::dstpos
int dstpos
Definition: isdnhdlc.h:40
osmo_sockaddr_str_from_str
int osmo_sockaddr_str_from_str(struct osmo_sockaddr_str *sockaddr_str, const char *ip, uint16_t port)
osmo_stat_item_value::value
int32_t value
actual value
Definition: stat_item.h:19
msgfile.h
osmo_sockaddr_str_to_32h
int osmo_sockaddr_str_to_32h(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip)
rate_ctr_group_desc::group_name_prefix
const char * group_name_prefix
The prefix to the name of all counters in this group.
Definition: rate_ctr.h:45
rate_ctr_difference
int64_t rate_ctr_difference(struct rate_ctr *ctr)
Return the counter difference since the last call to this function.
Definition: rate_ctr.c:273
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:873
osmo_sockaddr_str_from_32
int osmo_sockaddr_str_from_32(struct osmo_sockaddr_str *sockaddr_str, uint32_t ip, uint16_t port)
osmo_stats_reporter::buffer
struct msgb * buffer
message buffer for log output
Definition: stats.h:89
llist_for_each_entry
#define llist_for_each_entry(pos, head, member)
Iterate over a linked list of a given type.
Definition: linuxlist.h:293
update_name
static void update_name(struct osmo_fsm_inst *fi)
Definition: fsm.c:353
dbg_perror
#define dbg_perror(x)
Definition: serial.c:49
osmo_sercomm_inst::dlci
uint8_t dlci
DLCI of currently received msgb.
Definition: sercomm.h:62
osmo_encode_big_endian
uint8_t * osmo_encode_big_endian(uint64_t value, size_t data_len)
Generic big-endian encoding of big endian number up to 64bit.
Definition: utils.c:555
osmo_crc64gen_code::bits
int bits
Actual number of bits of the CRC.
Definition: crc64gen.h:35
osmo_stat_item_group::desc
const struct osmo_stat_item_group_desc * desc
Pointer to the counter group class.
Definition: stat_item.h:62
osmo_sock_init2_ofd
int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto, const char *local_host, uint16_t local_port, const char *remote_host, uint16_t remote_port, unsigned int flags)
Initialize a socket and fill osmo_fd.
Definition: socket.c:1007
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:65
osmo_strbuf::buf
char * buf
Point to the start of a string buffer.
Definition: utils.h:175
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:206
osmo_stats_reporter::agg_enabled
int agg_enabled
is aggregation enabled?
Definition: stats.h:90
sockaddr_str.h
osmo_stat_item_get_group_by_name_idx
struct osmo_stat_item_group * osmo_stat_item_get_group_by_name_idx(const char *name, const unsigned int idx)
Search for item group based on group name and index.
Definition: stat_item.c:281
LOGL_NOTICE
#define LOGL_NOTICE
abnormal/unexpected condition
Definition: logging.h:99
_LOG_FLT_COUNT
@ _LOG_FLT_COUNT
Definition: logging.h:184
rate_ctr_intv
rate_ctr_intv
Rate counter interval.
Definition: rate_ctr.h:15
RX_ST_DATA
@ RX_ST_DATA
Definition: sercomm.c:68
gsmtap_osmocore_log_hdr::sec
uint32_t sec
Definition: gsmtap.h:320
osmo_config_entry::mcc
char * mcc
Definition: msgfile.h:37
osmo_gettimeofday_override_time
struct timeval osmo_gettimeofday_override_time
Definition: timer_gettimeofday.c:49
sercomm_drv_lock
void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags)
Protect against IRQ context.
Definition: sercomm.c:43
multiaddr_snprintf
static int multiaddr_snprintf(char *buf, size_t buf_len, const char **hosts, size_t host_cnt)
Definition: socket.c:185
osmo_use_count_make_static_entries
void osmo_use_count_make_static_entries(struct osmo_use_count *uc, struct osmo_use_count_entry *buf, size_t buf_n_entries)
Add N static use token entries to avoid dynamic allocation of use count tokens.
Definition: use_count.c:293
osmo_sercomm_tx_queue_depth
unsigned int osmo_sercomm_tx_queue_depth(struct osmo_sercomm_inst *sercomm, uint8_t dlci)
How deep is the Tx queue for a given DLCI?
Definition: sercomm.c:130
sercomm_drv_unlock
void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags)
Release protection against IRQ context.
Definition: sercomm.c:45
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:28
desc
osmo_stat_item_desc::name
const char * name
name of the item
Definition: stat_item.h:36
osmo_config_entry::option
char * option
Definition: msgfile.h:39
host
osmo_signalfd::ofd
struct osmo_fd ofd
Definition: select.h:99
value_string
A mapping between human-readable string and numeric value.
Definition: utils.h:42
handle_counter
static int handle_counter(struct osmo_counter *counter, void *sctx_)
Definition: stats.c:740
_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:1029
osmo_fsm_inst_name
const char * osmo_fsm_inst_name(struct osmo_fsm_inst *fi)
get human-readable name of FSM instance
Definition: fsm.c:598
msgb_copy
struct msgb * msgb_copy(const struct msgb *msg, const char *name)
Copy an msgb.
Definition: msgb.c:366
osmo_stat_item_value::id
int32_t id
identifier of value
Definition: stat_item.h:18
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:109
osmo_str_tolower
const char * osmo_str_tolower(const char *src)
Convert a string to lowercase, using a static buffer.
Definition: utils.c:1087
OSMO_T_FMT_ARGS
#define OSMO_T_FMT_ARGS(T)
Definition: fsm.h:203
osmo_sercomm_inst::state
int state
transmit state
Definition: sercomm.h:46
osmo_counter_free
void osmo_counter_free(struct osmo_counter *ctr)
Release/Destroy a given counter.
Definition: counter.c:55
osmo_signalfd::cb
osmo_signalfd_cb * cb
Definition: select.h:101
osmo_stats_timer_cb
static int osmo_stats_timer_cb(struct osmo_fd *ofd, unsigned int what)
Definition: stats.c:155
msgb_hexdump_l4
static const char * msgb_hexdump_l4(const struct msgb *msg)
Definition: msgb.h:767
point
struct @95 point[15]
current_stat_item_index
static int32_t current_stat_item_index
Definition: stats.c:110
osmo_stats_reporter_type
osmo_stats_reporter_type
Statistics Reporter Type.
Definition: stats.h:55
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:884
msgb_reset
void msgb_reset(struct msgb *m)
Re-set all message buffer pointers.
Definition: msgb.c:168
osmo_signalfd_setup
struct osmo_signalfd * osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data)
create a signalfd and register it with osmocom select loop.
Definition: select.c:568
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:624
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:512
GSMTAP_TYPE_SIM
#define GSMTAP_TYPE_SIM
Definition: gsmtap.h:36
osmo_luhn
char osmo_luhn(const char *in, int in_len)
Calculate the Luhn checksum (as used for IMEIs).
Definition: utils.c:1172
osmo_stats_report
int osmo_stats_report()
Definition: stats.c:792
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:106
osmo_timerfd_schedule
int osmo_timerfd_schedule(struct osmo_fd *ofd, const struct timespec *first, const struct timespec *interval)
schedule the osmocom-wrapped timerfd to occur first at first, then periodically at interval
Definition: select.c:485
osmo_sercomm_inst
one instance of a sercomm multiplex/demultiplex
Definition: sercomm.h:33
gsmtap_osmocore_log_hdr::line_nr
uint32_t line_nr
line number
Definition: gsmtap.h:331
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:94
osmo_fsm_inst::fsm
struct osmo_fsm * fsm
back-pointer to the FSM of which we are an instance
Definition: fsm.h:91
osmo_it_q_fd_cb
static int osmo_it_q_fd_cb(struct osmo_fd *ofd, unsigned int what)
Definition: it_q.c:93
GSMTAP_CHANNEL_PACCH
#define GSMTAP_CHANNEL_PACCH
Definition: gsmtap.h:88
GSMTAP_CHANNEL_CCCH
#define GSMTAP_CHANNEL_CCCH
Definition: gsmtap.h:79
osmo_sockaddr_str_to_in_addr
int osmo_sockaddr_str_to_in_addr(const struct osmo_sockaddr_str *sockaddr_str, struct in_addr *dst)
osmo_signalfd_cb
void osmo_signalfd_cb(struct osmo_signalfd *osfd, const struct signalfd_siginfo *fdsi)
Definition: select.h:96
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:51
osmo_clock_override_gettimespec
struct timespec * osmo_clock_override_gettimespec(clockid_t clk_id)
__attribute__
__attribute__((weak))
Definition: sercomm.c:51
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:691
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
osmo_prbs_get_ubits
int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state)
Fill buffer of unpacked bits with next bits out of given PRBS instance.
Definition: prbs.c:70
log_target_destroy
void log_target_destroy(struct log_target *target)
Unregister, close and delete a log target.
Definition: logging.c:1029
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
timespecadd
#define timespecadd(a, b, result)
Definition: timer_compat.h:97
linuxrbtree.h
HDLC_SENDFLAG_B0
@ HDLC_SENDFLAG_B0
Definition: isdnhdlc.c:41
check_frame
static int check_frame(struct osmo_isdnhdlc_vars *hdlc)
Definition: isdnhdlc.c:79
type
enum osmo_sub_auth_type type
log_tgt_mutex_lock_impl
void log_tgt_mutex_lock_impl(void)
Acquire the osmo_log_tgt_mutex.
Definition: logging.c:111
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)
send an arbitrary type through GSMTAP.
Definition: gsmtap_util.c:327
rb_node::rb_right
struct rb_node * rb_right
Definition: linuxrbtree.h:104
log_check_level
int log_check_level(int subsys, unsigned int level)
Check whether a log entry will be generated.
Definition: logging.c:1183
osmo_use_count_entry::entry
struct llist_head entry
Entry in osmo_use_count->use_counts.
Definition: use_count.h:196
osmo_it_q::max_length
unsigned int max_length
Definition: it_q.h:32
osmo_str_startswith
bool osmo_str_startswith(const char *str, const char *startswith_str)
Compare start of a string.
Definition: utils.c:1203
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_STATS_CLASS_UNKNOWN
@ OSMO_STATS_CLASS_UNKNOWN
unknown class
Definition: stats.h:48
osmo_wqueue::bfd
struct osmo_fd bfd
osmocom file descriptor
Definition: write_queue.h:36
RSL_CHAN_RACH
#define RSL_CHAN_RACH
osmo_sock_get_name_buf
int osmo_sock_get_name_buf(char *str, size_t str_len, int fd)
Get address/port information on socket in provided string buffer, like "r=1.2.3.4:5<->l=6....
Definition: socket.c:1401
rate_ctr::previous
uint64_t previous
previous value, used for delta
Definition: rate_ctr.h:31
gsmtap_osmocore_log_hdr
Structure of the GSMTAP libosmocore logging header.
Definition: gsmtap.h:318
DLJIBUF
#define DLJIBUF
Osmocom Jitter Buffer.
Definition: logging.h:121
fsm_log_timeouts
static bool fsm_log_timeouts
Definition: fsm.c:93
osmo_sercomm_inst::msg_size
unsigned int msg_size
msgb allocation size for rx msgs
Definition: sercomm.h:56
osmo_stat_item_group_desc::group_name_prefix
const char * group_name_prefix
The prefix to the name of all values in this group.
Definition: stat_item.h:46
osmo_sercomm_change_speed
int osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, uint32_t bdrt)
wait until everything has been transmitted, then grab the lock and change the baud rate as requested
Definition: sercomm.c:148
osmo_timer_list::cb
void(* cb)(void *)
call-back called at timeout
Definition: timer.h:62
msgb_l4
#define msgb_l4(m)
obtain L4 header of msgb
Definition: msgb.h:138
osmo_sock_get_remote_ip_port
int osmo_sock_get_remote_ip_port(int fd, char *port, size_t len)
Get remote port on socket.
Definition: socket.c:1372
capsbuf
static __thread char capsbuf[128]
Definition: utils.c:47
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:833
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:522
is_initialised
static int is_initialised
Definition: stats.c:109
osmo_it_q_destroy
void osmo_it_q_destroy(struct osmo_it_q *q)
Destroy a message queue.
Definition: it_q.c:209
RSL_CHAN_Bm_ACCHs
#define RSL_CHAN_Bm_ACCHs
nearest
static __thread struct timeval nearest
Definition: timer.c:43
gsmtap_gsm_channel_names
const struct value_string gsmtap_gsm_channel_names[]
Definition: gsmtap_util.c:479
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:332
osmo_escape_str_buf2
char * osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len)
Return the string with all non-printable characters escaped.
Definition: utils.c:841
use_count.h
logp2syslog_level
static int logp2syslog_level(unsigned int level)
Definition: logging_syslog.c:47
RB_MAX_MESSAGE_SIZE
#define RB_MAX_MESSAGE_SIZE
A structure representing an osmocom string ringbuffer.
Definition: strrb.h:37
log_target::categories
struct log_category * categories
logging categories
Definition: logging.h:276
osmo_quote_str_c
char * osmo_quote_str_c(const void *ctx, const char *str, int in_len)
Like osmo_quote_str_buf() but returns the result in a dynamically-allocated buffer.
Definition: utils.c:946
osmo_timer_del
void osmo_timer_del(struct osmo_timer_list *timer)
delete a timer from timer management
Definition: timer.c:120
osmo_fsm_register
int osmo_fsm_register(struct osmo_fsm *fsm)
register a FSM with the core
Definition: fsm.c:287
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:198
msgb_l3
#define msgb_l3(m)
obtain L3 header of msgb
Definition: msgb.h:136
GSMTAP_CHANNEL_CBCH52
#define GSMTAP_CHANNEL_CBCH52
Definition: gsmtap.h:89
osmo_counter::name
const char * name
human-readable name
Definition: counter.h:11
osmo_use_count_entry::use_count
struct osmo_use_count * use_count
Parent use count and backpointer to the talloc_object.
Definition: use_count.h:198
osmo_sockaddr_str_from_sockaddr
int osmo_sockaddr_str_from_sockaddr(struct osmo_sockaddr_str *sockaddr_str, const struct sockaddr_storage *src)
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:70
msgb::l2h
unsigned char * l2h
pointer to A-bis layer 2 header: OML, RSL(RLL), NS
Definition: msgb.h:48
logging.h
GSMTAP_CHANNEL_UNKNOWN
#define GSMTAP_CHANNEL_UNKNOWN
Definition: gsmtap.h:77
osmo_stats_reporter::name
char * name
Human-readable name of this reporter.
Definition: stats.h:65
osmo_strbuf
State for OSMO_STRBUF_APPEND() and OSMO_STRBUF_PRINTF().
Definition: utils.h:173
osmo_stats_reporter_set_mtu
int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu)
osmo_quote_cstr_c
char * osmo_quote_cstr_c(void *ctx, const char *str, int in_len)
Return the string quoted and with all non-printable characters escaped, in dynamically-allocated buff...
Definition: utils.c:1004
osmo_crc16gen_code::remainder
uint16_t remainder
Remainder of the CRC (final XOR)
Definition: crc16gen.h:38
osmo_strrb::end
uint16_t end
index of the last slot
Definition: strrb.h:40
osmo_crc16gen_code
structure describing a given CRC code of max 16 bits
Definition: crc16gen.h:34
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:288
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:345
DLSTATS
#define DLSTATS
Statistics.
Definition: logging.h:113
rb_last
struct rb_node * rb_last(const struct rb_root *root)
Definition: rbtree.c:301
osmo_counter_alloc
struct osmo_counter * osmo_counter_alloc(const char *name)
Allocate a new counter with given name.
Definition: counter.c:40
osmo_gettid
pid_t osmo_gettid(void)
Wrapper around Linux's gettid() to make it easily accessible on different system versions.
Definition: thread.c:50
msgb::data_len
uint16_t data_len
length of underlying data array
Definition: msgb.h:54
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:322
rate_ctr::current
uint64_t current
current value
Definition: rate_ctr.h:30
osmo_tdef_factor
static unsigned long osmo_tdef_factor(enum osmo_tdef_unit a, enum osmo_tdef_unit b)
a = return_val * b.
Definition: tdef.c:89
GSMTAP_TYPE_GMR1_UM
#define GSMTAP_TYPE_GMR1_UM
Definition: gsmtap.h:42
crc_ccitt_byte
#define crc_ccitt_byte
Definition: isdnhdlc.c:45
OSMO_TDEF_CUSTOM
@ OSMO_TDEF_CUSTOM
unspecified unit, explained in osmo_tdef.desc.
Definition: tdef.h:42
osmo_counter_difference
int osmo_counter_difference(struct osmo_counter *ctr)
Compute difference between current and previous counter value.
Definition: counter.c:106
osmo_strrb_create
struct osmo_strrb * osmo_strrb_create(TALLOC_CTX *ctx, size_t rb_size)
Create an empty, initialized osmo_strrb.
Definition: strrb.c:59
osmo_stats_reporter_log_send
static int osmo_stats_reporter_log_send(struct osmo_stats_reporter *srep, const char *type, const char *name1, unsigned int index1, const char *name2, int value, const char *unit)
Definition: stats.c:581
osmo_strnchr
const char * osmo_strnchr(const char *str, size_t str_size, char c)
Find first occurence of a char in a size limited string.
Definition: utils.c:595
signalfd_callback
static int signalfd_callback(struct osmo_fd *ofd, unsigned int what)
Definition: select.c:542
osmo_use_count::talloc_object
void * talloc_object
Context to talloc-allocate use count entries from (if at all necessary); back-pointer to the owning o...
Definition: use_count.h:175
GSMTAP_CHANNEL_PCH
#define GSMTAP_CHANNEL_PCH
Definition: gsmtap.h:82
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:317
socket.h
osmo_fsm_state_name
const char * osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state)
get human-readable name of FSM state
Definition: fsm.c:614
osmo_serial_clear_custom_baudrate
int osmo_serial_clear_custom_baudrate(int fd)
Clear any custom baudrate.
Definition: serial.c:224
osmo_store32be
static void osmo_store32be(uint32_t x, void *p)
store unaligned 32-bit integer (big-endian encoding)
Definition: bit32gen.h:125
rb_set_parent
static void rb_set_parent(struct rb_node *rb, struct rb_node *p)
Definition: linuxrbtree.h:122
rate_ctr::intv
struct rate_ctr_per_intv intv[RATE_CTR_INTV_NUM]
per-interval data
Definition: rate_ctr.h:33
gsmtap_hdr::snr_db
int8_t snr_db
signal/noise ratio in dB
Definition: gsmtap.h:306
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:63
msgb_data
uint8_t * msgb_data(const struct msgb *msg)
get pointer to data section of message buffer
Definition: msgb.c:188
select.h
osmo_g_fsms
struct llist_head osmo_g_fsms
MSGB_ABORT
#define MSGB_ABORT(msg, fmt, args ...)
Definition: msgb.h:124
LOG_TGT_TYPE_SYSTEMD
@ LOG_TGT_TYPE_SYSTEMD
systemd journal logging
Definition: logging.h:250
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:477
osmo_fsm_inst::parent_term_event
uint32_t parent_term_event
the event we should send upon termination
Definition: fsm.h:113
panic.h
rate_ctr.h
rb_node
Definition: linuxrbtree.h:100
log_target::tgt_syslog
struct log_target::@8::@11 tgt_syslog
osmo_sock_get_name
char * osmo_sock_get_name(const void *ctx, int fd)
Get address/port information on socket in dyn-alloc string like "(r=1.2.3.4:5<->l=6....
Definition: socket.c:1384
RSL_CHAN_OSMO_PDCH
#define RSL_CHAN_OSMO_PDCH
osmo_ip_str_type
int osmo_ip_str_type(const char *ip)
const_basename
static const char * const_basename(const char *path)
Definition: logging.c:423
osmo_timer_list::active
unsigned int active
is it active?
Definition: timer.h:60
DLGLOBAL
#define DLGLOBAL
global logging
Definition: logging.h:104
osmo_isdnhdlc_vars::do_bitreverse
uint32_t do_bitreverse
Definition: isdnhdlc.h:57
addrinfo_helper
static struct addrinfo * addrinfo_helper(uint16_t family, uint16_t type, uint8_t proto, const char *host, uint16_t port, bool passive)
Definition: socket.c:62
signal_handler
Definition: signal.c:42
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:250
osmo_stats_reporter_create_log
struct osmo_stats_reporter * osmo_stats_reporter_create_log(const char *name)
Create a stats_reporter that logs via libosmocore logging.
Definition: stats.c:568
log_tgt_mutex_unlock
#define log_tgt_mutex_unlock()
Definition: logging.h:427
osmo_isdnhdlc_vars::shift_reg
uint8_t shift_reg
Definition: isdnhdlc.h:45
OSMO_HDLC_FRAMING_ERROR
#define OSMO_HDLC_FRAMING_ERROR
Definition: isdnhdlc.h:70
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:298
osmo_crc8gen_code::init
uint8_t init
Initialization value of the CRC state.
Definition: crc8gen.h:37
osmo_fd
Structure representing a file dsecriptor.
Definition: select.h:31
socket_helper_multiaddr
static int socket_helper_multiaddr(uint16_t family, uint16_t type, uint8_t proto, unsigned int flags)
Definition: socket.c:622
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:310
osmo_fsm_state::in_event_mask
uint32_t in_event_mask
bit-mask of permitted input events for this state
Definition: fsm.h:44
HDLC_GET_FLAG_B0
@ HDLC_GET_FLAG_B0
Definition: isdnhdlc.c:34
log_parse_category
int log_parse_category(const char *category)
parse a human-readable log category into numeric form
Definition: logging.c:319
msgb_l2
#define msgb_l2(m)
obtain L2 header of msgb
Definition: msgb.h:134
log_init
void int log_init(const struct log_info *inf, void *talloc_ctx)
Initialize the Osmocom logging core.
Definition: logging.c:1105
osmo_config_entry::text
char * text
Definition: msgfile.h:40
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:90
osmo_it_q_by_name
struct osmo_it_q * osmo_it_q_by_name(const char *name)
resolve it-queue by its [globally unique] name
Definition: it_q.c:83
gsmtap_osmocore_log_hdr::usec
uint32_t usec
Definition: gsmtap.h:321
level_color
static const char * level_color(int level)
Definition: logging.c:407
osmo_sercomm_register_rx_cb
int osmo_sercomm_register_rx_cb(struct osmo_sercomm_inst *sercomm, uint8_t dlci, dlci_cb_t cb)
Register a handler for a given DLCI.
Definition: sercomm.c:249
log_category::enabled
uint8_t enabled
is logging enabled?
Definition: logging.h:149
logging_tid
static __thread long int logging_tid
Definition: logging.c:87
osmo_use_count::use_cb
osmo_use_count_cb_t use_cb
If not NULL, this is invoked for each use count change.
Definition: use_count.h:177
LOG_MAX_CTX
#define LOG_MAX_CTX
Maximum number of logging contexts.
Definition: logging.h:188
LOGP
#define LOGP(ss, level, fmt, args...)
Log a new message through the Osmocom logging framework.
Definition: logging.h:43
osmo_hexdump_nospc_c
char * osmo_hexdump_nospc_c(const void *ctx, const unsigned char *buf, int len)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:453
osmo_tdef::max_val
unsigned long max_val
Maximum timer value (in this tdef unit), checked if set (not zero).
Definition: tdef.h:84
osmo_sercomm_inst::tx
struct osmo_sercomm_inst::@18 tx
transmit side
item_dequeue
static void * item_dequeue(struct llist_head *queue)
Definition: it_q.c:173
digits
uint8_t digits[3]
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:60
msgb_alloc
struct msgb * msgb_alloc(uint16_t size, const char *name)
Allocate a new message buffer from tall_msgb_ctx.
Definition: msgb.c:112
llist_empty
static int llist_empty(const struct llist_head *head)
Test whether a linked list is empty.
Definition: linuxlist.h:169
rb_is_red
#define rb_is_red(r)
Definition: linuxrbtree.h:117
osmo_timers_check
int osmo_timers_check(void)
Check how many timers we have in the system.
Definition: timer.c:283
rb_parent
#define rb_parent(r)
Definition: linuxrbtree.h:115
OSMO_STRBUF_PRINTF
#define OSMO_STRBUF_PRINTF(STRBUF, fmt, args...)
Shortcut for OSMO_STRBUF_APPEND() invocation using snprintf().
Definition: utils.h:254
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:44
osmo_sercomm_sendmsg
void osmo_sercomm_sendmsg(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struct msgb *msg)
User interface for transmitting messages for a given DLCI.
Definition: sercomm.c:106
tall_msgb_ctx
void * tall_msgb_ctx
Definition: msgb.c:101
osmo_prbs_state::state
uint64_t state
Definition: prbs.h:15
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:173
log_target::print_timestamp
unsigned int print_timestamp
should log messages be prefixed with a timestamp?
Definition: logging.h:283
OSMO_TDEF_US
@ OSMO_TDEF_US
microseconds
Definition: tdef.h:43
OSMO_HDLC_F_DCHANNEL
#define OSMO_HDLC_F_DCHANNEL
Definition: isdnhdlc.h:62
osmo_str_toupper_buf
size_t osmo_str_toupper_buf(char *dest, size_t dest_len, const char *src)
Convert a string to uppercase, while checking buffer size boundaries.
Definition: utils.c:1119
osmo_stats_reporter::enabled
int enabled
is this reporter enabled
Definition: stats.h:70
osmo_sercomm_inst::rx
struct osmo_sercomm_inst::@19 rx
receive side
rb_is_black
#define rb_is_black(r)
Definition: linuxrbtree.h:118
log_tgt_mutex_unlock_impl
void log_tgt_mutex_unlock_impl(void)
Release the osmo_log_tgt_mutex.
Definition: logging.c:127
osmo_crc32gen_code
structure describing a given CRC code of max 32 bits
Definition: crc32gen.h:34
osmo_osmo_hexdump_nospc
char * osmo_osmo_hexdump_nospc(const unsigned char *buf, int len) __attribute__((__deprecated__))
hexd_buff
static __thread char hexd_buff[4096]
Definition: utils.c:284
osmo_use_count_free
void osmo_use_count_free(struct osmo_use_count_entry *use_count_entry)
Deallocate a use count entry.
Definition: use_count.c:224
osmo_talloc_contexts::select
void * select
volatile select-dispatch context.
Definition: talloc.h:19
osmo_sercomm_alloc_msgb
static struct msgb * osmo_sercomm_alloc_msgb(unsigned int len)
Sercomm msgb allocator function.
Definition: sercomm.h:107
log_target::tgt_rb
struct log_target::@8::@13 tgt_rb
start_timer
static int start_timer()
Definition: stats.c:180
osmo_hexdump_nospc
char * osmo_hexdump_nospc(const unsigned char *buf, int len)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:435
osmo_counter::description
const char * description
humn-readable description
Definition: counter.h:12
osmo_fsm::event_names
const struct value_string * event_names
human-readable names of events
Definition: fsm.h:81
logp2syslog_level
static int logp2syslog_level(unsigned int level)
Definition: logging_systemd.c:40
osmo_fd_get_by_fd
struct osmo_fd * osmo_fd_get_by_fd(int fd)
find an osmo_fd based on the integer fd
Definition: select.c:444
osmo_sockaddr_local_ip
int osmo_sockaddr_local_ip(struct osmo_sockaddr *local_ip, const struct osmo_sockaddr *remote_ip)
Determine the matching local address for a given remote address.
Definition: socket.c:1670
DLSS7
#define DLSS7
Osmocom SS7.
Definition: logging.h:116
osmo_wqueue_bfd_cb
int osmo_wqueue_bfd_cb(struct osmo_fd *fd, unsigned int what)
Select loop function for write queue handling.
Definition: write_queue.c:43
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:38
osmo_htons
#define osmo_htons(x)
Definition: byteswap.h:44
_osmo_escape_str_buf
static size_t _osmo_escape_str_buf(char *buf, size_t bufsize, const char *str, int in_len, bool legacy_format)
Return the string with all non-printable characters escaped.
Definition: utils.c:767
osmo_hexdump
char * osmo_hexdump(const unsigned char *buf, int len)
Convert binary sequence to hexadecimal ASCII string.
Definition: utils.c:396
signal_handler::subsys
unsigned int subsys
Definition: signal.c:44
rate_ctr_group_desc
description of a rate counter group
Definition: rate_ctr.h:43
rb_erase
void rb_erase(struct rb_node *, struct rb_root *)
Definition: rbtree.c:219
counter.h
gsmtap_hdr::hdr_len
uint8_t hdr_len
length in number of 32bit words
Definition: gsmtap.h:300
osmo_stat_item_group::items
struct osmo_stat_item * items[0]
Actual counter structures below.
Definition: stat_item.h:66
osmo_use_count_find
struct osmo_use_count_entry * osmo_use_count_find(const struct osmo_use_count *uc, const char *use)
Definition: use_count.c:168
msgb_put_u8
static void msgb_put_u8(struct msgb *msgb, uint8_t word)
append a uint8 value to the end of the message
Definition: msgb.h:257
DLNS
#define DLNS
Osmocom NS layer.
Definition: logging.h:123
osmo_stats_reporter_set_remote_port
int osmo_stats_reporter_set_remote_port(struct osmo_stats_reporter *srep, int port)
osmo_tdef_for_each
#define osmo_tdef_for_each(t, tdefs)
Iterate an array of struct osmo_tdef, the last item should be fully zero, i.e.
Definition: tdef.h:98
OSMO_STATS_CLASS_SUBSCRIBER
@ OSMO_STATS_CLASS_SUBSCRIBER
subscriber
Definition: stats.h:51
osmo_sockaddr_str_cmp
int osmo_sockaddr_str_cmp(const struct osmo_sockaddr_str *a, const struct osmo_sockaddr_str *b)
rate_ctr_for_each_group
int rate_ctr_for_each_group(rate_ctr_group_handler_t handle_group, void *data)
Iterate over all counter groups.
Definition: rate_ctr.c:415
DLGSUP
#define DLGSUP
Generic Subscriber Update Protocol.
Definition: logging.h:114
osmo_stats_config::interval
int interval
Definition: stats.h:108
osmo_crc16_ccitt_table
uint16_t const osmo_crc16_ccitt_table[256]
CRC table for the CCITT CRC-6.
Definition: crc16.c:67
osmo_str_toupper_c
char * osmo_str_toupper_c(const void *ctx, const char *src)
Convert a string to uppercase, dynamically allocating the output from given talloc context See also o...
Definition: utils.c:1157
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
osmo_str2bcd
int osmo_str2bcd(uint8_t *dst, size_t dst_size, const char *digits, int start_nibble, int end_nibble, bool allow_hex)
Convert string to BCD.
Definition: utils.c:195
logging.h
gsmtap_sink_fd_cb
static int gsmtap_sink_fd_cb(struct osmo_fd *fd, unsigned int flags)
Definition: gsmtap_util.c:378
osmo_stats_reporter_check_config
static int osmo_stats_reporter_check_config(struct osmo_stats_reporter *srep, unsigned int index, int class_id)
Definition: stats.c:623
osmo_stat_item_desc
Statistics item description.
Definition: stat_item.h:35
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:212
rb_set_color
static void rb_set_color(struct rb_node *rb, int color)
Definition: linuxrbtree.h:126
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:898
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:145
signal_handler::entry
struct llist_head entry
Definition: signal.c:43
linuxlist.h
osmo_stats_reporter::name_prefix
char * name_prefix
prefix for counter names
Definition: stats.h:71
HDLC_SEND_CRC2
@ HDLC_SEND_CRC2
Definition: isdnhdlc.c:40
list
struct llist_head list
GSMTAP_CHANNEL_VOICE_F
#define GSMTAP_CHANNEL_VOICE_F
Definition: gsmtap.h:95
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:223
log_done
probe log_done()
rate_ctr_per_intv::last
uint64_t last
counter value in last interval
Definition: rate_ctr.h:24
osmo_sock_init_sa
int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type, uint8_t proto, unsigned int flags)
Initialize a socket and fill sockaddr.
Definition: socket.c:1032
log_context
Log context information, passed to filter.
Definition: logging.h:193
arfcn
uint16_t arfcn
ARFCN (frequency)
Definition: gsmtap.h:5
DLSCCP
#define DLSCCP
Osmocom SCCP.
Definition: logging.h:117
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:271
handle_abort
#define handle_abort(h)
global_value_id
static int32_t global_value_id
counter for assigning globally unique value identifiers
Definition: stat_item.c:67
RATE_CTR_INTV_DAY
@ RATE_CTR_INTV_DAY
last day
Definition: rate_ctr.h:19
internal_cat
static const struct log_info_cat internal_cat[OSMO_NUM_DLIB]
Definition: logging.c:150
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:152
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
HDLC_GETFLAG_B7
@ HDLC_GETFLAG_B7
Definition: isdnhdlc.c:34
GSMTAP_TYPE_LTE_RRC
#define GSMTAP_TYPE_LTE_RRC
Definition: gsmtap.h:45
RSL_CHAN_SDCCH4_ACCH
#define RSL_CHAN_SDCCH4_ACCH
OSMO_SNPRINTF_RET
#define OSMO_SNPRINTF_RET(ret, rem, offset, len)
Definition: utils.h:90
osmo_stat_item_group_desc::class_id
int class_id
The class to which this group belongs.
Definition: stat_item.h:50
osmo_wqueue::msg_queue
struct llist_head msg_queue
actual linked list implementing the queue
Definition: write_queue.h:43
prim.h
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:68
log_context::ctx
void * ctx[LOG_MAX_CTX+1]
Definition: logging.h:194
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:104
hex_chars
static const char hex_chars[]
Definition: utils.c:285
osmo_sock_mcast_iface_set
int osmo_sock_mcast_iface_set(int fd, const char *ifname)
Set the network device to which we should bind the multicast socket.
Definition: socket.c:1517
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:142
gsmtap_wq_w_cb
static int gsmtap_wq_w_cb(struct osmo_fd *ofd, struct msgb *msg)
Definition: gsmtap_util.c:362
osmo_fd::fd
int fd
actual operating-system level file decriptor
Definition: select.h:35
osmo_tdef_get_entry
struct osmo_tdef * osmo_tdef_get_entry(struct osmo_tdef *tdefs, int T)
Find tdef entry matching T.
Definition: tdef.c:223
osmo_stats_init
void osmo_stats_init(void *ctx)
Initilize the stats reporting module; call this once in your program.
Definition: stats.c:241
thread.h
osmo_strrb
Definition: strrb.h:38
osmo_sockaddr_str_to_sockaddr
int osmo_sockaddr_str_to_sockaddr(const struct osmo_sockaddr_str *sockaddr_str, struct sockaddr_storage *dst)
osmo_prbs_state
state of a given PRBS sequence generator
Definition: prbs.h:13
GSMTAP_TYPE_UMTS_RRC
#define GSMTAP_TYPE_UMTS_RRC
Definition: gsmtap.h:44
osmo_stat_item_for_each_item
int osmo_stat_item_for_each_item(struct osmo_stat_item_group *statg, osmo_stat_item_handler_t handle_item, void *data)
Iterate over all items in group, call user-supplied function on each.
Definition: stat_item.c:325
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:36
osmo_counter::value
unsigned long value
current value
Definition: counter.h:13
gsmtap_hdr::antenna_nr
uint8_t antenna_nr
Antenna Number.
Definition: gsmtap.h:311
DLGTP
#define DLGTP
GTP (GPRS Tunneling Protocol.
Definition: logging.h:112
gsmtap_osmocore_log_hdr::name
char name[32]
source file name
Definition: gsmtap.h:330
osmo_stat_item_group_handler
static int osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_)
Definition: stats.c:731
LOGPC
#define LOGPC(ss, level, fmt, args...)
Continue a log message through the Osmocom logging framework.
Definition: logging.h:52
osmo_strrb_is_empty
bool osmo_strrb_is_empty(const struct osmo_strrb *rb)
Check if an osmo_strrb is empty.
Definition: strrb.c:92
LOGL_DEBUG
#define LOGL_DEBUG
different log levels
Definition: logging.h:97
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:104
msgb::head
unsigned char * head
start of underlying memory buffer
Definition: msgb.h:57
RX_ST_CTRL
@ RX_ST_CTRL
Definition: sercomm.c:67
OSMO_SOCK_F_BIND
#define OSMO_SOCK_F_BIND
bind the socket to a local address/port
Definition: socket.h:37
osmo_crc64gen_code::remainder
uint64_t remainder
Remainder of the CRC (final XOR)
Definition: crc64gen.h:38
msgb_enqueue
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
Enqueue message buffer to tail of a queue.
Definition: msgb.c:133
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:639
osmo_log_tgt_mutex_on
static bool osmo_log_tgt_mutex_on
Definition: logging.c:95
osmo_stat_item_init
int osmo_stat_item_init(void *tall_ctx)
Initialize the stat item module.
Definition: stat_item.c:270
osmo_prim_hdr::primitive
unsigned int primitive
Primitive number.
Definition: prim.h:45
osmo_fd::data
void * data
data pointer passed through to call-back function
Definition: select.h:43
fsm_tmr_cb
static void fsm_tmr_cb(void *data)
Definition: fsm.c:316
osmo_escape_str_c
char * osmo_escape_str_c(const void *ctx, const char *str, int in_len)
Return the string with all non-printable characters escaped, in dynamically-allocated buffer.
Definition: utils.c:863
osmo_sockaddr_str
Definition: sockaddr_str.h:49
osmo_prim_event_map::primitive
unsigned int primitive
primtiive to match
Definition: prim.h:84
LOGL_ERROR
#define LOGL_ERROR
error condition, requires user action
Definition: logging.h:100
RATE_CTR_INTV_SEC
@ RATE_CTR_INTV_SEC
last second
Definition: rate_ctr.h:16
rate_ctr_reset
void rate_ctr_reset(struct rate_ctr *ctr)
Reset a rate counter back to zero.
Definition: rate_ctr.c:432
gsmtap_hdr::version
uint8_t version
version, set to 0x01 currently
Definition: gsmtap.h:299
bit64gen.h
osmo_stats_set_interval
int osmo_stats_set_interval(int interval)
Set the reporting interval (common for all reporters)
Definition: stats.c:382
osmo_sockaddr_str::port
uint16_t port
Port number.
Definition: sockaddr_str.h:55
LLIST_HEAD
static LLIST_HEAD(rate_ctr_groups)
msgb_printf
int msgb_printf(struct msgb *msgb, const char *format,...)
Print a string to the end of message buffer.
Definition: msgb.c:549
HDLC_SEND_FIRST_FLAG
@ HDLC_SEND_FIRST_FLAG
Definition: isdnhdlc.c:40
_osmo_it_q_enqueue
int _osmo_it_q_enqueue(struct osmo_it_q *queue, struct llist_head *item)
Thread-safe en-queue to an inter-thread message queue.
Definition: it_q.c:231
GSMTAP_TYPE_TETRA_I1
#define GSMTAP_TYPE_TETRA_I1
Definition: gsmtap.h:37
osmo_store64be_ext
static void osmo_store64be_ext(uint64_t x, void *p, uint8_t n)
store unaligned n-byte integer (big-endian encoding) from uint64_t
Definition: bit64gen.h:93
LOG_TGT_TYPE_STRRB
@ LOG_TGT_TYPE_STRRB
osmo_strrb-backed logging
Definition: logging.h:248
it_q.h
HDLC_FAST_IDLE
@ HDLC_FAST_IDLE
Definition: isdnhdlc.c:34
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:79
gsmtap_osmocore_log_hdr::proc_name
char proc_name[16]
name of process
Definition: gsmtap.h:323
osmo_select_main
int osmo_select_main(int polling)
select main loop integration
Definition: select.c:415
osmo_constant_time_cmp
int osmo_constant_time_cmp(const uint8_t *exp, const uint8_t *rel, const int count)
Wishful thinking to generate a constant time compare.
Definition: utils.c:512
rate_ctr
data we keep for each actual value
Definition: rate_ctr.h:29
log_set_all_filter
void log_set_all_filter(struct log_target *target, int)
Enable the LOG_FLT_ALL log filter.
Definition: logging.c:753
gsmtap.h
OSMO_FD_EXCEPT
#define OSMO_FD_EXCEPT
Indicate interest in exceptions from the file descriptor.
Definition: select.h:21
osmo_sockaddr_str_to_32n
int osmo_sockaddr_str_to_32n(const struct osmo_sockaddr_str *sockaddr_str, uint32_t *ip) OSMO_DEPRECATED("osmo_sockaddr_str_to_32n() actually uses *host* byte order. Use osmo_sockaddr_str_to_32h() instead")
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:38
osmo_sock_get_name2
const char * osmo_sock_get_name2(int fd)
Get address/port information on socket in static string, like "r=1.2.3.4:5<->l=6.7....
Definition: socket.c:1425
msgb::_data
unsigned char _data[0]
optional immediate data array
Definition: msgb.h:60
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:267
LOG_FLT_ALL
@ LOG_FLT_ALL
Definition: logging.h:177
mnl.h
OSMO_MAX
#define OSMO_MAX(a, b)
Return the maximum of two specified values.
Definition: utils.h:22
dlci_cb_t
void(* dlci_cb_t)(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struct msgb *msg)
call-back function for per-DLC receive handler
Definition: sercomm.h:30
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
g_poll
static __thread struct poll_state g_poll
Definition: select.c:69
osmo_it_q::event_ofd
struct osmo_fd event_ofd
Definition: it_q.h:27
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:254
ENOTSUP
#define ENOTSUP
OSMO_SOCK_F_NO_MCAST_ALL
#define OSMO_SOCK_F_NO_MCAST_ALL
disable receiving all multiast even for non-subscribed groups
Definition: socket.h:43
PRIM_OP_CONFIRM
@ PRIM_OP_CONFIRM
confirm
Definition: prim.h:30
rb_erase
void rb_erase(struct rb_node *node, struct rb_root *root)
Definition: rbtree.c:219
osmo_prim_hdr::sap
unsigned int sap
Service Access Point Identifier.
Definition: prim.h:44
osmo_sock_get_local_ip
int osmo_sock_get_local_ip(int fd, char *host, size_t len)
Get local IP address on socket.
Definition: socket.c:1339
osmo_crc16gen_code::init
uint16_t init
Initialization value of the CRC state.
Definition: crc16gen.h:37
_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:810
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:44
log_fini
void log_fini(void)
Definition: logging.c:1164
socket_helper
static int socket_helper(const struct addrinfo *rp, unsigned int flags)
Definition: socket.c:135
osmo_fsm_inst::log_level
int log_level
logging level for this FSM
Definition: fsm.h:99
PRIM_OP_RESPONSE
@ PRIM_OP_RESPONSE
response
Definition: prim.h:28
osmo_stats_reporter_send
int osmo_stats_reporter_send(struct osmo_stats_reporter *srep, const char *data, int data_len)
handle_counter
static int handle_counter(struct osmo_counter *counter, void *vctx_)
DLMGCP
#define DLMGCP
Osmocom MGCP.
Definition: logging.h:120
osmo_isdnhdlc_vars::do_closing
uint32_t do_closing
Definition: isdnhdlc.h:55
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:79
osmo_use_count_to_str_c
char * osmo_use_count_to_str_c(void *ctx, const struct osmo_use_count *uc)
Write a comprehensive listing of use counts to a talloc allocated string buffer.
Definition: use_count.c:158
osmo_wqueue_clear
void osmo_wqueue_clear(struct osmo_wqueue *queue)
Clear a osmo_wqueue.
Definition: write_queue.c:143
DLSMS
#define DLSMS
SMS sub-system.
Definition: logging.h:110
RX_ST_WAIT_START
@ RX_ST_WAIT_START
Definition: sercomm.c:65
osmo_counter::list
struct llist_head list
internal list head
Definition: counter.h:10
_osmo_quote_str_buf
static size_t _osmo_quote_str_buf(char *buf, size_t bufsize, const char *str, int in_len, bool legacy_format)
Return a quoted and escaped representation of the string.
Definition: utils.c:883
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:81
osmo_crc16_table
uint16_t const osmo_crc16_table[256]
CRC table for the CRC-16.
Definition: crc16.c:18
osmo_str2upper
void osmo_str2upper(char *out, const char *in) OSMO_DEPRECATED("Use osmo_str_toupper() or osmo_str_toupper_buf() instead
Convert an entire string to upper case.
Definition: utils.c:492
rb_link_node
static void rb_link_node(struct rb_node *node, struct rb_node *parent, struct rb_node **rb_link)
Definition: linuxrbtree.h:151
osmo_crc32gen_code::init
uint32_t init
Initialization value of the CRC state.
Definition: crc32gen.h:37
rate_ctr_group::idx
unsigned int idx
The index of this ctr_group within its class.
Definition: rate_ctr.h:63
DLINP
#define DLINP
(A-bis) Input sub-system
Definition: logging.h:106
osmo_crc8gen_code
structure describing a given CRC code of max 8 bits
Definition: crc8gen.h:34
_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:804