summaryrefslogtreecommitdiffstats
path: root/sharpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* build: fix new gcc 11.2 warningsDavid Lamparter2022-04-251-2/+2
| | | | | | | | Some recent improvement in GCC triggers 2 new warnings, and they're actual bugs (reading beyond end of prefix_ipv6 by accessing it as prefix, which is larger.) Luckily it's only in sharpd. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add SAFI argument to zclient_send_rnhDavid Lamparter2022-03-271-1/+2
| | | | | | Just pushing that SAFI_UNICAST up 1 level to the caller. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #10427 from sworleys/Protodown-Reason-UpstreamRuss White2022-03-163-0/+78
|\ | | | | Add Support for Setting Protodown Reason Code
| * sharpd: add support for setting protodownStephen Worley2022-03-093-0/+78
| | | | | | | | | | | | | | Add support for setting protodown via sharpd. This is just useful for testing. We can make use of this in topotests. Signed-off-by: Stephen Worley <sworley@nvidia.com>
* | *: When matching against a nexthop send and process what it matched againstDonald Sharp2022-03-121-4/+5
|/ | | | | | | | | | | | | | | | | | Currently the nexthop tracking code is only sending to the requestor what it was requested to match against. When the nexthop tracking code was simplified to not need an import check and a nexthop check in b8210849b8ac1abe2d5d9a5ab2459abfde65efa5 for bgpd. It was not noticed that a longer prefix could match but it would be seen as a match because FRR was not sending up both the resolved route prefix and the route FRR was asked to match against. This code change causes the nexthop tracking code to pass back up the matched requested route (so that the calling protocol can figure out which one it is being told about ) as well as the actual prefix that was matched to. Fixes: #10766 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Add necessary new line for output of vty_out()anlan_cs2022-02-271-1/+1
| | | | Signed-off-by: anlan_cs <vic.lan@pica8.com>
* *: Change thread->func to return void instead of intDonald Sharp2022-02-241-2/+1
| | | | | | | The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9649 from proelbtn/add-support-for-end-dt4Russ White2022-02-081-1/+7
|\ | | | | add support for SRv6 IPv4 L3VPN
| * sharpd: add support for End.DT4Ryoga Saito2021-11-221-1/+7
| | | | | | | | | | | | This patch enables sharpd to insert End.DT4 routes into zebra. Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
* | tests: Add CSPF topotestOlivier Dugeon2022-02-021-1/+3
| | | | | | | | | | | | | | | | Add new topotest for the Constraints ShortestPath First (CSPF) algorithm. This topotest uses IS-IS-TE as base network to populate a Traffic Engineering Database (TED) and sharpd to call cspf algorithms on this IS-IS-TE topology. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | sharpd: Add call to CSPFOlivier Dugeon2022-02-021-0/+103
| | | | | | | | | | | | | | | | New Constaint Shortest Path First algorithm has been introduce in FRR library. Add a new 'show sharp cspf' command as example of how to use these CSPF algorithm. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | *: rework renaming the default VRFIgor Ryzhov2021-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, it is possible to rename the default VRF either by passing `-o` option to zebra or by creating a file in `/var/run/netns` and binding it to `/proc/self/ns/net`. In both cases, only zebra knows about the rename and other daemons learn about it only after they connect to zebra. This is a problem, because daemons may read their config before they connect to zebra. To handle this rename after the config is read, we have some special code in every single daemon, which is not very bad but not desirable in my opinion. But things are getting worse when we need to handle this in northbound layer as we have to manually rewrite the config nodes. This approach is already hacky, but still works as every daemon handles its own NB structures. But it is completely incompatible with the central management daemon architecture we are aiming for, as mgmtd doesn't even have a connection with zebra to learn from it. And it shouldn't have it, because operational state changes should never affect configuration. To solve the problem and simplify the code, I propose to expand the `-o` option to all daemons. By using the startup option, we let daemons know about the rename before they read their configs so we don't need any special code to deal with it. There's an easy way to pass the option to all daemons by using `frr_global_options` variable. Unfortunately, the second way of renaming by creating a file in `/var/run/netns` is incompatible with the new mgmtd architecture. Theoretically, we could force daemons to read their configs only after they connect to zebra, but it means adding even more code to handle a very specific use-case. And anyway this won't work for mgmtd as it doesn't have a connection with zebra. So I had to remove this option. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | *: Remove redundand braces for single statement blocksDonatas Abraitis2021-11-271-2/+1
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | sharpd: Convert vty_out to vty_json for JSONDonatas Abraitis2021-11-251-7/+2
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | *: Convert quagga_signal_X to frr_signal_XDonald Sharp2021-11-111-1/+1
| | | | | | | | | | | | | | Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: convert zclient callbacks to tableDavid Lamparter2021-10-201-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: Remove the ZEBRA_IMPORT_ROUTE_XXX zapi messagesDonald Sharp2021-09-271-11/+3
| | | | | | | | | | | | | | | | | | These are no longer really needed. The client just needs to call nexthop resolution instead. So let's remove the zapi types. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | *: Add resolve via default flagDonald Sharp2021-09-271-1/+1
|/
* *: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis2021-08-251-1/+0
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: Replace 4/16 integers to IPV4_MAX_BYTELEN/IPV6_MAX_BYTELENDonatas Abraitis2021-07-011-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis2021-07-011-5/+5
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlenDonatas Abraitis2021-07-011-4/+4
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd,sharpd,zebra: fix code styleHiroki Shirokura2021-06-022-8/+6
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* *: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*Hiroki Shirokura2021-06-021-3/+0
| | | | | | | | | | | https://github.com/FRRouting/frr/pull/5865#discussion_r597670225 As this comment says. ZEBRA_FLAG_XXX should not have been used. To communicate SRv6 Route Information. A simple Nexthop Flag would have been sufficient for SRv6 information. And I fixed the whole thing that way. Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* lib,sharpd,zebra: update nexthop object with nh_srv6Hiroki Shirokura2021-06-021-2/+2
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: split srv6 route install commandHiroki Shirokura2021-06-021-59/+180
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: follow the practice on cli design for json outputHiroki Shirokura2021-06-021-15/+32
| | | | | | | | | | | | The "show sharp segment-routing srv6" command was a json output command, but it did not follow the common practice of the other commands. It follows the review and outputs the json format by using the json keyword. Otherwise, it produces human readable output. Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* *: eliminate redundant info from srv6 locator zapiHiroki Shirokura2021-06-021-34/+15
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* *: use one line init instead of memset and format itHiroki Shirokura2021-06-021-2/+1
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* *: fix code format accourding to checkpatchHiroki Shirokura2021-06-023-10/+19
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: install route supports nexthop-seg6 (step3)Hiroki Shirokura2021-06-021-1/+14
| | | | | | | | | | | We can install seg6 routes from shapd cli. This is for the behaviour test(topotest) to ensure SRv6 ZAPI is working fine. NEW-CLI: sharp install routes 1::1 nexthop-seg6 2001::1 encap a:: Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: support create/delete srv6-locator (step2)Hiroki Shirokura2021-06-025-0/+189
| | | | Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* shaprd: install route supports nexthop-seg6local (step1)Hiroki Shirokura2021-06-021-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | In this patch, we can install seg6local routes from shapd cli. New sub command "sharp install route $PREFIX nexthop-seg6local" is added to install seg6local routes via ZEBRA_ROUTE_ADD. This is for the behaviour test(topotest) to ensure SRv6 ZAPI is working fine. NEW-CLI: sharp install routes 1::1 nexthop-seg6local dum0 End 1 sharp install routes 2::1 nexthop-seg6local dum0 End_X 2001::1 1 sharp install routes 3::1 nexthop-seg6local dum0 End_T 10 1 sharp install routes 4::1 nexthop-seg6local dum0 End_DX4 10.0.0.1 1 SRv6 routes are installed as NEXTHOP_IFINDEX routes because of seg6local specification. seg6local routes depends the output device status instead of routing-nexthop. FYI: In seg6local implementation, kernel don't care RTA_OIF on the nexthop deeply but some requirement are exist as follow. (a) DEV isn't loopback interface (b) DEV's ipv6 status is enabled (c) DEV's enslaving status is the same with target-route Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: install_routes_helper support ZAPI_ROUTE flags (step1)Hiroki Shirokura2021-06-024-9/+19
| | | | | | | | | | | | current route addition mechanism on shaprd support only ipv4/v6 nexthop routes simply. so It doesn't need to ensure flags of zapi_routes. Then when we want to configure more complicated routing feature (like a srv6), we will want to control flags of zapi_route. In this patch, it will supports to configure flags of zapi_route when sharpd calls ZEBRA_ROUTE_ADD. Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
* sharpd: add v4 redistribute watchingDonald Sharp2021-05-043-0/+36
| | | | | | Add the ability for sharpd to watch v4 redistribution events Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: use correct list of redist protocols in remove lspMark Stapp2021-04-291-2/+2
| | | | | | | The remove lsp command was using the wrong list of route protocols - use the ZEBRA list, same as the other clis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: remove *.conf.sample filesQuentin Young2021-04-092-7/+0
| | | | | | | | | | Most of these are many, many years out of date. All of them vary randomly in quality. They show up by default in packages where they aren't really useful now that we use integrated config. Remove them. The useful ones have been moved to the docs. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* 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>