From 0dc12c9003a865c7ee829543d40e8c285863abe8 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 10 Oct 2023 16:45:57 -0400 Subject: [PATCH] Revert "lib: register bgp link-state afi/safi" This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3. --- bgpd/bgp_attr.c | 19 ------------------- bgpd/bgp_btoa.c | 3 --- bgpd/bgp_open.c | 27 --------------------------- bgpd/bgp_route.c | 6 ------ bgpd/bgp_vty.c | 14 -------------- bgpd/bgpd.h | 8 -------- bgpd/rfapi/rfapi_import.c | 8 -------- bgpd/rfapi/rfapi_monitor.c | 4 ---- lib/iana_afi.h | 15 --------------- lib/prefix.c | 8 -------- lib/zebra.h | 9 +++------ pbrd/pbr_zebra.c | 10 ---------- staticd/static_vty.c | 1 - tests/bgpd/test_peer_attr.c | 2 -- zebra/connected.c | 2 -- zebra/router-id.c | 2 -- zebra/zapi_msg.c | 1 - zebra/zebra_nhg.c | 2 -- 18 files changed, 3 insertions(+), 138 deletions(-) diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 8427b1b604a2..7916233444ec 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -4003,10 +4003,6 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi, switch (nh_afi) { case AFI_IP: switch (safi) { - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: - /* TODO */ - break; case SAFI_UNICAST: case SAFI_MULTICAST: case SAFI_LABELED_UNICAST: @@ -4040,10 +4036,6 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi, break; case AFI_IP6: switch (safi) { - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: - /* TODO */ - break; case SAFI_UNICAST: case SAFI_MULTICAST: case SAFI_LABELED_UNICAST: @@ -4094,9 +4086,6 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi, break; } break; - case AFI_LINKSTATE: - /* TODO */ - break; case AFI_L2VPN: if (safi != SAFI_FLOWSPEC) flog_err( @@ -4149,10 +4138,6 @@ void bgp_packet_mpattr_prefix(struct stream *s, afi_t afi, safi_t safi, stream_put_labeled_prefix(s, p, label, addpath_capable, addpath_tx_id); break; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: - /* TODO */ - break; case SAFI_FLOWSPEC: stream_putc(s, p->u.prefix_flowspec.prefixlen); stream_put(s, (const void *)p->u.prefix_flowspec.ptr, @@ -4179,10 +4164,6 @@ size_t bgp_packet_mpattr_prefix_size(afi_t afi, safi_t safi, case SAFI_MAX: assert(!"Attempting to figure size for a SAFI_UNSPEC/SAFI_MAX this is a DEV ESCAPE"); break; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: - /* TODO */ - break; case SAFI_UNICAST: case SAFI_MULTICAST: break; diff --git a/bgpd/bgp_btoa.c b/bgpd/bgp_btoa.c index c4e866c42ebc..8e27d9769f81 100644 --- a/bgpd/bgp_btoa.c +++ b/bgpd/bgp_btoa.c @@ -177,9 +177,6 @@ int main(int argc, char **argv) case AFI_IP6: printf("/AFI_IP6\n"); break; - case AFI_LINKSTATE: - printf("/AFI_LINKSTATE\n"); - break; default: printf("/UNKNOWN %d", subtype); break; diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 207a73801b7e..6ee5b5dc5cda 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -147,12 +147,6 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json, "capabilityErrorMultiProtocolAfi", "L2VPN"); break; - case AFI_LINKSTATE: - json_object_string_add( - json_cap, - "capabilityErrorMultiProtocolAfi", - "Link State"); - break; case AFI_UNSPEC: case AFI_MAX: json_object_int_add( @@ -204,18 +198,6 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json, "capabilityErrorMultiProtocolSafi", "flowspec"); break; - case SAFI_LINKSTATE: - json_object_string_add( - json_cap, - "capabilityErrorMultiProtocolSafi", - "Link State"); - break; - case SAFI_LINKSTATE_VPN: - json_object_string_add( - json_cap, - "capabilityErrorMultiProtocolSafi", - "Link State VPN"); - break; case SAFI_UNSPEC: case SAFI_MAX: json_object_int_add( @@ -237,9 +219,6 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json, case AFI_L2VPN: vty_out(vty, "AFI L2VPN, "); break; - case AFI_LINKSTATE: - vty_out(vty, "AFI Link State, "); - break; case AFI_UNSPEC: case AFI_MAX: vty_out(vty, "AFI Unknown %d, ", @@ -268,12 +247,6 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json, case SAFI_EVPN: vty_out(vty, "SAFI EVPN"); break; - case SAFI_LINKSTATE: - vty_out(vty, "SAFI LINK STATE"); - break; - case SAFI_LINKSTATE_VPN: - vty_out(vty, "SAFI LINK STATE VPN"); - break; case SAFI_UNSPEC: case SAFI_MAX: vty_out(vty, "SAFI Unknown %d ", diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index a6485a141fbb..3a850a486dce 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12052,8 +12052,6 @@ const struct prefix_rd *bgp_rd_from_dest(const struct bgp_dest *dest, case SAFI_UNICAST: case SAFI_MULTICAST: case SAFI_LABELED_UNICAST: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_FLOWSPEC: case SAFI_MAX: return NULL; @@ -13303,8 +13301,6 @@ static void bgp_table_stats_walker(struct event *t) case AFI_L2VPN: space = EVPN_ROUTE_PREFIXLEN; break; - case AFI_LINKSTATE: - /* TODO */ case AFI_UNSPEC: case AFI_MAX: return; @@ -13561,8 +13557,6 @@ static int bgp_table_stats_single(struct vty *vty, struct bgp *bgp, afi_t afi, case AFI_L2VPN: bitlen = EVPN_ROUTE_PREFIXLEN; break; - case AFI_LINKSTATE: - /* TODO */ case AFI_UNSPEC: case AFI_MAX: break; diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index f5ab0192bb3b..e49bafffb8f4 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -168,8 +168,6 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi) return BGP_VPNV4_NODE; case SAFI_FLOWSPEC: return BGP_FLOWSPECV4_NODE; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_UNSPEC: case SAFI_ENCAP: case SAFI_EVPN: @@ -190,8 +188,6 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi) return BGP_VPNV6_NODE; case SAFI_FLOWSPEC: return BGP_FLOWSPECV6_NODE; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_UNSPEC: case SAFI_ENCAP: case SAFI_EVPN: @@ -202,8 +198,6 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi) break; case AFI_L2VPN: return BGP_EVPN_NODE; - case AFI_LINKSTATE: - /* TODO */ case AFI_UNSPEC: case AFI_MAX: // We should never be here but to clarify the switch statement.. @@ -540,8 +534,6 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi) case SAFI_FLOWSPEC: return "ipv4-flowspec"; case SAFI_UNSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_EVPN: case SAFI_MAX: return "unknown-afi/safi"; @@ -561,8 +553,6 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi) return "ipv6-labeled-unicast"; case SAFI_FLOWSPEC: return "ipv6-flowspec"; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_UNSPEC: case SAFI_EVPN: case SAFI_MAX: @@ -578,16 +568,12 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi) case SAFI_MPLS_VPN: case SAFI_ENCAP: case SAFI_LABELED_UNICAST: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_FLOWSPEC: case SAFI_UNSPEC: case SAFI_MAX: return "unknown-afi/safi"; } break; - case AFI_LINKSTATE: - /* TODO */ case AFI_UNSPEC: case AFI_MAX: return "unknown-afi/safi"; diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 6eba3d6aaeec..ca1411a3b179 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -2504,8 +2504,6 @@ static inline int afindex(afi_t afi, safi_t safi) return BGP_AF_IPV4_ENCAP; case SAFI_FLOWSPEC: return BGP_AF_IPV4_FLOWSPEC; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_EVPN: case SAFI_UNSPEC: case SAFI_MAX: @@ -2526,8 +2524,6 @@ static inline int afindex(afi_t afi, safi_t safi) return BGP_AF_IPV6_ENCAP; case SAFI_FLOWSPEC: return BGP_AF_IPV6_FLOWSPEC; - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_EVPN: case SAFI_UNSPEC: case SAFI_MAX: @@ -2545,14 +2541,10 @@ static inline int afindex(afi_t afi, safi_t safi) case SAFI_ENCAP: case SAFI_FLOWSPEC: case SAFI_UNSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: return BGP_AF_MAX; } break; - case AFI_LINKSTATE: - /* TODO */ case AFI_UNSPEC: case AFI_MAX: return BGP_AF_MAX; diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 126ba225cb66..a93e186f8d82 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -248,8 +248,6 @@ void rfapiCheckRefcount(struct agg_node *rn, safi_t safi, int lockoffset) case SAFI_EVPN: case SAFI_LABELED_UNICAST: case SAFI_FLOWSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: assert(!"Passed in safi should be impossible"); } @@ -2974,7 +2972,6 @@ static void rfapiBgpInfoFilteredImportEncap( case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi); return; @@ -3423,7 +3420,6 @@ void rfapiBgpInfoFilteredImportVPN( rt = import_table->imported_vpn[afi]; break; - case AFI_LINKSTATE: case AFI_UNSPEC: case AFI_MAX: flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi); @@ -3823,8 +3819,6 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi) case SAFI_EVPN: case SAFI_LABELED_UNICAST: case SAFI_FLOWSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: /* not expected */ flog_err(EC_LIB_DEVELOPMENT, "%s: bad safi %d", __func__, safi); @@ -4069,8 +4063,6 @@ static void rfapiProcessPeerDownRt(struct peer *peer, case SAFI_EVPN: case SAFI_LABELED_UNICAST: case SAFI_FLOWSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: /* Suppress uninitialized variable warning */ rt = NULL; diff --git a/bgpd/rfapi/rfapi_monitor.c b/bgpd/rfapi/rfapi_monitor.c index 766b5d5360d9..3fe957ba4de7 100644 --- a/bgpd/rfapi/rfapi_monitor.c +++ b/bgpd/rfapi/rfapi_monitor.c @@ -237,8 +237,6 @@ void rfapiMonitorExtraFlush(safi_t safi, struct agg_node *rn) case SAFI_EVPN: case SAFI_LABELED_UNICAST: case SAFI_FLOWSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: assert(0); } @@ -307,8 +305,6 @@ void rfapiMonitorExtraPrune(safi_t safi, struct agg_node *rn) case SAFI_EVPN: case SAFI_LABELED_UNICAST: case SAFI_FLOWSPEC: - case SAFI_LINKSTATE: - case SAFI_LINKSTATE_VPN: case SAFI_MAX: assert(0); } diff --git a/lib/iana_afi.h b/lib/iana_afi.h index 9b4d33fa4d62..b9c19cc3d549 100644 --- a/lib/iana_afi.h +++ b/lib/iana_afi.h @@ -26,7 +26,6 @@ typedef enum { IANA_AFI_IPV4 = 1, IANA_AFI_IPV6 = 2, IANA_AFI_L2VPN = 25, - IANA_AFI_LINKSTATE = 16388, /* BGP-LS RFC 7752 */ } iana_afi_t; typedef enum { @@ -36,8 +35,6 @@ typedef enum { IANA_SAFI_LABELED_UNICAST = 4, IANA_SAFI_ENCAP = 7, IANA_SAFI_EVPN = 70, - IANA_SAFI_LINKSTATE = 71, /* BGP-LS RFC 7752 */ - IANA_SAFI_LINKSTATE_VPN = 72, /* BGP-LS RFC 7752 */ IANA_SAFI_MPLS_VPN = 128, IANA_SAFI_FLOWSPEC = 133 } iana_safi_t; @@ -51,8 +48,6 @@ static inline afi_t afi_iana2int(iana_afi_t afi) return AFI_IP6; case IANA_AFI_L2VPN: return AFI_L2VPN; - case IANA_AFI_LINKSTATE: - return AFI_LINKSTATE; case IANA_AFI_RESERVED: return AFI_MAX; } @@ -69,8 +64,6 @@ static inline iana_afi_t afi_int2iana(afi_t afi) return IANA_AFI_IPV6; case AFI_L2VPN: return IANA_AFI_L2VPN; - case AFI_LINKSTATE: - return IANA_AFI_LINKSTATE; case AFI_UNSPEC: case AFI_MAX: return IANA_AFI_RESERVED; @@ -101,10 +94,6 @@ static inline safi_t safi_iana2int(iana_safi_t safi) return SAFI_LABELED_UNICAST; case IANA_SAFI_FLOWSPEC: return SAFI_FLOWSPEC; - case IANA_SAFI_LINKSTATE: - return SAFI_LINKSTATE; - case IANA_SAFI_LINKSTATE_VPN: - return SAFI_LINKSTATE_VPN; case IANA_SAFI_RESERVED: return SAFI_MAX; } @@ -129,10 +118,6 @@ static inline iana_safi_t safi_int2iana(safi_t safi) return IANA_SAFI_LABELED_UNICAST; case SAFI_FLOWSPEC: return IANA_SAFI_FLOWSPEC; - case SAFI_LINKSTATE: - return IANA_SAFI_LINKSTATE; - case SAFI_LINKSTATE_VPN: - return IANA_SAFI_LINKSTATE_VPN; case SAFI_UNSPEC: case SAFI_MAX: return IANA_SAFI_RESERVED; diff --git a/lib/prefix.c b/lib/prefix.c index d5632c214132..f342c4c1dbea 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -132,8 +132,6 @@ const char *afi2str_lower(afi_t afi) return "ipv6"; case AFI_L2VPN: return "l2vpn"; - case AFI_LINKSTATE: - return "link-state"; case AFI_MAX: case AFI_UNSPEC: return "bad-value"; @@ -151,8 +149,6 @@ const char *afi2str(afi_t afi) return "IPv6"; case AFI_L2VPN: return "l2vpn"; - case AFI_LINKSTATE: - return "link-state"; case AFI_MAX: case AFI_UNSPEC: return "bad-value"; @@ -178,10 +174,6 @@ const char *safi2str(safi_t safi) return "labeled-unicast"; case SAFI_FLOWSPEC: return "flowspec"; - case SAFI_LINKSTATE: - return "link-state"; - case SAFI_LINKSTATE_VPN: - return "link-state-vpn"; case SAFI_UNSPEC: case SAFI_MAX: return "unknown"; diff --git a/lib/zebra.h b/lib/zebra.h index cd0b72834cfc..ecc87f58f10f 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -326,14 +326,13 @@ struct in_pktinfo { #define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */ #endif -/* Address family numbers. */ +/* Address family numbers from RFC1700. */ typedef enum { AFI_UNSPEC = 0, AFI_IP = 1, AFI_IP6 = 2, AFI_L2VPN = 3, - AFI_LINKSTATE = 4, /* BGP-LS RFC 7752 */ - AFI_MAX = 5, + AFI_MAX = 4 } afi_t; #define IS_VALID_AFI(a) ((a) > AFI_UNSPEC && (a) < AFI_MAX) @@ -348,9 +347,7 @@ typedef enum { SAFI_EVPN = 5, SAFI_LABELED_UNICAST = 6, SAFI_FLOWSPEC = 7, - SAFI_LINKSTATE = 8, /* BGP-LS RFC 7752 */ - SAFI_LINKSTATE_VPN = 9, /* BGP-LS RFC 7752 */ - SAFI_MAX = 10, + SAFI_MAX = 8 } safi_t; #define FOREACH_AFI_SAFI(afi, safi) \ diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index 876f9e19e024..30eaf62902ae 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -312,11 +312,6 @@ void route_add(struct pbr_nexthop_group_cache *pnhgc, struct nexthop_group nhg, "%s: Asked to install unsupported route type: L2VPN", __func__); break; - case AFI_LINKSTATE: - DEBUGD(&pbr_dbg_zebra, - "%s: Asked to install unsupported route type: Link-State", - __func__); - break; case AFI_UNSPEC: DEBUGD(&pbr_dbg_zebra, "%s: Asked to install unspecified route type", __func__); @@ -362,11 +357,6 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi) "%s: Asked to delete unsupported route type: L2VPN", __func__); break; - case AFI_LINKSTATE: - DEBUGD(&pbr_dbg_zebra, - "%s: Asked to delete unsupported route type: Link-State", - __func__); - break; case AFI_UNSPEC: DEBUGD(&pbr_dbg_zebra, "%s: Asked to delete unspecified route type", __func__); diff --git a/staticd/static_vty.c b/staticd/static_vty.c index 3c60cd7315dd..0582df88abad 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -131,7 +131,6 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args) assert(!!str2prefix(args->source, &src)); break; case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_UNSPEC: case AFI_MAX: break; diff --git a/tests/bgpd/test_peer_attr.c b/tests/bgpd/test_peer_attr.c index 761b23bf978f..bc6eba906905 100644 --- a/tests/bgpd/test_peer_attr.c +++ b/tests/bgpd/test_peer_attr.c @@ -660,8 +660,6 @@ static const char *str_from_afi(afi_t afi) return "ipv6"; case AFI_L2VPN: return "l2vpn"; - case AFI_LINKSTATE: - return "link-state"; case AFI_MAX: case AFI_UNSPEC: return "bad-value"; diff --git a/zebra/connected.c b/zebra/connected.c index 46f2a83a3cdb..ee0823f56f45 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -234,7 +234,6 @@ void connected_up(struct interface *ifp, struct connected *ifc) break; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: flog_warn(EC_ZEBRA_CONNECTED_AFI_UNKNOWN, "Received unknown AFI: %s", afi2str(afi)); @@ -425,7 +424,6 @@ void connected_down(struct interface *ifp, struct connected *ifc) break; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: zlog_warn("Unknown AFI: %s", afi2str(afi)); break; diff --git a/zebra/router-id.c b/zebra/router-id.c index 45edf45336a2..ef87d924fe54 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -102,7 +102,6 @@ int router_id_get(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf) return 0; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: return -1; } @@ -127,7 +126,6 @@ static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf) break; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: return -1; } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index b73511f02775..6754238ce582 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -544,7 +544,6 @@ int zsend_redistribute_route(int cmd, struct zserv *client, client->redist_v6_del_cnt++; break; case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: case AFI_UNSPEC: break; diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 396e9acfc8e0..1879bafcac4d 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -2288,7 +2288,6 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, break; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: flog_err(EC_LIB_DEVELOPMENT, "%s: unknown address-family: %u", __func__, @@ -2332,7 +2331,6 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, break; case AFI_UNSPEC: case AFI_L2VPN: - case AFI_LINKSTATE: case AFI_MAX: assert(afi != AFI_IP && afi != AFI_IP6); break;