summaryrefslogtreecommitdiffstats
path: root/mgmtd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mgmtd: testc: add listen for datastore notificationsChristian Hopps11 days2-11/+100
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: mgmtd: only send notify selectors to backends that provide.Christian Hopps11 days1-18/+28
| | | | | | | | - 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>
* lib: introduce global -w option for VRF netns backendIgor Ryzhov14 days1-4/+5
| | | | | | | | | | | | | | | | 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>
* lib: northbound/mgmtd: add backend model supportChristian Hopps2025-01-142-0/+18
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: fix new (incorrect) CLANG SA warningsChristian Hopps2025-01-141-0/+1
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: add notify selectors to filter datastore notificationsChristian Hopps2025-01-145-48/+286
| | | | | | - Additionally push the selectors down to the backends Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: improve debug statementChristian Hopps2025-01-061-2/+2
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #17647 from LabNConsulting/fix-oper-testJafar Al-Gharaibeh2024-12-241-1/+1
|\ | | | | tests: enable test failure detection and fix resulting failures
| * mgmtd: fix memory leak in FE adapterChristian Hopps2024-12-241-1/+1
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | mgmtd: fix compile erroranlan_cs2024-12-211-3/+3
|/ | | | | | | | | | | | 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>
* lib: add flag to have libyang load internal ietf-yang-library moduleChristian Hopps2024-10-072-4/+1
| | | | | | | | | | | | | | | | | | | | 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>
* mgmtd: add ietf-yang-library supportChristian Hopps2024-09-182-0/+28
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: mgmtd: add `changed` and `created` to edit-reply msgChristian Hopps2024-09-173-14/+28
| | | | | | - This is used for various return values in RESTCONF Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: mgmtd: cleanup error value for native messagingChristian Hopps2024-09-173-6/+36
| | | | | | - Now if positive it's libyang LY_ERR, otherwise it's `-errno` value. Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: allow dest DS "running" if implicit lock+commitChristian Hopps2024-09-171-4/+6
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: constify yang_resolve_snode_xpath resultsChristian Hopps2024-09-171-3/+1
| | | | | | Signed-off-by: Christian Hopps <chopps@labn.net> ang
* Merge pull request #16664 from mjstapp/igor_debug_simplifyJafar Al-Gharaibeh2024-08-292-46/+12
|\ | | | | *: simplify frrlib debug
| * lib: common debug status outputIgor Ryzhov2024-08-271-28/+0
| | | | | | | | | | | | | | Implement common code for debug status output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * lib: common debug config outputIgor Ryzhov2024-08-272-18/+8
| | | | | | | | | | | | | | Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * lib: rework debug initIgor Ryzhov2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | 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>
* | mgmtd: Ensure map is NULLDonald Sharp2024-08-281-0/+2
|/ | | | | | | | | | | | | | | 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>
* mgmtd: fix a couple compilation warnings.Christian Hopps2024-08-181-2/+1
| | | | | | | 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>
* *: Fix spelling errors foundDonald Sharp2024-08-153-4/+4
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* mgmtd: Add to .gitignore for mgmtd_testc programDonald Sharp2024-08-111-0/+1
| | | | | | | | 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>
* mgmtd: don't add implicit state data when reading config from fileIgor Ryzhov2024-08-071-1/+2
| | | | | | | | | | 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>
* lib: move non-error from __log_err to __dbgChristian Hopps2024-07-221-3/+3
| | | | | | | | | Additionally, print `errmsg_if_any` in successful debug messages if non-NULL. fixes #16386 #16043 Signed-off-by: Christian Hopps <chopps@labn.net>
* Merge pull request #16184 from LabNConsulting/chopps/fe-notify-selectJafar Al-Gharaibeh2024-06-131-7/+214
|\ | | | | mgmtd: add notification selection to front-end API
| * mgmtd: add native session-req (create/delete) messagesChristian Hopps2024-06-111-0/+124
| | | | | | | | | | | | | | This addition allows for a limited native-message-only front-end interaction. Signed-off-by: Christian Hopps <chopps@labn.net>
| * mgmtd: add front-end notification selector supportChristian Hopps2024-06-071-7/+90
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | mgmtd: add empty notif xpath map for completenessChristian Hopps2024-06-071-0/+11
|/ | | | | | | | 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>
* mgmtd: add missing diagnostic show cmd output (notify maps)Christian Hopps2024-05-091-4/+13
| | | | | | - also add missing rpc client accounting bug in same diagnostic command. Signed-off-by: Christian Hopps <chopps@labn.net>
* mgmtd: some cleanup from original RPC commitChristian Hopps2024-05-071-13/+28
| | | | | | | | - 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>
* mgmtd: rpc and action handling both should use rpc map.Christian Hopps2024-05-071-9/+3
| | | | | | | | | 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>
* Merge pull request #15594 from idryzhov/mgmt-rpcChristian Hopps2024-05-0610-35/+609
|\ | | | | mgmtd: implement YANG RPC/action support
| * tests: add topotest for mgmtd rpc processingIgor Ryzhov2024-04-221-0/+34
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * ripngd: convert RPC commands to mgmtdIgor Ryzhov2024-04-221-0/+7
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * ripd: convert RPC commands to mgmtdIgor Ryzhov2024-04-221-1/+9
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * lib: add native RPC processing to mgmt frontend clientIgor Ryzhov2024-04-221-0/+16
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * mgmtd: add native RPC processingIgor Ryzhov2024-04-227-2/+442
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| * mgmtd: add backend xpath map for RPCIgor Ryzhov2024-04-224-33/+102
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | *: add XREF_SETUP() to libraries and utilitesDavid Lamparter2024-05-022-0/+7
| | | | | | | | | | | | | | | | | | 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>
* | yang: ietf-netconf-acm needs to be in libfrrDavid Lamparter2024-04-251-1/+0
|/ | | | | | | 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>
* mgmtd: add support for native 'edit' operationIgor Ryzhov2024-03-265-16/+384
| | | | | | | | 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>
* mgmtd: remove unused event typeIgor Ryzhov2024-03-221-10/+0
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* eigrpd, mgmtd, ospf6d: frr_fini is lastDonald Sharp2024-03-131-1/+3
| | | | | | | | | | 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>
* Merge pull request #15469 from LabNConsulting/chopps/keychain-yangDonald Sharp2024-03-083-10/+17
|\ | | | | add ietf-key-chain YANG module support
| * lib: add keychain northbound supportChristian Hopps2024-03-053-10/+17
| | | | | | | | Signed-off-by: Christian Hopps <chopps@labn.net>
* | mgmtd: change error messageIgor Ryzhov2024-03-061-7/+3
| | | | | | | | | | | | Make the wording clearer about what's going on. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | mgmtd: fix warning if ripngd disabledVincent JARDIN2024-03-011-3/+3
|/ | | | | | | | | | | | ./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>
* lib: mgmtd: add xpath arg to notification messageChristian Hopps2024-02-191-11/+15
| | | | Signed-off-by: Christian Hopps <chopps@labn.net>