bgpd: remove HAVE_IPV6 conditionals
Signed-off-by: Lou Berger <lberger@labn.net>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 93c613f..0dcae61 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -838,10 +838,8 @@
{
if (p->family == AF_INET && p->u.prefix4.s_addr == INADDR_ANY)
return 0;
-#ifdef HAVE_IPV6
else if (p->family == AF_INET6 && p->prefixlen == 0)
return 0;
-#endif /* HAVE_IPV6 */
}
/* Transparency check. */
@@ -985,31 +983,25 @@
(safi != SAFI_ENCAP && p->family == AF_INET) || \
(safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 4))
-#ifdef HAVE_IPV6
#define NEXTHOP_IS_V6 (\
(safi != SAFI_ENCAP && p->family == AF_INET6) || \
(safi == SAFI_ENCAP && attr->extra->mp_nexthop_len == 16))
-#endif
/* next-hop-set */
if (transparent
|| (reflect && ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF_ALL))
|| (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED)
&& ((NEXTHOP_IS_V4 && attr->nexthop.s_addr)
-#ifdef HAVE_IPV6
|| (NEXTHOP_IS_V6 &&
! IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
)))
{
/* NEXT-HOP Unchanged. */
}
else if (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF)
|| (NEXTHOP_IS_V4 && attr->nexthop.s_addr == 0)
-#ifdef HAVE_IPV6
|| (NEXTHOP_IS_V6 &&
IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
|| (peer->sort == BGP_PEER_EBGP
&& bgp_multiaccess_check_v4 (attr->nexthop, peer->host) == 0))
{
@@ -1022,7 +1014,6 @@
else
memcpy (&attr->nexthop, &peer->nexthop.v4, IPV4_MAX_BYTELEN);
}
-#ifdef HAVE_IPV6
/* Set IPv6 nexthop. */
if (NEXTHOP_IS_V6)
{
@@ -1031,10 +1022,8 @@
IPV6_MAX_BYTELEN);
attr->extra->mp_nexthop_len = 16;
}
-#endif /* HAVE_IPV6 */
}
-#ifdef HAVE_IPV6
if (p->family == AF_INET6 && safi != SAFI_ENCAP)
{
/* Left nexthop_local unchanged if so configured. */
@@ -1073,7 +1062,6 @@
}
}
-#endif /* HAVE_IPV6 */
/* If this is EBGP peer and remove-private-AS is set. */
if (peer->sort == BGP_PEER_EBGP
@@ -1154,10 +1142,8 @@
{
if (p->family == AF_INET && p->u.prefix4.s_addr == INADDR_ANY)
return 0;
-#ifdef HAVE_IPV6
else if (p->family == AF_INET6 && p->prefixlen == 0)
return 0;
-#endif /* HAVE_IPV6 */
}
/* If the attribute has originator-id and it is same as remote
@@ -1216,10 +1202,8 @@
/* next-hop-set */
if ((p->family == AF_INET && attr->nexthop.s_addr == 0)
-#ifdef HAVE_IPV6
|| (p->family == AF_INET6 &&
IN6_IS_ADDR_UNSPECIFIED(&attr->extra->mp_nexthop_global))
-#endif /* HAVE_IPV6 */
)
{
/* Set IPv4 nexthop. */
@@ -1231,7 +1215,6 @@
else
memcpy (&attr->nexthop, &rsclient->nexthop.v4, IPV4_MAX_BYTELEN);
}
-#ifdef HAVE_IPV6
/* Set IPv6 nexthop. */
if (p->family == AF_INET6)
{
@@ -1240,10 +1223,8 @@
IPV6_MAX_BYTELEN);
attr->extra->mp_nexthop_len = 16;
}
-#endif /* HAVE_IPV6 */
}
-#ifdef HAVE_IPV6
if (p->family == AF_INET6)
{
struct attr_extra *attre = attr->extra;
@@ -1285,8 +1266,6 @@
}
}
-#endif /* HAVE_IPV6 */
-
/* If this is EBGP peer and remove-private-AS is set. */
if (rsclient->sort == BGP_PEER_EBGP
@@ -2581,7 +2560,6 @@
if (afi == AFI_IP)
str2prefix ("0.0.0.0/0", &p);
-#ifdef HAVE_IPV6
else if (afi == AFI_IP6)
{
struct attr_extra *ae = attr.extra;
@@ -2603,7 +2581,6 @@
ae->mp_nexthop_len = 32;
}
}
-#endif /* HAVE_IPV6 */
if (peer->default_rmap[afi][safi].name)
{
@@ -3309,7 +3286,6 @@
}
}
-#ifdef HAVE_IPV6
/* Check address. */
if (packet->afi == AFI_IP6 && packet->safi == SAFI_UNICAST)
{
@@ -3324,7 +3300,6 @@
continue;
}
}
-#endif /* HAVE_IPV6 */
/* Normal process. */
if (attr)
@@ -3978,14 +3953,12 @@
vty_out (vty, "%% Malformed prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
-#ifdef HAVE_IPV6
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
{
vty_out (vty, "%% Malformed prefix (link-local address)%s",
VTY_NEWLINE);
return CMD_WARNING;
}
-#endif /* HAVE_IPV6 */
apply_mask (&p);
@@ -4071,14 +4044,12 @@
vty_out (vty, "%% Malformed prefix%s", VTY_NEWLINE);
return CMD_WARNING;
}
-#ifdef HAVE_IPV6
if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6))
{
vty_out (vty, "%% Malformed prefix (link-local address)%s",
VTY_NEWLINE);
return CMD_WARNING;
}
-#endif /* HAVE_IPV6 */
apply_mask (&p);
@@ -4576,7 +4547,6 @@
"Network number\n"
"Specify a BGP backdoor route\n")
-#ifdef HAVE_IPV6
DEFUN (ipv6_bgp_network,
ipv6_bgp_network_cmd,
"network X:X::X:X/M",
@@ -4634,7 +4604,6 @@
BGP_STR
"Specify a network to announce via BGP\n"
"IPv6 prefix <network>/<length>, e.g., 3ffe::/16\n")
-#endif /* HAVE_IPV6 */
/* stubs for removed AS-Pathlimit commands, kept for config compatibility */
ALIAS_DEPRECATED (bgp_network,
@@ -4741,7 +4710,6 @@
"Specify a BGP backdoor route\n"
"AS-Path hopcount limit attribute\n"
"AS-Pathlimit TTL, in number of AS-Path hops\n")
-#ifdef HAVE_IPV6
ALIAS_DEPRECATED (ipv6_bgp_network,
ipv6_bgp_network_ttl_cmd,
"network X:X::X:X/M pathlimit <0-255>",
@@ -4757,7 +4725,6 @@
"IPv6 prefix <network>/<length>\n"
"AS-Path hopcount limit attribute\n"
"AS-Pathlimit TTL, in number of AS-Path hops\n")
-#endif /* HAVE_IPV6 */
/* Aggreagete address:
@@ -5585,7 +5552,6 @@
"Filter more specific routes from updates\n"
"Generate AS set path information\n")
-#ifdef HAVE_IPV6
DEFUN (ipv6_aggregate_address,
ipv6_aggregate_address_cmd,
"aggregate-address X:X::X:X/M",
@@ -5662,7 +5628,6 @@
"Configure BGP aggregate entries\n"
"Aggregate prefix\n"
"Filter more specific routes from updates\n")
-#endif /* HAVE_IPV6 */
/* Redistribute route treatment. */
void
@@ -5686,14 +5651,12 @@
if (nexthop)
attr.nexthop = *nexthop;
-#ifdef HAVE_IPV6
if (nexthop6)
{
struct attr_extra *extra = bgp_attr_extra_get(&attr);
extra->mp_nexthop_global = *nexthop6;
extra->mp_nexthop_len = 16;
}
-#endif
attr.med = metric;
attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC);
@@ -5982,13 +5945,10 @@
vty_out (vty, "%s", inet_ntop(af,
&attr->extra->mp_nexthop_global_in, buf, BUFSIZ));
break;
-#if HAVE_IPV6
case AF_INET6:
vty_out (vty, "%s", inet_ntop(af,
&attr->extra->mp_nexthop_global, buf, BUFSIZ));
break;
-#endif
-
default:
vty_out(vty, "?");
}
@@ -6001,7 +5961,6 @@
{
vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
}
-#ifdef HAVE_IPV6
else if (p->family == AF_INET6)
{
int len;
@@ -6016,7 +5975,6 @@
else
vty_out (vty, "%*s", len, " ");
}
-#endif /* HAVE_IPV6 */
else
{
vty_out(vty, "?");
@@ -6074,7 +6032,6 @@
else
vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
}
-#ifdef HAVE_IPV6
else if (p->family == AF_INET6)
{
int len;
@@ -6091,7 +6048,6 @@
else
vty_out (vty, "%*s", len, " ");
}
-#endif /* HAVE_IPV6 */
if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
vty_out (vty, "%10u ", attr->med);
@@ -6147,7 +6103,6 @@
else
vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
}
-#ifdef HAVE_IPV6
else if (p->family == AF_INET6)
{
assert (attr->extra);
@@ -6165,7 +6120,6 @@
buf1, BUFSIZ));
}
-#endif /* HAVE_IPV6 */
}
label = decode_label (binfo->extra->tag);
@@ -6328,7 +6282,6 @@
inet_ntoa (attr->extra->mp_nexthop_global_in) :
inet_ntoa (attr->nexthop));
}
-#ifdef HAVE_IPV6
else
{
assert (attr->extra);
@@ -6336,7 +6289,6 @@
inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global,
buf, INET6_ADDRSTRLEN));
}
-#endif /* HAVE_IPV6 */
if (binfo->peer == bgp->peer_self)
{
@@ -6362,7 +6314,6 @@
}
vty_out (vty, "%s", VTY_NEWLINE);
-#ifdef HAVE_IPV6
/* display nexthop local */
if (attr->extra && attr->extra->mp_nexthop_len == 32)
{
@@ -6371,7 +6322,6 @@
buf, INET6_ADDRSTRLEN),
VTY_NEWLINE);
}
-#endif /* HAVE_IPV6 */
/* Line 3 display Origin, Med, Locpref, Weight, valid, Int/Ext/Local, Atomic, best */
vty_out (vty, " Origin %s", bgp_origin_long_str[attr->origin]);
@@ -7247,7 +7197,6 @@
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 0);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_vpn_route,
show_bgp_ipv6_vpn_route_cmd,
"show bgp ipv6 vpn X:X::X:X",
@@ -7259,7 +7208,6 @@
{
return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MPLS_VPN, NULL, 0);
}
-#endif
DEFUN (show_bgp_ipv4_vpn_rd_route,
show_bgp_ipv4_vpn_rd_route_cmd,
@@ -7319,7 +7267,6 @@
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_ENCAP, NULL, 0);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_encap_route,
show_bgp_ipv6_encap_route_cmd,
"show bgp ipv6 encap X:X::X:X",
@@ -7331,7 +7278,6 @@
{
return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_ENCAP, NULL, 0);
}
-#endif
DEFUN (show_bgp_ipv4_safi_rd_route,
show_bgp_ipv4_safi_rd_route_cmd,
@@ -7362,7 +7308,6 @@
return bgp_show_route (vty, NULL, argv[2], AFI_IP, safi, &prd, 0);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_rd_route,
show_bgp_ipv6_safi_rd_route_cmd,
"show bgp ipv6 (encap|vpn) rd ASN:nn_or_IP-address:nn X:X::X:X",
@@ -7391,7 +7336,6 @@
}
return bgp_show_route (vty, NULL, argv[2], AFI_IP6, SAFI_ENCAP, &prd, 0);
}
-#endif
DEFUN (show_bgp_ipv4_prefix,
show_bgp_ipv4_prefix_cmd,
@@ -7432,7 +7376,6 @@
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_MPLS_VPN, NULL, 1);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_vpn_prefix,
show_bgp_ipv6_vpn_prefix_cmd,
"show bgp ipv6 vpn X:X::X:X/M",
@@ -7444,7 +7387,6 @@
{
return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_MPLS_VPN, NULL, 1);
}
-#endif
DEFUN (show_bgp_ipv4_encap_prefix,
show_bgp_ipv4_encap_prefix_cmd,
@@ -7459,7 +7401,6 @@
return bgp_show_route (vty, NULL, argv[0], AFI_IP, SAFI_ENCAP, NULL, 1);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_encap_prefix,
show_bgp_ipv6_encap_prefix_cmd,
"show bgp ipv6 encap X:X::X:X/M",
@@ -7472,7 +7413,6 @@
{
return bgp_show_route (vty, NULL, argv[0], AFI_IP6, SAFI_ENCAP, NULL, 1);
}
-#endif
DEFUN (show_bgp_ipv4_safi_rd_prefix,
show_bgp_ipv4_safi_rd_prefix_cmd,
@@ -7504,7 +7444,6 @@
return bgp_show_route (vty, NULL, argv[2], AFI_IP, safi, &prd, 1);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_rd_prefix,
show_bgp_ipv6_safi_rd_prefix_cmd,
"show bgp ipv6 (encap|vpn) rd ASN:nn_or_IP-address:nn X:X::X:X/M",
@@ -7534,7 +7473,6 @@
}
return bgp_show_route (vty, NULL, argv[2], AFI_IP6, safi, &prd, 1);
}
-#endif
DEFUN (show_bgp_afi_safi_view,
show_bgp_afi_safi_view_cmd,
@@ -7652,7 +7590,6 @@
NULL);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi,
show_bgp_ipv6_safi_cmd,
"show bgp ipv6 (unicast|multicast)",
@@ -7887,9 +7824,6 @@
return bgp_show_route (vty, argv[0], argv[1], AFI_IP6, SAFI_UNICAST, NULL, 1);
}
-#endif
-
-
static int
bgp_show_regexp (struct vty *vty, int argc, const char **argv, afi_t afi,
safi_t safi, enum bgp_show_type type)
@@ -7994,7 +7928,6 @@
bgp_show_type_regexp);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_regexp,
show_bgp_regexp_cmd,
"show bgp regexp .LINE",
@@ -8034,7 +7967,6 @@
return bgp_show_regexp (vty, argc, argv, AFI_IP6, SAFI_MULTICAST,
bgp_show_type_regexp);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_safi_flap_regexp,
show_bgp_ipv4_safi_flap_regexp_cmd,
@@ -8075,7 +8007,6 @@
"Display routes matching the AS path regular expression\n"
"A regular-expression to match the BGP AS paths\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_flap_regexp,
show_bgp_ipv6_safi_flap_regexp_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics regexp .LINE",
@@ -8114,7 +8045,6 @@
"Display flap statistics of routes\n"
"Display routes matching the AS path regular expression\n"
"A regular-expression to match the BGP AS paths\n")
-#endif
DEFUN (show_bgp_ipv4_safi_regexp,
show_bgp_ipv4_safi_regexp_cmd,
@@ -8138,7 +8068,7 @@
return bgp_show_regexp (vty, argc-1, argv+1, AFI_IP, safi,
bgp_show_type_regexp);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_regexp,
show_bgp_ipv6_safi_regexp_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) regexp .LINE",
@@ -8175,8 +8105,6 @@
bgp_show_type_regexp);
}
-#endif /* HAVE_IPV6 */
-
static int
bgp_show_prefix_list (struct vty *vty, const char *prefix_list_str, afi_t afi,
safi_t safi, enum bgp_show_type type)
@@ -8251,7 +8179,6 @@
bgp_show_type_prefix_list);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_prefix_list,
show_bgp_prefix_list_cmd,
"show bgp prefix-list WORD",
@@ -8300,7 +8227,6 @@
return bgp_show_prefix_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
bgp_show_type_prefix_list);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_prefix_list,
show_bgp_ipv4_prefix_list_cmd,
@@ -8353,7 +8279,6 @@
"Display routes conforming to the prefix-list\n"
"IP prefix-list name\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_flap_prefix_list,
show_bgp_ipv6_safi_flap_prefix_list_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics prefix-list WORD",
@@ -8390,7 +8315,6 @@
"Display flap statistics of routes\n"
"Display routes conforming to the prefix-list\n"
"IP prefix-list name\n")
-#endif
DEFUN (show_bgp_ipv4_safi_prefix_list,
show_bgp_ipv4_safi_prefix_list_cmd,
@@ -8413,7 +8337,7 @@
return bgp_show_prefix_list (vty, argv[1], AFI_IP, safi,
bgp_show_type_prefix_list);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_prefix_list,
show_bgp_ipv6_safi_prefix_list_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) prefix-list WORD",
@@ -8436,8 +8360,6 @@
bgp_show_type_prefix_list);
}
-#endif /* HAVE_IPV6 */
-
static int
bgp_show_filter_list (struct vty *vty, const char *filter, afi_t afi,
safi_t safi, enum bgp_show_type type)
@@ -8512,7 +8434,6 @@
bgp_show_type_filter_list);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_filter_list,
show_bgp_filter_list_cmd,
"show bgp filter-list WORD",
@@ -8552,7 +8473,6 @@
return bgp_show_filter_list (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
bgp_show_type_filter_list);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_ip_bgp_dampening_info,
show_ip_bgp_dampening_params_cmd,
@@ -8618,7 +8538,6 @@
"Display routes conforming to the filter-list\n"
"Regular expression access list name\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_flap_filter_list,
show_bgp_ipv6_safi_flap_filter_list_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics filter-list WORD",
@@ -8656,7 +8575,6 @@
"Display flap statistics of routes\n"
"Display routes conforming to the filter-list\n"
"Regular expression access list name\n")
-#endif
DEFUN (show_bgp_ipv4_safi_filter_list,
show_bgp_ipv4_safi_filter_list_cmd,
@@ -8679,7 +8597,7 @@
return bgp_show_filter_list (vty, argv[1], AFI_IP, safi,
bgp_show_type_filter_list);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_filter_list,
show_bgp_ipv6_safi_filter_list_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) filter-list WORD",
@@ -8715,8 +8633,6 @@
bgp_show_type_filter_list);
}
-#endif /* HAVE_IPV6 */
-
static int
bgp_show_route_map (struct vty *vty, const char *rmap_str, afi_t afi,
safi_t safi, enum bgp_show_type type)
@@ -8889,7 +8805,6 @@
bgp_show_type_community_all, NULL);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_community_all,
show_bgp_community_all_cmd,
"show bgp community",
@@ -8934,7 +8849,6 @@
return bgp_show (vty, NULL, AFI_IP6, SAFI_MULTICAST,
bgp_show_type_community_all, NULL);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_route_map,
show_bgp_ipv4_route_map_cmd,
@@ -8986,7 +8900,7 @@
"Display flap statistics of routes\n"
"Display routes matching the route-map\n"
"A route-map to match on\n")
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_flap_route_map,
show_bgp_ipv6_safi_flap_route_map_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics route-map WORD",
@@ -9023,7 +8937,6 @@
"Display flap statistics of routes\n"
"Display routes matching the route-map\n"
"A route-map to match on\n")
-#endif
DEFUN (show_bgp_ipv4_safi_route_map,
show_bgp_ipv4_safi_route_map_cmd,
@@ -9046,7 +8959,7 @@
return bgp_show_route_map (vty, argv[1], AFI_IP, safi,
bgp_show_type_route_map);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_route_map,
show_bgp_ipv6_safi_route_map_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) route-map WORD",
@@ -9081,7 +8994,6 @@
return bgp_show_route_map (vty, argv[0], AFI_IP6, SAFI_UNICAST,
bgp_show_type_route_map);
}
-#endif
DEFUN (show_bgp_ipv4_cidr_only,
show_bgp_ipv4_cidr_only_cmd,
@@ -9152,17 +9064,11 @@
/* new046 */
DEFUN (show_bgp_afi_safi_community_all,
show_bgp_afi_safi_community_all_cmd,
-#ifdef HAVE_IPV6
"show bgp (ipv4|ipv6) (encap|multicast|unicast|vpn) community",
-#else
- "show bgp ipv4 (encap|multicast|unicast|vpn) community",
-#endif
SHOW_STR
BGP_STR
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address Family modifier\n"
"Address Family modifier\n"
"Address Family modifier\n"
@@ -9185,17 +9091,11 @@
}
DEFUN (show_bgp_afi_community_all,
show_bgp_afi_community_all_cmd,
-#ifdef HAVE_IPV6
"show bgp (ipv4|ipv6) community",
-#else
- "show bgp ipv4 community",
-#endif
SHOW_STR
BGP_STR
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Display routes matching the communities\n")
{
afi_t afi;
@@ -9609,7 +9509,6 @@
"Do not export to next AS (well-known community)\n"
"Exact match of the communities")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_community,
show_bgp_community_cmd,
"show bgp community (AA:NN|local-AS|no-advertise|no-export)",
@@ -10227,7 +10126,6 @@
"Do not advertise to any peer (well-known community)\n"
"Do not export to next AS (well-known community)\n"
"Exact match of the communities")
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_community,
show_bgp_ipv4_community_cmd,
@@ -10392,19 +10290,13 @@
DEFUN (show_bgp_view_afi_safi_community_all,
show_bgp_view_afi_safi_community_all_cmd,
-#ifdef HAVE_IPV6
"show bgp view WORD (ipv4|ipv6) (unicast|multicast) community",
-#else
- "show bgp view WORD ipv4 (unicast|multicast) community",
-#endif
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address Family modifier\n"
"Address Family modifier\n"
"Display routes matching the communities\n")
@@ -10421,31 +10313,20 @@
return CMD_WARNING;
}
-#ifdef HAVE_IPV6
afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#else
- afi = AFI_IP;
- safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
-#endif
return bgp_show (vty, bgp, afi, safi, bgp_show_type_community_all, NULL);
}
DEFUN (show_bgp_view_afi_safi_community,
show_bgp_view_afi_safi_community_cmd,
-#ifdef HAVE_IPV6
"show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)",
-#else
- "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export)",
-#endif
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address family modifier\n"
"Address family modifier\n"
"Display routes matching the communities\n"
@@ -10457,32 +10338,20 @@
int afi;
int safi;
-#ifdef HAVE_IPV6
afi = (strncmp (argv[1], "ipv6", 4) == 0) ? AFI_IP6 : AFI_IP;
safi = (strncmp (argv[2], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
return bgp_show_community (vty, argv[0], argc-3, &argv[3], 0, afi, safi);
-#else
- afi = AFI_IP;
- safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST;
- return bgp_show_community (vty, argv[0], argc-2, &argv[2], 0, afi, safi);
-#endif
}
ALIAS (show_bgp_view_afi_safi_community,
show_bgp_view_afi_safi_community2_cmd,
-#ifdef HAVE_IPV6
"show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#else
- "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#endif
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address family modifier\n"
"Address family modifier\n"
"Display routes matching the communities\n"
@@ -10497,19 +10366,13 @@
ALIAS (show_bgp_view_afi_safi_community,
show_bgp_view_afi_safi_community3_cmd,
-#ifdef HAVE_IPV6
"show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#else
- "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#endif
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address family modifier\n"
"Address family modifier\n"
"Display routes matching the communities\n"
@@ -10528,19 +10391,13 @@
ALIAS (show_bgp_view_afi_safi_community,
show_bgp_view_afi_safi_community4_cmd,
-#ifdef HAVE_IPV6
"show bgp view WORD (ipv4|ipv6) (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#else
- "show bgp view WORD ipv4 (unicast|multicast) community (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export) (AA:NN|local-AS|no-advertise|no-export)",
-#endif
SHOW_STR
BGP_STR
"BGP view\n"
"View name\n"
"Address family\n"
-#ifdef HAVE_IPV6
"Address family\n"
-#endif
"Address family modifier\n"
"Address family modifier\n"
"Display routes matching the communities\n"
@@ -10730,8 +10587,6 @@
"Do not export to next AS (well-known community)\n"
"Exact match of the communities")
-
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_community,
show_bgp_ipv6_safi_community_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) community (AA:NN|local-AS|no-advertise|no-export)",
@@ -10932,8 +10787,6 @@
"Do not export to next AS (well-known community)\n"
"Exact match of the communities")
-#endif /* HAVE_IPV6 */
-
static int
bgp_show_community_list (struct vty *vty, const char *com, int exact,
afi_t afi, safi_t safi)
@@ -11019,7 +10872,6 @@
return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_community_list,
show_bgp_community_list_cmd,
"show bgp community-list (<1-500>|WORD)",
@@ -11119,7 +10971,6 @@
{
return bgp_show_community_list (vty, argv[0], 1, AFI_IP6, SAFI_MULTICAST);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_community_list,
show_bgp_ipv4_community_list_cmd,
@@ -11185,7 +11036,6 @@
return bgp_show_community_list (vty, argv[1], 1, AFI_IP, SAFI_UNICAST);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_community_list,
show_bgp_ipv6_safi_community_list_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) community-list (<1-500>|WORD)",
@@ -11232,7 +11082,6 @@
}
return bgp_show_community_list (vty, argv[1], 1, AFI_IP6, safi);
}
-#endif /* HAVE_IPV6 */
static int
bgp_show_prefix_longer (struct vty *vty, const char *prefix, afi_t afi,
@@ -11359,7 +11208,6 @@
"Display flap statistics of routes\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_prefix_longer,
show_bgp_prefix_longer_cmd,
"show bgp X:X::X:X/M longer-prefixes",
@@ -11399,7 +11247,6 @@
return bgp_show_prefix_longer (vty, argv[0], AFI_IP6, SAFI_MULTICAST,
bgp_show_type_prefix_longer);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_bgp_ipv4_prefix_longer,
show_bgp_ipv4_prefix_longer_cmd,
@@ -11453,7 +11300,6 @@
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display route and more specific routes\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_flap_prefix_longer,
show_bgp_ipv6_safi_flap_prefix_longer_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M longer-prefixes",
@@ -11491,7 +11337,6 @@
"Display flap statistics of routes\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Display route and more specific routes\n")
-#endif
DEFUN (show_bgp_ipv4_safi_prefix_longer,
show_bgp_ipv4_safi_prefix_longer_cmd,
@@ -11517,7 +11362,6 @@
bgp_show_type_prefix_longer);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_prefix_longer,
show_bgp_ipv6_safi_prefix_longer_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) X:X::X:X/M longer-prefixes",
@@ -11541,7 +11385,6 @@
return bgp_show_prefix_longer (vty, argv[1], AFI_IP6, safi,
bgp_show_type_prefix_longer);
}
-#endif
DEFUN (show_bgp_ipv4_safi_flap_address,
show_bgp_ipv4_safi_flap_address_cmd,
@@ -11578,7 +11421,7 @@
"Display detailed information about dampening\n"
"Display flap statistics of routes\n"
"Network in the BGP routing table to display\n")
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_flap_address,
show_bgp_ipv6_flap_address_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics A.B.C.D",
@@ -11614,7 +11457,6 @@
"Display detailed information about dampening\n"
"Display flap statistics of routes\n"
"Network in the BGP routing table to display\n")
-#endif
DEFUN (show_bgp_ipv4_safi_flap_prefix,
show_bgp_ipv4_safi_flap_prefix_cmd,
@@ -11653,7 +11495,6 @@
"Display flap statistics of routes\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_ipv6_safi_flap_prefix,
show_bgp_ipv6_safi_flap_prefix_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics X:X::X:X/M",
@@ -11704,8 +11545,6 @@
bgp_show_type_prefix_longer);
}
-#endif /* HAVE_IPV6 */
-
static struct peer *
peer_lookup_in_view (struct vty *vty, const char *view_name,
const char *ip_str)
@@ -12375,7 +12214,7 @@
return bgp_peer_counts (vty, peer, AFI_IP, safi);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_prefix_counts,
show_bgp_ipv6_safi_neighbor_prefix_counts_cmd,
"show bgp ipv6 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X) prefix-counts",
@@ -12405,7 +12244,6 @@
return bgp_peer_counts (vty, peer, AFI_IP6, safi);
}
-#endif
DEFUN (show_ip_bgp_encap_neighbor_prefix_counts,
show_ip_bgp_encap_neighbor_prefix_counts_cmd,
@@ -12604,7 +12442,6 @@
return peer_adj_routes (vty, peer, AFI_IP, SAFI_UNICAST, 0);
}
-#ifdef HAVE_IPV6
DEFUN (show_bgp_view_neighbor_advertised_route,
show_bgp_view_neighbor_advertised_route_cmd,
"show bgp view WORD neighbors (A.B.C.D|X:X::X:X) advertised-routes",
@@ -12708,7 +12545,6 @@
return peer_adj_routes (vty, peer, AFI_IP6, SAFI_MULTICAST, 0);
}
-#endif /* HAVE_IPV6 */
DEFUN (show_ip_bgp_view_neighbor_received_routes,
show_ip_bgp_view_neighbor_received_routes_cmd,
@@ -12931,7 +12767,7 @@
return peer_adj_routes (vty, peer, AFI_IP, safi, 0);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_advertised_route,
show_bgp_ipv6_safi_neighbor_advertised_route_cmd,
"show bgp ipv6 (multicast|unicast) neighbors (A.B.C.D|X:X::X:X) advertised-routes",
@@ -13011,8 +12847,6 @@
return peer_adj_routes (vty, peer, AFI_IP6, SAFI_UNICAST, 1);
}
-#endif /* HAVE_IPV6 */
-
DEFUN (show_bgp_ipv4_safi_neighbor_received_routes,
show_bgp_ipv4_safi_neighbor_received_routes_cmd,
@@ -13043,7 +12877,7 @@
return peer_adj_routes (vty, peer, AFI_IP, safi, 1);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_received_routes,
show_bgp_ipv6_safi_neighbor_received_routes_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) received-routes",
@@ -13073,7 +12907,6 @@
return peer_adj_routes (vty, peer, AFI_IP6, safi, 1);
}
-#endif
DEFUN (show_bgp_view_afi_safi_neighbor_adv_recd_routes,
show_bgp_view_afi_safi_neighbor_adv_recd_routes_cmd,
@@ -13260,7 +13093,7 @@
return CMD_SUCCESS;
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_received_prefix_filter,
show_bgp_ipv6_safi_neighbor_received_prefix_filter_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) received prefix-filter",
@@ -13397,7 +13230,6 @@
return CMD_SUCCESS;
}
-#endif /* HAVE_IPV6 */
static int
bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
@@ -13714,7 +13546,7 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
bgp_show_type_flap_neighbor);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_flap,
show_bgp_ipv6_safi_neighbor_flap_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) flap-statistics",
@@ -13744,7 +13576,6 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
bgp_show_type_flap_neighbor);
}
-#endif
DEFUN (show_bgp_ipv4_safi_neighbor_damp,
show_bgp_ipv4_safi_neighbor_damp_cmd,
@@ -13775,7 +13606,7 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
bgp_show_type_damp_neighbor);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_damp,
show_bgp_ipv6_safi_neighbor_damp_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) neighbors (A.B.C.D|X:X::X:X) dampened-routes",
@@ -13805,7 +13636,6 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
bgp_show_type_damp_neighbor);
}
-#endif
DEFUN (show_bgp_ipv4_safi_neighbor_routes,
show_bgp_ipv4_safi_neighbor_routes_cmd,
@@ -13835,7 +13665,7 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP, safi,
bgp_show_type_neighbor);
}
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_neighbor_routes,
show_bgp_ipv6_safi_neighbor_routes_cmd,
"show bgp ipv6 (multicast|unicast) neighbors (A.B.C.D|X:X::X:X) routes",
@@ -13864,7 +13694,6 @@
return bgp_show_neighbor_route (vty, peer, AFI_IP6, safi,
bgp_show_type_neighbor);
}
-#endif
DEFUN (show_bgp_view_ipv4_safi_rsclient_route,
show_bgp_view_ipv4_safi_rsclient_route_cmd,
@@ -14102,7 +13931,6 @@
NEIGHBOR_ADDR_STR
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
-#ifdef HAVE_IPV6
DEFUN (show_bgp_view_ipv6_neighbor_routes,
show_bgp_view_ipv6_neighbor_routes_cmd,
"show bgp view WORD ipv6 neighbors (A.B.C.D|X:X::X:X) routes",
@@ -14359,8 +14187,6 @@
"Neighbor to display information about\n"
"Display the dampened routes received from neighbor\n")
-#endif /* HAVE_IPV6 */
-
DEFUN (show_bgp_view_rsclient,
show_bgp_view_rsclient_cmd,
"show bgp view WORD rsclient (A.B.C.D|X:X::X:X)",
@@ -14502,7 +14328,6 @@
"Information about Route Server Client\n"
NEIGHBOR_ADDR_STR2)
-#ifdef HAVE_IPV6
ALIAS (show_bgp_view_ipv6_rsclient,
show_bgp_ipv6_rsclient_cmd,
"show bgp ipv6 rsclient (A.B.C.D|X:X::X:X)",
@@ -15021,8 +14846,6 @@
NEIGHBOR_ADDR_STR
"IP prefix <network>/<length>, e.g., 3ffe::/16\n")
-#endif /* HAVE_IPV6 */
-
struct bgp_table *bgp_distance_table;
struct bgp_distance
@@ -15460,7 +15283,7 @@
"Address Family modifier\n"
"Display detailed information about dampening\n"
"Display paths suppressed due to dampening\n")
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_dampened_paths,
show_bgp_ipv6_safi_dampened_paths_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) dampened-paths",
@@ -15494,7 +15317,6 @@
"Address Family modifier\n"
"Display detailed information about dampening\n"
"Display paths suppressed due to dampening\n")
-#endif
DEFUN (show_bgp_ipv4_safi_flap_statistics,
show_bgp_ipv4_safi_flap_statistics_cmd,
@@ -15529,7 +15351,7 @@
"Address Family modifier\n"
"Display detailed information about dampening\n"
"Display flap statistics of routes\n")
-#ifdef HAVE_IPV6
+
DEFUN (show_bgp_ipv6_safi_flap_statistics,
show_bgp_ipv6_safi_flap_statistics_cmd,
"show bgp ipv6 (encap|multicast|unicast|vpn) flap-statistics",
@@ -15563,7 +15385,6 @@
"Address Family modifier\n"
"Display detailed information about dampening\n"
"Display flap statistics of routes\n")
-#endif
/* Display specified route of BGP table. */
static int
@@ -16300,7 +16121,6 @@
/* prefix count */
install_element (ENABLE_NODE, &show_bgp_ipv4_safi_neighbor_prefix_counts_cmd);
install_element (ENABLE_NODE, &show_bgp_ipv6_safi_neighbor_prefix_counts_cmd);
-#ifdef HAVE_IPV6
install_element (ENABLE_NODE, &show_bgp_ipv6_neighbor_prefix_counts_cmd);
/* New config IPv6 BGP commands. */
@@ -16455,7 +16275,6 @@
/* Statistics */
install_element (ENABLE_NODE, &show_bgp_statistics_cmd);
install_element (ENABLE_NODE, &show_bgp_statistics_view_cmd);
-#endif /* HAVE_IPV6 */
install_element (BGP_NODE, &bgp_distance_cmd);
install_element (BGP_NODE, &no_bgp_distance_cmd);
@@ -16519,10 +16338,8 @@
install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_backdoor_ttl_cmd);
install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_natural_backdoor_ttl_cmd);
-#ifdef HAVE_IPV6
install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd);
install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd);
-#endif
/* old style commands */
install_element (VIEW_NODE, &show_ip_bgp_cmd);