libosmovty  1.7.0.61-0d9b6.202211030053
Osmocom VTY library
buffer.h File Reference
#include <sys/types.h>

Go to the source code of this file.

Enumerations

enum  buffer_status_t {
  BUFFER_ERROR = -1,
  BUFFER_EMPTY = 0,
  BUFFER_PENDING = 1
}
 

Functions

struct bufferbuffer_new (void *ctx, size_t)
 
void buffer_reset (struct buffer *)
 
void buffer_free (struct buffer *)
 
void buffer_put (struct buffer *, const void *, size_t)
 
void buffer_putc (struct buffer *, unsigned char)
 
void buffer_putstr (struct buffer *, const char *)
 
char * buffer_getstr (struct buffer *)
 
int buffer_empty (struct buffer *)
 
buffer_status_t buffer_write (struct buffer *, int fd, const void *, size_t)
 
buffer_status_t buffer_flush_available (struct buffer *, int fd)
 
buffer_status_t buffer_flush_all (struct buffer *, int fd)
 
buffer_status_t buffer_flush_window (struct buffer *, int fd, int width, int height, int erase, int no_more)
 

Detailed Description

Buffering to output and input.

Enumeration Type Documentation

◆ buffer_status_t

Enumerator
BUFFER_ERROR 
BUFFER_EMPTY 
BUFFER_PENDING 

Function Documentation

◆ buffer_empty()

int buffer_empty ( struct buffer )

References buffer::head.

◆ buffer_flush_all()

buffer_status_t buffer_flush_all ( struct buffer ,
int  fd 
)

◆ buffer_flush_available()

◆ buffer_flush_window()

buffer_status_t buffer_flush_window ( struct buffer ,
int  fd,
int  width,
int  height,
int  erase,
int  no_more 
)

◆ buffer_free()

void buffer_free ( struct buffer )

References buffer_reset().

Referenced by vty_close(), and vty_new().

◆ buffer_getstr()

char* buffer_getstr ( struct buffer )

References data, buffer::head, and tall_vty_ctx.

◆ buffer_new()

struct buffer* buffer_new ( void *  ctx,
size_t   
)

References BUFFER_SIZE_DEFAULT, and buffer::size.

Referenced by vty_new().

◆ buffer_put()

void buffer_put ( struct buffer ,
const void *  ,
size_t   
)

◆ buffer_putc()

void buffer_putc ( struct buffer ,
unsigned char   
)

References buffer_put(), and c.

◆ buffer_putstr()

void buffer_putstr ( struct buffer ,
const char *   
)

References buffer_put(), and c.

◆ buffer_reset()

void buffer_reset ( struct buffer )

◆ buffer_write()

