16 #define VTY_PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b))) 18 #define VTY_PRINTF_ATTRIBUTE(a,b) 22 #define ERRNO_IO_RETRY(EN) \ 23 (((EN) == EAGAIN) || ((EN) == EWOULDBLOCK) || ((EN) == EINTR)) 26 #define VTY_READ_BUFSIZ 512 28 #define VTY_BUFSIZ 512 29 #define VTY_MAXHIST 20 32 #define VTY_CMD_USR_ATTR_NUM 32 34 #define VTY_CMD_ATTR_FLAGS_RESERVED \ 35 { '.', '!', '@', '^' } 127 enum {
VTY_NORMAL, VTY_CLOSE, VTY_MORE, VTY_MORELINE } status;
141 #define TELNET_NAWS_SB_LEN 5 174 #define VTY_NEWLINE ((vty->type == VTY_TERM) ? "\r\n" : "\n") 200 OSMO_DEPRECATED(
"Implicit parent node tracking has replaced the use of this callback. This callback is" 201 " no longer called, ever, and can be left NULL.");
203 int (*config_is_consistent)(
struct vty *vty);
219 int vty_out_va(struct vty *vty, const
char *format, va_list ap);
225 void vty_log (const
char *level, const
char *proto, const
char *fmt, va_list);
void vty_init_vtysh(void)
Definition: vty.c:1787
int vty_shell_serv(struct vty *)
Definition: vty.c:1782
int length
Command length.
Definition: vty.h:102
#define OSMO_DEPRECATED(text)
void * tall_ctx
talloc context
Definition: vty.h:190
int node
Node status of this vty.
Definition: vty.h:65
struct cmd_element cfg_description_cmd
char * indent
When reading from a config file, these are the indenting characters expected for children of the curr...
Definition: vty.h:167
const char * name
name of the application
Definition: vty.h:184
int lines
Configure lines.
Definition: vty.h:155
FILE * file
underlying file (if any)
Definition: vty.h:75
size_t sb_len
How many subnegotiation characters have we received?
Definition: vty.h:147
int vty_read(struct vty *vty)
Read data via vty socket.
Definition: vty.c:1278
int vty_config_unlock(struct vty *)
Unlock the configuration from a given VTY.
Definition: vty.c:366
int vty_config_lock(struct vty *)
Lock the configuration to a given VTY.
Definition: vty.c:353
int hindex
History insert end point.
Definition: vty.h:114
Internal representation of a single VTY.
Definition: vty.h:73
int int vty_out_va(struct vty *vty, const char *format, va_list ap)
Definition: vty.c:259
int height
Widnow height.
Definition: vty.h:152
void vty_log(const char *level, const char *proto, const char *fmt, va_list)
char * indent
When reading from a config file, these are the indenting characters expected for children of this VTY...
Definition: vty.h:69
void vty_close(struct vty *)
Close a given vty interface.
Definition: vty.c:211
#define VTY_CMD_USR_ATTR_NUM
Definition: vty.h:32
int max
Command max length.
Definition: vty.h:105
int width
Window width.
Definition: vty.h:150
bool vty_is_active(struct vty *vty)
Definition: telnet_interface.c:212
bool expert_mode
Whether the expert mode is enabled.
Definition: vty.h:170
const char * copyright
copyright string of the application
Definition: vty.h:188
char * buf
Command input buffer.
Definition: vty.h:96
int vty_out(struct vty *, const char *,...) VTY_PRINTF_ATTRIBUTE(2
unsigned char escape
For escape character.
Definition: vty.h:124
#define VTY_NEWLINE
Definition: vty.h:174
#define VTY_PRINTF_ATTRIBUTE(a, b)
Definition: vty.h:18
int sock
Definition: vty.h:255
int fail
Failure count.
Definition: vty.h:90
void * vty_current_index(struct vty *)
return the current index of a given VTY
Definition: vty.c:336
int node
Node status of this vty.
Definition: vty.h:87
int config
In configure mode.
Definition: vty.h:160
void * priv
private data, specified by creator
Definition: vty.h:62
void vty_reset(void)
Reset all VTY status.
Definition: vty.c:1737
int vty_read_config_file(const char *file_name, void *priv)
Read the configuration file using the VTY code.
Definition: vty.c:1864
unsigned char iac
IAC handling.
Definition: vty.h:134
const char * version
version string of the application
Definition: vty.h:186
int fd
File descripter of this vty.
Definition: vty.h:81
static const char * vty_newline(struct vty *vty)
Definition: vty.h:176
int vty_get_bind_port(int default_port)
Returns configured port passed to the 'line vty'/'bind' command or default_port.
Definition: vty.c:1637
void * tall_vty_ctx
Definition: vty.c:107
int vty_current_node(struct vty *vty)
return the current node of a given VTY
Definition: vty.c:342
void * priv
private data, specified by creator
Definition: vty.h:78
struct cmd_element cfg_no_description_cmd
struct buffer * obuf
Output buffer.
Definition: vty.h:93
struct llist_head entry
Definition: vty.h:59
int vty_shell(struct vty *)
Return if this VTY is a shell or not.
Definition: vty.c:254
Structure of a command element.
Definition: command.h:166
void vty_init(struct vty_app_info *app_info)
Initialize VTY layer.
Definition: vty.c:1796
#define TELNET_NAWS_SB_LEN
Definition: vty.h:141
struct vty * vty
Definition: vty.h:256
event
VTY events.
Definition: vty.h:38
int vty_out_newline(struct vty *)
print a newline on the given VTY
Definition: vty.c:328
int hp
History lookup current point.
Definition: vty.h:111
int monitor
Definition: vty.h:157
struct vty * vty_create(int vty_sock, void *priv)
Create new vty structure.
Definition: vty.c:1511
char * vty_get_cwd(void)
Definition: vty.c:1777
void * index_sub
For multiple level index treatment such as key chain and key.
Definition: vty.h:121
int cp
Command cursor point.
Definition: vty.h:99
void vty_hello(struct vty *)
Definition: vty.c:376
signal_vty
signal handling
Definition: vty.h:249
unsigned char iac_sb_in_progress
IAC SB (option subnegotiation) handling.
Definition: vty.h:137
struct vty * vty_new(void)
Allocate a new vty interface structure.
Definition: vty.c:115
Information an application registers with the VTY.
Definition: vty.h:182
vty_type
Definition: vty.h:51
#define VTY_MAXHIST
Definition: vty.h:29
int vty_go_parent(struct vty *vty)
Definition: command.c:2408
const char * vty_get_bind_addr(void)
Definition: vty.c:1630
void * index
For current referencing point of interface, route-map, access-list etc...
Definition: vty.h:118