summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2017-04-27 00:39:10 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2017-04-27 00:39:10 +0200
commit39530dfe75a574dbf283ac39fcbee5481bd4aaae (patch)
tree6f3284f9d55610eee0ed4bc835dbb1fc8f5a8656
parentMerge pull request #399 from donaldsharp/is_configured (diff)
downloadfrr-39530dfe75a574dbf283ac39fcbee5481bd4aaae.tar.xz
frr-39530dfe75a574dbf283ac39fcbee5481bd4aaae.zip
Problem with DEFUNSH in vtysh, issue #358
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
-rw-r--r--vtysh/vtysh.c128
1 files changed, 75 insertions, 53 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 1e70858df..682cd99c2 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1134,81 +1134,99 @@ DEFUNSH (VTYSH_BGPD,
}
DEFUNSH (VTYSH_BGPD,
- address_family_encapv4,
- address_family_encapv4_cmd,
- "address-family <encap|encapv4>",
- "Enter Address Family command mode\n"
+ address_family_encapv4,
+ address_family_encapv4_cmd,
+ "address-family [ipv4] <encap|encapv4>",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
"Address Family\n"
- "Address Family\n")
+ "Address Family\n")
{
vty->node = BGP_ENCAP_NODE;
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
- address_family_encapv6,
- address_family_encapv6_cmd,
- "address-family encapv6",
- "Enter Address Family command mode\n"
- "Address Family\n")
+ address_family_encapv6,
+ address_family_encapv6_cmd,
+ "address-family [ipv6] encapv6",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
+ "Address Family\n")
{
vty->node = BGP_ENCAPV6_NODE;
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
- address_family_ipv4_unicast,
- address_family_ipv4_unicast_cmd,
- "address-family ipv4 [<unicast|multicast|vpn|encap>]",
- "Enter Address Family command mode\n"
- "Address Family\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n")
+ address_family_ipv4,
+ address_family_ipv4_cmd,
+ "address-family ipv4 [unicast]",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
+ "Address Family Modifier\n")
{
- int idx = 0;
-
- if (argv_find (argv, argc, "multicast", &idx))
- vty->node = BGP_IPV4M_NODE;
-
- else if (argv_find (argv, argc, "encap", &idx))
- vty->node = BGP_ENCAP_NODE;
-
- else if (argv_find (argv, argc, "vpn", &idx))
- vty->node = BGP_VPNV4_NODE;
-
- else
- vty->node = BGP_IPV4_NODE;
-
+ vty->node = BGP_IPV4_NODE;
return CMD_SUCCESS;
}
DEFUNSH (VTYSH_BGPD,
- address_family_ipv6,
- address_family_ipv6_cmd,
- "address-family ipv6 [<unicast|multicast|vpn|encap>]",
- "Enter Address Family command mode\n"
- "Address Family\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n"
- "Address Family Modifier\n")
+ address_family_ipv4_multicast,
+ address_family_ipv4_multicast_cmd,
+ "address-family ipv4 multicast",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
+ "Address Family modifier\n")
{
- int idx = 0;
-
- if (argv_find (argv, argc, "multicast", &idx))
- vty->node = BGP_IPV6M_NODE;
+ vty->node = BGP_IPV4M_NODE;
+ return CMD_SUCCESS;
+}
- else if (argv_find (argv, argc, "encap", &idx))
- vty->node = BGP_ENCAPV6_NODE;
+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;
+}
- else if (argv_find (argv, argc, "vpn", &idx))
- vty->node = BGP_VPNV6_NODE;
+DEFUNSH (VTYSH_BGPD,
+ address_family_ipv6,
+ address_family_ipv6_cmd,
+ "address-family ipv6 [unicast]",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
+ "Address Family modifier\n")
+{
+ vty->node = BGP_IPV6_NODE;
+ return CMD_SUCCESS;
+}
- else
- vty->node = BGP_IPV6_NODE;
+DEFUNSH (VTYSH_BGPD,
+ address_family_ipv6_multicast,
+ address_family_ipv6_multicast_cmd,
+ "address-family ipv6 multicast",
+ "Enter Address Family command mode\n"
+ "Address Family\n"
+ "Address Family modifier\n")
+{
+ vty->node = BGP_IPV6M_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;
}
@@ -3335,8 +3353,12 @@ vtysh_init_vty (void)
install_element (BGP_NODE, &vnc_nve_group_cmd);
install_element (BGP_NODE, &vnc_l2_group_cmd);
#endif
- install_element (BGP_NODE, &address_family_ipv4_unicast_cmd);
+ install_element (BGP_NODE, &address_family_ipv4_cmd);
+ install_element (BGP_NODE, &address_family_ipv4_multicast_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_multicast_cmd);
+ install_element (BGP_NODE, &address_family_ipv6_vpn_cmd);
install_element (BGP_NODE, &address_family_evpn_cmd);
install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
install_element (BGP_VPNV6_NODE, &exit_address_family_cmd);