summaryrefslogtreecommitdiff
path: root/sharpd
AgeCommit message (Collapse)Author
2023-09-29*: Do not cast to the same type as the destination isDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-20bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthopDmytro Shytyi
Append zebra and lib to use muliple SRv6 segs SIDs, and keep one seg SID for bgpd and sharpd. Note: bgpd and sharpd compilation relies on the lib and zebra files, i.e if we separate this: lib or zebra or bgpd or sharpd in different commits - this will not compile. Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-07-10sharpd: allow sharpd to install non-recursive routesMark Stapp
Add a config option so that sharpd can install routes without the ALLOW_RECURSION flag, matching IGP behavior. The default remains 'recursion'. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-06-23sharpd: support opaque zapi notificationsMark Stapp
Add cli and support to sharpd to exercise the zapi opaque 'notification' features. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-04-20Merge pull request #12933 from Orange-OpenSource/link_statePhilippe Guibert
lib: Update edge key in link state database
2023-04-07sharpd: Update TE to new Link State Edge keyOlivier Dugeon
Following the modification of the edge key in link state database this patch updates the sharp_vty.c file to replace the old uint64_t edge key by the new ls_edge_key structure when searching for an edge. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-04-06*: Use a `struct prefix *p` instead of a `struct prefix` in functionsDonald Sharp
When passing a prefix into a function let's pass by address instead of pass by value. Let's save our stack space. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-03sharpd: Fix sharpd memory leakKeelan10
Free path Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-03-30sharpd: Adjust TED builderOlivier Dugeon
Following correction of IS-IS subnet creation, this patch adjust the way the TED is created in sharpd to automatically adjust subnet deletion. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-13sharpd: clang-format style fixStephen Worley
clang-format style fix Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13lib,sharpd: add ability for sharpd to install vni labelsStephen Worley
Add the ability for sharpd to install vni labels for testing. This patch is just for testing/dev work purposes with evpn. It adds some code to vty for nexthop-groups so we can explicitly add a label to nexthops and then let sharpd encode them to zebra. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-11-22sharpd: traffic control PoCSiger Yang
This commit adds a command to sharpd to validate the proof of concept for traffic control on specific interface with specific filters. Signed-off-by: Siger Yang <siger.yang@outlook.com>
2022-11-04*: Add ability to encode / decode resilence down zapiDonald Sharp
At this point add abilty for the encode/decode of the resilience down ZAPI to zebra. Just hookup sharpd at this point in time. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-11-04*: Add ability for daemons to notice resilience changesDonald Sharp
This patch just introduces the callback mechanism for the resilient nexthop changes so that upper level daemons can take advantage of the change. This does nothing at this point but just call some code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-18sharpd: add support for SRv6 End.DT46 behaviorCarmine Scarpitta
This commit adds the support for SRv6 End.DT46 behavior to SHARPD. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-10-07*: Create and use infrastructure to show debugs in libDonald Sharp
There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-24sharpd: Fix memory leaks related to SRv6 nexthopsCarmine Scarpitta
Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks` gives several memory leak errors. This is due to the way SRv6 routes (seg6 and seg6local routes) are handled: when the user executes the CLI command `sharp install seg6-routes` or `sharp install seg6local-routes` to create a seg6 or seg6local route, sharpd calls `nexthop_add_srv6_seg6` or `nexthop_add_srv6_seg6local` to create an SRv6 nexthop. A pointer to the SRv6 nexthop is stored in the global data structure `sg.r.nhop`. If you call `sharp install routes`, `sharp install seg6-routes` or `sharp install seg6local-routes` to create more routes, `sg.r.nhop` is set to zero and the pointer to the SRv6 nexthop contained in `sg.r.nhop` is definitely lost and the allocated memory is never freed. This patch adds calls to `nexthop_del_srv6_seg6()` and `nexthop_del_srv6_seg6local()` to free the memory allocated for the SRv6 nexthop before clearing the `sg.r.nhop` data structure. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-08-24sharpd: Fix memory leak in release-locator-chunkCarmine Scarpitta
Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks` gives several memory leak errors. This is due to the way SRv6 chunks are released: when the user executes the CLI command `sharp srv6-manager release-locator-chunk` to release the chunks of an SRv6 locator, the `list_delete()` function is called to delete the chunks list (`loc->chunks`), but the memory allocated for the chunks is not freed. This patch defines a new callback `sharp_srv6_locator_chunk_free()`. This callback takes care of freeing the memory allocated for a given chunk. When `list_delete()` is called to remove the chunk list `loc->chunks`, it automatically calls `sharp_srv6_locator_chunk_free()` on each element of the list to free the allocated memory before deleting the list. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-08-24sharpd: Fix memory leak in release-locator-chunkCarmine Scarpitta
Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks` gives several memory leak errors. This is due to the way SRv6 chunks are released: when the user executes the CLI command `sharp srv6-manager release-locator-chunk` to release the chunks of an SRv6 locator, all the chunks are removed from the list `loc->chunks`. Also, the locator is removed from the SRv6 locators list `sg.srv6_locators`, but the memory allocated for the locator is not freed. This patch adds a call to `XFREE()` to properly free the allocated memory when all the chunks of an SRv6 locator are removed and the locator is removed as well. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2022-04-25build: fix new gcc 11.2 warningsDavid Lamparter
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>
2022-03-27*: add SAFI argument to zclient_send_rnhDavid Lamparter
Just pushing that SAFI_UNICAST up 1 level to the caller. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-15Merge pull request #10427 from sworleys/Protodown-Reason-UpstreamRuss White
Add Support for Setting Protodown Reason Code
2022-03-12*: When matching against a nexthop send and process what it matched againstDonald Sharp
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>
2022-03-09sharpd: add support for setting protodownStephen Worley
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>
2022-02-27*: Add necessary new line for output of vty_out()anlan_cs
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
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>
2022-02-08Merge pull request #9649 from proelbtn/add-support-for-end-dt4Russ White
add support for SRv6 IPv4 L3VPN
2022-02-02tests: Add CSPF topotestOlivier Dugeon
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>
2022-02-02sharpd: Add call to CSPFOlivier Dugeon
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>
2021-12-21*: rework renaming the default VRFIgor Ryzhov
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>
2021-11-27*: Remove redundand braces for single statement blocksDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25sharpd: Convert vty_out to vty_json for JSONDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-22sharpd: add support for End.DT4Ryoga Saito
This patch enables sharpd to insert End.DT4 routes into zebra. Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2021-11-11*: Convert quagga_signal_X to frr_signal_XDonald Sharp
Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-10-20*: convert zclient callbacks to tableDavid Lamparter
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>
2021-09-27*: Remove the ZEBRA_IMPORT_ROUTE_XXX zapi messagesDonald Sharp
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>
2021-09-27*: Add resolve via default flagDonald Sharp
2021-08-25*: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-01*: Replace 4/16 integers to IPV4_MAX_BYTELEN/IPV6_MAX_BYTELENDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-01*: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-07-01*: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlenDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>