diff options
Diffstat (limited to 'lib/vty.h')
| -rw-r--r-- | lib/vty.h | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -34,6 +34,7 @@ #include "qobj.h" #include "compiler.h" #include "northbound.h" +#include "zlog_live.h" #ifdef __cplusplus extern "C" { @@ -161,7 +162,22 @@ struct vty { unsigned char escape; /* Current vty status. */ - enum { VTY_NORMAL, VTY_CLOSE, VTY_MORE, VTY_MORELINE } status; + enum { + VTY_NORMAL, + VTY_CLOSE, + VTY_MORE, + VTY_MORELINE, + VTY_PASSFD, + } status; + + /* vtysh socket/fd passing (for terminal monitor) */ + int pass_fd; + + /* CLI command return value (likely CMD_SUCCESS) when pass_fd != -1 */ + uint8_t pass_fd_status[4]; + + /* live logging target / terminal monitor */ + struct zlog_live_cfg live_log; /* IAC handling: was the last character received the IAC (interpret-as-command) escape character (and therefore the next @@ -186,9 +202,6 @@ struct vty { /* Configure lines. */ int lines; - /* Terminal monitor. */ - int monitor; - /* Read and write thread. */ struct thread *t_read; struct thread *t_write; @@ -329,6 +342,11 @@ extern bool vty_set_include(struct vty *vty, const char *regexp); */ extern int vty_json(struct vty *vty, struct json_object *json); +/* post fd to be passed to the vtysh client + * fd is owned by the VTY code after this and will be closed when done + */ +extern void vty_pass_fd(struct vty *vty, int fd); + extern bool vty_read_config(struct nb_config *config, const char *config_file, char *config_default_dir); extern void vty_time_print(struct vty *, int); |
