lib: register bgp link-state afi/safi

Register BGP Link-State AFI/SAFI values from RFC7752.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
This commit is contained in:
Louis Scalbert 2022-12-27 15:13:18 +01:00
parent 41fa35a8f4
commit 1642a68d60
18 changed files with 138 additions and 3 deletions

View file

@ -4003,6 +4003,10 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
switch (nh_afi) { switch (nh_afi) {
case AFI_IP: case AFI_IP:
switch (safi) { switch (safi) {
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
/* TODO */
break;
case SAFI_UNICAST: case SAFI_UNICAST:
case SAFI_MULTICAST: case SAFI_MULTICAST:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
@ -4036,6 +4040,10 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
break; break;
case AFI_IP6: case AFI_IP6:
switch (safi) { switch (safi) {
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
/* TODO */
break;
case SAFI_UNICAST: case SAFI_UNICAST:
case SAFI_MULTICAST: case SAFI_MULTICAST:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
@ -4086,6 +4094,9 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
break; break;
} }
break; break;
case AFI_LINKSTATE:
/* TODO */
break;
case AFI_L2VPN: case AFI_L2VPN:
if (safi != SAFI_FLOWSPEC) if (safi != SAFI_FLOWSPEC)
flog_err( flog_err(
@ -4138,6 +4149,10 @@ void bgp_packet_mpattr_prefix(struct stream *s, afi_t afi, safi_t safi,
stream_put_labeled_prefix(s, p, label, addpath_capable, stream_put_labeled_prefix(s, p, label, addpath_capable,
addpath_tx_id); addpath_tx_id);
break; break;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
/* TODO */
break;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
stream_putc(s, p->u.prefix_flowspec.prefixlen); stream_putc(s, p->u.prefix_flowspec.prefixlen);
stream_put(s, (const void *)p->u.prefix_flowspec.ptr, stream_put(s, (const void *)p->u.prefix_flowspec.ptr,
@ -4164,6 +4179,10 @@ size_t bgp_packet_mpattr_prefix_size(afi_t afi, safi_t safi,
case SAFI_MAX: case SAFI_MAX:
assert(!"Attempting to figure size for a SAFI_UNSPEC/SAFI_MAX this is a DEV ESCAPE"); assert(!"Attempting to figure size for a SAFI_UNSPEC/SAFI_MAX this is a DEV ESCAPE");
break; break;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
/* TODO */
break;
case SAFI_UNICAST: case SAFI_UNICAST:
case SAFI_MULTICAST: case SAFI_MULTICAST:
break; break;

View file

@ -176,6 +176,9 @@ int main(int argc, char **argv)
case AFI_IP6: case AFI_IP6:
printf("/AFI_IP6\n"); printf("/AFI_IP6\n");
break; break;
case AFI_LINKSTATE:
printf("/AFI_LINKSTATE\n");
break;
default: default:
printf("/UNKNOWN %d", subtype); printf("/UNKNOWN %d", subtype);
break; break;

View file

@ -147,6 +147,12 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
"capabilityErrorMultiProtocolAfi", "capabilityErrorMultiProtocolAfi",
"L2VPN"); "L2VPN");
break; break;
case AFI_LINKSTATE:
json_object_string_add(
json_cap,
"capabilityErrorMultiProtocolAfi",
"Link State");
break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
json_object_int_add( json_object_int_add(
@ -198,6 +204,18 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
"capabilityErrorMultiProtocolSafi", "capabilityErrorMultiProtocolSafi",
"flowspec"); "flowspec");
break; 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_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
json_object_int_add( json_object_int_add(
@ -219,6 +237,9 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
case AFI_L2VPN: case AFI_L2VPN:
vty_out(vty, "AFI L2VPN, "); vty_out(vty, "AFI L2VPN, ");
break; break;
case AFI_LINKSTATE:
vty_out(vty, "AFI Link State, ");
break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
vty_out(vty, "AFI Unknown %d, ", vty_out(vty, "AFI Unknown %d, ",
@ -247,6 +268,12 @@ void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
case SAFI_EVPN: case SAFI_EVPN:
vty_out(vty, "SAFI EVPN"); vty_out(vty, "SAFI EVPN");
break; 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_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
vty_out(vty, "SAFI Unknown %d ", vty_out(vty, "SAFI Unknown %d ",

View file

@ -12052,6 +12052,8 @@ const struct prefix_rd *bgp_rd_from_dest(const struct bgp_dest *dest,
case SAFI_UNICAST: case SAFI_UNICAST:
case SAFI_MULTICAST: case SAFI_MULTICAST:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_MAX: case SAFI_MAX:
return NULL; return NULL;
@ -13301,6 +13303,8 @@ static void bgp_table_stats_walker(struct event *t)
case AFI_L2VPN: case AFI_L2VPN:
space = EVPN_ROUTE_PREFIXLEN; space = EVPN_ROUTE_PREFIXLEN;
break; break;
case AFI_LINKSTATE:
/* TODO */
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
return; return;
@ -13557,6 +13561,8 @@ static int bgp_table_stats_single(struct vty *vty, struct bgp *bgp, afi_t afi,
case AFI_L2VPN: case AFI_L2VPN:
bitlen = EVPN_ROUTE_PREFIXLEN; bitlen = EVPN_ROUTE_PREFIXLEN;
break; break;
case AFI_LINKSTATE:
/* TODO */
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
break; break;

View file

@ -168,6 +168,8 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
return BGP_VPNV4_NODE; return BGP_VPNV4_NODE;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return BGP_FLOWSPECV4_NODE; return BGP_FLOWSPECV4_NODE;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_ENCAP: case SAFI_ENCAP:
case SAFI_EVPN: case SAFI_EVPN:
@ -188,6 +190,8 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
return BGP_VPNV6_NODE; return BGP_VPNV6_NODE;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return BGP_FLOWSPECV6_NODE; return BGP_FLOWSPECV6_NODE;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_ENCAP: case SAFI_ENCAP:
case SAFI_EVPN: case SAFI_EVPN:
@ -198,6 +202,8 @@ static enum node_type bgp_node_type(afi_t afi, safi_t safi)
break; break;
case AFI_L2VPN: case AFI_L2VPN:
return BGP_EVPN_NODE; return BGP_EVPN_NODE;
case AFI_LINKSTATE:
/* TODO */
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
// We should never be here but to clarify the switch statement.. // We should never be here but to clarify the switch statement..
@ -534,6 +540,8 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return "ipv4-flowspec"; return "ipv4-flowspec";
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_MAX: case SAFI_MAX:
return "unknown-afi/safi"; return "unknown-afi/safi";
@ -553,6 +561,8 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
return "ipv6-labeled-unicast"; return "ipv6-labeled-unicast";
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return "ipv6-flowspec"; return "ipv6-flowspec";
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_MAX: case SAFI_MAX:
@ -568,12 +578,16 @@ static const char *get_bgp_default_af_flag(afi_t afi, safi_t safi)
case SAFI_MPLS_VPN: case SAFI_MPLS_VPN:
case SAFI_ENCAP: case SAFI_ENCAP:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
return "unknown-afi/safi"; return "unknown-afi/safi";
} }
break; break;
case AFI_LINKSTATE:
/* TODO */
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
return "unknown-afi/safi"; return "unknown-afi/safi";

View file

@ -2504,6 +2504,8 @@ static inline int afindex(afi_t afi, safi_t safi)
return BGP_AF_IPV4_ENCAP; return BGP_AF_IPV4_ENCAP;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return BGP_AF_IPV4_FLOWSPEC; return BGP_AF_IPV4_FLOWSPEC;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
@ -2524,6 +2526,8 @@ static inline int afindex(afi_t afi, safi_t safi)
return BGP_AF_IPV6_ENCAP; return BGP_AF_IPV6_ENCAP;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return BGP_AF_IPV6_FLOWSPEC; return BGP_AF_IPV6_FLOWSPEC;
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
@ -2541,10 +2545,14 @@ static inline int afindex(afi_t afi, safi_t safi)
case SAFI_ENCAP: case SAFI_ENCAP:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
return BGP_AF_MAX; return BGP_AF_MAX;
} }
break; break;
case AFI_LINKSTATE:
/* TODO */
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
return BGP_AF_MAX; return BGP_AF_MAX;

View file

@ -248,6 +248,8 @@ void rfapiCheckRefcount(struct agg_node *rn, safi_t safi, int lockoffset)
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
assert(!"Passed in safi should be impossible"); assert(!"Passed in safi should be impossible");
} }
@ -2972,6 +2974,7 @@ static void rfapiBgpInfoFilteredImportEncap(
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi); flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
return; return;
@ -3420,6 +3423,7 @@ void rfapiBgpInfoFilteredImportVPN(
rt = import_table->imported_vpn[afi]; rt = import_table->imported_vpn[afi];
break; break;
case AFI_LINKSTATE:
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi); flog_err(EC_LIB_DEVELOPMENT, "%s: bad afi %d", __func__, afi);
@ -3819,6 +3823,8 @@ rfapiBgpInfoFilteredImportFunction(safi_t safi)
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
/* not expected */ /* not expected */
flog_err(EC_LIB_DEVELOPMENT, "%s: bad safi %d", __func__, safi); flog_err(EC_LIB_DEVELOPMENT, "%s: bad safi %d", __func__, safi);
@ -4063,6 +4069,8 @@ static void rfapiProcessPeerDownRt(struct peer *peer,
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
/* Suppress uninitialized variable warning */ /* Suppress uninitialized variable warning */
rt = NULL; rt = NULL;

View file

@ -237,6 +237,8 @@ void rfapiMonitorExtraFlush(safi_t safi, struct agg_node *rn)
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
assert(0); assert(0);
} }
@ -305,6 +307,8 @@ void rfapiMonitorExtraPrune(safi_t safi, struct agg_node *rn)
case SAFI_EVPN: case SAFI_EVPN:
case SAFI_LABELED_UNICAST: case SAFI_LABELED_UNICAST:
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
case SAFI_LINKSTATE:
case SAFI_LINKSTATE_VPN:
case SAFI_MAX: case SAFI_MAX:
assert(0); assert(0);
} }

View file

@ -26,6 +26,7 @@ typedef enum {
IANA_AFI_IPV4 = 1, IANA_AFI_IPV4 = 1,
IANA_AFI_IPV6 = 2, IANA_AFI_IPV6 = 2,
IANA_AFI_L2VPN = 25, IANA_AFI_L2VPN = 25,
IANA_AFI_LINKSTATE = 16388, /* BGP-LS RFC 7752 */
} iana_afi_t; } iana_afi_t;
typedef enum { typedef enum {
@ -35,6 +36,8 @@ typedef enum {
IANA_SAFI_LABELED_UNICAST = 4, IANA_SAFI_LABELED_UNICAST = 4,
IANA_SAFI_ENCAP = 7, IANA_SAFI_ENCAP = 7,
IANA_SAFI_EVPN = 70, 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_MPLS_VPN = 128,
IANA_SAFI_FLOWSPEC = 133 IANA_SAFI_FLOWSPEC = 133
} iana_safi_t; } iana_safi_t;
@ -48,6 +51,8 @@ static inline afi_t afi_iana2int(iana_afi_t afi)
return AFI_IP6; return AFI_IP6;
case IANA_AFI_L2VPN: case IANA_AFI_L2VPN:
return AFI_L2VPN; return AFI_L2VPN;
case IANA_AFI_LINKSTATE:
return AFI_LINKSTATE;
case IANA_AFI_RESERVED: case IANA_AFI_RESERVED:
return AFI_MAX; return AFI_MAX;
} }
@ -64,6 +69,8 @@ static inline iana_afi_t afi_int2iana(afi_t afi)
return IANA_AFI_IPV6; return IANA_AFI_IPV6;
case AFI_L2VPN: case AFI_L2VPN:
return IANA_AFI_L2VPN; return IANA_AFI_L2VPN;
case AFI_LINKSTATE:
return IANA_AFI_LINKSTATE;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
return IANA_AFI_RESERVED; return IANA_AFI_RESERVED;
@ -94,6 +101,10 @@ static inline safi_t safi_iana2int(iana_safi_t safi)
return SAFI_LABELED_UNICAST; return SAFI_LABELED_UNICAST;
case IANA_SAFI_FLOWSPEC: case IANA_SAFI_FLOWSPEC:
return 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: case IANA_SAFI_RESERVED:
return SAFI_MAX; return SAFI_MAX;
} }
@ -118,6 +129,10 @@ static inline iana_safi_t safi_int2iana(safi_t safi)
return IANA_SAFI_LABELED_UNICAST; return IANA_SAFI_LABELED_UNICAST;
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return IANA_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_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
return IANA_SAFI_RESERVED; return IANA_SAFI_RESERVED;

View file

@ -132,6 +132,8 @@ const char *afi2str_lower(afi_t afi)
return "ipv6"; return "ipv6";
case AFI_L2VPN: case AFI_L2VPN:
return "l2vpn"; return "l2vpn";
case AFI_LINKSTATE:
return "link-state";
case AFI_MAX: case AFI_MAX:
case AFI_UNSPEC: case AFI_UNSPEC:
return "bad-value"; return "bad-value";
@ -149,6 +151,8 @@ const char *afi2str(afi_t afi)
return "IPv6"; return "IPv6";
case AFI_L2VPN: case AFI_L2VPN:
return "l2vpn"; return "l2vpn";
case AFI_LINKSTATE:
return "link-state";
case AFI_MAX: case AFI_MAX:
case AFI_UNSPEC: case AFI_UNSPEC:
return "bad-value"; return "bad-value";
@ -174,6 +178,10 @@ const char *safi2str(safi_t safi)
return "labeled-unicast"; return "labeled-unicast";
case SAFI_FLOWSPEC: case SAFI_FLOWSPEC:
return "flowspec"; return "flowspec";
case SAFI_LINKSTATE:
return "link-state";
case SAFI_LINKSTATE_VPN:
return "link-state-vpn";
case SAFI_UNSPEC: case SAFI_UNSPEC:
case SAFI_MAX: case SAFI_MAX:
return "unknown"; return "unknown";

View file

@ -326,13 +326,14 @@ struct in_pktinfo {
#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */ #define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
#endif #endif
/* Address family numbers from RFC1700. */ /* Address family numbers. */
typedef enum { typedef enum {
AFI_UNSPEC = 0, AFI_UNSPEC = 0,
AFI_IP = 1, AFI_IP = 1,
AFI_IP6 = 2, AFI_IP6 = 2,
AFI_L2VPN = 3, AFI_L2VPN = 3,
AFI_MAX = 4 AFI_LINKSTATE = 4, /* BGP-LS RFC 7752 */
AFI_MAX = 5,
} afi_t; } afi_t;
#define IS_VALID_AFI(a) ((a) > AFI_UNSPEC && (a) < AFI_MAX) #define IS_VALID_AFI(a) ((a) > AFI_UNSPEC && (a) < AFI_MAX)
@ -347,7 +348,9 @@ typedef enum {
SAFI_EVPN = 5, SAFI_EVPN = 5,
SAFI_LABELED_UNICAST = 6, SAFI_LABELED_UNICAST = 6,
SAFI_FLOWSPEC = 7, SAFI_FLOWSPEC = 7,
SAFI_MAX = 8 SAFI_LINKSTATE = 8, /* BGP-LS RFC 7752 */
SAFI_LINKSTATE_VPN = 9, /* BGP-LS RFC 7752 */
SAFI_MAX = 10,
} safi_t; } safi_t;
#define FOREACH_AFI_SAFI(afi, safi) \ #define FOREACH_AFI_SAFI(afi, safi) \

View file

@ -335,6 +335,11 @@ void route_add(struct pbr_nexthop_group_cache *pnhgc, struct nexthop_group nhg,
"%s: Asked to install unsupported route type: L2VPN", "%s: Asked to install unsupported route type: L2VPN",
__func__); __func__);
break; break;
case AFI_LINKSTATE:
DEBUGD(&pbr_dbg_zebra,
"%s: Asked to install unsupported route type: Link-State",
__func__);
break;
case AFI_UNSPEC: case AFI_UNSPEC:
DEBUGD(&pbr_dbg_zebra, DEBUGD(&pbr_dbg_zebra,
"%s: Asked to install unspecified route type", __func__); "%s: Asked to install unspecified route type", __func__);
@ -380,6 +385,11 @@ void route_delete(struct pbr_nexthop_group_cache *pnhgc, afi_t afi)
"%s: Asked to delete unsupported route type: L2VPN", "%s: Asked to delete unsupported route type: L2VPN",
__func__); __func__);
break; break;
case AFI_LINKSTATE:
DEBUGD(&pbr_dbg_zebra,
"%s: Asked to delete unsupported route type: Link-State",
__func__);
break;
case AFI_UNSPEC: case AFI_UNSPEC:
DEBUGD(&pbr_dbg_zebra, DEBUGD(&pbr_dbg_zebra,
"%s: Asked to delete unspecified route type", __func__); "%s: Asked to delete unspecified route type", __func__);

