summaryrefslogtreecommitdiff
path: root/lib/mgmt_be_client.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-02-10 02:11:13 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-02-11 13:26:52 +0200
commit3ac3a6605d550d7ffb2535e1a90c7ebc04e940be (patch)
tree38497c7f296518fab21800211d2366013c2d9d11 /lib/mgmt_be_client.h
parentd94f80fbc4347cbbf5ee6ecbdf3682329db832dc (diff)
lib, mgmtd: rework processing of yang notifications
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>
Diffstat (limited to 'lib/mgmt_be_client.h')
-rw-r--r--lib/mgmt_be_client.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/mgmt_be_client.h b/lib/mgmt_be_client.h
index d144ebc728..361899fc1d 100644
--- a/lib/mgmt_be_client.h
+++ b/lib/mgmt_be_client.h
@@ -73,16 +73,8 @@ struct mgmt_be_client_cbs {
struct mgmt_be_client_txn_ctx *txn_ctx,
bool destroyed);
- struct mgmt_be_client_notification_cb *notify_cbs;
- uint nnotify_cbs;
-};
-
-struct mgmt_be_client_notification_cb {
- const char *xpath; /* the notification */
- uint8_t format; /* currently only LYD_JSON supported */
- void (*callback)(struct mgmt_be_client *client, uintptr_t usr_data,
- struct mgmt_be_client_notification_cb *this,
- const char *notif_data);
+ const char **notif_xpaths;
+ uint nnotif_xpaths;
};
/***************************************************************