summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2019-05-17lib: add more convenient boolean adder for jsonQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add support for configuration writingQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: autoconfig supportQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: protodown macvlan in backup stateQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add sizing macro to ipaddr.hQuentin Young
Useful for getting the size of the relevant data in the `ip` field of struct ipaddr. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add function to get iface link-localQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add internet checksum with pseudoheadersQuentin Young
Add convenience functions to compute the Internet checksum of a data block, including a pseudoheader. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: add initial macvlan supportQuentin Young
* Search for macvlan interfaces with the appropriate name and MAC address when starting up a new VRRP instance * Split VRRP socket into two; one for Tx, one for Rx * Bind Tx socket to the macvlan subinterface so our VRRP advertisements go out with the correct MAC address * Send ARP requests from this macvlan subinterface * Improve error messaging Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17vrrpd: ipv6 supportQuentin Young
Add initial support for IPv6. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17lib: add list_to_arrayQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-16Merge pull request #4352 from donaldsharp/routemap_fix_replaceMark Stapp
lib: Fix gcc 9.1 and --enable-werror issues found
2019-05-16Merge pull request #4144 from pguibert6WIND/bfd_cbitRuss White
BFD CBIT
2019-05-16Merge pull request #4340 from qlyoung/hash-key-constRuss White
lib: hashing functions should take const arguments
2019-05-16lib: Fix gcc 9.1 and --enable-werror issues foundDonald Sharp
Compiling FRR w/ gcc 9.1 and --enable-werror generates some issues that need to be cleaned up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-14lib: hashing functions should take const argumentsQuentin Young
It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-14lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enumStephen Worley
Add an upspecified option to the AFI enum and update switch statements using it in bgpd and pbrd. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-05-14bgpd: add vty command to enable bfd control-plane-check-failurePhilippe Guibert
new vty command is added: neighbor XXX bfd check-control-plane-failure this command will enforce the check of bgp controlplane, when bfd detects changes in the dataplane. - at configuration, the cbit will be set if that command is executed - at flapping time, if the command is configured and remote cbit is set accordingly, then the bfd event will be ignored. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-14bfdd, lib, bgpd: add bfd cbit usagePhilippe Guibert
bfd cbit is a value carried out in bfd messages, that permit to keep or not, the independence between control plane and dataplane. In other words, while most of the cases plan to flush entries, when bfd goes down, there are some cases where that bfd event should be ignored. this is the case with non stop forwarding mechanisms where entries may be kept. this is the case for BGP, when graceful restart capability is used. If BFD event down happens, and bgp is in graceful restart mode, it is wished to ignore the BFD event while waiting for the remote router to restart. The changes take into account the following: - add a config flag across zebra layer so that daemon can set or not the cbit capability. - ability for daemons to read the remote bfd capability associated to a bfd notification. - in bfdd, according to the value, the cbit value is set - in bfdd, the received value is retrived and stored in the bfd session context. - by default, the local cbit announced to remote is set to 1 while preservation of the local path is not set. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-14Merge pull request #4304 from donaldsharp/route_map_switchDavid Lamparter
Route map switch
2019-05-14Merge pull request #4112 from pguibert6WIND/bfd_vrfRafael Zalamena
support for BFD VRF
2019-05-13lib: Add const to openbsd-tree functionsStephen Worley
A few of the functions in openbsd's RB tree implementation needed to have const in their parameters. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-05-13lib: fix crash in the CLI grammar sandboxRenato Westphal
The CLI grammer sandbox needs to initialize the northbound subsystem otherwise the running_config global variable won't be set, which leads to crashes. Fixes #4319. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-10bgpd, lib, ospf6d, ospfd, pimd, zebra: Rework routemap event callbackDonald Sharp
The route_map_event_hook callback was passing the `route_map_event_t` to each individual interested party. No-one is ever using this data so let's cut to the chase a bit and remove the pass through of data. This is considered ok in that the routemap.c code came this way originally and after 15+ years no-one is using this functionality. Nor do I see any `easy` way to do anything useful with this data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-10lib: in routemap.c if using a switch for an enum get rid of enumDonald Sharp
From looking at a current PR: #4297, we see that routemap.c code was not properly updating dependency information for some route_map_event_t enum types. This has lead to dependancy information not being updated properly. While at this time I do not know whether or not we need to update the switch for the missing types, I do know that if we add something in the future we should make the person adding the code consider this. So let's remove all `default:` switch statement handlers from routemap.c when switching on an enum. Future time will need to be spent to figure out what is needed to be done here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-10build: fix Lua buildQuentin Young
Each of Lua's major versions are incompatible with each other. Ubuntu, at least, does not provide a single liblua.so or /usr/include/lua; all SOs and headers are versioned, e.g. liblua5.3.so and /usr/include/lua5.3. There's already an m4 macro in the GNU collection to handle this situation, so let's use that. This allows building with Lua enabled to work on platforms other than Fedora. * Move lib/lua.[ch] -> lib/frrlua.[ch] to prevent path conflicts * Fix configure.ac search for proper CPP and linker flags * Add Lua include path to AM_CPPFLAGS * Update vtysh/extract.pl.in Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-10Merge pull request #4297 from vishaldhingra/rmapDonald Sharp
lib : Child rmap not sending an update to parent rmap,if there is an update in child rmap.
2019-05-10Merge pull request #4242 from donaldsharp/zebra_dietRenato Westphal
Zebra diet
2019-05-09Merge pull request #4287 from NaveenThanikachalam/dup_config_processingDonald Sharp
lib, bgpd: Disallow processing of duplicate config.
2019-05-08lib, bgpd: Disallow processing of duplicate config.Naveen Thanikachalam
This fix aims to reduce the load on BGPD when certain exisiting configurations are replayed. Specifically, the fix prevents BGPD from processing routes when the following already existing configurations are replayed: 1) A match criteria is configured within a route-map. 2) When "call" is invoked within a route-map. 3) When a route-map is tied to a BGP neighbor. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2019-05-08lib : Child rmap not sending an update to parent rmap,if there is an update ↵vishaldhingra
in child rmap. Route map library creates a hash table to save the dependency binding. route-map LRM permit 1 call rLRM Whenever there is change in child routemap(rLRM), it tries to find the dependency mapping with the child route map MATCH event and it fails.The handing of match add and match delete was missing to get the correct dependency,here it's LRM. This fix would correct the flow to get the correct dependency. Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2019-05-07lib, vtysh: Make archaic "terminal" optional in configure commandDinesh Dutt
The 'configure terminal' command is a bit redundant, so make the terminal portion optional. Signed-off-by: Dinesh Dutt <dd.ps4u@gmail.com>
2019-05-07Merge pull request #4280 from qlyoung/remove-yang-strreplace-funcRenato Westphal
lib: remove str_replace function
2019-05-07Merge pull request #4082 from opensourcerouting/grpc-nb-pluginQuentin Young
gRPC northbound plugin
2019-05-07lib: remove str_replace functionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-07Merge pull request #4270 from opensourcerouting/libyang-compatLou Berger
lib, yang: disable libyang custom user types temporarily
2019-05-07bgp, ospfd, ospf6d, pimd, lib, isisd: add bfd_client_sendmsg vrf_idPhilippe Guibert
vrf_id parameter is added to the api of bfd_client_sendmsg(). this permits being registered to bfd from a separate vrf. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07lib: perform a bind inside vrf_socket() callPhilippe Guibert
This is an extension to previous behavior, where the bind() operation was performed only when vrf was not a netns backend kind. This was done like that because usually the bind parameter is the vrf name itself, and having an interface name with vrf name is an expectation so that the bind operation works. the bind() operation can be performed on whatever device provided that that name is not null and there is an interface in the vrf that has the same name as the parameter. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-06Merge pull request #4268 from qlyoung/frrstr-replaceRenato Westphal
lib: add string replace function
2019-05-06lib, yang: disable libyang custom user types temporarilyRenato Westphal
libyang 1.0 introduced a few changes in the user types API, and these changes made FRR incompatible with libyang 1.x. In order to ease our migration from libyang 0.x to libyang 1.x, let's disable our libyang custom user types temporarily so that FRR can work with both libyang 0.x and libyang 1.x. This should be especially helpful to the CI systems during the transition. Once the migration to libyang 1.x is complete, this commit will be reverted. Disabling our libyang custom user types should have only minimal performance implications when processing configuration transactions. The user types infrastructure should be more important in the future to perform canonization of YANG data values when necessary. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-06lib: add string replace functionQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-06Merge pull request #4253 from qlyoung/zapi-handler-args-macroRenato Westphal
ZAPI callback args macro
2019-05-03*: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young
This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-03lib: define ZAPI_CALLBACK_ARGS macroQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-03lib: Remove functionally dead code.Donald Sharp
The vrf_with_default_name vrf variable is set to NULL and then tested to see if it is valid. Removing the dead code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02lib: Convert table code to use new hash typeDonald Sharp
This converts the new table code to use the new hash type provided by David. The following test is 1 million routes installed and how much memory we are using: Old mem usage: Memory statistics for zebra: System allocator statistics: Total heap allocated: 574 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 536 MiB Free small blocks: 33 MiB Free ordinary blocks: 4600 KiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 New Memory usage: Memory statistics for zebra: System allocator statistics: Total heap allocated: 542 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 506 MiB Free small blocks: 3374 KiB Free ordinary blocks: 33 MiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02lib: Make prefix_hash_key accept a constDonald Sharp
We should not be modifying the pointer for the prefix_hash_key function, make it a const so that we can use it elsewhere. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02lib: Make _find functions treat the head as constDonald Sharp
The head of a list should not change for find functions. Probably are others that should be considered but these changes can come in as needed I believe. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02Revert "bgpd: Prevent IPv6 routes received via a ibgp session with own ip as ↵Donald Sharp
nexthop "
2019-05-02Revert "Zebra diet"Lou Berger
2019-05-01lib: Convert table code to use new hash typeDonald Sharp
This converts the new table code to use the new hash type provided by David. The following test is 1 million routes installed and how much memory we are using: Old mem usage: Memory statistics for zebra: System allocator statistics: Total heap allocated: 574 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 536 MiB Free small blocks: 33 MiB Free ordinary blocks: 4600 KiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 New Memory usage: Memory statistics for zebra: System allocator statistics: Total heap allocated: 542 MiB Holding block headers: 0 bytes Used small blocks: 0 bytes Used ordinary blocks: 506 MiB Free small blocks: 3374 KiB Free ordinary blocks: 33 MiB Ordinary blocks: 0 Small blocks: 0 Holding blocks: 0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>