summaryrefslogtreecommitdiff
path: root/bfdd/bfdd.c
AgeCommit message (Collapse)Author
2024-07-25bfdd: remove control socket obsolete codeRafael Zalamena
Let's remove the obsolete BFD control socket. If the functionality is needed then YANG/northbound notifications / getting should be used instead. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-02-01*: create a single registry of daemons' default port valuesMark Stapp
Create a single registry of default port values that daemons are using. Most of these are vty ports, but there are some others for features like ospfapi and zebra FPM. Signed-off-by: Mark Stapp <mjs@labn.net>
2024-01-27*: fix `frr_daemon_info` indentationDavid Lamparter
clang-format doesn't understand FRR_DAEMON_INFO is a long macro where laying out items semantically makes sense. (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get confused with the mismatching `( ( )`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27build: nuke `BFDD_CONTROL_SOCKET`David Lamparter
This just unnecessarily complicates things by involving autoconf. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-21bfdd: Free zclient memory on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-19bfdd: Use shorter memory names so that they fit in vty outputDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-12bfdd: Prevent coverity from thinking values are uninitedDonald Sharp
Coverity is claiming that bfdd is able got have bglobal.bg_use_dplane can be true, while dplane_addr can be uninitialized. Not really possible since global variables are initialized to all 0's. In any event. Force it to think it can't go there. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11*: Convert quagga_signal_X to frr_signal_XDonald Sharp
Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-25*: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-17*: require semicolon after FRR_DAEMON_INFO & co.David Lamparter
... again ... Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
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-01-28bfdd: Remove #if 0Donald Sharp
We do have a bunch of old code that is never used. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-24bfdd: support connecting to BFD data planeRafael Zalamena
Add option to connect to a data plane server instead of receiving connections. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-11-24bfdd: import distributed BFD implementationRafael Zalamena
Distributed BFD is a term used for BFD implementations that do not run on the routing engine, instead it is run on a data plane (software or hardware based). The current code implements the basic communication between FRR BFD daemon with an external BFD data plane and defines the protocol format in the file `bfddp_packet.h`. To enable/use data plane you need to start BFD daemon with the command line `--dplaneaddr <type>:<address>`, then a socket will be opened to listen for incoming data plane connections. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-09-22bfdd: add missing includesIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-07-02Merge pull request #6437 from opensourcerouting/bfd-profiles-bgpDonald Sharp
bfdd,bgpd: profiles integration support
2020-06-05*: add filter northbound supportRafael Zalamena
Allow all daemons to work with filter northbound. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-05-29bfdd: don't update peers settings on shutdownRafael Zalamena
During the shutdown phase don't attempt to apply settings to peers as it is useless and will crash if the peer hash is gone. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-16Merge pull request #6247 from FRRouting/nb_conversionsDonald Sharp
Merge nb_converions branch to master
2020-04-16*: include vrf northbound module in initChirag Shah
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-04-16Merge pull request #5451 from opensourcerouting/rcu-logSantosh P K
logging subsystem rewrite
2020-04-10bfdd: use standard log macrosRafael Zalamena
Remove old log_* macros and standardize on FRR's logging infrastructure. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-01lib: rewrite zlog lock-free & TLS-bufferedDavid Lamparter
This is a full rewrite of the "back end" logging code. It now uses a lock-free list to iterate over logging targets, and the targets themselves are as lock-free as possible. (syslog() may have a hidden internal mutex in the C library; the file/fd targets use a single write() call which should ensure atomicity kernel-side.) Note that some functionality is lost in this patch: - Solaris printstack() backtraces are ditched (unlikely to come back) - the `log-filter` machinery is gone (re-added in followup commit) - `terminal monitor` is temporarily stubbed out. The old code had a race condition with VTYs going away. It'll likely come back rewritten and with vtysh support. - The `zebra_ext_log` hook is gone. Instead, it's now much easier to add a "proper" logging target. v2: TLS buffer to get some actual performance Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-21bfdd: remove logging shimDavid Lamparter
This does exactly nothing, other than hiding format warnings... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make frr_yang_module_info constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-10-30bfdd: split northbound callbacks into multiple filesRenato Westphal
Rearrange the bfdd northbound callbacks as following: * bfd_nb.h: prototypes of all northbound callbacks. * bfd_nb.c: definition of all northbound callbacks and their associated YANG data paths. * bfd_nb_config.c: implementation of YANG configuration nodes. * bfd_nb_state.c: implementation of YANG state nodes. This should help to keep to code more organized and easier to maintain. No behavior changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-06-22bfdd: implement configuration reloadRafael Zalamena
Reload configuration on SIGHUP using the northbound. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-22bfdd: migrate session commands to northboundRafael Zalamena
Lets start using the new BFD yang model and translate the BFD session configuration commands to use the northbound. One important change: all sessions will default to use `VRF_DEFAULT_NAME` (usually "default") when no VRF is configured. All places which search for BFD sessions must now take this into account. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-21bfdd: use MTYPE_STATICDavid Lamparter
MTYPE definitions should be local to the file using them whereever possible. Also remove some superfluous ; Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-05Merge pull request #4431 from donaldsharp/mad_gainzRafael Zalamena
Switch over to `-N FOO` adding FOO to the various directories/files we open up
2019-06-04bfdd: Modify bfdd to quietly accept access-listsDonald Sharp
The `access-list ...` command was causing bfdd to return 'unknown commands'. Make bfdd at least cognizant of access-lists enough to not create strange error messages Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-04bfdd: Allow -N to influence BFDD_CONTROL_SOCKETDonald Sharp
When selecting to run bfdd with -N allow the namespace passed in to be added to the $frr_statedir/<namespace name>/bfdd.sock If --bfdctl is passed in that will override the -N option. If neither --bfdctl or -N is passed in then the default of $frr_statedir/bfdd.sock is used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-07bfd: add bfdd_privs to the bglobal structurePhilippe Guibert
this structure contains the bfdd_privs structure in charge of the privilege settings. The initialisation has moved a bit, in order that the preinit settings are done. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07bfdd: socket handling per vrf contextPhilippe Guibert
sockets are created foreach network namespace context enabled. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07bfdd: add vrf frameworkPhilippe Guibert
vrf initialisation is done. hooks are installed. no specific action is done, except the vrf initialisation. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07bfdd: add sys_admin capability and net_raw capabilityPhilippe Guibert
in order to be able to create sockets on separate namespaces, add the privs setting needed. the former capability is needed to use SO_BINDTODEVICE option. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-02-14bfdd: implement session interface observerRafael Zalamena
Allow `bfdd` to configure inexisting interfaces / VRF and only activate them once the interface/VRF start existing. This implementation doesn't handle dynamic VRFs yet. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-09-03bfdd: use UDP sockets instead of rawRafael Zalamena
Avoid all complexities of handling ethernet/IP/UDP headers and just use UDP sockets: let the OS kernel handle this task. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-09-03bfdd: enumerate all diagnositic codesRafael Zalamena
Enumerate all codes, update the string representation and fix the misdiagnosed echo failure. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-09-03bfdd: remove VxLAN codeRafael Zalamena
Remove all VxLAN code. There are probably better ways to write VxLAN support without having to use raw sockets and depend on extra user configuration input. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: clean up header inclusionRafael Zalamena
Most of the headers we need are included by zebra.h, so lets simplify this. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: re-route PTM-BFD daemon messagesRafael Zalamena
When `bfdd` is enabled - which it is by default - re-route the PTM-BFD messages to the FRR's internal BFD daemon instead of the external PTM daemon. This will help the migration of BFD implementations and avoid duplicating code. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: add vty shell commandsRafael Zalamena
Implement vty shell integration and allow `bfdd` to be configured through FRR's vtysh. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08bfdd: imported new daemon source codeRafael Zalamena
Import source code from external `bfdd` daemon ported from Cumulus PTM. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>