summaryrefslogtreecommitdiffstats
path: root/sharpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* sharpd: Add Traffic Engineering Database (TED)Olivier Dugeon2021-03-235-0/+174
| | | | | | | | | | | Add new feature and commands to sharpd in order to collect Traffic Engineering Database information from an IGP (OSPF or IS-IS) though the ZAPI Opaque Message and the support of the Link State Library. This feature serves as an example of how to code a Traffic Engineering Database consumer and tests the mechanism. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* Merge pull request #8121 from opensourcerouting/macro-cleanupDonatas Abraitis2021-03-223-5/+6
|\ | | | | *: require ISO C11 + semicolons after file-scope macros
| * *: require semicolon after FRR_DAEMON_INFO & co.David Lamparter2021-03-171-1/+2
| | | | | | | | | | | | ... again ... Signed-off-by: David Lamparter <equinox@diac24.net>
| * *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-173-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | sharpd: Dump metric received for the reachabilityDonald Sharp2021-03-161-1/+2
|/ | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Convert over to using builtin printf functionalityDonald Sharp2021-03-141-11/+6
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: don't send invalid nexthop-groups to zebraMark Stapp2021-01-211-1/+31
| | | | | | | | Ensure that there are valid (resolved) nexthops, and no invalid backup nexthops, in nhgs sent to zebra for installation. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: Replace s_addr check agains 0 with INADDR_ANYDonatas Abraitis2020-12-141-3/+3
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* sharpd, zebra: Pass and display opaque data as PoCDonald Sharp2020-12-084-13/+31
| | | | | | | Pass data from sharpd to zebra as opaque data and display it as part of the detailed route data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib, sharpd, vtysh: When reading a file in for config send start/end indicatorsDonald Sharp2020-11-191-0/+12
| | | | | | | When reading a file in for configuration, send start and end indicators to interested parties. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert all usage of zclient_send_message to new enumDonald Sharp2020-11-151-4/+6
| | | | | | | | | The `enum zclient_send_status` enum needs to be extended throughout the code base to use the new states and to fix up places where we tested against the return value being non zero. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd, lib, sharpd: Add enum for zclient_send_message returnDonald Sharp2020-11-151-8/+4
| | | | | | | | Add a `enum zclient_send_status` for appropriate handling of return codes from zclient_send_message. Touch all the places where we handle this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Add buffering supportDonald Sharp2020-11-151-22/+106
| | | | | | | | | Have sharpd notice that when sending routes to zebra that the underlying system has buffered data and to pause sending more data to zebra until such time we get a callback that the write was successful to zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Re-arrange route_add|deleteDonald Sharp2020-11-152-72/+85
| | | | | | | | | These functions are never called outside of sharp_zebra.c, re-arrange a little to make the inclusions in sharp_zebra.h not needed and to also have these functions return whether or not the underlying buffering system was invoked in stream sending. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: Advertise FIB installed routes to bgp peers (Part 1)Soman K S2020-11-061-1/+2
| | | | | | | | | | | | | | | | | | Issue: The bgp routes learnt from peers which are not installed in kernel are advertised to peers. This can cause routers to send traffic to these destinations only to get dropped. The fix is to provide a configurable option "bgp suppress-fib-pending". When the option is enabled, bgp will advertise routes only if it these are successfully installed in kernel. Fix (Part1) : * Added message ZEBRA_ROUTE_NOTIFY_REQUEST used by client to request FIB install status for routes * Added AFI/SAFI to ZAPI messages * Modified the functions zapi_route_notify_decode(), zsend_route_notify_owner() and route_notify_internal() to include AFI, SAFI as parameters Signed-off-by: kssoman <somanks@gmail.com>
* :* Convert prefix2str to %pFXDonatas Abraitis2020-10-222-15/+6
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* sharpd: Fix nexthop group name collisionDonald Sharp2020-10-171-2/+3
| | | | | | | | | | | | | | | | | | | If you have two nexthop groups named one oneone then the sharp daemon will treat them as the same nexthop group. This is because we are doign this: static int sharp_nhg_compare_func(const struct sharp_nhg *a, const struct sharp_nhg *b) { return strncmp(a->name, b->name, strlen(a->name)); } The strlen should be the size of the array of name. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7222 from idryzhov/fix-debugRenato Westphal2020-10-101-1/+1
|\ | | | | fix debug commands node inconsistencies
| * *: move "show debugging ..." commands to enable nodeIgor Ryzhov2020-10-021-1/+1
| | | | | | | | | | | | Use the same node for "show debugging" commands in all daemons. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | vtysh: dynamically generate the list of daemons for commandsIgor Ryzhov2020-10-021-0/+1
|/ | | | | | | Some daemons were actually missing from the static definitions: nhrpd, babeld, eigrpd and bfdd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: make failure to decode nht update an errorQuentin Young2020-10-011-2/+1
| | | | | | | 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>
* sharpd: make id log more specificStephen Worley2020-09-281-1/+1
| | | | | | Make ID log more specific as to the ID being assigned here. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* lib,zebra,sharpd: add code for backup proto-NHs but disabledStephen Worley2020-09-283-4/+30
| | | | | | | | | | | | 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>
* lib,sharpd: align zapi NHG apis a bitStephen Worley2020-09-281-10/+11
| | | | | | | 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>
* sharp: add check for num_nh > multipathStephen Worley2020-09-281-0/+7
| | | | | | | 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>
* zebra,sharpd: checkpatch fixesStephen Worley2020-09-281-9/+5
| | | | | | Check patches fixes for NHG API pathes. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* lib,zebra,sharpd: clang formatStephen Worley2020-09-283-9/+7
| | | | | | Clang format for NHG API and sharpd patches. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* sharpd: implement NHG notification handlingStephen Worley2020-09-283-1/+77
| | | | | | | | | 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>
* Revert "lib,sharpd,pbrd: `set installable` nhg command"Stephen Worley2020-09-281-36/+4
| | | | This reverts commit 1844f45e30913b27cfd875036f865a0edadcf244.
* lib,sharpd,pbrd: `set installable` nhg commandStephen Worley2020-09-281-4/+36
| | | | | | | | | | | Add a command `set installable` that allows configured nexthop groups to be treated as separate/installable objects in the RIB. A callback needs to be implemented per daemon to handle installing the NHG into the rib via zapi when this command is set. This patch includes the implementation for sharpd. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* sharpd: print the correct ID the NHG is usingStephen Worley2020-09-281-1/+1
| | | | | | | | We were incrementing in the output the ID value when we shouldnt be. The value the NHG is assigned is before its incremented. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* sharpd: add abilty to send a nhg to zebraDonald Sharp2020-09-287-13/+165
| | | | | | | 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>
* sharpd: add a command to send ARP/NDP requestsJakub Urbańczyk2020-08-123-0/+54
| | | | Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
* sharpd: Cleanup help textDonald Sharp2020-08-111-2/+2
| | | | | | Help text was a bit inconsistent/wrong. Fix it like you mixed it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #6854 from mjstapp/sharp_lsp_updateDonald Sharp2020-08-063-25/+38
|\ | | | | sharpd: support 'update lsp' zapi testing
| * sharpd: support 'update lsp' zapi testingMark Stapp2020-08-043-25/+38
| | | | | | | | | | | | | | Add 'update' support so that sharpd can exercise add, update, and delete zapi exchanges for LSPs. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | sharpd,vtysh: no access list or route map commandsRafael Zalamena2020-08-041-3/+0
|/ | | | | | | Don't send access list or route map commands to `sharpd` since it doesn't use them. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* lib,sharpd,zebra: initial support for multiple backup nexthopsMark Stapp2020-07-172-1/+6
| | | | | | | | | | 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>
* Merge pull request #6530 from mjstapp/backup_nhg_notifyDonald Sharp2020-07-101-0/+6
|\ | | | | lib, zebra: async notifications for backup routes and LSPs
| * sharpd: be explicit if nht is uninstalledMark Stapp2020-07-071-0/+6
| | | | | | | | | | | | | | Emit a debug if sharpd gets a nexthop-tracking message without any nexthops. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | sharpd: use extern for globalsMark Stapp2020-07-071-2/+2
|/ | | | | | | 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>
* sharpd: add zclient session create and deleteMark Stapp2020-06-163-10/+125
| | | | | | | 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>
* *: have daemons call frr_fini() at terminationMark Stapp2020-06-111-0/+2
| | | | | | | | Fix a number of library and daemon issues so that daemons can call frr_fini() during normal termination. Without this, temporary logging files are left behind in /var/tmp/frr/. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* sharpd,zebra: unicast support for zapi messagesMark Stapp2020-06-103-6/+43
| | | | | | | | | 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>
* lib,sharpd: add a SHARP_STR aliasMark Stapp2020-06-101-2/+2
| | | | | | Add a vty-friendly protocol name alias for sharpd. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* lib,zebra,sharpd: modify opaque zapi message to support unicastMark Stapp2020-06-101-5/+4
| | | | | | | | 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>
* *: integrate remaining daemons with filterRafael Zalamena2020-06-051-0/+1
| | | | | | | Don't crash when trying to `show running-config` because of missing filter northbound integration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* sharpd: add handler for OPAQUE messagesMark Stapp2020-06-021-1/+19
| | | | | | | Add a simple handler to receive OPAQUE zapi messages for testing. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* sharpd: send opaque message registrationsMark Stapp2020-06-023-0/+62
| | | | | | | For testing, add cli to sharpd to send opaque message registration and un-registration messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* sharpd: send new OPAQUE messagesMark Stapp2020-06-023-0/+47
| | | | | | Add a simple cli to exercise the new OPAQUE messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>