diff options
Diffstat (limited to 'lib/vty.h')
| -rw-r--r-- | lib/vty.h | 36 |
1 files changed, 30 insertions, 6 deletions
@@ -31,15 +31,27 @@ #include "compiler.h" #include "northbound.h" +#ifdef __cplusplus +extern "C" { +#endif + #define VTY_BUFSIZ 4096 #define VTY_MAXHIST 20 #define VTY_MAXDEPTH 8 +#define VTY_MAXCFGCHANGES 8 + struct vty_error { char error_buf[VTY_BUFSIZ]; uint32_t line_num; }; +struct vty_cfg_change { + char xpath[XPATH_MAXLEN]; + enum nb_operation operation; + const char *value; +}; + /* VTY struct. */ struct vty { /* File descripter of this vty. */ @@ -98,10 +110,17 @@ struct vty { /* History insert end point */ int hindex; + /* Changes enqueued to be applied in the candidate configuration. */ + size_t num_cfg_changes; + struct vty_cfg_change cfg_changes[VTY_MAXCFGCHANGES]; + /* XPath of the current node */ int xpath_index; char xpath[VTY_MAXDEPTH][XPATH_MAXLEN]; + /* In configure mode. */ + bool config; + /* Private candidate configuration mode. */ bool private_config; @@ -111,6 +130,10 @@ struct vty { /* Base candidate configuration. */ struct nb_config *candidate_config_base; + /* Confirmed-commit timeout and rollback configuration. */ + struct thread *t_confirmed_commit_timeout; + struct nb_config *confirmed_commit_rollback; + /* qobj object ID (replacement for "index") */ uint64_t qobj_index; @@ -149,9 +172,6 @@ struct vty { /* Terminal monitor. */ int monitor; - /* In configure mode. */ - int config; - /* Read and write thread. */ struct thread *t_read; struct thread *t_write; @@ -299,9 +319,9 @@ extern void vty_close(struct vty *); extern char *vty_get_cwd(void); extern void vty_log(const char *level, const char *proto, const char *fmt, struct timestamp_control *, va_list); -extern int vty_config_lock(struct vty *); -extern int vty_config_unlock(struct vty *); -extern void vty_config_lockless(void); +extern int vty_config_enter(struct vty *vty, bool private_config, + bool exclusive); +extern void vty_config_exit(struct vty *); extern int vty_config_exclusive_lock(struct vty *vty); extern void vty_config_exclusive_unlock(struct vty *vty); extern int vty_shell(struct vty *); @@ -317,4 +337,8 @@ extern void vty_stdio_close(void); an async-signal-safe function. */ extern void vty_log_fixed(char *buf, size_t len); +#ifdef __cplusplus +} +#endif + #endif /* _ZEBRA_VTY_H */ |
