bgp_show_type_community_list_exact
};
-static int
+int
bgp_show_encap (
struct vty *vty,
afi_t afi,
return CMD_SUCCESS;
}
-DEFUN (show_bgp_ipv4_encap,
- show_bgp_ipv4_encap_cmd,
- "show [ip] bgp ipv4 encap",
- SHOW_STR
- IP_STR
- BGP_STR
- "Address Family\n"
- "Display ENCAP NLRI specific information\n")
-{
- return bgp_show_encap (vty, AFI_IP, NULL, bgp_show_type_normal, NULL, 0);
-}
-
-DEFUN (show_bgp_ipv6_encap,
- show_bgp_ipv6_encap_cmd,
- "show [ip] bgp ipv6 encap",
- SHOW_STR
- IP_STR
- BGP_STR
- "Address Family\n"
- "Display ENCAP NLRI specific information\n")
-{
- return bgp_show_encap (vty, AFI_IP6, NULL, bgp_show_type_normal, NULL, 0);
-}
-
DEFUN (show_bgp_ipv4_encap_rd,
show_bgp_ipv4_encap_rd_cmd,
"show [ip] bgp ipv4 encap rd ASN:nn_or_IP-address:nn",
install_element (BGP_ENCAP_NODE, &encap_network_cmd);
install_element (BGP_ENCAP_NODE, &no_encap_network_cmd);
- install_element (VIEW_NODE, &show_bgp_ipv4_encap_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_neighbor_advertised_routes_cmd);
install_element (VIEW_NODE, &show_bgp_ipv4_encap_rd_neighbor_advertised_routes_cmd);
- install_element (VIEW_NODE, &show_bgp_ipv6_encap_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_tags_cmd);
install_element (VIEW_NODE, &show_bgp_ipv6_encap_rd_tags_cmd);
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);
#include "bgp_encap_types.h"
#endif /* _QUAGGA_BGP_ENCAP_H */
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)
{
return CMD_SUCCESS;
}
-DEFUN (show_bgp_ip_vpn_rd,
- show_bgp_ip_vpn_rd_cmd,
- "show [ip] bgp "BGP_AFI_CMD_STR" vpn [rd ASN:nn_or_IP-address:nn] [json]",
- SHOW_STR
- IP_STR
- BGP_STR
- BGP_VPNVX_HELP_STR
- "Display VPN NLRI specific information\n"
- "Display information for a route distinguisher\n"
- "VPN Route Distinguisher\n"
- JSON_STR)
-{
- int idx_ext_community = 5;
- int ret;
- struct prefix_rd prd;
- afi_t afi;
- int idx = 0;
-
- if (argv_find_and_parse_afi (argv, argc, &idx, &afi))
- {
- if (argv[idx_ext_community]->arg)
- {
- ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
- if (! ret)
- {
- vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return bgp_show_mpls_vpn (vty, afi, &prd, bgp_show_type_normal, NULL, 0, use_json (argc, argv));
- }
- else
- {
- return bgp_show_mpls_vpn (vty, afi, NULL, bgp_show_type_normal, NULL, 0, use_json (argc, argv));
- }
- }
- return CMD_SUCCESS;
-}
-
#ifdef KEEP_OLD_VPN_COMMANDS
DEFUN (show_ip_bgp_vpn_all,
show_ip_bgp_vpn_all_cmd,
install_element (BGP_VPNV6_NODE, &vpnv6_network_cmd);
install_element (BGP_VPNV6_NODE, &no_vpnv6_network_cmd);
- install_element (VIEW_NODE, &show_bgp_ip_vpn_rd_cmd);
#ifdef KEEP_OLD_VPN_COMMANDS
install_element (VIEW_NODE, &show_ip_bgp_vpn_all_cmd);
install_element (VIEW_NODE, &show_ip_bgp_vpn_rd_cmd);
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);
#endif /* _QUAGGA_BGP_MPLSVPN_H */
#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"
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,