buffer_status_t buffer_write ( struct buffer ,
int  fd,
const void *  ,
size_t   
)
ALIAS_DEPRECATED
ALIAS_DEPRECATED(logging_level_force_all, deprecated_logging_level_all_cmd, "logging level all " LOG_LEVEL_ARGS, LOGGING_STR LEVEL_STR CATEGORY_ALL_STR LOG_LEVEL_STRS)
vty_out_statistics_partial2
void vty_out_statistics_partial2(struct vty *vty, const char *prefix, int max_level, bool skip_zero)
Definition: utils.c:346
vty_out_va
int int vty_out_va(struct vty *vty, const char *format, va_list ap)
Definition: vty.c:266
stats.h
cmd_node_vector
static vector cmd_node_vector(vector v, enum node_type ntype)
Definition: command.c:1092
cmd_element::usrattr
unsigned int usrattr
Command attributes (program specific)
Definition: command.h:185
osmo_stats_reporter::have_net_config
unsigned int have_net_config
vty::VTY_CLOSE
@ VTY_CLOSE
Definition: vty.h:128
osmo_fsm_event_name
const char * osmo_fsm_event_name(const struct osmo_fsm *fsm, uint32_t event)
osmo_stat_item_get_last
int32_t osmo_stat_item_get_last(const struct osmo_stat_item *item)
vty_go_parent
int vty_go_parent(struct vty *vty)
Definition: command.c:2468
cmd_execute_command_real
static int cmd_execute_command_real(vector vline, struct vty *vty, struct cmd_element **cmd)
Definition: command.c:2495
vty::index
void * index
For current referencing point of interface, route-map, access-list etc...
Definition: vty.h:119
osmo_gettimeofday
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
log_target_create_vty
struct log_target * log_target_create_vty(struct vty *vty)
Definition: logging_vty.c:88
osmo_stats_reporter_disable
int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep)
OSMO_STATS_CLASS_GLOBAL
OSMO_STATS_CLASS_GLOBAL
sched_vty_opts
static struct sched_vty_opts * sched_vty_opts
Definition: cpu_sched_vty.c:83
vty_is_active
bool vty_is_active(struct vty *vty)
Definition: telnet_interface.c:208
rate_ctr_for_each_counter
int rate_ctr_for_each_counter(struct rate_ctr_group *ctrg, rate_ctr_handler_t handle_counter, void *data)
osmo_stats_reporter::dest_port
int dest_port
vty::sb_len
size_t sb_len
How many subnegotiation characters have we received?
Definition: vty.h:148
osmo_stats_reporter_free
void osmo_stats_reporter_free(struct osmo_stats_reporter *srep)
cmd_describe_command_real
static vector cmd_describe_command_real(vector vline, struct vty *vty, int *status)
Definition: command.c:2035
vty_out_stat_item_group2
void vty_out_stat_item_group2(struct vty *vty, const char *prefix, struct osmo_stat_item_group *statg, bool skip_zero)
print a stat item group to given VTY
Definition: utils.c:288
GSMTAP_UDP_PORT
#define GSMTAP_UDP_PORT
RATE_CTR_INTV_HOUR
RATE_CTR_INTV_HOUR
print_attr_list
static void print_attr_list(struct vty *vty, unsigned int attr_mask)
Definition: command.c:3149
SHOW_STATS_STR
#define SHOW_STATS_STR
Definition: stats_vty.c:41
osmo_stat_item_handler
static int osmo_stat_item_handler(struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *vctx_)
Definition: utils.c:264
VTY_BIND_ADDR_DEFAULT
#define VTY_BIND_ADDR_DEFAULT
Definition: vty.c:99
client_data
static int client_data(struct osmo_fd *fd, unsigned int what)
Definition: telnet_interface.c:143
params
uint8_t params[0]
rate_ctr_desc
buffer::size
size_t size
Definition: buffer.c:45
log_add_target
void log_add_target(struct log_target *target)
vty_command
static int vty_command(struct vty *vty)
Definition: vty.c:453
_vector
Definition: vector.h:22
osmo_tcp_stats_config::batch_size
int batch_size
BASE_CMD_STR
#define BASE_CMD_STR
Definition: talloc_ctx_vty.c:167
vty_do_window_size
static void vty_do_window_size(struct vty *vty)
Definition: vty.c:771
log_category_name
const char * log_category_name(int subsys)
ACQUIRE_VTY_LOG_TGT_WITH_LOCK
#define ACQUIRE_VTY_LOG_TGT_WITH_LOCK(vty, tgt)
Get tgt with log lock acquired, return and release lock with warning if tgt is not found.
Definition: logging_vty.c:104
time
char time[12]
telnet_close_client
int telnet_close_client(struct osmo_fd *fd)
close a telnet connection
Definition: telnet_interface.c:119
vty_shell
int vty_shell(struct vty *vty)
Return if this VTY is a shell or not.
Definition: vty.c:261
vector_set_index
int vector_set_index(vector v, unsigned int i, void *val)
Definition: vector.c:144
NO_STR
#define NO_STR
Definition: command.h:375
vty_app_info::tall_ctx
void * tall_ctx
talloc context
Definition: vty.h:191
osmo_fsm_state
enable_node
struct cmd_node enable_node
Definition: command.c:99
cmd_node::node
int node
Node index.
Definition: command.h:127
vty_delete_char
static void vty_delete_char(struct vty *vty)
Definition: vty.c:931
signal.h
IPV6_MATCH
@ IPV6_MATCH
Definition: command.c:1107
OSMO_STRINGIFY
#define OSMO_STRINGIFY(x)
OSMO_SOCK_NAME_MAXLEN
#define OSMO_SOCK_NAME_MAXLEN
log_target::tgt_gsmtap
struct log_target::@8::@14 tgt_gsmtap
RANGE_MATCH
@ RANGE_MATCH
Definition: command.c:1108
log_set_print_filename2
void log_set_print_filename2(struct log_target *target, enum log_filename_type lft)
LOGL_FATAL
#define LOGL_FATAL
timer_doc_string
static char * timer_doc_string(const char *prefix, const char *suffix)
Definition: tdef_vty.c:345
telnet_backward_char
static const char telnet_backward_char
Definition: vty.c:486
tall_vty_cmd_ctx
void * tall_vty_cmd_ctx
Definition: command.c:68
osmo_stats_reporter::flush_period
unsigned int flush_period
OSMO_STRINGIFY_VAL
#define OSMO_STRINGIFY_VAL(x)
vty_ref_gen_mode_names
const struct value_string vty_ref_gen_mode_names[]
Definition: command.c:904
ANY_MATCH
@ ANY_MATCH
Definition: command.c:1102
telnet_connection::dbg
struct log_target * dbg
logging target associated with this telnet connection
Definition: telnet_interface.h:41
host::advanced
int advanced
Flags for services.
Definition: command.h:61
CMD_ATTR_NODE_EXIT
@ CMD_ATTR_NODE_EXIT
Definition: command.h:152
log_parse_level
int log_parse_level(const char *lvl)
rctr_vty_ctx::skip_zero
bool skip_zero
Definition: stats_vty.c:612
telnet_new_connection
static int telnet_new_connection(struct osmo_fd *fd, unsigned int what)
Definition: telnet_interface.c:166
sched_vty_opts
Definition: cpu_sched_vty.c:76
rate_ctr_handler_fmt
static int rate_ctr_handler_fmt(struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *vctx_)
Definition: utils.c:111
loglevel_strs
const struct value_string loglevel_strs[]
EVERYTHING_STR
#define EVERYTHING_STR
Definition: logging_vty.c:59
vty::length
int length
Command length.
Definition: vty.h:103
cmd_node::func
int(* func)(struct vty *)
Node's configuration write function.
Definition: command.h:136
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
vty::indent
char * indent
When reading from a config file, these are the indenting characters expected for children of the curr...
Definition: vty.h:168
vty_app_info::name
const char * name
name of the application
Definition: vty.h:185
rate_ctr_group::desc
const struct rate_ctr_group_desc * desc
CMD_COMPLETE_FULL_MATCH
#define CMD_COMPLETE_FULL_MATCH
Definition: command.h:202
install_node_bare
static void install_node_bare(struct cmd_node *node, int(*func)(struct vty *))
Install top node of command vector, without adding basic node commands.
Definition: command.c:178
CMD_VARARG
#define CMD_VARARG(S)
Definition: command.h:359
CMD_ERR_NO_MATCH
#define CMD_ERR_NO_MATCH
Definition: command.h:197
config_write_sched
static int config_write_sched(struct vty *vty)
Definition: cpu_sched_vty.c:575
rctr_vty_ctx
Definition: stats_vty.c:610
osmo_fsm::name
const char * name
len
static size_t len(const char *str)
Definition: command.c:2821
vty_stop_input
static void vty_stop_input(struct vty *vty)
Definition: vty.c:1269
log_target_file_switch_to_wqueue
int log_target_file_switch_to_wqueue(struct log_target *target)
install_default
void install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()")
Deprecated, now happens implicitly when calling install_node().
Definition: command.c:4293
cmd_execute_command
int cmd_execute_command(vector, struct vty *, struct cmd_element **, int)
Definition: command.c:2677
CFG_REPORTER_STR
#define CFG_REPORTER_STR
Definition: stats_vty.c:39
cmd_element::doc
const char * doc
Documentation of this command.
Definition: command.h:178
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
Definition: command.c:3561
vty_pop_parent
static bool vty_pop_parent(struct vty *vty)
Definition: command.c:2433
vty_backward_pure_word
static void vty_backward_pure_word(struct vty *vty)
Definition: vty.c:858
log_category
log_target_file_switch_to_stream
int log_target_file_switch_to_stream(struct log_target *target)
OSMO_STATS_REPORTER_LOG
OSMO_STATS_REPORTER_LOG
cmd_entry_function
static const char * cmd_entry_function(const char *src, const char *dst)
Definition: command.c:1918
vty_beginning_of_line
static void vty_beginning_of_line(struct vty *vty)
Definition: vty.c:573
g
struct osmo_tdef_group * g
Definition: tdef_vty.c:274
VTY_CLOSED
@ VTY_CLOSED
Definition: vty.h:43
osmo_tdef_vty_groups_init
void osmo_tdef_vty_groups_init(unsigned int parent_cfg_node, struct osmo_tdef_group *groups)
Convenience implementation for keeping a fixed set of timer groups in a program.
Definition: tdef_vty.c:364
vty::hist
char * hist[VTY_MAXHIST]
Histry of command.
Definition: vty.h:109
Vvty_serv_thread
vector Vvty_serv_thread
Definition: vty.c:91
LOG_FILENAME_PATH
LOG_FILENAME_PATH
BUFFER_PENDING
@ BUFFER_PENDING
Definition: buffer.h:68
telnet_connection::priv
void * priv
private data pointer passed through
Definition: telnet_interface.h:35
OSMO_ASSERT
#define OSMO_ASSERT(exp)
_OSMO_CORE_LIB_ATTR_COUNT
@ _OSMO_CORE_LIB_ATTR_COUNT
Definition: command.h:171
config_write_log_single
static int config_write_log_single(struct vty *vty, struct log_target *tgt)
Definition: logging_vty.c:1001
vty_ref_gen_mode_desc
const struct value_string vty_ref_gen_mode_desc[]
Definition: command.c:911
vty_bind_addr
static const char * vty_bind_addr
Definition: vty.c:98
log_parse_category_mask
void log_parse_category_mask(struct log_target *target, const char *_mask)
osmo_stat_item_group
cfg_stats_node
struct cmd_node cfg_stats_node
Definition: stats_vty.c:59
LOG_FILENAME_BASENAME
LOG_FILENAME_BASENAME
vty_signal_data::event
enum event event
Definition: vty.h:258
server_socket
static struct osmo_fd server_socket
Definition: telnet_interface.c:57
vty_dump_xml_ref_to_vty
static int vty_dump_xml_ref_to_vty(struct vty *vty)
Definition: command.c:886
sched_vty_thread_id
sched_vty_thread_id
Definition: cpu_sched_vty.c:59
write_config_file
static int write_config_file(const char *config_file, char **outpath)
Definition: command.c:3357
log_target_create
struct log_target * log_target_create(void)
rate_ctr_group_desc::class_id
int class_id
cmp_node
static int cmp_node(const void *p, const void *q)
Definition: command.c:195
utils.h
xml_escape
static char * xml_escape(const char *inp)
Definition: command.c:558
osmo_stat_item_group::idx
unsigned int idx
cmd_lib_attr_letters
static const char cmd_lib_attr_letters[32]
Definition: command.c:674
cmd_lib_attr_desc
static const char *const cmd_lib_attr_desc[32]
Definition: command.c:661
vty_kill_line_from_beginning
static void vty_kill_line_from_beginning(struct vty *)
Definition: vty.c:991
vty::iac_sb_in_progress
unsigned char iac_sb_in_progress
IAC SB (option subnegotiation) handling.
Definition: vty.h:138
entry
struct llist_head entry
set_srep_parameter_str
static int set_srep_parameter_str(struct vty *vty, int(*fun)(struct osmo_stats_reporter *, const char *), const char *val, const char *param_name)
Definition: stats_vty.c:80
osmo_stat_item_get_desc
const struct osmo_stat_item_desc * osmo_stat_item_get_desc(struct osmo_stat_item *item)
osmo_tdef::val
unsigned long val
config_end_cmd
struct cmd_element config_end_cmd
vector_active
#define vector_active(V)
Definition: vector.h:39
CMD_ATTR_LIB_COMMAND
@ CMD_ATTR_LIB_COMMAND
Definition: command.h:153
osmo_strrb_elements
size_t osmo_strrb_elements(const struct osmo_strrb *rb)
MAXPATHLEN
#define MAXPATHLEN
Definition: command.c:56
telnet_interface.h
osmo_talloc_vty_add_cmds
void osmo_talloc_vty_add_cmds(void)
Install VTY commands for talloc context introspection.
Definition: talloc_ctx_vty.c:247
desc::cmd
const char * cmd
Command string.
Definition: command.h:190
OSMO_SCCP_LIB_ATTR_RSTRT_ASP
@ OSMO_SCCP_LIB_ATTR_RSTRT_ASP
Definition: command.h:166
cmd_complete_command
char ** cmd_complete_command(vector vline, struct vty *vty, int *status)
Definition: command.c:2396
vty_read_config_filep
int vty_read_config_filep(FILE *confp, void *priv)
Read up VTY configuration from a file stream.
Definition: vty.c:1514
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
config
write Write running configuration to or terminal n Write configuration to the copy running config startup config
Definition: command.c:3550
LOG_TGT_TYPE_STDERR
LOG_TGT_TYPE_STDERR
cmd_gflag_mask
static const char * cmd_gflag_mask(const struct cmd_element *cmd)
Definition: command.c:3273
osmo_stat_item
log_target_find
struct log_target * log_target_find(enum log_target_type type, const char *fname)
osmo_fd_register
int osmo_fd_register(struct osmo_fd *fd)
sched_node
static struct cmd_node sched_node
Definition: cpu_sched_vty.c:85
osmo_stats_reporter_list
struct llist_head osmo_stats_reporter_list
proc_tid_exists
static bool proc_tid_exists(pid_t tid)
Definition: cpu_sched_vty.c:197
buffer_getstr
char * buffer_getstr(struct buffer *b)
Definition: buffer.c:100
log_target::print_filename_pos
enum log_filename_pos print_filename_pos
DEFUN
DEFUN(show_talloc_ctx, show_talloc_ctx_cmd, BASE_CMD_STR, BASE_CMD_DESCR)
Definition: talloc_ctx_vty.c:179
osmo_fsm_inst::children
struct llist_head children
osmo_fd::cb
int(* cb)(struct osmo_fd *fd, unsigned int what)
vty_hist_add
static void vty_hist_add(struct vty *vty)
Definition: vty.c:587
set_sched_rr
static int set_sched_rr(unsigned int prio)
Definition: cpu_sched_vty.c:465
vty_dump_element
static int vty_dump_element(const struct cmd_element *cmd, print_func_t print_func, void *data, const char *newline)
Definition: command.c:684
cmd_free_strvec
void cmd_free_strvec(vector)
Free allocated string vector.
Definition: command.c:330
NO_FORCE_ALL_STR
#define NO_FORCE_ALL_STR
Definition: logging_vty.c:48
OSMO_TDEF_VTY_ARG_SET_OPTIONAL
#define OSMO_TDEF_VTY_ARG_SET_OPTIONAL
Definition: tdef_vty.h:54
buffer_reset
void buffer_reset(struct buffer *b)
Definition: buffer.c:127
generate_cpu_hex_mask
static int generate_cpu_hex_mask(char *str, size_t str_buf_size, cpu_set_t *cpuset, size_t cpuset_size)
Definition: cpu_sched_vty.c:154
SKIP_ZERO_STR
#define SKIP_ZERO_STR
Definition: stats_vty.c:42
VTY_NEWLINE
#define VTY_NEWLINE
Definition: vty.h:175
cmd_element
Structure of a command element.
Definition: command.h:175
log_info_cat::name
const char * name
osmo_fsm::log_subsys
int log_subsys
msgb.h
node_type
node_type
There are some command levels which called from command node.
Definition: command.h:73
log_set_print_category_hex
void log_set_print_category_hex(struct log_target *target, int print_category_hex)
IPV4_MATCH
@ IPV4_MATCH
Definition: command.c:1105
vector_only_wrapper_free
void vector_only_wrapper_free(vector v)
Definition: vector.c:58
DEFUN
DEFUN(config_who, config_who_cmd, "who", "Display who is on vty\n")
Definition: vty.c:1630
osmo_clock_gettime
int osmo_clock_gettime(clockid_t clk_id, struct timespec *tp)
check_base
static int check_base(const char *str)
Definition: command.c:1489
vty_cwd
char * vty_cwd
Definition: vty.c:93
osmo_vty_write_config_file
int osmo_vty_write_config_file(const char *filename)
Write the current running config to a given file.
Definition: command.c:4357
CMD_SUCCESS
return CMD_SUCCESS
Definition: tdef_vty.c:283
LOG_LEVEL_STRS
#define LOG_LEVEL_STRS
Definition: logging_vty.c:52
telnet_connection::entry
struct llist_head entry
linked list header for internal management
Definition: telnet_interface.h:33
vty::cp
int cp
Command cursor point.
Definition: vty.h:100
log_info
osmo_talloc_asprintf
#define osmo_talloc_asprintf(ctx, dest, fmt, args ...)
llist_for_each_entry_safe
#define llist_for_each_entry_safe(pos, n, head, member)
WALK_FILTER_TREE
@ WALK_FILTER_TREE
Definition: talloc_ctx_vty.c:36
buffer::tail
struct buffer_data * tail
Definition: buffer.c:42
log_target_create_stderr
struct log_target * log_target_create_stderr(void)
vector_lookup
void * vector_lookup(vector, unsigned int)
Definition: vector.c:157
MAX_CHUNKS
#define MAX_CHUNKS
osmo_fsm_inst::proc
struct osmo_fsm_inst::@0 proc
CMD_ERR_NOTHING_TODO
#define CMD_ERR_NOTHING_TODO
Definition: command.h:201
osmo_fsm_inst::child
struct llist_head child
host::password
char * password
Password for vty interface.
Definition: command.h:44
osmo_tdef_vty_out_all_va
void osmo_tdef_vty_out_all_va(struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt, va_list va)
Write to VTY the current status of all given timers.
Definition: tdef_vty.c:215
get_string_value
int get_string_value(const struct value_string *vs, const char *str)
vty_get_bind_addr
const char * vty_get_bind_addr(void)
Definition: vty.c:1677
strrb.h
osmo_tdef::desc
const char * desc
RATE_CTR_INTV_MIN
RATE_CTR_INTV_MIN
vty_end_config
static void vty_end_config(struct vty *vty)
Definition: vty.c:902
OSMO_TDEF_VTY_DOC_T
#define OSMO_TDEF_VTY_DOC_T
Definition: tdef_vty.h:43
config_list_cmd
struct cmd_element config_list_cmd
log_set_print_category
void log_set_print_category(struct log_target *target, int print_category)
get_value_string_or_null
const char * get_value_string_or_null(const struct value_string *vs, uint32_t val)
rate_ctr.h
telnet_escape_char
static const char telnet_escape_char
Definition: vty.c:488
osmo_strrb_get_nth
const char * osmo_strrb_get_nth(const struct osmo_strrb *rb, unsigned int string_index)
vty_config_unlock
int vty_config_unlock(struct vty *)
Unlock the configuration from a given VTY.
Definition: vty.c:392
VECTOR_MIN_SIZE
#define VECTOR_MIN_SIZE
Definition: vector.h:29
osmo_fd_unregister
void osmo_fd_unregister(struct osmo_fd *fd)
osmo_stat_item_group_desc::group_description
const char * group_description
cmd_element::cmdsize
unsigned int cmdsize
Command index count.
Definition: command.h:181
vector_empty_slot
int vector_empty_slot(vector v)
Definition: vector.c:113
tall_vty_vec_ctx
void * tall_vty_vec_ctx
Definition: vector.c:34
vty_bind
log_set_print_timestamp
void log_set_print_timestamp(struct log_target *target, int print_timestamp)
cmd_attr_desc
static const struct value_string cmd_attr_desc[]
Definition: command.c:632
osmo_stats_reporter::type
enum osmo_stats_reporter_type type
log_target::print_filename2
enum log_filename_type print_filename2
VTY_CMD_USR_ATTR_NUM
#define VTY_CMD_USR_ATTR_NUM
Definition: vty.h:33
OSMO_FD_READ
#define OSMO_FD_READ
vty_out_fsm
void vty_out_fsm(struct vty *vty, struct osmo_fsm *fsm)
Print information about a FSM [class] to the given VTY.
Definition: fsm_vty.c:83
osmo_tdef_group
vty_execute
static int vty_execute(struct vty *vty)
Definition: vty.c:717
CFG_STATS_NODE
@ CFG_STATS_NODE
Configure the statistics.
Definition: command.h:82
CONFIGFILE_MASK
#define CONFIGFILE_MASK
Definition: command.c:66
NO_MATCH
@ NO_MATCH
Definition: command.c:1101
log_info::print_fn
log_print_filters * print_fn
vty_out_statistics_full
void vty_out_statistics_full(struct vty *vty, const char *prefix)
Definition: utils.c:366
osmo_tdefs_reset
void osmo_tdefs_reset(struct osmo_tdef *tdefs)
cmd_node::name
char name[64]
Human-readable ID of this node.
Definition: command.h:144
osmo_stderr_target
struct log_target * osmo_stderr_target
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
vty_out_rate_ctr_group
void vty_out_rate_ctr_group(struct vty *vty, const char *prefix, struct rate_ctr_group *ctrg)
Definition: utils.c:89
vty_save_cwd
static void vty_save_cwd(void)
Definition: vty.c:1806
vty_forward_kill_word
static void vty_forward_kill_word(struct vty *vty)
Definition: vty.c:998
osmo_stats_reporter_create_statsd
struct osmo_stats_reporter * osmo_stats_reporter_create_statsd(const char *name)
osmo_stats_tcp_set_interval
int osmo_stats_tcp_set_interval(int interval)
CMD_ERR_AMBIGUOUS
#define CMD_ERR_AMBIGUOUS
Definition: command.h:198
vty_new
struct vty * vty_new(void)
Allocate a new vty interface structure.
Definition: vty.c:116
vty::lines
int lines
Configure lines.
Definition: vty.h:156
OSMO_STATS_REPORTER_STATSD
OSMO_STATS_REPORTER_STATSD
CMD_IPV4_PREFIX
#define CMD_IPV4_PREFIX(S)
Definition: command.h:363
osmo_fsm_vty_add_cmds
void osmo_fsm_vty_add_cmds(void)
Install VTY commands for FSM introspection This installs a couple of VTY commands for introspection o...
Definition: fsm_vty.c:202
LOG_FILENAME_NONE
LOG_FILENAME_NONE
vty.h
vty_get_bind_port
int vty_get_bind_port(int default_port)
Returns configured port passed to the 'line vty'/'bind' command or default_port.
Definition: vty.c:1684
osmo_tdef
ALIAS
ALIAS(config_write_file, config_write_cmd, "write", "Write running configuration to memory, network, or terminal\n") ALIAS(config_write_file
EXACT_MATCH
@ EXACT_MATCH
Definition: command.c:1111
osmo_stats_reporter
OTC_GLOBAL
#define OTC_GLOBAL
vty_dont_linemode
static void vty_dont_linemode(struct vty *vty)
Definition: vty.c:763
buffer_free
void buffer_free(struct buffer *b)
Definition: buffer.c:93
vty_forward_char
static void vty_forward_char(struct vty *vty)
Definition: vty.c:555
ATTR_TYPE_GLOBAL
@ ATTR_TYPE_GLOBAL
Definition: command.c:3144
osmo_tcp_stats_config
vty_kill_line
static void vty_kill_line(struct vty *vty)
Definition: vty.c:971
MAXPATHLEN
#define MAXPATHLEN
Definition: vty.c:73
start
uint32_t start
vty_init_vtysh
void vty_init_vtysh(void)
Definition: vty.c:1834
log_target_create_file
struct log_target * log_target_create_file(const char *fname)
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)
vty_telnet_option
static int vty_telnet_option(struct vty *vty, unsigned char *buf, int nbytes)
Definition: vty.c:618
log_deprecated_func
static int log_deprecated_func(struct cmd_element *cmd, struct vty *vty, int argc, const char *argv[])
Definition: logging_vty.c:1120
log_target_create_syslog
struct log_target * log_target_create_syslog(const char *ident, int option, int facility)
telnet_space_char
static const char telnet_space_char
Definition: vty.c:487
sched_vty_opts::tall_ctx
void * tall_ctx
Definition: cpu_sched_vty.c:77
vty_backward_char
static void vty_backward_char(struct vty *vty)
Definition: vty.c:564
buffer_put
void buffer_put(struct buffer *b, const void *p, size_t size)
Definition: buffer.c:162
vector_lookup_ensure
void * vector_lookup_ensure(vector v, unsigned int i)
Definition: vector.c:165
VTY_WRITE
@ VTY_WRITE
Definition: vty.h:42
log_target_create_rb
struct log_target * log_target_create_rb(size_t size)
cpu_affinity_it::entry
struct llist_head entry
Definition: cpu_sched_vty.c:68
vty_clear_buf
static void vty_clear_buf(struct vty *vty)
Definition: vty.c:110
vty_complete_command
static void vty_complete_command(struct vty *vty)
Definition: vty.c:1045
osmo_fsm_inst
vty::fd
int fd
File descripter of this vty.
Definition: vty.h:82
SH_FSMI_STR
#define SH_FSMI_STR
Definition: fsm_vty.c:127
SCHED_VTY_THREAD_UNKNOWN
@ SCHED_VTY_THREAD_UNKNOWN
Definition: cpu_sched_vty.c:64
LOG_TGT_TYPE_SYSLOG
LOG_TGT_TYPE_SYSLOG
LLIST_HEAD
LLIST_HEAD(active_connections)
DEFUN_ATTR
DEFUN_ATTR(cfg_sched_cpu_affinity, cfg_sched_cpu_affinity_cmd, "cpu-affinity (self|all|<0-4294967295>|THREADNAME) CPUHEXMASK [delay]", "Set CPU affinity mask on a (group of) thread(s)\n" "Set CPU affinity mask on thread running the VTY\n" "Set CPU affinity mask on all process' threads\n" "Set CPU affinity mask on a thread with specified PID\n" "Set CPU affinity mask on a thread with specified thread name\n" "CPU affinity mask\n" "If set, delay applying the affinity mask now and let the app handle it at a later point\n", CMD_ATTR_IMMEDIATE)
Definition: cpu_sched_vty.c:375
cmd_node
Node which has some commands and prompt string and configuration function pointer .
Definition: command.h:125
install_element_ve
void install_element_ve(struct cmd_element *cmd)
Definition: command.c:1009
log_category::loglevel
uint8_t loglevel
OSMO_TDEF_VTY_DOC_SET
#define OSMO_TDEF_VTY_DOC_SET
Definition: tdef_vty.h:53
DEFUN
DEFUN(show_fsms, show_fsms_cmd, "show fsm all", SH_FSM_STR "Display a list of all registered finite state machines\n")
Definition: fsm_vty.c:129
DEFUN
DEFUN(cfg_stats_reporter_local_ip, cfg_stats_reporter_local_ip_cmd, "local-ip ADDR", "Set the IP address to which we bind locally\n" "IP Address\n")
Definition: stats_vty.c:119
length
uint8_t length
vty_escape_map
static void vty_escape_map(unsigned char c, struct vty *vty)
Definition: vty.c:1286
network
write Write running configuration to network
Definition: command.c:3545
osmo_tdef::unit
enum osmo_tdef_unit unit
vty_out_context::skip_zero
bool skip_zero
Definition: utils.c:48
log_target::use_color
unsigned int use_color
CONF_BACKUP_EXT
#define CONF_BACKUP_EXT
Definition: command.h:406
osmo_stat_item_desc::description
const char * description
vty_out_rate_ctr_group_fmt2
void vty_out_rate_ctr_group_fmt2(struct vty *vty, const char *fmt, struct rate_ctr_group *ctrg, bool skip_zero)
print a rate counter group to given VTY, formatting the line for each counter according to a format s...
Definition: utils.c:227
osmo_counter
VTY_FILE
@ VTY_FILE
Definition: vty.h:54
osmo_asciidoc_escape
char * osmo_asciidoc_escape(const char *inp)
escape all special asciidoc symbols
Definition: command.c:515
CMD_ATTR_IMMEDIATE
@ CMD_ATTR_IMMEDIATE
Definition: command.h:151
asciidoc_counter_generate
static void asciidoc_counter_generate(struct vty *vty)
Definition: stats_vty.c:471
DEFUN
DEFUN(config_terminal, config_terminal_cmd, "configure terminal", "Configuration from vty interface\n" "Configuration terminal\n")
Definition: command.c:2980
osmo_fsm
buffer_flush_all
buffer_status_t buffer_flush_all(struct buffer *b, int fd)
Definition: buffer.c:199
osmo_tdef_vty_groups_write
void osmo_tdef_vty_groups_write(struct vty *vty, const char *indent)
Write the global osmo_tdef_group configuration to VTY, as previously passed to osmo_tdef_vty_groups_i...
Definition: tdef_vty.c:387
llist_del
static void llist_del(struct llist_head *entry)
osmo_stats_reporter_find
struct osmo_stats_reporter * osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name)
vty::priv
void * priv
private data, specified by creator
Definition: vty.h:79
host_config_set
void host_config_set(const char *)
Definition: command.c:4280
buffer_new
struct buffer * buffer_new(void *ctx, size_t size)
Definition: buffer.c:71
cmd_lcd
static int cmd_lcd(char **matched)
Definition: command.c:2213
osmo_tdef::default_val
const unsigned long default_val
cmd_element::func
int(* func)(struct cmd_element *, struct vty *, int, const char *[])
Definition: command.h:177
level
uint8_t level
vty::max
int max
Command max length.
Definition: vty.h:106
install_lib_element_ve
void install_lib_element_ve(struct cmd_element *cmd)
Definition: command.c:1016
cmd_ipv4_prefix_match
static enum match_type cmd_ipv4_prefix_match(const char *str)
Definition: command.c:1167
tall_log_ctx
void * tall_log_ctx
buffer_new
struct buffer * buffer_new(void *ctx, size_t)
Definition: buffer.c:71
BASE_CMD_DESCR
#define BASE_CMD_DESCR
Definition: talloc_ctx_vty.c:170
osmo_tdef_vty_write
void osmo_tdef_vty_write(struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt,...)
Write current timer configuration arguments to the vty.
Definition: tdef_vty.c:250
vty_out_context
Definition: utils.c:44
buffer_data::cp
size_t cp
Definition: buffer.c:53
cfg_no_description_cmd
struct cmd_element cfg_no_description_cmd
osmo_vty_save_config_file
int osmo_vty_save_config_file(void)
Save the current state to the config file.
Definition: command.c:4375
log_set_print_level
void log_set_print_level(struct log_target *target, int print_level)
vty_parent_node::node
int node
Node status of this vty.
Definition: vty.h:66
log_target::print_ext_timestamp
unsigned int print_ext_timestamp
log_target::loglevel
uint8_t loglevel
data
uint8_t data[0]
osmo_stats_config
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)
log_info::num_cat_user
unsigned int num_cat_user
cpu_affinity_it::cpuset_size
size_t cpuset_size
Definition: cpu_sched_vty.c:72
buffer_data::next
struct buffer_data * next
Definition: buffer.c:50
vty_dump_nodes
static int vty_dump_nodes(print_func_t print_func, void *data, const char *newline, unsigned char gflag_mask, bool match)
Definition: command.c:798
osmo_cpu_sched_vty_apply_localthread
int osmo_cpu_sched_vty_apply_localthread(void)
Apply cpu-affinity on calling thread based on VTY configuration.
Definition: cpu_sched_vty.c:628
AUTH_ENABLE_NODE
@ AUTH_ENABLE_NODE
Authentication mode for change enable.
Definition: command.h:76
vty_transpose_chars
static void vty_transpose_chars(struct vty *vty)
Definition: vty.c:1016
LOGL_INFO
#define LOGL_INFO
install_node
void install_node(struct cmd_node *, int(*)(struct vty *))
Install top node of command vector.
Definition: command.c:188
mode
uint8_t mode
log_target
default_motd
const char * default_motd
Definition: command.c:112
CONFIG_NODE
@ CONFIG_NODE
Config node.
Definition: command.h:78
telnet_connection
A telnet connection.
Definition: telnet_interface.h:31
procname2pid
static enum sched_vty_thread_id procname2pid(pid_t *res_pid, const char *str, bool applynow)
Definition: cpu_sched_vty.c:278
logging_vty_add_deprecated_subsys
void logging_vty_add_deprecated_subsys(void *ctx, const char *name)
Definition: logging_vty.c:1126
CMD_VARIABLE
#define CMD_VARIABLE(S)
Definition: command.h:358
log_info::cat
const struct log_info_cat * cat
vector_count
unsigned int vector_count(vector v)
Definition: vector.c:186
rate_ctr_group_handler
static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_)
Definition: stats_vty.c:615
stats_tcp.h
vector_init
vector vector_init(unsigned int size)
Definition: vector.c:37
match_type
match_type
Definition: command.c:1100
vector_copy
vector vector_copy(vector v)
Definition: vector.c:74
log_target::sd_journal
struct log_target::@8::@15 sd_journal
view_node
struct cmd_node view_node
Definition: command.c:87
MAX_FLUSH
#define MAX_FLUSH
osmo_tdef_groups_for_each
osmo_tdef_groups_for_each(g, global_tdef_groups)
Definition: tdef_vty.c:279
vector_free
void vector_free(vector v)
Definition: vector.c:68
command.h
rate_ctr_group_handler
static int rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *vctx_)
Definition: utils.c:239
osmo_stats_vty_add_cmds
void osmo_stats_vty_add_cmds()
Add stats related commands to the VTY Call this once during your application initialization if you wo...
Definition: stats_vty.c:745
osmo_stats_vty2srep
static struct osmo_stats_reporter * osmo_stats_vty2srep(struct vty *vty)
Definition: stats_vty.c:72
CFG_STATS_STR
#define CFG_STATS_STR
Definition: stats_vty.c:38
cmd_element::strvec
vector strvec
Pointing out each description vector.
Definition: command.h:180
SCHED_VTY_THREAD_ALL
@ SCHED_VTY_THREAD_ALL
Definition: cpu_sched_vty.c:61
CMD_ERR_INVALID_INDENT
#define CMD_ERR_INVALID_INDENT
Definition: command.h:206
CONTROL
#define CONTROL(X)
Definition: vty.c:1280
log_target::facility
int facility
SHOW_STR
#define SHOW_STR
Definition: command.h:372
log_target::print_tid
unsigned int print_tid
buffer_putstr
void buffer_putstr(struct buffer *b, const char *c)
Definition: buffer.c:192
log_target::print_level
bool print_level
osmo_fsm_find_by_name
struct osmo_fsm * osmo_fsm_find_by_name(const char *name)
osmo_stat_item_desc::unit
const char * unit
STATE_MASK
#define STATE_MASK
Definition: command.c:1246
vty_app_info::version
const char * version
version string of the application
Definition: vty.h:187
osmo_stats_reporter::dest_addr_str
char * dest_addr_str
OSMO_STRLCPY_ARRAY
#define OSMO_STRLCPY_ARRAY(array, src)
osmo_fsm::states
const struct osmo_fsm_state * states
log_info::num_cat
unsigned int num_cat
rate_ctr_group
CFG_LOG_NODE
@ CFG_LOG_NODE
Configure the logging.
Definition: command.h:81
talloc_ctx_walk
static void talloc_ctx_walk(const char *ctx, const char *depth, struct walk_cb_params *params)
Parse talloc context and depth values from a VTY command.
Definition: talloc_ctx_vty.c:141
log_target_create_systemd
struct log_target * log_target_create_systemd(bool raw)
desc_unique_string
static int desc_unique_string(vector v, const char *str)
Definition: command.c:2010
vty_buffer_reset
static void vty_buffer_reset(struct vty *vty)
Definition: vty.c:1310
vty_parent_node::priv
void * priv
private data, specified by creator
Definition: vty.h:63
rate_ctr_group_desc::group_description
const char * group_description
vty_parent_node::entry
struct llist_head entry
Definition: vty.h:60
CMD_RANGE
#define CMD_RANGE(S)
Definition: command.h:360
vty_signal_data
Definition: vty.h:257
telnet_init
int telnet_init(void *tall_ctx, void *priv, int port)
Initialize telnet based VTY interface listening to 127.0.0.1.
Definition: telnet_interface.c:68
pad_append_str
static char * pad_append_str(char *s, const char *a, int minwidth)
Definition: utils.c:96
vty_will_echo
static void vty_will_echo(struct vty *vty)
Definition: vty.c:747
log_target::tgt_file
struct log_target::@8::@10 tgt_file
TCP_STATS_DEFAULT_INTERVAL
#define TCP_STATS_DEFAULT_INTERVAL
host::motdfile
char * motdfile
Definition: command.h:66
osmo_tdef_val_in_range
bool osmo_tdef_val_in_range(struct osmo_tdef *tdef, unsigned long new_val)
vty_describe_fold
static void vty_describe_fold(struct vty *vty, int cmd_width, unsigned int desc_width, struct desc *desc)
Definition: vty.c:1118
vty_insert_word_overwrite
static void vty_insert_word_overwrite(struct vty *vty, char *str)
Definition: vty.c:545
vector_slot
#define vector_slot(V, I)
Definition: vector.h:34
vty_install_default
void vty_install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly with install_node()")
Deprecated, now happens implicitly when calling install_node().
Definition: command.c:4300
telnet_connection::fd
struct osmo_fd fd
filedsecriptor (socket )
Definition: telnet_interface.h:37
vty_clear_screen
static void vty_clear_screen(struct vty *vty)
Definition: vty.c:889
local_sysl_map
static const int local_sysl_map[]
Definition: logging_vty.c:639
_cfg_log_syslog
static int _cfg_log_syslog(struct vty *vty, int facility)
Definition: logging_vty.c:653
sysl_level_names
static struct value_string sysl_level_names[]
Definition: logging_vty.c:687
LOG_FILENAME_POS_LINE_END
LOG_FILENAME_POS_LINE_END
osmo_tdef_unit_name
static const char * osmo_tdef_unit_name(enum osmo_tdef_unit val)
cmd_attr_get_flag
static char cmd_attr_get_flag(unsigned int attr)
Definition: command.c:646
vty::width
int width
Window width.
Definition: vty.h:151
OSMO_ABIS_LIB_ATTR_LINE_UPD
@ OSMO_ABIS_LIB_ATTR_LINE_UPD
Definition: command.h:168
vty_flush
void vty_flush(struct vty *vty)
Definition: vty.c:211
log_set_use_color
void log_set_use_color(struct log_target *target, int use_color)
tdef_vty.h
vty_close
void vty_close(struct vty *)
Close a given vty interface.
Definition: vty.c:218
vty_next_line
static void vty_next_line(struct vty *vty)
Definition: vty.c:798
vty::sb_buf
unsigned char sb_buf[TELNET_NAWS_SB_LEN]
sub-negotiation buffer
Definition: vty.h:144
misc.h
cmd_describe_command
vector cmd_describe_command(vector vline, struct vty *vty, int *status)
Definition: command.c:2182
LOG_FILENAME_POS_HEADER_END
LOG_FILENAME_POS_HEADER_END
BUFFER_DATA_FREE
#define BUFFER_DATA_FREE(D)
Definition: buffer.c:68
buffer_add
static struct buffer_data * buffer_add(struct buffer *b)
Definition: buffer.c:140
vty
Internal representation of a single VTY.
Definition: vty.h:74
config_write_stats
static int config_write_stats(struct vty *vty)
Definition: stats_vty.c:724
vty::type
enum vty_type type
Is this vty connect to file or not.
Definition: vty.h:85
is_cmd_ambiguous
static int is_cmd_ambiguous(char *command, vector v, int index, enum match_type type)
Definition: command.c:1784
osmo_counters_count
int osmo_counters_count()
vty::hindex
int hindex
History insert end point.
Definition: vty.h:115
log_set_print_tid
void log_set_print_tid(struct log_target *target, int print_tid)
__attribute__
static __attribute__((constructor))
Definition: command.c:4468
STATS_STR
#define STATS_STR
Definition: stats_vty.c:44
pad_append_ctr
static char * pad_append_ctr(char *s, uint64_t ctr, int minwidth)
Definition: utils.c:104
config_write_stats_reporter
static int config_write_stats_reporter(struct vty *vty, struct osmo_stats_reporter *srep)
Definition: stats_vty.c:663
LEVEL_STR
#define LEVEL_STR
Definition: logging_vty.c:41
log_del_target
void log_del_target(struct log_target *target)
STATE_START
#define STATE_START
Definition: command.c:1240
TELNET_NAWS_SB_LEN
#define TELNET_NAWS_SB_LEN
Definition: vty.h:142
copy_runningconfig_startupconfig_cmd
write Write running configuration to or terminal n Write configuration to the copy_runningconfig_startupconfig_cmd
Definition: command.c:3549
vty_current_index
void * vty_current_index(struct vty *vty)
return the current index of a given VTY
Definition: vty.c:362
config_from_file
int config_from_file(struct vty *, FILE *)
Definition: command.c:2847
cmd_prompt
const char * cmd_prompt(enum node_type)
Return prompt character of specified node.
Definition: command.c:502
cmd_make_descvec
static vector cmd_make_descvec(const char *string, const char *descstr)
New string vector.
Definition: command.c:381
vty_clear_parents
static void vty_clear_parents(struct vty *vty)
Definition: command.c:2448
tall_telnet_ctx
static void * tall_telnet_ctx
Definition: telnet_interface.c:52
osmo_tdef::min_val
unsigned long min_val
WALK_FILTER_REGEXP
@ WALK_FILTER_REGEXP
Definition: talloc_ctx_vty.c:35
osmo_stats_reporter_set_max_class
int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep, enum osmo_stats_class class_id)
CMD_WARNING
#define CMD_WARNING
Definition: command.h:196
value_string::str
const char * str
buffer_flush_available
buffer_status_t buffer_flush_available(struct buffer *b, int fd)
Definition: buffer.c:379
osmo_fsm_inst::parent
struct osmo_fsm_inst * parent
VTY_REF_GEN_MODE_DEFAULT
@ VTY_REF_GEN_MODE_DEFAULT
Default mode: all commands except deprecated and hidden.
Definition: command.h:473
check_element_exists
static int check_element_exists(struct cmd_node *cnode, const char *cmdstring)
Definition: command.c:962
asciidoc_osmo_stat_item_group_handler
static int asciidoc_osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_)
Definition: stats_vty.c:556
DEFUN_HIDDEN
DEFUN_HIDDEN(do_echo, echo_cmd, "echo .MESSAGE", "Echo a message back to the vty\n" "The message to echo\n")
Definition: command.c:3876
get_num_cpus
static int get_num_cpus()
Definition: cpu_sched_vty.c:92
telnet_init_dynif
int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port)
Initialize telnet based VTY interface.
Definition: telnet_interface.c:79
host::enable_encrypt
char * enable_encrypt
Definition: command.h:49
host::lines
int lines
System wide terminal lines.
Definition: command.h:52
vty_reset
void vty_reset(void)
Reset all VTY status.
Definition: vty.c:1784
osmo_stat_item_group::name
char * name
rctr_vty_ctx::vty
struct vty * vty
Definition: stats_vty.c:611
tdefs
struct osmo_tdef * tdefs
Definition: tdef_vty.c:291
vty::buf
char * buf
Command input buffer.
Definition: vty.h:97
ENABLE_NODE
@ ENABLE_NODE
Enable node.
Definition: command.h:77
osmo_signal_dispatch
void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data)
timer_command_string
static char * timer_command_string(const char *prefix, const char *suffix)
Definition: tdef_vty.c:336
vty::node
int node
Node status of this vty.
Definition: vty.h:88
vty_out_context::max_level
int max_level
Definition: utils.c:47
osmo_tdef_vty_show_cmd
int osmo_tdef_vty_show_cmd(struct vty *vty, struct osmo_tdef *tdefs, const char *T_arg, const char *prefix_fmt,...)
Output one or all timers to the VTY, as for a VTY command like 'show timer [TNNNN]'.
Definition: tdef_vty.c:144
buffer_status_t
buffer_status_t
Definition: buffer.h:56
osmo_str_tolower_buf
size_t osmo_str_tolower_buf(char *dest, size_t dest_len, const char *src)
vty_cmd_range_match
int vty_cmd_range_match(const char *range, const char *str)
Definition: command.c:1512
node_name_from_prompt
static const char * node_name_from_prompt(const char *prompt, char *name_buf, size_t name_buf_size)
Definition: command.c:152
vty_print_logtarget
static void vty_print_logtarget(struct vty *vty, const struct log_info *info, const struct log_target *tgt)
Definition: logging_vty.c:507
config_exit_cmd
struct cmd_element config_exit_cmd
vty_dump_xml_ref
int vty_dump_xml_ref(FILE *stream) OSMO_DEPRECATED("Use vty_dump_xml_ref_mode() instead")
Print the XML reference of all VTY nodes to the given stream.
Definition: command.c:956
logging_print_file_args
static const struct value_string logging_print_file_args[]
Definition: logging_vty.c:287
osmo_tdef_group::name
const char * name
osmo_tdef::T
const int T
walk_cb_params::chunk_ptr
const void * chunk_ptr
Definition: talloc_ctx_vty.c:42
S_VTY_EVENT
@ S_VTY_EVENT
Definition: vty.h:254
LOG_STR
#define LOG_STR
Definition: logging_vty.c:40
print_func_vty
static int print_func_vty(void *data, const char *format,...)
Definition: command.c:875
AUTH_NODE
@ AUTH_NODE
Authentication mode of vty interface.
Definition: command.h:74
osmo_fd::when
unsigned int when
telnet_init_default
int telnet_init_default(void *tall_ctx, void *priv, int default_port)
Initializes telnet based VTY interface using the configured bind addr/port.
Definition: telnet_interface.c:109
EXTEND_MATCH
@ EXTEND_MATCH
Definition: command.c:1103
vty_out_fsm_inst2
void vty_out_fsm_inst2(struct vty *vty, const char *prefix, struct osmo_fsm_inst *fsmi)
Print a FSM instance to the given VTY.
Definition: fsm_vty.c:93
cmd_element::string
const char * string
Command specification by string.
Definition: command.h:176
gDEFUN
gDEFUN(cfg_description, cfg_description_cmd, "description .TEXT", "Save human-readable description of the object\n" "Text until the end of the line\n")
Definition: logging_vty.c:586
vty
vty
Definition: tdef_vty.c:296
depth
unsigned int depth
CMD_ERR_EXEED_ARGC_MAX
#define CMD_ERR_EXEED_ARGC_MAX
Definition: command.h:200
osmo_stat_item_for_each_group
int osmo_stat_item_for_each_group(osmo_stat_item_group_handler_t handle_group, void *data)
node_flag_mask
static unsigned int node_flag_mask(const struct cmd_node *cnode, bool expert_mode)
Definition: command.c:3237
cmd_element::daemon
int daemon
Daemon to which this command belong.
Definition: command.h:179
install_basic_node_commands
static void install_basic_node_commands(int node)
Install common commands like 'exit' and 'list'.
Definition: command.c:4305
cmd_unique_string
static int cmd_unique_string(vector v, const char *str)
Definition: command.c:1996
cmd_element::attr
unsigned char attr
Command attributes (global)
Definition: command.h:184
host::app_info
const struct vty_app_info * app_info
VTY application information.
Definition: command.h:69
assert_loginfo
void assert_loginfo(const char *src)
vty_out
int vty_out(struct vty *, const char *,...) VTY_PRINTF_ATTRIBUTE(2
osmo_counters_for_each
int osmo_counters_for_each(int(*handle_counter)(struct osmo_counter *, void *), void *data)
osmo_fsm_inst::name
const char * name
vty_app_info::go_parent_cb
int(* go_parent_cb)(struct vty *vty)
Call-back for taking actions upon exiting a node.
Definition: vty.h:197
osmo_fsm_inst::state
uint32_t state
log_target::print_category
unsigned int print_category
vty_signal_data::sock
int sock
Definition: vty.h:259
log_info::save_fn
log_save_filters * save_fn
vty_cmd_string_from_valstr
char * vty_cmd_string_from_valstr(void *ctx, const struct value_string *vals, const char *prefix, const char *sep, const char *end, int do_lower)
Generate a VTY command string from value_string.
Definition: utils.c:372
host::enable
char * enable
Enable password.
Definition: command.h:48
IPV6_PREFIX_MATCH
@ IPV6_PREFIX_MATCH
Definition: command.c:1106
buffer
Definition: buffer.c:39
cpu_affinity_it::bufname
char bufname[64]
Definition: cpu_sched_vty.c:70
vty_app_info::config_is_consistent
int(* config_is_consistent)(struct vty *vty)
Check if the config is consistent before write.
Definition: vty.h:204
install_element
void install_element(int node_type, struct cmd_element *)
Install a command into a node.
Definition: command.c:981
vty_read_config_file
int vty_read_config_file(const char *file_name, void *priv)
Read the configuration file using the VTY code.
Definition: vty.c:1911
event
event
VTY events.
Definition: vty.h:39
talloc.h
VTY_CMD_ATTR_FLAGS_RESERVED
#define VTY_CMD_ATTR_FLAGS_RESERVED
Definition: vty.h:35
name
const char * name
log_target::rb
void * rb
osmo_stats_reporter::bind_addr_str
char * bind_addr_str
vty::parent_nodes
struct llist_head parent_nodes
List of parent nodes, last item is the outermost parent.
Definition: vty.h:164
h
struct gad_raw_head h
STATE_SLASH
#define STATE_SLASH
Definition: command.c:1245
CMD_COMPLETE_MATCH
#define CMD_COMPLETE_MATCH
Definition: command.h:203
vty::fail
int fail
Failure count.
Definition: vty.h:91
vty_out_context::vty
struct vty * vty
Definition: utils.c:45
pid
uint32_t pid
vty_out_fsm2
void vty_out_fsm2(struct vty *vty, const char *prefix, struct osmo_fsm *fsm)
Print information about a FSM [class] to the given VTY.
Definition: fsm_vty.c:53
vty_parent_node::indent
char * indent
When reading from a config file, these are the indenting characters expected for children of this VTY...
Definition: vty.h:70
vty_newline
static const char * vty_newline(struct vty *vty)
Definition: vty.h:177
walk_cb_params::depth_pass
unsigned int depth_pass
Definition: talloc_ctx_vty.c:41
STATE_DOUBLE
#define STATE_DOUBLE
Definition: command.c:1242
SH_FSM_STR
#define SH_FSM_STR
Definition: fsm_vty.c:126
log_target::type
enum log_target_type type
_vector::alloced
unsigned int alloced
Definition: vector.h:24
log_target::print_category_hex
bool print_category_hex
asciidoc_rate_ctr_handler
static int asciidoc_rate_ctr_handler(struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *sctx_)
Definition: stats_vty.c:482
host::encrypt
int encrypt
Definition: command.h:62
SCHED_VTY_THREAD_SELF
@ SCHED_VTY_THREAD_SELF
Definition: cpu_sched_vty.c:60
llist_head
buffer_putc
void buffer_putc(struct buffer *b, unsigned char c)
Definition: buffer.c:186
VIEW_NODE
@ VIEW_NODE
View node.
Definition: command.h:75
add_group_args
static char * add_group_args(void *talloc_ctx, char *dest)
Definition: tdef_vty.c:314
ATTR_TYPE_LIB
@ ATTR_TYPE_LIB
Definition: command.c:3145
BUFFER_SIZE_DEFAULT
#define BUFFER_SIZE_DEFAULT
Definition: buffer.c:66
osmo_stats_reporter_set_remote_addr
int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const char *addr)
vty::status
enum vty::@2 status
Current vty status.
if
if(vty->type==VTY_SHELL_SERV)
Definition: command.c:3565
node
struct cmd_node * node
Definition: command.c:3563
vty_node
struct cmd_node vty_node
Definition: vty.c:1777
auth_enable_node
struct cmd_node auth_enable_node
Definition: command.c:93
c
struct abis_rsl_common_hdr c
CMD_COMPLETE_LIST_MATCH
#define CMD_COMPLETE_LIST_MATCH
Definition: command.h:204
CMD_ATTR_PUBLIC_MASK
#define CMD_ATTR_PUBLIC_MASK
Definition: command.c:642
CMD_ATTR_HIDDEN
@ CMD_ATTR_HIDDEN
Definition: command.h:150
osmo_stats_reporter_set_flush_period
int osmo_stats_reporter_set_flush_period(struct osmo_stats_reporter *srep, unsigned int period)
cfg_log_node
struct cmd_node cfg_log_node
Definition: logging_vty.c:629
config_help_cmd
struct cmd_element config_help_cmd
log_tgt_mutex_lock
#define log_tgt_mutex_lock()
osmo_stats_reporter::max_class
enum osmo_stats_class max_class
LOG_TGT_TYPE_FILE
LOG_TGT_TYPE_FILE
osmo_tdef_group::desc
const char * desc
SHOW_LOG_STR
#define SHOW_LOG_STR
Definition: logging_vty.c:541
l
int gsm48_generate_mid_from_tmsi *(uint8_t *buf, uint32_t tmsi) OSMO_DEPRECATED_OUTSIDE("Instead u l))
osmo_fsm_inst::T
int T
osmo_str_to_int64
int osmo_str_to_int64(int64_t *result, const char *str, int base, int64_t min_val, int64_t max_val)
log_set_print_extended_timestamp
void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp)
vty_event
void vty_event(enum event event, int sock, struct vty *vty)
vty_hello
void vty_hello(struct vty *vty)
Definition: vty.c:402
loggingrb.h
buffer.h
vty_prompt
static void vty_prompt(struct vty *vty)
Definition: vty.c:437
asciidoc_rate_ctr_group_handler
static int asciidoc_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_)
Definition: stats_vty.c:507
cmd_node::vtysh
int vtysh
Is this node's configuration goes to vtysh ?
Definition: command.h:133
print_version
void print_version(int print_copyright)
print the version (and optionally copyright) information
Definition: command.c:117
cpu_affinity_it::tid_type
enum sched_vty_thread_id tid_type
Definition: cpu_sched_vty.c:69
CMD_IPV4
#define CMD_IPV4(S)
Definition: command.h:362
LOG_TGT_TYPE_GSMTAP
LOG_TGT_TYPE_GSMTAP
osmo_stats_reporter_set_name_prefix
int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix)
rate_ctr_handler
static int rate_ctr_handler(struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *vctx_)
Definition: utils.c:51
host::name
char * name
Host name of this router.
Definition: command.h:41
buffer_write
buffer_status_t buffer_write(struct buffer *b, int fd, const void *p, size_t size)
Definition: buffer.c:439
config_node
struct cmd_node config_node
Definition: command.c:105
timer.h
osmo_stats_reporter_enable
int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep)
SCHED_VTY_THREAD_ID
@ SCHED_VTY_THREAD_ID
Definition: cpu_sched_vty.c:62
host::config
char * config
config file name of this host
Definition: command.h:58
vty_out_uptime
int vty_out_uptime(struct vty *vty, const struct timespec *starttime)
calculates the time difference of a give timespec to the current time and prints in a human readable ...
Definition: vty.c:345
host::password_encrypt
char * password_encrypt
Definition: command.h:45
SYSCONFDIR
#define SYSCONFDIR
Definition: vty.c:81
osmo_tdef_range_str_buf
int osmo_tdef_range_str_buf(char *buf, size_t buf_len, struct osmo_tdef *t)
CMD_ATTR_DEPRECATED
@ CMD_ATTR_DEPRECATED
Definition: command.h:149
L_CPU_SCHED_NODE
@ L_CPU_SCHED_NODE
CPU Sched related options node.
Definition: command.h:102
osmo_fsm::num_states
unsigned int num_states
WALK_FILTER_NONE
@ WALK_FILTER_NONE
Definition: talloc_ctx_vty.c:34
DEFUN
DEFUN(cfg_sched, cfg_sched_cmd, "cpu-sched", "Configure CPU Scheduler related settings")
Definition: cpu_sched_vty.c:499
osmo_tcp_stats_config::interval
int interval
config_write_memory_cmd
config_write_memory_cmd
Definition: command.c:3543
vector_only_index_free
void vector_only_index_free(void *index)
Definition: vector.c:63
add_category_strings
static void add_category_strings(char **cmd_str_p, char **doc_str_p, const struct log_info *categories)
Definition: logging_vty.c:317
vty_current_node
int vty_current_node(struct vty *vty)
return the current node of a given VTY
Definition: vty.c:368
tdef.h
LOG_LEVEL_ARGS
#define LOG_LEVEL_ARGS
Definition: logging_vty.c:51
osmo_stats_reporter::mtu
int mtu
rate_ctr_group_reset
void rate_ctr_group_reset(struct rate_ctr_group *ctrg)
log_target::fname
const char * fname
vty_out
int vty_out(struct vty *vty, const char *format,...)
VTY standard output function.
Definition: vty.c:324
logging_vty_add_cmds
void logging_vty_add_cmds()
Register logging related commands to the VTY.
Definition: logging_vty.c:1199
vty::escape
unsigned char escape
For escape character.
Definition: vty.h:125
rate_ctr_group_desc::group_name_prefix
const char * group_name_prefix
log_set_log_level
void log_set_log_level(struct log_target *target, int log_level)
config_write_log
static int config_write_log(struct vty *vty)
Definition: logging_vty.c:1108
vty_signal_data::vty
struct vty * vty
Definition: vty.h:260
buffer_data
Definition: buffer.c:49
llist_for_each_entry
#define llist_for_each_entry(pos, head, member)
vty::monitor
int monitor
Definition: vty.h:158
VTY_NORMAL
#define VTY_NORMAL
Definition: vty.c:1281
osmo_stat_item_group::desc
const struct osmo_stat_item_group_desc * desc
osmo_fsm_inst::id
const char * id
print_func_t
int(* print_func_t)(void *data, const char *fmt,...)
Definition: command.c:630
telnet_connection::vty
struct vty * vty
VTY instance associated with telnet connection.
Definition: telnet_interface.h:39
vty_parent_node
Definition: vty.h:59
cmd_filter
static enum match_type cmd_filter(char *command, vector v, unsigned int index, enum match_type level)
Definition: command.c:1698
LOGL_NOTICE
#define LOGL_NOTICE
vty_self_insert
static void vty_self_insert(struct vty *vty, char c)
Definition: vty.c:511
buffer_reset
void buffer_reset(struct buffer *)
Definition: buffer.c:127
cmd_try_do_shortcut
static int cmd_try_do_shortcut(enum node_type node, char *first_word)
Definition: command.c:2022
llist_add
static void llist_add(struct llist_head *_new, struct llist_head *head)
desc
Command description structure.
Definition: command.h:189
vty_forward_word
static void vty_forward_word(struct vty *vty)
Definition: vty.c:848
host
Host configuration variable.
Definition: command.h:39
terminal
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 terminal
Definition: command.c:3558
buffer_data::data
unsigned char data[0]
Definition: buffer.c:59
value_string
log_target_systemd_set_raw
void log_target_systemd_set_raw(struct log_target *target, bool raw)
OSMO_T_FMT_ARGS
#define OSMO_T_FMT_ARGS(T)
password_check
static int password_check
Definition: vty.c:106
IPV6_PREFIX_STR
#define IPV6_PREFIX_STR
Definition: command.c:1239
asciidoc_handle_counter
static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_)
Definition: stats_vty.c:452
cmd_flag_mask
static const char * cmd_flag_mask(const struct cmd_element *cmd, unsigned int flag_mask)
Definition: command.c:3294
llist_first_entry_or_null
#define llist_first_entry_or_null(ptr, type, member)
VTY_SHELL
@ VTY_SHELL
Definition: vty.h:55
vty::obuf
struct buffer * obuf
Output buffer.
Definition: vty.h:94
memory
write memory
Definition: command.c:3544
OSMO_STAT_ITEM_NO_UNIT
#define OSMO_STAT_ITEM_NO_UNIT
linuxlist.h
INIT_MATCHVEC_SIZE
#define INIT_MATCHVEC_SIZE
osmo_tdef_group::tdefs
struct osmo_tdef * tdefs
ATTR_TYPE_APP
@ ATTR_TYPE_APP
Definition: command.c:3146
indent_cmp
static int indent_cmp(const char *a, const char *b)
Make sure the common length of strings a and b is identical, then compare their lengths.
Definition: command.c:2830
vty::index_sub
void * index_sub
For multiple level index treatment such as key chain and key.
Definition: vty.h:122
walk_filter_type
walk_filter_type
Definition: talloc_ctx_vty.c:33
host::logfile
char * logfile
Log filename.
Definition: command.h:55
logging_internal.h
vty::expert_mode
bool expert_mode
Whether the expert mode is enabled.
Definition: vty.h:171
IPV6_ADDR_STR
#define IPV6_ADDR_STR
Definition: command.c:1238
vty_command_is_common
static bool vty_command_is_common(const struct cmd_element *cmd)
Return true if a node is installed by install_basic_node_commands(), so that we can avoid repeating t...
Definition: command.c:4330
osmo_fsm_inst::fsm
struct osmo_fsm * fsm
cmd_complete_command
char ** cmd_complete_command()
vty_app_info::usr_attr_letters
char usr_attr_letters[VTY_CMD_USR_ATTR_NUM]
Flag letters of the application specific VTY attributes (optional).
Definition: vty.h:208
vty_ensure
static void vty_ensure(struct vty *vty, int length)
Definition: vty.c:501
DEFUN_DEPRECATED
DEFUN_DEPRECATED(deprecated_logging_level_everything, deprecated_logging_level_everything_cmd, NULL, NULL)
Definition: logging_vty.c:414
VTY_SHELL_SERV
@ VTY_SHELL_SERV
Definition: vty.h:56
log_target_destroy
void log_target_destroy(struct log_target *target)
BUFFER_ERROR
@ BUFFER_ERROR
Definition: buffer.h:59
talloc_ctx_walk_cb
static void talloc_ctx_walk_cb(const void *chunk, int depth, int max_depth, int is_ref, void *data)
Print a talloc memory hierarchy to the given VTY.
Definition: talloc_ctx_vty.c:59
llist_add_tail
static void llist_add_tail(struct llist_head *_new, struct llist_head *head)
walk_cb_params
Definition: talloc_ctx_vty.c:39
vector_ensure
void vector_ensure(vector v, unsigned int num)
Definition: vector.c:96
add_group_docs
static char * add_group_docs(void *talloc_ctx, char *dest)
Definition: tdef_vty.c:327
vector.h
type
enum osmo_sub_auth_type type
walk_cb_params::vty
struct vty * vty
Definition: talloc_ctx_vty.c:43
ARRAY_SIZE
#define ARRAY_SIZE(x)
vty_create
struct vty * vty_create(int vty_sock, void *priv)
Create new vty structure.
Definition: vty.c:1558
vty::config
int config
In configure mode.
Definition: vty.h:161
counter.h
sched_vty_opts::cpu_affinity_li_mutex
pthread_mutex_t cpu_affinity_li_mutex
Definition: cpu_sched_vty.c:80
osmo_str_startswith
bool osmo_str_startswith(const char *str, const char *startswith_str)
cmd_entry_function_desc
static const char * cmd_entry_function_desc(const char *src, const char *dst)
Definition: command.c:1939
osmo_log_target_list
struct llist_head osmo_log_target_list
osmo_fsm::instances
struct llist_head instances
osmo_sock_get_name_buf
int osmo_sock_get_name_buf(char *str, size_t str_len, int fd)
rate_ctr::previous
uint64_t previous
argv
argv
Definition: tdef_vty.c:296
buffer_empty
int buffer_empty(struct buffer *b)
Definition: buffer.c:121
DEFUN
#define DEFUN(funcname, cmdname, cmdstr, helpstr)
Macro for defining a VTY node and function.
Definition: command.h:259
value_string::value
uint32_t value
osmo_stat_item_group_desc::group_name_prefix
const char * group_name_prefix
log_target::hostname
const char * hostname
CMD_ARGC_MAX
#define CMD_ARGC_MAX
Definition: command.h:209
vty_redraw_line
static void vty_redraw_line(struct vty *)
Definition: vty.c:841
cmd_cmdsize
static int cmd_cmdsize(vector strvec)
Definition: command.c:480
vty_write
static void vty_write(struct vty *vty, const char *buf, size_t nbytes)
Definition: vty.c:491
log_set_print_filename_pos
void log_set_print_filename_pos(struct log_target *target, enum log_filename_pos pos)
vty_config_write
static int vty_config_write(struct vty *vty)
Definition: vty.c:1752
log_target::output
void(* output)(struct log_target *target, unsigned int level, const char *string)
cmd_init
void cmd_init(int)
Definition: command.c:4389
PARTLY_MATCH
@ PARTLY_MATCH
Definition: command.c:1110
vty_bind_port
static int vty_bind_port
Definition: vty.c:101
log_target::categories
struct log_category * categories
ERRNO_IO_RETRY
#define ERRNO_IO_RETRY(EN)
Definition: vty.h:23
vty_parent
static struct vty_parent_node * vty_parent(struct vty *vty)
Definition: command.c:2426
sched_vty_opts::sched_rr_prio
int sched_rr_prio
Definition: cpu_sched_vty.c:78
VTY_NODE
@ VTY_NODE
Vty node.
Definition: command.h:84
buffer_put
void buffer_put(struct buffer *, const void *, size_t)
Definition: buffer.c:162
TCP_STATS_DEFAULT_BATCH_SIZE
#define TCP_STATS_DEFAULT_BATCH_SIZE
osmo_counter::name
const char * name
sched_vty_opts::cpu_affinity_li
struct llist_head cpu_affinity_li
Definition: cpu_sched_vty.c:79
reset_rate_ctr_group_handler
static int reset_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_)
Definition: stats_vty.c:648
logging.h
osmo_stats_reporter::name
char * name
cmd_match
static enum match_type cmd_match(const char *str, const char *command, enum match_type min, bool recur)
Definition: command.c:1630
CMD_IPV6_PREFIX
#define CMD_IPV6_PREFIX(S)
Definition: command.h:365
osmo_stats_reporter_set_mtu
int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu)
vty_history_print
static void vty_history_print(struct vty *vty)
Definition: vty.c:782
vty_event
void vty_event(enum event event, int sock, struct vty *vty)
callback from core VTY code about VTY related events
Definition: telnet_interface.c:219
install_lib_element
void install_lib_element(int node_type, struct cmd_element *)
Install a library command into a node.
Definition: command.c:1002
RET_WITH_UNLOCK
#define RET_WITH_UNLOCK(ret)
Definition: logging_vty.c:114
OSMO_FD_WRITE
#define OSMO_FD_WRITE
log_target::raw
bool raw
rate_ctr::current
uint64_t current
LOG_TGT_TYPE_VTY
LOG_TGT_TYPE_VTY
OSMO_TDEF_CUSTOM
OSMO_TDEF_CUSTOM
cmd_execute_command_strict
int cmd_execute_command_strict(vector, struct vty *, struct cmd_element **)
Definition: command.c:2711
VTY_BUFSIZ
#define VTY_BUFSIZ
Definition: vty.h:29
argc
argc
Definition: tdef_vty.c:296
IPV4_PREFIX_MATCH
@ IPV4_PREFIX_MATCH
Definition: command.c:1104
cfg_description_cmd
struct cmd_element cfg_description_cmd
tall_vty_ctx
void * tall_vty_ctx
Definition: vty.c:108
file
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
VTY_READ
@ VTY_READ
Definition: vty.h:41
vty_out_fsm_inst
void vty_out_fsm_inst(struct vty *vty, struct osmo_fsm_inst *fsmi)
Print a FSM instance to the given VTY.
Definition: fsm_vty.c:121
rate_ctr::intv
struct rate_ctr_per_intv intv[RATE_CTR_INTV_NUM]
OSMO_STATS_CLASS_PEER
OSMO_STATS_CLASS_PEER
vty::iac
unsigned char iac
IAC handling.
Definition: vty.h:135
log_target_rb_avail_size
size_t log_target_rb_avail_size(struct log_target const *target)
vty_config
static int vty_config
Definition: vty.c:104
osmo_g_fsms
struct llist_head osmo_g_fsms
host_config_file
const char * host_config_file(void)
Definition: command.c:4285
LOG_TGT_TYPE_SYSTEMD
LOG_TGT_TYPE_SYSTEMD
osmo_tdef_vty_set_cmd
return osmo_tdef_vty_set_cmd(vty, tdefs, timer_args)
osmo_fsm_inst::parent_term_event
uint32_t parent_term_event
vty_will_suppress_go_ahead
static void vty_will_suppress_go_ahead(struct vty *vty)
Definition: vty.c:755
vty_auth
static void vty_auth(struct vty *vty)
Definition: vty.c:147
log_target::tgt_syslog
struct log_target::@8::@11 tgt_syslog
vty_out_rate_ctr_group_fmt
void vty_out_rate_ctr_group_fmt(struct vty *vty, const char *fmt, struct rate_ctr_group *ctrg)
Definition: utils.c:234
vty_down_level
static void vty_down_level(struct vty *vty)
Definition: vty.c:876
DLGLOBAL
#define DLGLOBAL
osmo_stats_reporter_create_log
struct osmo_stats_reporter * osmo_stats_reporter_create_log(const char *name)
log_tgt_mutex_unlock
#define log_tgt_mutex_unlock()
group_arg
group_arg
Definition: tdef_vty.c:299
vty_go_parent
int vty_go_parent(struct vty *vty)
Definition: command.c:2468
osmo_fd
log_level_str
const char * log_level_str(unsigned int lvl)
osmo_fsm_state::in_event_mask
uint32_t in_event_mask
log_parse_category
int log_parse_category(const char *category)
config_write_host
static int config_write_host(struct vty *vty)
Definition: command.c:1051
host::motd
const char * motd
Banner configuration.
Definition: command.h:65
VTY_MAXHIST
#define VTY_MAXHIST
Definition: vty.h:30
vty_config_lock
int vty_config_lock(struct vty *)
Lock the configuration to a given VTY.
Definition: vty.c:379
SCHED_VTY_THREAD_NAME
@ SCHED_VTY_THREAD_NAME
Definition: cpu_sched_vty.c:63
log_category::enabled
uint8_t enabled
LOGP
#define LOGP(ss, level, fmt, args...)
osmo_tdef::max_val
unsigned long max_val
vty::hp
int hp
History lookup current point.
Definition: vty.h:112
llist_empty
static int llist_empty(const struct llist_head *head)
_vector::index
void ** index
Definition: vector.h:25
osmo_log_vty2tgt
struct log_target * osmo_log_vty2tgt(struct vty *vty)
Get log target associated to VTY console.
Definition: logging_vty.c:147
cmd_desc_str
static char * cmd_desc_str(const char **string)
Fetch next description.
Definition: command.c:346
vty_get_cwd
char * vty_get_cwd(void)
Definition: vty.c:1824
log_target::print_timestamp
unsigned int print_timestamp
config_write_terminal_cmd
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 config_write_terminal_cmd
Definition: command.c:3557
osmo_stats_reporter::enabled
int enabled
vty_end_of_line
static void vty_end_of_line(struct vty *vty)
Definition: vty.c:580
cmd_ipv4_match
static enum match_type cmd_ipv4_match(const char *str)
Definition: command.c:1114
VTY_PRE_ESCAPE
#define VTY_PRE_ESCAPE
Definition: vty.c:1282
fsm.h
log_target::tgt_rb
struct log_target::@8::@13 tgt_rb
osmo_fsm_state_name
const char * osmo_fsm_state_name(const struct osmo_fsm *fsm, uint32_t state)
VTY_REF_GEN_MODE_HIDDEN
@ VTY_REF_GEN_MODE_HIDDEN
"Inverse" mode: only hidden commands.
Definition: command.h:477
VTY_ESCAPE
#define VTY_ESCAPE
Definition: vty.c:1283
osmo_counter::description
const char * description
application.h
osmo_fsm::event_names
const struct value_string * event_names
_vty_output
static void _vty_output(struct log_target *tgt, unsigned int level, const char *line)
Definition: logging_vty.c:78
VTY_READ_BUFSIZ
#define VTY_READ_BUFSIZ
Definition: vty.h:27
vty_backward_word
static void vty_backward_word(struct vty *vty)
Definition: vty.c:865
osmo_tdef_vty_out_one
void osmo_tdef_vty_out_one(struct vty *vty, struct osmo_tdef *t, const char *prefix_fmt,...)
Write to VTY the current status of one timer.
Definition: tdef_vty.c:201
osmo_fsm_state::out_state_mask
uint32_t out_state_mask
set_srep_parameter_int
static int set_srep_parameter_int(struct vty *vty, int(*fun)(struct osmo_stats_reporter *, int), const char *val, const char *param_name)
Definition: stats_vty.c:98
walk_cb_params::filter
enum walk_filter_type filter
Definition: talloc_ctx_vty.c:40
cmd_make_strvec2
int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p)
Break up string in command tokens.
Definition: command.c:251
OSMO_ABIS_LIB_ATTR_IPA_NEW_LNK
@ OSMO_ABIS_LIB_ATTR_IPA_NEW_LNK
Definition: command.h:167
buffer_data::sp
size_t sp
Definition: buffer.c:56
global_tdef_groups
static struct osmo_tdef_group * global_tdef_groups
Singleton Tnnn groups definition as set by osmo_tdef_vty_groups_init().
Definition: tdef_vty.c:267
cmd_complete_command_real
static char ** cmd_complete_command_real(vector vline, struct vty *vty, int *status)
Definition: command.c:2243
argv_concat
char * argv_concat(const char **argv, int argc, int shift)
Definition: command.c:126
cmd_node::cmd_vector
vector cmd_vector
Vector of this node's command list.
Definition: command.h:139
vty_out_rate_ctr_group2
void vty_out_rate_ctr_group2(struct vty *vty, const char *prefix, struct rate_ctr_group *ctrg, bool skip_zero)
print a rate counter group to given VTY
Definition: utils.c:79
my_sched_setaffinity
static int my_sched_setaffinity(enum sched_vty_thread_id tid_type, pid_t pid, cpu_set_t *cpuset, size_t cpuset_size)
Definition: cpu_sched_vty.c:331
VARARG_MATCH
@ VARARG_MATCH
Definition: command.c:1109
vty::height
int height
Widnow height.
Definition: vty.h:153
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)
log_info_cat::description
const char * description
OSMO_STATS_CLASS_SUBSCRIBER
OSMO_STATS_CLASS_SUBSCRIBER
rate_ctr_for_each_group
int rate_ctr_for_each_group(rate_ctr_group_handler_t handle_group, void *data)
k
uint8_t k[OSMO_A5_MAX_KEY_LEN_BYTES]
osmo_stats_config::interval
int interval
STATE_ADDR
#define STATE_ADDR
Definition: command.c:1243
vty_dump_xml_ref_mode
int vty_dump_xml_ref_mode(FILE *stream, enum vty_ref_gen_mode mode)
Print the XML reference of all VTY nodes to the given stream.
Definition: command.c:923
logging.h
timer_args
const char ** timer_args
Definition: tdef_vty.c:288
log_target::tgt_vty
struct log_target::@8::@12 tgt_vty
osmo_stat_item_desc
cmd_deopt
static char * cmd_deopt(void *ctx, const char *str)
Definition: command.c:1616
OSMO_T_FMT
#define OSMO_T_FMT
CMD_SUCCESS
return CMD_SUCCESS
Definition: command.c:3584
osmo_fsm_state::name
const char * name
buffer_free
void buffer_free(struct buffer *)
Definition: buffer.c:93
osmo_stat_item_group_handler
static int osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *vctx_)
Definition: utils.c:304
gen_logging_level_cmd_strs
static void gen_logging_level_cmd_strs(struct cmd_element *cmd, const char *level_args, const char *level_strs)
Definition: logging_vty.c:334
osmo_stats_reporter::name_prefix
char * name_prefix
list
struct llist_head list
BUFFER_EMPTY
@ BUFFER_EMPTY
Definition: buffer.h:63
CMD_OPTION
#define CMD_OPTION(S)
Definition: command.h:357
log_target::filter_map
int filter_map
RATE_CTR_INTV_DAY
RATE_CTR_INTV_DAY
vty_out_newline
int vty_out_newline(struct vty *)
print a newline on the given VTY
Definition: vty.c:335
STATE_COLON
#define STATE_COLON
Definition: command.c:1241
cpu_affinity_it
Definition: cpu_sched_vty.c:67
vty_delete_backward_char
static void vty_delete_backward_char(struct vty *vty)
Definition: vty.c:961
cmp_desc
static int cmp_desc(const void *p, const void *q)
Definition: command.c:203
vty_shell_serv
int vty_shell_serv(struct vty *vty)
Definition: vty.c:1829
OSMO_SNPRINTF_RET
#define OSMO_SNPRINTF_RET(ret, rem, offset, len)
vty_app_info::usr_attr_desc
const char * usr_attr_desc[VTY_CMD_USR_ATTR_NUM]
Description of the application specific VTY attributes (optional).
Definition: vty.h:206
osmo_stat_item_group_desc::class_id
int class_id
vty_self_insert_overwrite
static void vty_self_insert_overwrite(struct vty *vty, char c)
Definition: vty.c:530
_vector::active
unsigned int active
Definition: vector.h:23
vty_out_context::prefix
const char * prefix
Definition: utils.c:46
osmo_fd::fd
int fd
osmo_tdef_get_entry
struct osmo_tdef * osmo_tdef_get_entry(struct osmo_tdef *tdefs, int T)
socket.h
osmo_strrb
osmo_tdef_vty_parse_T_arg
struct osmo_tdef * osmo_tdef_vty_parse_T_arg(struct vty *vty, struct osmo_tdef *tdefs, const char *osmo_tdef_str)
Parse an argument like "1234", "T1234", "t1234", or "X1234", "x1234", as from OSMO_TDEF_VTY_ARG_T.
Definition: tdef_vty.c:51
vty_read
int vty_read(struct vty *vty)
Read data via vty socket.
Definition: vty.c:1318
buffer::head
struct buffer_data * head
Definition: buffer.c:41
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)
vtyvec
static vector vtyvec
Definition: vty.c:89
gsmtap.h
vty_backward_kill_word
static void vty_backward_kill_word(struct vty *vty)
Definition: vty.c:1007
OSMO_TDEF_VTY_ARG_T_OPTIONAL
#define OSMO_TDEF_VTY_ARG_T_OPTIONAL
Definition: tdef_vty.h:46
timespecsub
#define timespecsub(a, b, result)
gDEFUN
gDEFUN(config_exit, config_exit_cmd, "exit", "Exit current mode and down to previous mode\n")
Definition: command.c:3026
VTY_TERM
@ VTY_TERM
Definition: vty.h:53
OSMO_SOCK_F_BIND
#define OSMO_SOCK_F_BIND
CMD_SUCCESS_DAEMON
#define CMD_SUCCESS_DAEMON
Definition: command.h:205
osmo_tdef_vty_parse_val_arg
unsigned long osmo_tdef_vty_parse_val_arg(const char *val_arg, unsigned long default_val)
Parse an argument of the form "(0-2147483647|default)", as from OSMO_TDEF_VTY_ARG_VAL.
Definition: tdef_vty.c:96
cmd_describe_command
vector cmd_describe_command()
osmo_fd::data
void * data
sort_node
void sort_node(void)
Sort each node's command element according to command string.
Definition: command.c:212
stats_class_strs
static const struct value_string stats_class_strs[]
Definition: stats_vty.c:65
cpu_affinity_it::cpuset
cpu_set_t * cpuset
Definition: cpu_sched_vty.c:71
vty_ref_gen_mode
vty_ref_gen_mode
VTY reference generation mode.
Definition: command.h:471
LOGL_ERROR
#define LOGL_ERROR
RATE_CTR_INTV_SEC
RATE_CTR_INTV_SEC
cmd_node::prompt
const char * prompt
Prompt character at vty interface.
Definition: command.h:130
vty_init
void vty_init(struct vty_app_info *app_info)
Initialize VTY layer.
Definition: vty.c:1843
osmo_stats_set_interval
int osmo_stats_set_interval(int interval)
vector_set
int vector_set(vector v, void *val)
Definition: vector.c:128
buffer_flush_all
buffer_status_t buffer_flush_all(struct buffer *, int fd)
Definition: buffer.c:199
cmdvec
vector cmdvec
Definition: command.c:75
auth_node
struct cmd_node auth_node
Definition: command.c:81
CMD_ERR_INCOMPLETE
#define CMD_ERR_INCOMPLETE
Definition: command.h:199
osmo_tdef_vty_out_all
void osmo_tdef_vty_out_all(struct vty *vty, struct osmo_tdef *tdefs, const char *prefix_fmt,...)
Write to VTY the current status of all given timers.
Definition: tdef_vty.c:235
LOG_TGT_TYPE_STRRB
LOG_TGT_TYPE_STRRB
desc::str
const char * str
Command's description.
Definition: command.h:191
rate_ctr
vty_app_info::copyright
const char * copyright
copyright string of the application
Definition: vty.h:189
vector_unset
void vector_unset(vector v, unsigned int i)
Definition: vector.c:172
log_set_all_filter
void log_set_all_filter(struct log_target *target, int all)
print_func_stream
static int print_func_stream(void *data, const char *format,...)
Definition: command.c:894
vty_describe_command
static void vty_describe_command(struct vty *vty)
Definition: vty.c:1158
CMD_SUCCESS
#define CMD_SUCCESS
Return value of the commands.
Definition: command.h:195
SS_L_VTY
SS_L_VTY
vty_out
vty_out(vty, "!%s", VTY_NEWLINE)
VTY_REF_GEN_MODE_EXPERT
@ VTY_REF_GEN_MODE_EXPERT
Expert mode: all commands including hidden, excluding deprecated.
Definition: command.h:475
fd
const struct osmo_fd * fd
LOG_FLT_ALL
LOG_FLT_ALL
FORCE_ALL_STR
#define FORCE_ALL_STR
Definition: logging_vty.c:44
vty_out_statistics_partial
void vty_out_statistics_partial(struct vty *vty, const char *prefix, int max_level)
Definition: utils.c:356
osmo_tdef_vty_out_one_va
void osmo_tdef_vty_out_one_va(struct vty *vty, struct osmo_tdef *t, const char *prefix_fmt, va_list va)
Write to VTY the current status of one timer.
Definition: tdef_vty.c:169
buffer_flush_window
buffer_status_t buffer_flush_window(struct buffer *, int fd, int width, int height, int erase, int no_more)
FILTER_STR
#define FILTER_STR
Definition: logging.h:6
gen_vty_logp_cmd_strs
static void gen_vty_logp_cmd_strs(struct cmd_element *cmd)
Definition: logging_vty.c:1169
T_arg
const char * T_arg
Definition: tdef_vty.c:273
vty_out_statistics_full2
void vty_out_statistics_full2(struct vty *vty, const char *prefix, bool skip_zero)
Definition: utils.c:361
stat_item.h
osmo_cpu_sched_vty_init
int osmo_cpu_sched_vty_init(void *tall_ctx)
Initialize sched VTY nodes.
Definition: cpu_sched_vty.c:601
proc_name_exists
static bool proc_name_exists(const char *name, pid_t *res_pid)
Definition: cpu_sched_vty.c:227
CMD_IPV6
#define CMD_IPV6(S)
Definition: command.h:364
ADD
#define ADD(out, str)
STATE_DOT
#define STATE_DOT
Definition: command.c:1244
walk_cb_params::regexp
regex_t regexp
Definition: talloc_ctx_vty.c:44
cpu_affinity_it::delay
bool delay
Definition: cpu_sched_vty.c:73
asciidoc_osmo_stat_item_handler
static int asciidoc_osmo_stat_item_handler(struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_)
Definition: stats_vty.c:528
osmo_str_to_int
int osmo_str_to_int(int *result, const char *str, int base, int min_val, int max_val)
osmo_fsm_inst::log_level
int log_level
handle_counter
static int handle_counter(struct osmo_counter *counter, void *vctx_)
Definition: utils.c:328
vty_previous_line
static void vty_previous_line(struct vty *vty)
Definition: vty.c:822
osmo_stats_report
int osmo_stats_report(void)
rate_ctr_group::name
char * name
vty_app_info
Information an application registers with the VTY.
Definition: vty.h:183
cmd_make_strvec
vector cmd_make_strvec(const char *)
Breaking up string into each command piece.
Definition: command.c:322
osmo_log_info
struct log_info * osmo_log_info
CATEGORY_ALL_STR
#define CATEGORY_ALL_STR
Definition: logging_vty.c:43
vty_out_stat_item_group
void vty_out_stat_item_group(struct vty *vty, const char *prefix, struct osmo_stat_item_group *statg)
Definition: utils.c:298
LOGGING_STR
#define LOGGING_STR
Definition: logging.h:5
rate_ctr_group::idx
unsigned int idx
parse_cpu_hex_mask
static int parse_cpu_hex_mask(const char *str, cpu_set_t *cpuset, size_t cpuset_size)
Definition: cpu_sched_vty.c:114
starttime
static struct timespec starttime
Definition: command.c:71
DEFUN
DEFUN(enable_logging, enable_logging_cmd, "logging enable", LOGGING_STR "Enables logging to this vty\n")
Definition: logging_vty.c:120
telnet_exit
void telnet_exit(void)
Close all telnet connections and release the telnet socket.
Definition: telnet_interface.c:255