extern void bgp_encap_init (void);
extern int bgp_nlri_parse_encap (struct peer *, struct attr *, struct bgp_nlri *);
- int
- bgp_show_encap (
- struct vty *vty,
- afi_t afi,
- struct prefix_rd *prd,
- enum bgp_show_type type,
- void *output_arg,
- int tags);
++extern int bgp_show_encap (struct vty *vty, afi_t afi, struct prefix_rd *prd,
++ enum bgp_show_type type, void *output_arg, int tags);
#include "bgp_encap_types.h"
#endif /* _QUAGGA_BGP_ENCAP_H */
}
return CMD_SUCCESS;
}
+ #endif
-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_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
-};
-
-static int
+int
bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg, int tags, u_char use_json)
{
extern int
argv_find_and_parse_vpnvx(struct cmd_token **argv, int argc, int *index, afi_t *afi);
- int
- bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
- enum bgp_show_type type, void *output_arg, int tags, u_char use_json);
++extern int bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
++ enum bgp_show_type type, void *output_arg, int tags, u_char use_json);
#endif /* _QUAGGA_BGP_MPLSVPN_H */
#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_lcommunity_all,
- bgp_show_type_lcommunity,
- bgp_show_type_lcommunity_list,
- 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,
+ bgp_show_prefix_list (struct vty *vty, struct bgp *bgp,
const char *prefix_list_str, afi_t afi,
safi_t safi, enum bgp_show_type type);
static int
else
return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL, uj);
}
- else if (strmatch(argv[idx]->text, "community-list"))
- {
- const char *clist_number_or_name = argv[++idx]->arg;
- if (++idx < argc && strmatch (argv[idx]->arg, "exact-match"))
- exact_match = 1;
- return bgp_show_community_list (vty, vrf, clist_number_or_name, exact_match, afi, safi);
- }
- /* prefix-longer */
- 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);
- }
++
+ if (argv_find(argv, argc, "community-list", &idx))
+ {
+ const char *clist_number_or_name = argv[++idx]->arg;
+ if (++idx < argc && strmatch (argv[idx]->text, "exact-match"))
+ exact_match = 1;
+ return bgp_show_community_list (vty, bgp, clist_number_or_name, exact_match, afi, safi);
+ }
+ /* prefix-longer */
+ if (argv_find(argv, argc, "A.B.C.D/M", &idx) || argv_find(argv, argc, "X:X::X:X/M", &idx))
+ return bgp_show_prefix_longer (vty, bgp, 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,
struct bgp_nexthop_cache;
+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_lcommunity_all,
++ bgp_show_type_lcommunity,
++ bgp_show_type_lcommunity_list,
+ bgp_show_type_flap_statistics,
+ bgp_show_type_flap_neighbor,
+ bgp_show_type_dampend_paths,
+ bgp_show_type_damp_neighbor
+};
+
+
#define BGP_SHOW_SCODE_HEADER "Status codes: s suppressed, d damped, "\
"h history, * valid, > best, = multipath,%s"\
" i internal, r RIB-failure, S Stale, R Removed%s"
#include "bgpd/bgp_damp.h"
#include "bgpd/bgp_debug.h"
#include "bgpd/bgp_fsm.h"
--#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_nexthop.h"
#include "bgpd/bgp_open.h"
#include "bgpd/bgp_regex.h"
#include "bgpd/bgp_route.h"
++#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_zebra.h"
#include "bgpd/bgp_table.h"
#include "bgpd/bgp_vty.h"
vty->node = BGP_VPNV6_NODE;
return CMD_SUCCESS;
}
-
-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;
-}
--#endif /* KEEP_OLD_VPN_COMMANDS */
++#endif
DEFUN (address_family_encap,
address_family_encap_cmd,
#ifdef KEEP_OLD_VPN_COMMANDS
install_element (BGP_NODE, &address_family_vpnv4_cmd);
install_element (BGP_NODE, &address_family_vpnv6_cmd);
- install_element (BGP_NODE, &address_family_ipv4_vpn_cmd);
- install_element (BGP_NODE, &address_family_ipv6_vpn_cmd);
#endif /* KEEP_OLD_VPN_COMMANDS */
+
install_element (BGP_NODE, &address_family_encap_cmd);
install_element (BGP_NODE, &address_family_encapv6_cmd);
#include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h"
--#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_route.h"
++#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/rfapi/rfapi.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_attr.h"
--#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/rfapi/bgp_rfapi_cfg.h"
#include "bgpd/rfapi/rfapi.h"
#include "bgpd/rfapi/rfapi_backend.h"
#include "bgpd/bgp_route.h"
++#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_advertise.h"
#include "bgpd/bgp_vnc_types.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_ecommunity.h"
#include "bgpd/bgp_attr.h"
--#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/rfapi/bgp_rfapi_cfg.h"
#include "bgpd/rfapi/rfapi.h"
#include "bgpd/rfapi/rfapi_backend.h"
#include "bgpd/bgp_route.h"
++#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_advertise.h"