From 662a1b050093567d96ebab3e98c22effe712e85b Mon Sep 17 00:00:00 2001 From: Wesley Coakley Date: Tue, 6 Oct 2020 16:07:02 -0400 Subject: vtysh: Fix vtysh node build warn errors Two vtysh nodes were misplaced during a recent refactor and were not included under appropriate #ifdef directives and consequently triggered build warnings (errors) Signed-off-by: Wesley Coakley --- vtysh/vtysh.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'vtysh') diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 63610a328..5f8d6603f 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1773,6 +1773,24 @@ DEFUNSH(VTYSH_BGPD, vnc_l2_group, vnc_l2_group_cmd, "vnc l2-group NAME", vty->node = BGP_VNC_L2_GROUP_NODE; return CMD_SUCCESS; } + +DEFUNSH(VTYSH_BGPD, exit_vnc_config, exit_vnc_config_cmd, "exit-vnc", + "Exit from VNC configuration mode\n") +{ + if (vty->node == BGP_VNC_DEFAULTS_NODE + || vty->node == BGP_VNC_NVE_GROUP_NODE + || vty->node == BGP_VNC_L2_GROUP_NODE) + vty->node = BGP_NODE; + return CMD_SUCCESS; +} + +DEFUNSH(VTYSH_BGPD, exit_vrf_policy, exit_vrf_policy_cmd, "exit-vrf-policy", + "Exit from VRF policy configuration mode\n") +{ + if (vty->node == BGP_VRF_POLICY_NODE) + vty->node = BGP_NODE; + return CMD_SUCCESS; +} #endif #endif /* HAVE_BGPD */ @@ -2106,17 +2124,6 @@ DEFUNSH(VTYSH_BGPD, exit_vni, exit_vni_cmd, "exit-vni", "Exit from VNI mode\n") return CMD_SUCCESS; } -DEFUNSH(VTYSH_BGPD, exit_vnc_config, exit_vnc_config_cmd, "exit-vnc", - "Exit from VNC configuration mode\n") -{ - if (vty->node == BGP_VNC_DEFAULTS_NODE - || vty->node == BGP_VNC_NVE_GROUP_NODE - || vty->node == BGP_VNC_L2_GROUP_NODE) - vty->node = BGP_NODE; - return CMD_SUCCESS; - -} - DEFUNSH(VTYSH_BGPD, rpki_exit, rpki_exit_cmd, "exit", "Exit current mode and down to previous mode\n") { @@ -2142,14 +2149,6 @@ DEFUNSH(VTYSH_BGPD, bmp_quit, bmp_quit_cmd, "quit", { return bmp_exit(self, vty, argc, argv); } - -DEFUNSH(VTYSH_BGPD, exit_vrf_policy, exit_vrf_policy_cmd, "exit-vrf-policy", - "Exit from VRF policy configuration mode\n") -{ - if (vty->node == BGP_VRF_POLICY_NODE) - vty->node = BGP_NODE; - return CMD_SUCCESS; -} #endif /* HAVE_BGPD */ DEFUNSH(VTYSH_VRF, exit_vrf_config, exit_vrf_config_cmd, "exit-vrf", -- cgit v1.2.3 From 57a75dc6d529bb40d00693506ed491fd774e7a4e Mon Sep 17 00:00:00 2001 From: Wesley Coakley Date: Tue, 6 Oct 2020 16:37:13 -0400 Subject: vtysh: ignore generated file vtysh_daemons.h Signed-off-by: Wesley Coakley --- vtysh/.gitignore | 1 + 1 file changed, 1 insertion(+) (limited to 'vtysh') diff --git a/vtysh/.gitignore b/vtysh/.gitignore index c1a39b8a1..118b84407 100644 --- a/vtysh/.gitignore +++ b/vtysh/.gitignore @@ -1,3 +1,4 @@ vtysh vtysh_cmd.c extract.pl +vtysh_daemons.h -- cgit v1.2.3