summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-02-03 16:29:53 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-02-03 16:29:53 +0100
commitfd420a3275a622846858e56460fe9e04ddef3f7f (patch)
tree09f61280acc468b7a4fd0f649143fcc59a9c78df /vtysh
parentbgpd: Put back original behavior for some show bgp commands (diff)
downloadfrr-fd420a3275a622846858e56460fe9e04ddef3f7f.tar.xz
frr-fd420a3275a622846858e56460fe9e04ddef3f7f.zip
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 <sharpd@cumulusnetworks.com.
Diffstat (limited to 'vtysh')
-rwxr-xr-xvtysh/extract.pl.in4
-rw-r--r--vtysh/vtysh.c55
2 files changed, 55 insertions, 4 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 9813b19ce..8842f3f5d 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -53,9 +53,9 @@ $ignore{'"router bgp " "<1-4294967295>" " (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
@@ -1216,6 +1216,31 @@ DEFUNSH (VTYSH_BGPD,
}
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,
"address-family ipv6",
@@ -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);