View file

@ -126,6 +126,7 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)
assert(!!str2prefix(args->source, &src)); assert(!!str2prefix(args->source, &src));
break; break;
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_MAX: case AFI_MAX:
break; break;

View file

@ -660,6 +660,8 @@ static const char *str_from_afi(afi_t afi)
return "ipv6"; return "ipv6";
case AFI_L2VPN: case AFI_L2VPN:
return "l2vpn"; return "l2vpn";
case AFI_LINKSTATE:
return "link-state";
case AFI_MAX: case AFI_MAX:
case AFI_UNSPEC: case AFI_UNSPEC:
return "bad-value"; return "bad-value";

View file

@ -234,6 +234,7 @@ void connected_up(struct interface *ifp, struct connected *ifc)
break; break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
flog_warn(EC_ZEBRA_CONNECTED_AFI_UNKNOWN, flog_warn(EC_ZEBRA_CONNECTED_AFI_UNKNOWN,
"Received unknown AFI: %s", afi2str(afi)); "Received unknown AFI: %s", afi2str(afi));
@ -424,6 +425,7 @@ void connected_down(struct interface *ifp, struct connected *ifc)
break; break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
zlog_warn("Unknown AFI: %s", afi2str(afi)); zlog_warn("Unknown AFI: %s", afi2str(afi));
break; break;

View file

@ -102,6 +102,7 @@ int router_id_get(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
return 0; return 0;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
return -1; return -1;
} }
@ -126,6 +127,7 @@ static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf)
break; break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
return -1; return -1;
} }

View file

@ -565,6 +565,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
client->redist_v6_del_cnt++; client->redist_v6_del_cnt++;
break; break;
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
case AFI_UNSPEC: case AFI_UNSPEC:
break; break;

View file

@ -2281,6 +2281,7 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
break; break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
flog_err(EC_LIB_DEVELOPMENT, flog_err(EC_LIB_DEVELOPMENT,
"%s: unknown address-family: %u", __func__, "%s: unknown address-family: %u", __func__,
@ -2324,6 +2325,7 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
break; break;
case AFI_UNSPEC: case AFI_UNSPEC:
case AFI_L2VPN: case AFI_L2VPN:
case AFI_LINKSTATE:
case AFI_MAX: case AFI_MAX:
assert(afi != AFI_IP && afi != AFI_IP6); assert(afi != AFI_IP && afi != AFI_IP6);
break; break;