summaryrefslogtreecommitdiff
path: root/mgmtd
AgeCommit message (Collapse)Author
2025-01-18mgmtd: testc: add listen for datastore notificationsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-18lib: mgmtd: only send notify selectors to backends that provide.Christian Hopps
- Previously we sent selectors to all backends when a replace was done, improve this to only send them to backends that provide the selected state. Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-15lib: introduce global -w option for VRF netns backendIgor Ryzhov
Current -n option is only for zebra and mgmtd. All other daemons receive the VRF backend configuration from zebra upon connection to it. This leads to a potential race condition - daemons need to know the backend before they start reading their config, but they can be not connected to zebra yet at this point. As the VRF backend cannot change during runtime, let's introduce a new global -w option for setting netns backend, to make sure that all daemons know their VRF backend immediately after start. The reason for introducing a new option instead of making -n global is that ospfd already uses -n for another purposes. Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2025-01-14lib: northbound/mgmtd: add backend model supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13lib: fix new (incorrect) CLANG SA warningsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13mgmtd: add notify selectors to filter datastore notificationsChristian Hopps
- Additionally push the selectors down to the backends Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-06mgmtd: improve debug statementChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-12-24Merge pull request #17647 from LabNConsulting/fix-oper-testJafar Al-Gharaibeh
tests: enable test failure detection and fix resulting failures
2024-12-24mgmtd: fix memory leak in FE adapterChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-12-21mgmtd: fix compile erroranlan_cs
Compile error with `--disable-ripd`: ``` mgmtd/mgmt_be_adapter.c:86:5: error: "HAVE_RIPD" is not defined, evaluates to 0 [-Werror=undef] 86 | #if HAVE_RIPD | ^~~~~~~~~ ``` I have searched the code, there is only three places need to be fixed. Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-10-07lib: add flag to have libyang load internal ietf-yang-library moduleChristian Hopps
Mgmtd makes use of libyang's internal ietf-yang-library module to add support for said module to FRR management. Previously, mgmtd was loading this module explicitly; however, that required that libyang's `ietf-yang-library.yang` module definition file be co-located with FRR's yang files so that it (and ietf-datastore.yang) would be found when searched for by libyang using FRRs search path. This isn't always the case depending on how the user compiles and installs libyang so mgmtd was failing to run in some cases. Instead of doing it the above way we simply tell libyang to load it's internal version of ietf-yang-library when we initialize the libyang context. This required adding a boolean to a couple of the init functions which is why so many files are touched (although all the changes are minimal). Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-17mgmtd: add ietf-yang-library supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-17lib: mgmtd: add `changed` and `created` to edit-reply msgChristian Hopps
- This is used for various return values in RESTCONF Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-17lib: mgmtd: cleanup error value for native messagingChristian Hopps
- Now if positive it's libyang LY_ERR, otherwise it's `-errno` value. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-17mgmtd: allow dest DS "running" if implicit lock+commitChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-09-17lib: constify yang_resolve_snode_xpath resultsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net> ang
2024-08-29Merge pull request #16664 from mjstapp/igor_debug_simplifyJafar Al-Gharaibeh
*: simplify frrlib debug
2024-08-28mgmtd: Ensure map is NULLDonald Sharp
Build is complaining: build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c: In function ‘mgmt_register_client_xpath’: build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:274:27: warning: ‘maps’ may be used uninitialized [-Wmaybe-uninitialized] build 27-Aug-2024 05:46:38 274 | map = darr_append(*maps); build 27-Aug-2024 05:46:38 | ^ build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:250:36: note: ‘maps’ was declared here build 27-Aug-2024 05:46:38 250 | struct mgmt_be_xpath_map **maps, *map; build 27-Aug-2024 05:46:38 | ^~~~ Let's make the compiler happy, even though there is no problem. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-27lib: common debug status outputIgor Ryzhov
Implement common code for debug status output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27lib: common debug config outputIgor Ryzhov
Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27lib: rework debug initIgor Ryzhov
The debug library allows to register a `debug_set_all` callback which should enable all debugs in a daemon. This callback is implemented exactly the same in each daemon. Instead of duplicating the code, rework the lib to allow registration of each debug type, and implement the common code only once in the lib. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-18mgmtd: fix a couple compilation warnings.Christian Hopps
Also an empty (thus non-replace) notify selectors message shouldn't clear the selectors, it should just do nothing. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-08-15*: Fix spelling errors foundDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-10mgmtd: Add to .gitignore for mgmtd_testc programDonald Sharp
This program, mgmtd_testc, is built with the --enable-mgmtd-test-be-client configure option but it is not .gitignore'd. Let's fix that Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-08mgmtd: don't add implicit state data when reading config from fileIgor Ryzhov
When mgmt reads configuration from file, it shouldn't add implicit state data to the candidate datastore. Configuration datastores like candidate should never store state, otherwise they fail validation. Fixes #15814 Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
2024-07-22lib: move non-error from __log_err to __dbgChristian Hopps
Additionally, print `errmsg_if_any` in successful debug messages if non-NULL. fixes #16386 #16043 Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-13Merge pull request #16184 from LabNConsulting/chopps/fe-notify-selectJafar Al-Gharaibeh
mgmtd: add notification selection to front-end API
2024-06-11mgmtd: add native session-req (create/delete) messagesChristian Hopps
This addition allows for a limited native-message-only front-end interaction. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-07mgmtd: add empty notif xpath map for completenessChristian Hopps
New back-end clients may need to add notification static allocations so we should have it available for those users, rather than requiring the new user delve into the mgmtd infra and modify it themselves. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-06-06mgmtd: add front-end notification selector supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-09mgmtd: add missing diagnostic show cmd output (notify maps)Christian Hopps
- also add missing rpc client accounting bug in same diagnostic command. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-07mgmtd: some cleanup from original RPC commitChristian Hopps
- Fix memleak on multiple errstr returns (multiple clients) Allow the - multiple clients to all return results and merge them (as with other operations like get tree). Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-07mgmtd: rpc and action handling both should use rpc map.Christian Hopps
The previous idea of using config xpath registrations for actions b/c the config is the subject of the action is sub-optimal. It splits handling of YANG "actions" (Action and RPCs) between 2 different registartion maps for the same category of functionality. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-06Merge pull request #15594 from idryzhov/mgmt-rpcChristian Hopps
mgmtd: implement YANG RPC/action support
2024-05-02*: add XREF_SETUP() to libraries and utilitesDavid Lamparter
This is theoretically not needed if neither DEFUNs nor zlog_* calls are used, except I'm about to turn it into a build error to catch the cases where it _is_ necessary. Which is libmgmt_be_nb.la in this case, where it causes build failures on hppa. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25yang: ietf-netconf-acm needs to be in libfrrDavid Lamparter
ietf-key-chain depends on ietf-netconf-acm, and lib/ code sets up the former, so ietf-netconf-acm needs to be embedded in the libfrr too. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-22tests: add topotest for mgmtd rpc processingIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22ripngd: convert RPC commands to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22ripd: convert RPC commands to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22lib: add native RPC processing to mgmt frontend clientIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22mgmtd: add native RPC processingIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22mgmtd: add backend xpath map for RPCIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-26mgmtd: add support for native 'edit' operationIgor Ryzhov
This operation basically implements support for RESTCONF operations. It receives an xpath and a data tree in JSON/XML format, instead of a list of (xpath, value) tuples as required by the current protobuf interface. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-22mgmtd: remove unused event typeIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-13eigrpd, mgmtd, ospf6d: frr_fini is lastDonald Sharp
I noticed that ospf6d always had a linked list memory leak. Tracking it down shows that frr_fini() shuts down the memory system and prints out memory not cleaned up. eigrpd, mgmtd and ospf6d all called cleanup functions after frr_fini leaving memory leaked that was not really leaked. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-08Merge pull request #15469 from LabNConsulting/chopps/keychain-yangDonald Sharp
add ietf-key-chain YANG module support
2024-03-06mgmtd: change error messageIgor Ryzhov
Make the wording clearer about what's going on. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-04lib: add keychain northbound supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-01mgmtd: fix warning if ripngd disabledVincent JARDIN
./configure [...] --disable-ripngd could lead to: mgmtd/mgmt_vty.c:614:5: warning: "HAVE_RIPNGD" is not defined, evaluates to 0 [-Wundef] 614 | #if HAVE_RIPNGD | ^~~~~~~~~~~ Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-02-18lib: mgmtd: add xpath arg to notification messageChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>