Commit graph

23 commits

Author SHA1 Message Date
Philippe Guibert b79574b5c6 bgpd: add sync for monitored afi/safi of imported bgps
If an imported BGP is configured after BGP updates have been
received, then BMP will not detect those updates in the
monitor messages.

Syncronisation is also needed for separate instances.
For each imported bgp instance, syncronisation is re-done
for monitored afi/safis for ALL available instances.
- upon configuring an afi/safi (as previously)
- when configuring an imported view

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-07 15:35:32 +01:00
Philippe Guibert ab31e964e4 bgpd, topotests: bmp, add loc-rib peer up event for imported bgp
Add the emission of a loc-rib peer up event for an imported bgp instance
at import-vrf configuration. Add a test to control in the BMP collector
that the peer up message is the one from that BGP instance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-07 15:35:31 +01:00
Philippe Guibert b68b4aa70e bgpd: modify bmp_bgp_update_vrf_status() API
The bgpbmp parameter is not used. Instead the bgp pointer, and
the vrf state are used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-07 15:35:31 +01:00
Philippe Guibert 2a609860c8 bgpd: add 'bmp import-vrf-view' command
Add a configuration command to import BGP information from
another BGP instance. Specifically, it should be possible for
a user to have a BMP instance configured on the default VRF,
and be able to import the VRF information from the other BGP
VRF instances.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-01-07 15:35:31 +01:00
Maxence Younsi 035304c25a bgpd: bmp loc-rib peer up/down for vrfs
added bmp bgp peer for vrfs
added peer up vrf in bmp peer up state
added vrf state in bmpbgp
added safe bmp_peer_sendall : bmp_peer_sendall_safe
changed bgp_open_send to call new bgp_open_make
bgp_open_make creates a bgp open packet, now used in bmp for peer up vrf
added hook and call to bgp instance state
vrf peer state is recomputed when interfaces (including vrf itf) go up / down
and when it gets created or removed

Link: e48ba38070
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
2024-10-11 15:14:12 +02:00
Philippe Guibert 7ba991cf96 bgpd: add 'bmp stat send-experimental' command
Some wireshark versions can not decode the experimental
bmp stat code. This may also be the case for some collectors.
Add a vty command to be able to disable bmp to sending
those values.

> [no] bmp stat send-experimental

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:12:38 +02:00
mxyns 66d564a60b bgpd: loc-rib uptime moved to bgp_path_info_extra and set in header
moved loc-rib uptime field "bgp_rib_uptime" to struct bgp_path_info_extra for memory concerns
moved logic into bgp_route_update's callback bmp_route_update
written timestamp in per peer header

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
2023-11-04 12:17:48 +01:00
mxyns 66e0c6f826 bgpd: peer flag set for loc-rib monitoring (left set to 0 in other cases)
set peer type flag to 3 for loc rib monitoring
leave to 0 in other cases like before, even though RFC7854 tells us to set it to 0 1 or 2 depending on the case global/rd/local instance

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
2023-11-04 12:17:47 +01:00
Maxence Younsi 9d219585e6 bgpd: basic loc rib monitoring (no syncing yet, not rfc compliant encoding)
bmp loc rib monitoring rfc 9069 debuts, loc-rib monitoring draft/poc

Signed-off-by: Maxence Younsi <mx.yns@outlook.fr>
2023-11-04 12:17:47 +01:00
Donald Sharp e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Francois Dumontet 09f267ec95 bmp: add a interface source to bmp connect command
With current release, forcin the source ip address when setting up a BMP
connection is not possible.

The need is to add an extra parameter for the following vty command:

router bgp 65500
bmp targets AAA
bmp connect 2.2.2.2 port 666 min-retry 100 max-retry 700
bmp connect 2:2::2:2 port 666 min-retry 100 max-retry 700 [source-interface lo1]

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2022-06-16 12:51:11 +02:00
David Lamparter 960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter 96244aca23 *: require semicolon after DEFINE_QOBJ & co.
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:37 +01:00
David Lamparter bf8d3d6aca *: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...

With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.

Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
Quentin Young 21e8caa293 bgpd: send correct BMP down message when nht fails
When sending BMP messages for a status change event for a peer whose NHT
has failed, we were sending a Peer Down Reason Code of 1 (Local system
closed, NOTIFICATION follows) with no NOTIFICAION PDU (because there was
none). This is wrong. Also, the reason code of 1 is semantically off, it
should be 2 (Local system closed, FSM event follows).

This patch:

- adds definitions of all BGP FSM event codes per RFC4271
- changes the BMP reason code emitted when a peer changes state due to
  NHT failure to 2 and encodes FSM event 18 (TcpConnectionFails)
- changes the catch-all case where we have not yet
  implemented the appropriate BMP response to indicate reason code 2
  with FSM event 0 (no relevant Event code is defined).

These changes ought to prevent the BMP session from being torn down due
to an improperly formatted message.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2021-02-12 14:11:05 -05:00
Donald Sharp 09319b4e0f bgpd: More bgp_node -> bgp_dest cleanup
Some more of the bgp_node usage snuck in from big commits in
the past month or so from feature work.  Do some work
to put it back to bgp_dest for incoming future work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-17 08:52:35 -04:00
streambinder 87102aa005 bgpd: bmp: add support for L2VPN/EVPN routes
Co-authored-by: giacomo270197 <gcasoni@hotmail.it>
Signed-off-by: streambinder <posta@davidepucci.it>
2020-06-30 14:37:00 +02:00
David Lamparter 3286ca0750 lib,nhrpd,bgpd/bmp: pass resolver failure details
To keep the calling code agnostic of the DNS resolver libary used, pass
a strerror-style string instead of a status code that would need extra
handling.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 13:33:36 +01:00
David Lamparter ed18356f1f bgpd/bmp: BMP implementation
This implements BMP.  There's no fine-grained history here, the non-BMP
preparations are already split out from here so all that remains is BMP
proper.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-30 19:22:23 +02:00
David Lamparter 0ba4eeec22 bgpd/bmp: convert BMP code into module
This is mostly here for documentation purposes to show how some code is
converted into a module.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-30 19:00:45 +02:00
David Lamparter d35a6c2895 bgpd/bmp: use bgp packet dump hook
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-30 19:00:45 +02:00
Yasuhiro Ohara 6c29258c96 bgpd/bmp: Initial BMP implementation.
This is the initial BMP skeleton from Yasuhiro Ohara.

(License/Signoff note: code published on github as GPLv2+.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-30 19:00:45 +02:00