summaryrefslogtreecommitdiff
path: root/lib/mgmt_be_client.c
AgeCommit message (Collapse)Author
2025-01-18lib: mgmt_be_client handles datastore notification using CBsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
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-07Merge pull request #17772 from LabNConsulting/chopps/fix-oper-walkDonald Sharp
improve error handling of operational state walk callback
2025-01-07lib: add impl of NOTIF message ops (notif, replace, delete, patch)Christian Hopps
- needed for supporting backend datastore notifications Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-06lib: change and improve walk finish callback function APIChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
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-04-22lib: add native RPC processing to mgmt backend clientIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-22mgmtd: fix a couple of log messagesIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-18lib: mgmtd: add xpath arg to notification messageChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-15lib: always call new notification hooks tooChristian Hopps
- call the new notification hooks when backends call the old notification posting API. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-11lib, mgmtd: rework processing of yang notificationsIgor Ryzhov
Currently, YANG notification processing is done using a special type of callbacks registered in backend clients. In this commit, we start using regular northbound infrastructure instead, because it already has a convenient way of registering xpath-specific callbacks without the need for creating additional structures for each necessary notification. We also now pass a notification data to the callback, instead of a plain JSON. This allows to use regular YANG library functions for inspecting notification fields, instead of manually parsing the JSON. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-10lib, mgmtd: fix processing of yang notificationsIgor Ryzhov
Current code assumes that notification is always sent in stripped JSON format and therefore notification xpath starts at the third symbol of notification data. Assuming JSON is more or less fine, because this representation is internal to FRR, but the assumption about the xpath is wrong, because it won't work for not top-level notifications. YANG allows to define notification as a child for some data node deep into the tree and in this case notification data contains not only the notification node itself, but also all its parents. To fix the issue, parse the notification data and get its xpath from its schema node. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-31mgmtd: convert MGMTD_BE_CLIENT_DBG() to debug_be_client()Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-30mgmtd: backend subscriptions to notificationsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-30lib: mgmtd: add YANG notification supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-28lib: use shared candidate between vty and mgmtd clientIgor Ryzhov
When the daemon is partially mgmtd-converted, it receives configuration from vty and mgmtmd simultaneosly. This configuration must be synchronized. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-27lib, mgmtd: fix wrong mgmtd socket pathsDavid Lamparter
These paths were ignoring the `-N` namespacing option. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-19lib: better conditionalize leaf-list predicate xpath additionChristian Hopps
If we're in the backend we already have the predicate added by mgmtd -- don't add it again. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11mgmt, lib: implement REPLACE operationIgor Ryzhov
Replace operation removes the current data node configuration and sets the provided value. As current northbound code works only with one xpath at a time, the operation only makes sense to clear the config of a container without deleting it itself. However, the next step is to allow passing JSON-encoded complex values to northbound operations which will make replace operation much more useful. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmt, lib: differentiate DELETE and REMOVE operationsIgor Ryzhov
Currently, there's a single operation type which doesn't return error if the object doesn't exists. To be compatible with NETCONF/RESTCONF, we should support differentiate between DELETE (fails when object doesn't exist) and REMOVE (doesn't fail if the object doesn't exist). Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmtd, lib: implement CREATE_EXCL operationIgor Ryzhov
Currently, there's no difference between CREATE and MODIFY operations. To be compatible with NETCONF/RESTCONF, add new CREATE_EXCL operation that throws an error if the configuration data already exists. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-12-30lib: mgmtd: increase soft-max msg size to 64KChristian Hopps
- remove unused mgmt client/server constants Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: add dedicated API functions for native msgsChristian Hopps
- reorg native message header Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: northbound: add yielding and batching to oper-state queriesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: create and use libyang tree during oper-state walkChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28mgmtd: step 6: remove old unfinished get-data codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: step 2: mgmtd: BE client code for get-tree functionalityChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-11lib: fix the ASAN OneDefinitionRule violation.Christian Hopps
Rename global client pointer variables and make the linkage static. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-05lib: mgmtd: enable conn debugs when user enables client debugChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-22Merge pull request #14815 from idryzhov/lib-mgmt-depsChristian Hopps
Remove lib dependency on mgmtd
2023-11-18Merge pull request #14657 from idryzhov/mgmtd-remove-batch-idsChristian Hopps
mgmtd, lib: remove batch ids from all messages
2023-11-17lib, mgmtd: remove function duplicationIgor Ryzhov
And also remove lib dependency on mgmtd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-13Merge pull request #14768 from idryzhov/mgmtd-base-xpathDonald Sharp
lib, mgmtd: respect base xpath in mgmtd
2023-11-12lib, mgmtd: respect base xpath in mgmtdIgor Ryzhov
`nb_cli_apply_changes` can be called with base xpath which should be prepended to xpaths of every change in a transaction. This base xpath is respected by regular northbound CLI but not by mgmtd. This commit fixes the problem. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-12mgmtd, lib: remove batch ids from all messagesIgor Ryzhov
Batch IDs are only used to verify that all messages were received and processed by a backend. It's not necessary to do that as we use reliable stream transport - messages can't be dropped or received out of order. This commit also fixes possible race condition that can happen if one backend process messages slower than other backends. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-11lib: mgmtd: fix debug cli commands and memleaksChristian Hopps
- Cannot have 2 cmd_node's with same .node number. Install the mgmtd client library debug nodes (client frontend and client backend) using new unique node numbers. Fixes memleaks. - Fix "debug mgmt client backend" to generate correct config (and not for frontend). Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-06mgmtd: simplify xpath registriesChristian Hopps
- move from client id indexed array of uints for register info per client to a u64 bitmask. - add bit walking FOREACH macro Walk the client IDs whose bits are set in a mask. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-17mgmtd, lib: remove batch ids from cfg apply replyIgor Ryzhov
The config is always applied fully, all batches are included. There's no need to pass a list of applied batches as it always contains all of them. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-06-27mgmtd: remove unused "placeholder" code.Christian Hopps
We don't need un-run/un-tested placeholder code we may never need. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-13Merge pull request #13768 from LabNConsulting/chopps/mgmt-better-logsIgor Ryzhov
mgmtd: improvements in logging and commentary
2023-06-13Merge pull request #13764 from LabNConsulting/chopps/robust1Igor Ryzhov
lib: mgmtd: make error handling more robust
2023-06-13lib: mgmtd: improvements in logging and commentaryChristian Hopps
- log names of datastores not numbers - improve logging for mgmt_msg_read - Rather than use a bool, instead store the pending const string name of the command being run that has postponed the CLI. This adds some nice information to the logging when enabled. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-12lib: mgmtd: make error handling more robustChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-12lib: mgmtd: fix/stdize debug message macrosChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-04lib: mgmtd: remove abstraction layer and other cleanupChristian Hopps
Code is no longer using a global FE "client context", and instead creates client objects, rename the structure and it's uses to reflect this. Remove an obfuscating abstraction layer whose existence was entirely based on using a uintptr_t rather than a pointer to an declared-only struct. Change multi-duty "params" structure into a single duty callbacks one. Remove unsupported API code. Signed-off-by: Christian Hopps <chopps@labn.net>