From 959331a339a04a5cc893baf520bd294cb18473cc Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 20 Sep 2021 22:11:18 -0300 Subject: [PATCH] lib: do not include bgpd headers in route_opaque.h Duplicate a couple of definitions in order to remove the bgpd includes from this libfrr header. This is necessary to fix some name collisions like PREFIX_LIST_IN being defined differently on multiple daemons (as soon as other daemons start including route_opaque.h). Including daemon headers on libfrr headers is a bad practice and should be avoided whenever possible. Signed-off-by: Renato Westphal --- bgpd/bgp_zebra.c | 2 ++ lib/route_opaque.h | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index a9d9b8d393..48ed07926c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -65,6 +65,8 @@ #include "bgpd/bgp_evpn_mh.h" #include "bgpd/bgp_mac.h" #include "bgpd/bgp_trace.h" +#include "bgpd/bgp_community.h" +#include "bgpd/bgp_lcommunity.h" /* All information about zebra. */ struct zclient *zclient = NULL; diff --git a/lib/route_opaque.h b/lib/route_opaque.h index c5e7d6a327..678a171e48 100644 --- a/lib/route_opaque.h +++ b/lib/route_opaque.h @@ -24,9 +24,12 @@ #include "assert.h" #include "zclient.h" -#include "bgpd/bgp_aspath.h" -#include "bgpd/bgp_community.h" -#include "bgpd/bgp_lcommunity.h" +/* copied from bgpd/bgp_community.h */ +#define COMMUNITY_SIZE 4 +/* copied from bgpd/bgp_lcommunity.h */ +#define LCOMMUNITY_SIZE 12 +/* copied from bgpd/bgp_route.h */ +#define BGP_MAX_SELECTION_REASON_STR_BUF 32 struct bgp_zebra_opaque { char aspath[256]; -- 2.39.5