From: David Lamparter Date: Tue, 8 Nov 2016 18:41:48 +0000 (+0100) Subject: vtysh: add watchquagga to target list X-Git-Tag: frr-2.0-rc1~72^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4a96e94474ec52767a18df7e84873d752d863834;p=mirror%2Ffrr.git vtysh: add watchquagga to target list Also tag some commands as VTYSH_REALLYALL; these are absolutely neccessary for correct vtysh operation and will cause "interesting" breakage if not present on all daemons. Signed-off-by: David Lamparter --- diff --git a/configure.ac b/configure.ac index c99ba222d6..4032a447cc 100755 --- a/configure.ac +++ b/configure.ac @@ -1735,6 +1735,7 @@ AC_DEFINE_UNQUOTED(OSPF6_VTYSH_PATH, "$quagga_statedir/ospf6d.vty",ospf6d vty so AC_DEFINE_UNQUOTED(LDP_VTYSH_PATH, "$quagga_statedir/ldpd.vty",ldpd vty socket) AC_DEFINE_UNQUOTED(ISIS_VTYSH_PATH, "$quagga_statedir/isisd.vty",isisd vty socket) AC_DEFINE_UNQUOTED(PIM_VTYSH_PATH, "$quagga_statedir/pimd.vty",pimd vty socket) +AC_DEFINE_UNQUOTED(WATCHQUAGGA_VTYSH_PATH, "$quagga_statedir/watchquagga.vty",watchquagga vty socket) AC_DEFINE_UNQUOTED(DAEMON_VTY_DIR, "$quagga_statedir",daemon vty directory) dnl autoconf does this, but it does it too late... diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index ed6c892ba4..9888c35346 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -73,6 +73,7 @@ struct vtysh_client vtysh_client[] = { .fd = -1, .name = "bgpd", .flag = VTYSH_BGPD, .path = BGP_VTYSH_PATH, .next = NULL}, { .fd = -1, .name = "isisd", .flag = VTYSH_ISISD, .path = ISIS_VTYSH_PATH, .next = NULL}, { .fd = -1, .name = "pimd", .flag = VTYSH_PIMD, .path = PIM_VTYSH_PATH, .next = NULL}, + { .fd = -1, .name = "watchquagga", .flag = VTYSH_WATCHQUAGGA, .path = WATCHQUAGGA_VTYSH_PATH, .next = NULL}, }; enum vtysh_write_integrated vtysh_write_integrated = WRITE_INTEGRATED_UNSPECIFIED; @@ -1073,7 +1074,7 @@ vtysh_end (void) return CMD_SUCCESS; } -DEFUNSH (VTYSH_ALL, +DEFUNSH (VTYSH_REALLYALL, vtysh_end_all, vtysh_end_all_cmd, "end", @@ -1480,8 +1481,8 @@ DEFUNSH (VTYSH_ALL, return CMD_SUCCESS; } -DEFUNSH (VTYSH_ALL, - vtysh_enable, +DEFUNSH (VTYSH_REALLYALL, + vtysh_enable, vtysh_enable_cmd, "enable", "Turn on privileged mode command\n") @@ -1490,8 +1491,8 @@ DEFUNSH (VTYSH_ALL, return CMD_SUCCESS; } -DEFUNSH (VTYSH_ALL, - vtysh_disable, +DEFUNSH (VTYSH_REALLYALL, + vtysh_disable, vtysh_disable_cmd, "disable", "Turn off privileged mode command\n") @@ -1501,7 +1502,7 @@ DEFUNSH (VTYSH_ALL, return CMD_SUCCESS; } -DEFUNSH (VTYSH_ALL, +DEFUNSH (VTYSH_REALLYALL, vtysh_config_terminal, vtysh_config_terminal_cmd, "configure terminal", @@ -1582,7 +1583,7 @@ vtysh_exit (struct vty *vty) return CMD_SUCCESS; } -DEFUNSH (VTYSH_ALL, +DEFUNSH (VTYSH_REALLYALL, vtysh_exit_all, vtysh_exit_all_cmd, "exit", diff --git a/vtysh/vtysh.h b/vtysh/vtysh.h index d515918e03..dade049ad7 100644 --- a/vtysh/vtysh.h +++ b/vtysh/vtysh.h @@ -34,7 +34,13 @@ DECLARE_MGROUP(MVTYSH) #define VTYSH_ISISD 0x40 #define VTYSH_PIMD 0x100 #define VTYSH_LDPD 0x200 +#define VTYSH_WATCHQUAGGA 0x400 +/* commands in REALLYALL are crucial to correct vtysh operation */ +#define VTYSH_REALLYALL ~0U +/* watchquagga is not in ALL since library CLI functions should not be + * run on it (logging & co. should stay in a fixed/frozen config, and + * things like prefix lists are not even initialised) */ #define VTYSH_ALL VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD #define VTYSH_RMAP VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_PIMD #define VTYSH_INTERFACE VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_LDPD|VTYSH_ISISD|VTYSH_PIMD