summaryrefslogtreecommitdiff
path: root/sharpd/sharp_zebra.c
AgeCommit message (Collapse)Author
2020-09-30*: make failure to decode nht update an errorQuentin Young
This should never happen; no need to debug guard it and it's not a warning, if this isn't working then NHT is not working at all. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-09-28lib,zebra,sharpd: add code for backup proto-NHs but disabledStephen Worley
Add the zapi code for encoding/decoding of backup nexthops for when we are ready for it, but disable it for now so that we revert to the old way with them. When zebra gets a proto-NHG with a backup in it, we early fail and tell the upper level proto. In this case sharpd. Sharpd then reverts to the old way of installation with the route. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28lib,sharpd: align zapi NHG apis a bitStephen Worley
Align the zapi NHG apis to be more consistent with the zapi_route apis. Add a struct zapi_nhg to use for encodings as well. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28sharp: add check for num_nh > multipathStephen Worley
Add a check for installing nexthop_group greater than multipath number. Truncate if we hit it and log a warning to the user. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28lib,zebra,sharpd: clang formatStephen Worley
Clang format for NHG API and sharpd patches. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28sharpd: implement NHG notification handlingStephen Worley
Implement handling of NHG notifications in sharpd so that the routes don't attempt to use an NHG ID that did not successfully get created. If it does not get installed, we fall back to traditional zapi messaging. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28sharpd: add abilty to send a nhg to zebraDonald Sharp
Modify the sharpd program to have the ability to pass down a NHG and then operate on it for route installation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-12sharpd: add a command to send ARP/NDP requestsJakub Urbańczyk
Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-08-04sharpd: support 'update lsp' zapi testingMark Stapp
Add 'update' support so that sharpd can exercise add, update, and delete zapi exchanges for LSPs. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-17lib,sharpd,zebra: initial support for multiple backup nexthopsMark Stapp
Initial changes to support a nexthop with multiple backups. Lib changes to hold a small array in each primary, zapi message changes to support sending multiple backups, and daemon changes to show commands to support multiple backups. The config input for multiple backup indices is not present here. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-10Merge pull request #6530 from mjstapp/backup_nhg_notifyDonald Sharp
lib, zebra: async notifications for backup routes and LSPs
2020-07-07sharpd: be explicit if nht is uninstalledMark Stapp
Emit a debug if sharpd gets a nexthop-tracking message without any nexthops. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-07sharpd: use extern for globalsMark Stapp
Use extern when declaring a couple of globals in sharp_zebra. gcc 10 on fedora 32 needs this. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-16sharpd: add zclient session create and deleteMark Stapp
Add a couple of clis and some simple support that allows sharpd to create extra zapi client sessions. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10sharpd,zebra: unicast support for zapi messagesMark Stapp
Distinguish between unicast and broadcast opaque messages in zebra handler code. Add cli and internal api changes to have sharpd send unicast opaque messages. Add opaque cli commands to the sharp user doc. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10lib,zebra,sharpd: modify opaque zapi message to support unicastMark Stapp
Start modifying the OPAQUE zapi message to include optional unicast destination zapi client info. Add a 'decode' api and opaque msg struct to encapsulate that optional info. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02sharpd: add handler for OPAQUE messagesMark Stapp
Add a simple handler to receive OPAQUE zapi messages for testing. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02sharpd: send opaque message registrationsMark Stapp
For testing, add cli to sharpd to send opaque message registration and un-registration messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02sharpd: send new OPAQUE messagesMark Stapp
Add a simple cli to exercise the new OPAQUE messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-01sharpd: include backup nh info with lspsMark Stapp
If present in a configured nexthop_group, include backup nexthop/nhlfe info with LSP zapi add/update messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-27sharpd: support backup nexthopsMark Stapp
Add cli and zapi support for backup nexthops for sharpd routes. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-24*: remove tabs from log messagesDavid Lamparter
Some logging systems are, er, "allergic" to tabs in log messages. (RFC5424: "The syslog application SHOULD avoid octet values below 32") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-03-17Merge pull request #5779 from mjstapp/sharp_with_lspsDonald Sharp
sharpd: add support to install/remove lsps
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-25sharpd: add support for install/remove lspsMark Stapp
First round of support for exercising the lsp and ftn paths using sharpd. This supports lsp-only, and binding to ipv4 prefix. Also use the common lib nexthop-to-zapi helper api instead of sharpd's open-coded version. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-09lib, zebra: Allow for encode/decode of nexthop weight in pass downDonald Sharp
Add code to encode/decode the nexthop weight when we pass it down into zebra. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-06lib,sharpd: support labelled nexthop-groups in sharpdMark Stapp
Update sharpd's zapi client code to support labelled nexthops if they're present in a nexthop-group. Signed-off-by: Mark Stapp <mjs@voltanet.io>
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-02sharpd: Start infrastructure to allow for redistribution testingDonald Sharp
Start the work in sharpd to allow the testing of redistribution of routes. Namely telling zebra to tell us about redistribution events via the callback. Future work here will allow sharpd to specify the redistribution events it wants and to allow us to track that via counters. Signed-off-by: Donald Sharp <sharpd@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-08-02sharpd: Fix repeat sub-command to workDonald Sharp
The repeat sub-command was not properly repeating. It was starting the removal during the install: 2019/08/03 00:10:14.351 SHARP: Inserting 300000 routes 2019/08/03 00:13:01.556 SHARP: Installed All Items 167.204747 2019/08/03 00:13:01.556 SHARP: Removing 300000 routes 2019/08/03 00:13:03.126 SHARP: Inserting 300000 routes 2019/08/03 00:14:34.794 SHARP: Removed all Items 91.668040 2019/08/03 00:16:11.743 SHARP: Installed All Items 188.616462 2019/08/03 00:16:11.743 SHARP: Removing 300000 routes 2019/08/03 00:16:14.256 SHARP: Inserting 300000 routes This command allows the remove to wait till the install is fully finished and vice versa: 2019/08/03 00:22:54 SHARP: Inserting 10000 routes 2019/08/03 00:22:55 SHARP: Installed All Items 0.572028 2019/08/03 00:22:55 SHARP: Removing 10000 routes 2019/08/03 00:22:55 SHARP: Removed all Items 0.568284 2019/08/03 00:22:55 SHARP: Inserting 10000 routes 2019/08/03 00:22:56 SHARP: Installed All Items 0.567687 2019/08/03 00:22:56 SHARP: Removing 10000 routes 2019/08/03 00:22:56 SHARP: Removed all Items 0.551011 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-23Revert "Ospf missing interface handling 2"Donald Sharp
2019-06-12*: change if_lookup_by_name() api with vrfPhilippe Guibert
the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-11*: fix some dumb printf format warningsDavid Lamparter
Some types like `time_t` vary across platforms and always need to be cast when printed. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-06-07lib, pimd, sharpd: Various output string cleanupsDonald Sharp
Various compilers in our CI system were complaining about various auto-conversions. Let's get these cleaned up a bit more. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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-03-01sharpd: Add ability to pass vrf we want to watchDonald Sharp
Add the ability for the sharp zebra code to pass down the vrf that we want to watch. At this point in time, we cannot use it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-01sharpd: Setup route installation to be able to select vrf to useDonald Sharp
Modify the sharp code to allow for vrf route installation. At this point in time the code is nascent. Future commits will turn on this behavior. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-13sharpd: Allow the registration of import checks to zebraDonald Sharp
Minor code modification to allow the sharp_zebra.c code to differentiate between import check or nexthop watch types. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-07sharpd: Add 'sharp data nexthop' data dumpDonald Sharp
Add some basic data dumping about what we have watched from the vty/vtysh cli for nexthops. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-07sharpd: Move route global variables into the global data structureDonald Sharp
Clean up the route global variables into a global data structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-07sharpd: Allow nhop tracking to specify connectedDonald Sharp
Allow the sharp daemon to specify whether or not a watched nexthop should be connected or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-10sharpd: Do addition/subtraction for meDonald Sharp
Write a bit of code to track the start/stop times and do subtraction! In the future we expect this code to slice and dice as well. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-10sharpd: Allow route install/removal of v6 routes.Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-03sharpd: Add code to allow install/uninstall repeatedlyDonald Sharp
Add a bit of test code to allow the tester to install/uninstall the routes via: sharp install routes A.B.C.D nexthop Y.Z.M.D 1000000 repeat 100 This will install 1000000 routes wait for them to be finished then uninstall them then start installation over 100 times. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2019-01-02sharpd: Abstract the route install/delete functions a bitDonald Sharp
Abstract the route install/delete functions a bit to allow me to expand on them in the with future commits. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>