]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/vty.h
eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
[mirror_frr.git] / lib / vty.h
index 4c434fb2f206eaa43c6113d622528e53119ec47a..79b1bd5e9311aee3d44d0e3947d6f1e294e287f5 100644 (file)
--- a/lib/vty.h
+++ b/lib/vty.h
 #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 +106,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 +126,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 +168,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 +315,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 *);