summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2016-01-12 13:41:56 -0500
committerPaul Jakma <paul.jakma@hpe.com>2016-02-26 14:11:43 +0000
commit13c378d96a57017f5995b2e0df46cfc31123f0e8 (patch)
tree6b4669bf22264a816ef451f3058cd8f59872eab5 /vtysh/vtysh.c
parent9da04bca0e994ec92b9242159bf27d89c6743354 (diff)
downloadquagga-13c378d96a57017f5995b2e0df46cfc31123f0e8.tar.bz2
quagga-13c378d96a57017f5995b2e0df46cfc31123f0e8.tar.xz
bgpd, lib, vtysh: hook up bgp VPNv6 CLI node
Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh/vtysh.c')
-rw-r--r--vtysh/vtysh.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 2703bb99..418e5d76 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -280,7 +280,8 @@ vtysh_execute_func (const char *line, int pager)
* to move into node in the vtysh where it succeeded. */
if (ret == CMD_SUCCESS || ret == CMD_SUCCESS_DAEMON || ret == CMD_WARNING)
{
- if ((saved_node == BGP_VPNV4_NODE || saved_node == BGP_IPV4_NODE
+ if ((saved_node == BGP_VPNV4_NODE || saved_node == BGP_VPNV6_NODE
+ || saved_node == BGP_IPV4_NODE
|| saved_node == BGP_IPV6_NODE || saved_node == BGP_IPV4M_NODE
|| saved_node == BGP_IPV6M_NODE)
&& (tried == 1))
@@ -684,6 +685,12 @@ static struct cmd_node bgp_vpnv4_node =
"%s(config-router-af)# "
};
+static struct cmd_node bgp_vpnv6_node =
+{
+ BGP_VPNV6_NODE,
+ "%s(config-router-af)# "
+};
+
static struct cmd_node bgp_ipv4_node =
{
BGP_IPV4_NODE,
@@ -819,6 +826,29 @@ DEFUNSH (VTYSH_BGPD,
}
DEFUNSH (VTYSH_BGPD,
+ address_family_vpnv6,
+ address_family_vpnv6_cmd,
+ "address-family vpnv6",
+ "Enter Address Family command mode\n"
+ "Address family\n")
+{
+ vty->node = BGP_VPNV6_NODE;
+ return CMD_SUCCESS;
+}
+
+DEFUNSH (VTYSH_BGPD,
+ address_family_vpnv6_unicast,
+ address_family_vpnv6_unicast_cmd,
+ "address-family vpnv6 unicast",
+ "Enter Address Family command mode\n"
+ "Address family\n"
+ "Address Family Modifier\n")
+{
+ vty->node = BGP_VPNV6_NODE;
+ return CMD_SUCCESS;
+}
+
+DEFUNSH (VTYSH_BGPD,
address_family_ipv4_unicast,
address_family_ipv4_unicast_cmd,
"address-family ipv4 unicast",
@@ -1043,6 +1073,7 @@ vtysh_exit (struct vty *vty)
vty->node = CONFIG_NODE;
break;
case BGP_VPNV4_NODE:
+ case BGP_VPNV6_NODE:
case BGP_IPV4_NODE:
case BGP_IPV4M_NODE:
case BGP_IPV6_NODE:
@@ -1081,6 +1112,7 @@ DEFUNSH (VTYSH_BGPD,
if (vty->node == BGP_IPV4_NODE
|| vty->node == BGP_IPV4M_NODE
|| vty->node == BGP_VPNV4_NODE
+ || vty->node == BGP_VPNV6_NODE
|| vty->node == BGP_IPV6_NODE
|| vty->node == BGP_IPV6M_NODE)
vty->node = BGP_NODE;
@@ -2275,6 +2307,7 @@ vtysh_init_vty (void)
install_node (&rmap_node, NULL);
install_node (&zebra_node, NULL);
install_node (&bgp_vpnv4_node, NULL);
+ install_node (&bgp_vpnv6_node, NULL);
install_node (&bgp_ipv4_node, NULL);
install_node (&bgp_ipv4m_node, NULL);
/* #ifdef HAVE_IPV6 */
@@ -2301,6 +2334,7 @@ vtysh_init_vty (void)
vtysh_install_default (RMAP_NODE);
vtysh_install_default (ZEBRA_NODE);
vtysh_install_default (BGP_VPNV4_NODE);
+ vtysh_install_default (BGP_VPNV6_NODE);
vtysh_install_default (BGP_IPV4_NODE);
vtysh_install_default (BGP_IPV4M_NODE);
vtysh_install_default (BGP_IPV6_NODE);
@@ -2337,6 +2371,8 @@ vtysh_init_vty (void)
install_element (BGP_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_VPNV4_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_VPNV4_NODE, &vtysh_quit_bgpd_cmd);
+ install_element (BGP_VPNV6_NODE, &vtysh_exit_bgpd_cmd);
+ install_element (BGP_VPNV6_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_IPV4_NODE, &vtysh_exit_bgpd_cmd);
install_element (BGP_IPV4_NODE, &vtysh_quit_bgpd_cmd);
install_element (BGP_IPV4M_NODE, &vtysh_exit_bgpd_cmd);
@@ -2368,6 +2404,7 @@ vtysh_init_vty (void)
install_element (BGP_IPV4_NODE, &vtysh_end_all_cmd);
install_element (BGP_IPV4M_NODE, &vtysh_end_all_cmd);
install_element (BGP_VPNV4_NODE, &vtysh_end_all_cmd);
+ install_element (BGP_VPNV6_NODE, &vtysh_end_all_cmd);
install_element (BGP_IPV6_NODE, &vtysh_end_all_cmd);
install_element (BGP_IPV6M_NODE, &vtysh_end_all_cmd);
install_element (ISIS_NODE, &vtysh_end_all_cmd);
@@ -2394,6 +2431,8 @@ vtysh_init_vty (void)
install_element (CONFIG_NODE, &router_bgp_view_cmd);
install_element (BGP_NODE, &address_family_vpnv4_cmd);
install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd);
+ install_element (BGP_NODE, &address_family_vpnv6_cmd);
+ install_element (BGP_NODE, &address_family_vpnv6_unicast_cmd);
install_element (BGP_NODE, &address_family_ipv4_unicast_cmd);
install_element (BGP_NODE, &address_family_ipv4_multicast_cmd);
#ifdef HAVE_IPV6
@@ -2401,6 +2440,7 @@ vtysh_init_vty (void)
install_element (BGP_NODE, &address_family_ipv6_unicast_cmd);
#endif
install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
+ install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);
install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
install_element (BGP_IPV6_NODE, &exit_address_family_cmd);