summaryrefslogtreecommitdiffstats
path: root/sharpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17445 from cscarpitta/fix/sharp-use-ipv6-max-bitlenDonatas Abraitis2024-11-171-2/+2
|\ | | | | sharpd: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlen
| * sharpd: Use IPV6_MAX_BITLEN in `sharp send opaque notify`Carmine Scarpitta2024-11-171-1/+1
| | | | | | | | Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
| * sharpd: Use IPV6_MAX_BITLEN in `sharp install seg6local-routes`Carmine Scarpitta2024-11-171-1/+1
| | | | | | | | Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
* | sharpd: Fix typo in `sharp install seg6local-routes` help messageCarmine Scarpitta2024-11-171-1/+1
| | | | | | | | Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
* | sharpd: Fix typo in `sharp install seg6-routes` help messageCarmine Scarpitta2024-11-171-1/+1
| | | | | | | | Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
* | sharpd: Fix typo in `sharp install routes` help messageCarmine Scarpitta2024-11-171-1/+1
|/ | | | Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
* sharpd: Allow sharpd to watch nexthops in the mribDonald Sharp2024-10-283-15/+16
| | | | | | | Nothing special here, just allow sharpd to ask to watch nexthops in the mrib. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Eliminate leaked list for locator-chunksDonald Sharp2024-08-081-0/+9
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: fix set ZAPI_MESSAGE_NEXTHOP in nhg only when nexthops usedPhilippe Guibert2024-07-041-1/+1
| | | | | | | | | | The ZAPI_MESSAGE_NEXTHOP flag is systematically set, even if the route message does not include any nexthops. Limit the usage of this value only when nexthops are present. Fixes: 8a71d93d85a6 ("sharpd: Add Super Happy Advanced Routing Protocol") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra, sharpd: add srv6 End.DX6 supportPhilippe Guibert2024-04-251-0/+6
| | | | | | | | | | | | Add the support for adding DX6 behavior into netlink layer of zebra. Add the necessary test in sharpd. > ubuntu2204# sharp install seg6local-routes 1:1::1:2 nexthop-seg6local loop1 End_DX6 4:4::4:6 1 > ubuntu2204# do show ipv6 route > [..] > D>* 1:1::1:2/128 [150/0] is directly connected, loop1, seg6local End.DX6 nh6 4:4::4:6, weight 1, 00:00:03 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: create a single registry of daemons' default port valuesMark Stapp2024-02-011-2/+0
| | | | | | | | Create a single registry of default port values that daemons are using. Most of these are vty ports, but there are some others for features like ospfapi and zebra FPM. Signed-off-by: Mark Stapp <mjs@labn.net>
* *: fix `frr_daemon_info` indentationDavid Lamparter2024-01-271-6/+10
| | | | | | | | | | clang-format doesn't understand FRR_DAEMON_INFO is a long macro where laying out items semantically makes sense. (Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get confused with the mismatching `( ( )`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sharpd: Add ability to turn off watching of redistributionDonald Sharp2024-01-263-6/+8
| | | | | | | | Wanted to do some testing of redistribute without having to restart sharpd over and over. Added ability to turn off the `sharp watch redistribute XX` functionality. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Fix coverity issuesDonald Sharp2024-01-231-1/+1
| | | | | | | New commits had an assignment instead of a comparison option. Coverity wisely found it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: Allow sharpd to listen to neighbor eventsDonald Sharp2024-01-223-0/+72
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #15001 from pguibert6WIND/zebra_nexthop_reworkRuss White2024-01-091-2/+1
|\ | | | | Zebra nexthop rework
| * bgpd, lib: add zapi_route_set_nhg_id() supportPhilippe Guibert2023-12-181-2/+1
| | | | | | | | | | | | | | | | | | There is no function that both sets the nhg id, and sets the ZAPI_MESSAGE_NHG flag if the nhg id is valid. Create a ZAPI API to do this, and apply the changes wherever needed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | lib, sharpd: Move sys/resource.h to where it is usedDonald Sharp2024-01-041-0/+1
|/ | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* sharpd: fix avoid twice sending NHG_DEL for a nexthop-groupPhilippe Guibert2023-12-052-1/+3
| | | | | | | | | | | | | | | | | | | | | | After removing the nexthop of a nexthop group, when the nexthop group is removed, a nhg removal failure happens: > ubuntu2204(config)# nexthop-group CCC > ubuntu2204(config-nh-group)# nexthop 192.0.2.211 loop1 > ubuntu2204(config-nh-group)# no nexthop 192.0.2.211 loop1 > [..] > 2023/12/05 08:59:22 SHARP: [H3QKG-WH8ZV] Removed nhg 179687505 > ubuntu2204(config-nh-group)# exi > ubuntu2204(config)# no nexthop-group CCC > [..] > 2023/12/05 08:59:27 SHARP: [N030J-V0SFN] Failed removal of nhg 179687505 The NHG_DEL message is sent twice at the nexthop deletion, and at the nexthop-group deletion. Avoid sending it twice. Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* sharpd: fix deleting nhid when suppressing nexthop from nh groupPhilippe Guibert2023-12-051-4/+4
| | | | | | | | | | When no nexthops are in a nexthop group, two successive events are sent: NHG_DEL and NHG_ADD, but only the NHG_DEL one is necessary. Fixes this by returning in the nhg_add() function. Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* sharpd: fix deleting nhid when suppressing nexthop from nh groupPhilippe Guibert2023-11-301-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When removing the last nexthop from a nexthop-group, the nexthop group remains in the zebra contexts: > ubuntu2204(config)# nexthop-group gdgd > 2023/11/23 14:06:36 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687502 > ubuntu2204(config-nh-group)# nexthop 192.0.2.7 loop1 > ubuntu2204(config-nh-group)# 2023/11/23 14:06:38 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687502): group 338 > 2023/11/23 14:06:38 ZEBRA: [R43C6-KYHWT] netlink_nexthop_msg_encode: RTM_NEWNEXTHOP, id=179687502 > 2023/11/23 14:06:38 ZEBRA: [HYEHE-CQZ9G] nl_batch_send: netlink-dp (NS 0), batch size=44, msg cnt=1 > 2023/11/23 14:06:38 SHARP: [JWRCN-N9K90] Installed nhg 179687502 > > ubuntu2204(config-nh-group)# no nexthop 192.0.2.7 loop1 > 2023/11/23 14:06:47 SHARP: [Y2G2F-ZTW6M] nhg_add: nhg 179687502 not sent: no valid nexthops > ubuntu2204(config-nh-group)# do show nexthop-group rib 179687502 > ID: 179687502 (sharp) > RefCnt: 1 > Uptime: 00:00:23 > VRF: default > Valid, Installed > Depends: (338) > via 192.0.2.7, loop1 (vrf default), weight 1 Fix this by sending an NHG_DEL message when no nexthops are attached, and when the id was already installed. Fixes: 5a9c0931aa95 ("sharpd: don't send invalid nexthop-groups to zebra") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* sharpd: replace `receive_notify` with requestDavid Lamparter2023-11-231-3/+2
| | | | | | | Send `ZEBRA_ROUTE_NOTIFY_REQUEST` rather than relying on the options field in zclient startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sharpd: use `zclient->nexthop_update`David Lamparter2023-11-201-15/+8
| | | | | | Same as above. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sharpd: Set Callback Function for Memory CleanupKeelan102023-11-153-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a callback function for memory cleanup of sharp_nh_tracker. Specifically, set `sharp_nh_tracker_free` as the deletion function for the `sg.nhs` list. This ensures proper cleanup of resources when elements are removed. The ASan leak log for reference: ``` *********************************************************************************** Address Sanitizer Error detected in zebra_nht_resolution.test_verify_nh_resolution/r1.asan.sharpd.32320 ================================================================= ==32320==ERROR: LeakSanitizer: detected memory leaks Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f4ee812ad28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28) #1 0x7f4ee7b291cc in qcalloc lib/memory.c:105 #2 0x5582be672011 in sharp_nh_tracker_get sharpd/sharp_nht.c:36 #3 0x5582be680b42 in watch_nexthop_v4_magic sharpd/sharp_vty.c:139 #4 0x5582be680b42 in watch_nexthop_v4 sharpd/sharp_vty_clippy.c:192 #5 0x7f4ee7aac0b1 in cmd_execute_command_real lib/command.c:978 #6 0x7f4ee7aac575 in cmd_execute_command lib/command.c:1036 #7 0x7f4ee7aac9f4 in cmd_execute lib/command.c:1203 #8 0x7f4ee7bd50bb in vty_command lib/vty.c:594 #9 0x7f4ee7bd5566 in vty_execute lib/vty.c:1357 #10 0x7f4ee7bdde37 in vtysh_read lib/vty.c:2365 #11 0x7f4ee7bc8dfa in event_call lib/event.c:1965 #12 0x7f4ee7b0c3bf in frr_run lib/libfrr.c:1214 #13 0x5582be671252 in main sharpd/sharp_main.c:188 #14 0x7f4ee6f1bc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s). *********************************************************************************** ``` Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
* sharpd: Clean up memory leaks on shutdownDonald Sharp2023-11-133-10/+36
| | | | | | | | | | | | | a) The cleanup of zclient on shutdown was not being done b) Cleanup vrf shutdown c) Cleanup some lists Signed-off-by: Donald Sharp <sharpd@nvidia.com> sharpd: Cleanup shutdown of vrf and some lists Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* lib: convert if_zapi_callbacks into actual hooksDavid Lamparter2023-11-031-2/+4
| | | | | | | | | ...so that multiple functions can be subscribed. The create/destroy hooks are renamed to real/unreal because that's what they *actually* signal. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Do not cast to the same type as the destination isDonatas Abraitis2023-09-291-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd,lib,sharpd,zebra: srv6 introduce multiple segs/SIDs in nexthopDmytro Shytyi2023-09-201-1/+1
| | | | | | | | | | | 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>
* sharpd: allow sharpd to install non-recursive routesMark Stapp2023-07-102-4/+9
| | | | | | | | 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>
* sharpd: support opaque zapi notificationsMark Stapp2023-06-233-1/+59
| | | | | | | Add cli and support to sharpd to exercise the zapi opaque 'notification' features. Signed-off-by: Mark Stapp <mjs@labn.net>
* Merge pull request #12933 from Orange-OpenSource/link_statePhilippe Guibert2023-04-201-2/+4
|\ | | | | lib: Update edge key in link state database
| * sharpd: Update TE to new Link State Edge keyOlivier Dugeon2023-04-071-2/+4
| | | | | | | | | | | | | | | | 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>
* | *: Use a `struct prefix *p` instead of a `struct prefix` in functionsDonald Sharp2023-04-071-1/+1
| | | | | | | | | | | | | | 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>
* | sharpd: Fix sharpd memory leakKeelan102023-04-031-1/+2
|/ | | | | | Free path Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
* sharpd: Adjust TED builderOlivier Dugeon2023-03-301-1/+1
| | | | | | | 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>
* *: Convert event.h to frrevent.hDonald Sharp2023-03-243-3/+3
| | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert `struct event_master` to `struct event_loop`Donald Sharp2023-03-243-3/+3
| | | | | | Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert struct thread_master to struct event_master and it's ilkDonald Sharp2023-03-243-3/+3
| | | | | | | Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Rename `struct thread` to `struct event`Donald Sharp2023-03-241-1/+1
| | | | | | | | | 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>
* *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-243-3/+3
| | | | | | | | | | | 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>
* Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-179-142/+9
|\ | | | | *: convert to SPDX License identifiers
| * *: auto-convert to SPDX License IDsDavid Lamparter2023-02-099-142/+9
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | sharpd: clang-format style fixStephen Worley2023-02-141-2/+2
| | | | | | | | | | | | clang-format style fix Signed-off-by: Stephen Worley <sworley@nvidia.com>
* | lib,sharpd: add ability for sharpd to install vni labelsStephen Worley2023-02-141-0/+5
|/ | | | | | | | | | 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>
* sharpd: traffic control PoCSiger Yang2022-11-223-35/+153
| | | | | | | 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>
* *: Add ability to encode / decode resilence down zapiDonald Sharp2022-11-042-0/+17
| | | | | | | | 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>
* *: Add ability for daemons to notice resilience changesDonald Sharp2022-11-041-1/+6
| | | | | | | | | 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>
* build, vtysh: extract vtysh commands from .xrefDavid Lamparter2022-10-262-3/+0
| | | | | | | | | | | | | | | | | | | 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>
* sharpd: add support for SRv6 End.DT46 behaviorCarmine Scarpitta2022-10-181-1/+7
| | | | | | This commit adds the support for SRv6 End.DT46 behavior to SHARPD. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>