-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some encap/mpls commands #111
Changes from all commits
1496eba
4e01997
b2f0fa5
75688c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
#include "bgpd/bgp_filter.h" | ||
#include "bgpd/bgp_fsm.h" | ||
#include "bgpd/bgp_mplsvpn.h" | ||
#include "bgpd/bgp_encap.h" | ||
#include "bgpd/bgp_nexthop.h" | ||
#include "bgpd/bgp_damp.h" | ||
#include "bgpd/bgp_advertise.h" | ||
|
@@ -7213,27 +7214,6 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, | |
#define BGP_SHOW_DAMP_HEADER " Network From Reuse Path%s" | ||
#define BGP_SHOW_FLAP_HEADER " Network From Flaps Duration Reuse Path%s" | ||
|
||
enum bgp_show_type | ||
{ | ||
bgp_show_type_normal, | ||
bgp_show_type_regexp, | ||
bgp_show_type_prefix_list, | ||
bgp_show_type_filter_list, | ||
bgp_show_type_route_map, | ||
bgp_show_type_neighbor, | ||
bgp_show_type_cidr_only, | ||
bgp_show_type_prefix_longer, | ||
bgp_show_type_community_all, | ||
bgp_show_type_community, | ||
bgp_show_type_community_exact, | ||
bgp_show_type_community_list, | ||
bgp_show_type_community_list_exact, | ||
bgp_show_type_flap_statistics, | ||
bgp_show_type_flap_neighbor, | ||
bgp_show_type_dampend_paths, | ||
bgp_show_type_damp_neighbor | ||
}; | ||
|
||
static int | ||
bgp_show_prefix_list (struct vty *vty, const char *name, | ||
const char *prefix_list_str, afi_t afi, | ||
|
@@ -7902,15 +7882,9 @@ DEFUN (show_ip_bgp_ipv4, | |
afi = strmatch(argv[idx]->text, "ipv6") ? AFI_IP6 : AFI_IP; | ||
if (argv_find (argv, argc, "unicast", &idx) || argv_find (argv, argc, "multicast", &idx)) | ||
safi = bgp_vty_safi_from_arg (argv[idx]->text); | ||
else if (argv_find (argv, argc, "encap", &idx) || argv_find (argv, argc, "vpn", &idx)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be changed to use bgp_vty_find_and_parse_afi_safi_vrf (PR #107) if (argv_find_and_parse_afi (argv, argc, &idx, &afi)) |
||
safi = strmatch (argv[idx]->text, "encap") ? SAFI_ENCAP : SAFI_MPLS_VPN; | ||
} | ||
else if (argv_find (argv, argc, "encap", &idx) || argv_find (argv, argc, "vpnv4", &idx)) | ||
{ | ||
afi = AFI_IP; | ||
safi = strmatch (argv[idx]->text, "encap") ? SAFI_ENCAP : SAFI_MPLS_VPN; | ||
// advance idx if necessary | ||
argv_find (argv, argc, "unicast", &idx); | ||
} | ||
|
||
int uj = use_json (argc, argv); | ||
if (uj) argc--; | ||
|
||
|
@@ -7972,8 +7946,12 @@ DEFUN (show_ip_bgp_ipv4, | |
else if (argv[idx]->type == IPV4_TKN || argv[idx]->type == IPV6_TKN) | ||
return bgp_show_prefix_longer (vty, vrf, argv[idx + 1]->arg, afi, safi, bgp_show_type_prefix_longer); | ||
} | ||
|
||
return bgp_show (vty, bgp, afi, safi, sh_type, NULL, uj); | ||
if (safi == SAFI_MPLS_VPN) | ||
return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, uj); | ||
else if (safi == SAFI_ENCAP) | ||
return bgp_show_encap (vty, afi, NULL, bgp_show_type_normal, NULL, 0); | ||
else | ||
return bgp_show (vty, bgp, afi, safi, sh_type, NULL, uj); | ||
} | ||
|
||
DEFUN (show_ip_bgp_route, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5588,28 +5588,6 @@ DEFUN (address_family_vpnv6, | |
} | ||
#endif /* KEEP_OLD_VPN_COMMANDS */ | ||
|
||
DEFUN (address_family_ipv4_vpn, | ||
address_family_ipv4_vpn_cmd, | ||
"address-family ipv4 vpn", | ||
"Enter Address Family command mode\n" | ||
"Address Family\n" | ||
"Subsequent Address Family modifier\n") | ||
{ | ||
vty->node = BGP_VPNV4_NODE; | ||
return CMD_SUCCESS; | ||
} | ||
|
||
DEFUN (address_family_ipv6_vpn, | ||
address_family_ipv6_vpn_cmd, | ||
"address-family ipv6 vpn", | ||
"Enter Address Family command mode\n" | ||
"Address Family\n" | ||
"Subsequent Address Family modifier\n") | ||
{ | ||
vty->node = BGP_VPNV6_NODE; | ||
return CMD_SUCCESS; | ||
} | ||
|
||
DEFUN (address_family_encap, | ||
address_family_encap_cmd, | ||
"address-family <encap|encapv4>", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this now defined? |
||
|
@@ -10717,9 +10695,6 @@ bgp_vty_init (void) | |
install_element (BGP_NODE, &address_family_vpnv4_cmd); | ||
install_element (BGP_NODE, &address_family_vpnv6_cmd); | ||
#endif /* KEEP_OLD_VPN_COMMANDS */ | ||
install_element (BGP_NODE, &address_family_ipv4_vpn_cmd); | ||
install_element (BGP_NODE, &address_family_ipv6_vpn_cmd); | ||
|
||
install_element (BGP_NODE, &address_family_encap_cmd); | ||
install_element (BGP_NODE, &address_family_encapv6_cmd); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stay consistent with the code around this new declaration