]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BMP: Allow build without BMP and disable BMP build by default
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 18 Apr 2023 15:21:13 +0000 (17:21 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 18 Apr 2023 15:21:13 +0000 (17:21 +0200)
It has still several important issues to be enabled by default.

configure.ac
proto/bgp/bgp.c
proto/bgp/packets.c
proto/bmp/bmp.h

index f2091219ce088ec2453fb3bc00dee80c94382a6a..c9c52038dc2b3e0699fdc45f029ee5cb4877a73c 100644 (file)
@@ -312,7 +312,7 @@ if test "$enable_mpls_kernel" != no ; then
   fi
 fi
 
-all_protocols="$proto_bfd babel bgp bmp mrt ospf perf pipe radv rip rpki static"
+all_protocols="$proto_bfd babel bgp mrt ospf perf pipe radv rip rpki static"
 
 all_protocols=`echo $all_protocols | sed 's/ /,/g'`
 
index a6d30effff3e2a27c1496c0f71a0b5d418accf66..c806765a7117b5bd595a1beeb82655cecac7675c 100644 (file)
@@ -1694,7 +1694,6 @@ bgp_init(struct proto_config *CF)
   struct bgp_config *cf = (struct bgp_config *) CF;
 
   P->rt_notify = bgp_rt_notify;
-  P->rte_update_in_notify = bgp_rte_update_in_notify;
   P->preexport = bgp_preexport;
   P->neigh_notify = bgp_neigh_notify;
   P->reload_routes = bgp_reload_routes;
@@ -1706,6 +1705,10 @@ bgp_init(struct proto_config *CF)
   P->rte_modify = bgp_rte_modify_stale;
   P->rte_igp_metric = bgp_rte_igp_metric;
 
+#ifdef CONFIG_BMP
+  P->rte_update_in_notify = bgp_rte_update_in_notify;
+#endif
+
   p->cf = cf;
   p->is_internal = (cf->local_as == cf->remote_as);
   p->is_interior = p->is_internal || cf->confederation_member;
index 42016eae877a8391ec04eb39aaa1fee769a0042b..b953716997155a9ced06212113425f2b75877531 100644 (file)
@@ -2407,6 +2407,9 @@ bgp_create_mp_unreach(struct bgp_write_state *s, struct bgp_bucket *buck, byte *
   return buf+11+len;
 }
 
+
+#ifdef CONFIG_BMP
+
 static byte *
 bgp_create_update_bmp(struct bgp_channel *c, byte *buf, struct bgp_bucket *buck, bool update)
 {
@@ -2489,6 +2492,9 @@ bgp_rte_update_in_notify(struct channel *C, const net_addr *n,
   bmp_route_monitor_put_update_in_pre_msg(buf, end - buf);
 }
 
+#endif /* CONFIG_BMP */
+
+
 static byte *
 bgp_create_update(struct bgp_channel *c, byte *buf)
 {
index ff02d3b23de4ea0c9d619ae0b09bda6a46ae3cb6..22ee79c3f2cc85e0ae9edf10202518677336c277 100644 (file)
@@ -85,6 +85,9 @@ struct bmp_proto {
   bool started;                    // Flag that stores running status of BMP instance
 };
 
+
+#ifdef CONFIG_BMP
+
 /**
  * bmp_put_sent_bgp_open_msg - save sent BGP OPEN msg packet in BMP implementation.
  * NOTE: If there has been passed sent and received BGP OPEN MSGs to the BMP
@@ -135,4 +138,17 @@ void
 bmp_peer_down(const struct bgp_proto *bgp, const int err_class, const byte *pkt,
   size_t pkt_size);
 
-#endif /* _BIRD_BMP_H_ */
+
+#else /* BMP build disabled */
+
+static inline void bmp_put_sent_bgp_open_msg(const struct bgp_proto *bgp UNUSED, const byte* pkt UNUSED, const size_t pkt_size UNUSED) { }
+static inline void bmp_put_recv_bgp_open_msg(const struct bgp_proto *bgp UNUSED, const byte* pkt UNUSED, const size_t pkt_size UNUSED) { }
+static inline void bmp_route_monitor_update_in_pre_begin(void) { }
+static inline void bmp_route_monitor_put_update_in_pre_msg(const byte *data UNUSED, const size_t data_size UNUSED) { }
+static inline void bmp_route_monitor_update_in_pre_commit(const struct bgp_proto *bgp UNUSED) { }
+static inline void bmp_route_monitor_update_in_pre_end(void) { }
+static inline void bmp_peer_down(const struct bgp_proto *bgp UNUSED, const int err_class UNUSED, const byte *pkt UNUSED, size_t pkt_size UNUSED) { }
+
+#endif /* CONFIG_BMP */
+
+#endif /* _BIRD_BMP_H_ */