Skip to content

Commit

Permalink
Revert "lib: register bgp link-state afi/safi"
Browse files Browse the repository at this point in the history
This reverts commit 1642a68.
  • Loading branch information
donaldsharp committed Oct 10, 2023
1 parent 9c44816 commit 0dc12c9
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 138 deletions.
19 changes: 0 additions & 19 deletions bgpd/bgp_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions bgpd/bgp_btoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 0 additions & 27 deletions bgpd/bgp_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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, ",
Expand Down Expand Up @@ -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 ",
Expand Down
6 changes: 0 additions & 6 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 0 additions & 14 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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..
Expand Down Expand Up @@ -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";
Expand All @@ -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:
Expand All @@ -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";
Expand Down
8 changes: 0 additions & 8 deletions bgpd/bgpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions bgpd/rfapi/rfapi_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions bgpd/rfapi/rfapi_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
15 changes: 0 additions & 15 deletions lib/iana_afi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions lib/prefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand Down
Loading

0 comments on commit 0dc12c9

Please sign in to comment.