From fd420a3275a622846858e56460fe9e04ddef3f7f Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 3 Feb 2017 10:29:53 -0500 Subject: bgpd, vtysh: Fix vtysh able to handle some safi modes for bgp This adds the ability for vtysh to handle v4 and v6 safi modes besides unicast and multicast. Signed-off-by: Donald Sharp " " (view|vrf) WORD"'} = "ignore"; $ignore{'"router isis WORD"'} = "ignore"; $ignore{'"router zebra"'} = "ignore"; $ignore{'"address-family ipv4"'} = "ignore"; -$ignore{'"address-family ipv4 (unicast|multicast)"'} = "ignore"; +$ignore{'"address-family ipv4 (unicast|multicast|vpn|encap)"'} = "ignore"; $ignore{'"address-family ipv6"'} = "ignore"; -$ignore{'"address-family ipv6 (unicast|multicast)"'} = "ignore"; +$ignore{'"address-family ipv6 (unicast|multicast|vpn|encap)"'} = "ignore"; $ignore{'"address-family ipv4 vpn"'} = "ignore"; $ignore{'"address-family vpnv4"'} = "ignore"; $ignore{'"address-family vpnv4 unicast"'} = "ignore"; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 17f6bfa5a..6f9273e88 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1215,6 +1215,31 @@ DEFUNSH (VTYSH_BGPD, return CMD_SUCCESS; } +DEFUNSH (VTYSH_BGPD, + address_family_ipv4_encap, + address_family_ipv4_encap_cmd, + "address-family ipv4 encap", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_ENCAP_NODE; + return CMD_SUCCESS; +} + +DEFUNSH (VTYSH_BGPD, + address_family_ipv4_vpn, + address_family_ipv4_vpn_cmd, + "address-family ipv4 vpn", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_VPNV4_NODE; + return CMD_SUCCESS; +} + + DEFUNSH (VTYSH_BGPD, address_family_ipv6, address_family_ipv6_cmd, @@ -1250,6 +1275,30 @@ DEFUNSH (VTYSH_BGPD, return CMD_SUCCESS; } +DEFUNSH (VTYSH_BGPD, + address_family_ipv6_encap, + address_family_ipv6_encap_cmd, + "address-family ipv6 encap", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_ENCAPV6_NODE; + return CMD_SUCCESS; +} + +DEFUNSH (VTYSH_BGPD, + address_family_ipv6_vpn, + address_family_ipv6_vpn_cmd, + "address-family ipv6 vpn", + "Enter Address Family command mode\n" + "Address family\n" + "Address Family Modifier\n") +{ + vty->node = BGP_VPNV6_NODE; + return CMD_SUCCESS; +} + #if defined (ENABLE_BGP_VNC) DEFUNSH (VTYSH_BGPD, vnc_defaults, @@ -3373,11 +3422,13 @@ vtysh_init_vty (void) #endif install_element (BGP_NODE, &address_family_ipv4_unicast_cmd); install_element (BGP_NODE, &address_family_ipv4_multicast_cmd); -#ifdef HAVE_IPV6 + install_element (BGP_NODE, &address_family_ipv4_encap_cmd); + install_element (BGP_NODE, &address_family_ipv4_vpn_cmd); install_element (BGP_NODE, &address_family_ipv6_cmd); install_element (BGP_NODE, &address_family_ipv6_unicast_cmd); install_element (BGP_NODE, &address_family_ipv6_multicast_cmd); -#endif + install_element (BGP_NODE, &address_family_ipv6_encap_cmd); + install_element (BGP_NODE, &address_family_ipv6_vpn_cmd); install_element (BGP_VPNV4_NODE, &exit_address_family_cmd); install_element (BGP_VPNV6_NODE, &exit_address_family_cmd); install_element (BGP_ENCAP_NODE, &exit_address_family_cmd); -- cgit v1.2.3