From 02164814b49a3385caae0ea10aa042487c6002d2 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 18 Apr 2023 17:21:13 +0200 Subject: BMP: Allow build without BMP and disable BMP build by default It has still several important issues to be enabled by default. --- proto/bmp/bmp.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'proto/bmp') diff --git a/proto/bmp/bmp.h b/proto/bmp/bmp.h index ff02d3b2..22ee79c3 100644 --- a/proto/bmp/bmp.h +++ b/proto/bmp/bmp.h @@ -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_ */ -- cgit v1.2.3