summaryrefslogtreecommitdiff
path: root/ripd
AgeCommit message (Collapse)Author
2020-04-27build: make clippy Makefile rules nicerDavid Lamparter
These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27build: use VPATH for vtysh_scanDavid Lamparter
No need to put $(top_srcdir) everywhere. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-24Merge pull request #6279 from opensourcerouting/nb-cb-argsDonald Sharp
*: change the signature of the northbound callbacks to be more flexible
2020-04-23Merge pull request #6262 from qlyoung/remove-sprintfDavid Lamparter
2020-04-23*: change the signature of the northbound callbacks to be more flexibleRenato Westphal
Having a fixed set of parameters for each northbound callback isn't a good idea since it makes it difficult to add new parameters whenever that becomes necessary, as several hundreds or thousands of existing callbacks need to be updated accordingly. To remediate this issue, this commit changes the signature of all northbound callbacks to have a single parameter: a pointer to a 'nb_cb_x_args' structure (where x is different for each type of callback). These structures encapsulate all real parameters (both input and output) the callbacks need to have access to. And adding a new parameter to a given callback is as simple as adding a new field to the corresponding 'nb_cb_x_args' structure, without needing to update any instance of that callback in any daemon. This commit includes a .cocci semantic patch that can be used to update old code to the new format automatically. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-20*: sprintf -> snprintfQuentin Young
Replace sprintf with snprintf where straightforward to do so. - sprintf's into local scope buffers of known size are replaced with the equivalent snprintf call - snprintf's into local scope buffers of known size that use the buffer size expression now use sizeof(buffer) - sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp buffer followed by strlcat Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-17*: replace all random() callsRafael Zalamena
Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. 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-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: move CLI parent data to cmd_node->parent_nodeDavid Lamparter
Same as before, instead of shoving this into a big central list we can just put the parent node in cmd_node. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-09lib, *: add a common time interval formatting apiMark Stapp
Add a common api that formats a time interval into a string with different output for short and longer intervals. We do this in several places, for cli/ui output. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-08*: Replace `sizeof something` to sizeof(something)Donatas Abraitis
Satisfy checkpatch.pl requirements (check for sizeof without parenthesis) Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05Merge pull request #5916 from mjstapp/fix_gmtimeQuentin Young
*: use gmtime_r exclusively
2020-03-05*: use gmtime_r, localtime_r exclusivelyMark Stapp
Stop using gmtime() or localtime() everywhere. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-14ripd: Add vrf name to debug outputDonald Sharp
The vrf id is insufficient of a discriminator in people's head Give them what they need. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-10Merge pull request #5763 from ton31337/fix/return_without_parentRenato Westphal
*: Remove parenthesis on return for constants
2020-02-09*: Remove parenthesis on return for constantsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-05Merge pull request #5104 from opensourcerouting/route-map-nbv2Donald Sharp
lib: migrate route map to use northbound
2020-02-04*: remove null check before XFREEQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-04*: fix route map integrationRafael Zalamena
Add the appropriated code to bootstrap route map northbound for all daemons. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-03*: don't null after XFREE; XFREE does this itselfQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15doc: rename man pages to frr-*David Lamparter
The vrrpd one conflicts with the standalone vrrpd package; also we're installing daemons to /usr/lib/frr on some systems so they're not on PATH. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-31ripd: Fix redistribute/no redistribute rinse repeate commandsDonald Sharp
ripd was using zclient_redistribute for installation but not for removal. As such the lib/zclient.c was not properly tracking add/removal. I think it would be best to just let rip to track this instead of zclient. Fixes: #5599 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-12ripd, ripngd: Free up list after call into nb_cli_rpcDonald Sharp
We have a clear memory leak after running `clear ip rip` Fix this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-06lib: rename memory_vty.c to lib_vty.cDavid Lamparter
And memory_init() to lib_cmd_init(). 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-11-30*: make all route_map_rule_cmd constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-02*: Convert connected_free to a double pointerDonald Sharp
Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-29ripd: split northbound callbacks into multiple filesRenato Westphal
Rearrange the ripd northbound callbacks as following: * rip_nb.h: prototypes of all northbound callbacks. * rip_nb.c: definition of all northbound callbacks and their associated YANG data paths. * rip_nb_config.c: implementation of YANG configuration nodes. * rip_nb_state.c: implementation of YANG state nodes. * rip_nb_rpcs.c: implementation of YANG RPCs. * rip_nb_notifications.c: implementation of YANG notifications. 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-09-30*: strip trailing whitespaceQuentin Young
Some of it has snuck by CI Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-19*: Convert zapi->interface_delete to ifp callbackDonald Sharp
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert interface_down to interface down callbackDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert from ->interface_up to the interface callbackDonald Sharp
For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Switch all zclient->interface_add to interface create callbackDonald Sharp
Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Add infrastructure to support zapi interface callbacksDonald Sharp
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-18Revert "lib: introduce a read-write lock for northbound configurations"Renato Westphal
Adding a lock to protect the global running configuration doesn't help much since the FRR daemons are not prepared to process configuration changes in a pthread that is not the main one (a whole lot of new protections would be necessary to prevent race conditions). This means the lock added by commit 83981138 only adds more complexity for no benefit. Remove it now to simplify the code. All northbound clients, including the gRPC one, should either run in the main pthread or use synchronization primitives to process configuration transactions in the main pthread. This reverts commit 83981138fe8c1e0a40b8dede74eca65449dda5de.
2019-09-17Merge pull request #4564 from pguibert6WIND/misc_vrf_update_nameRuss White
Misc vrf update name
2019-09-03*: frr_elevate_privs -> frr_with_privsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-08-27ripd: change vrf name with bypassing nb apiPhilippe Guibert
ripd operational & config data may already applied and available, while an external event requests for changing the vrf name. this change updates the config and operational context of yang. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-08-27ripd: update the default vrf name by registering to callbackPhilippe Guibert
if default vrf name is updated, then rip contexts based on that hypothetical vrfname, will be enabled. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-08-08ospfd,ripd: Enabling build with opensslMichal Ruprich
Enabling openssl library for md5 authentication in RIP and OSPF Signed-off-by: Michal Ruprich <michalruprich@gmail.com>
2019-07-22lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOPLakshman Krishnamoorthy
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP Traditionally route map MATCH rule apis were designed to return a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH. (Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR). Depending on this response, the following statemachine decided the course of action: State1: If match cmd returns RMAP_MATCH then, keep existing behaviour. If routemap type is PERMIT, execute set cmds or call cmds if applicable, otherwise PERMIT! Else If routemap type is DENY, we DENYMATCH right away State2: If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH We require a 3rd state because of the following situation: The issue - what if, the rule api needs to abort or ignore a rule?: "match evpn vni xx" route-map filter can be applied to incoming routes regardless of whether the tunnel type is vxlan or mpls. This rule should be N/A for mpls based evpn route, but applicable to only vxlan based evpn route. Also, this rule should be applicable for routes with VNI label only, and not for routes without labels. For example, type 3 and type 4 EVPN routes do not have labels, so, this match cmd should let them through. Today, the filter produces either a match or nomatch response regardless of whether it is mpls/vxlan, resulting in either permitting or denying the route.. So an mpls evpn route may get filtered out incorrectly. Eg: "route-map RM1 permit 10 ; match evpn vni 20" or "route-map RM2 deny 20 ; match vni 20" With the introduction of the 3rd state, we can abort this rule check safely. How? The rules api can now return RMAP_NOOP to indicate that it encountered an invalid check, and needs to abort just that rule, but continue with other rules. As a result we have a 3rd state: State3: If match cmd returned RMAP_NOOP Then, proceed to other route-map, otherwise if there are no more rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH. Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-07-01ripd: fix problems with the "ip rip authentication" commandRenato Westphal
libyang-0.16-r3 doesn't allow the creation of data nodes if their corresponding "when" statement (if any) resolves to false. This change broke the "ip rip authentication" command. This commit adapts this command so that it's not affected by the new libyang stricter validation checks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>