diff options
| author | Christian Hopps <chopps@labn.net> | 2025-01-08 10:34:57 -0500 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2025-01-13 23:40:52 -0500 |
| commit | 255026c2cef831e38539a0f044c39d45cc0d41bd (patch) | |
| tree | ba4d640a2651bf21b02404707c30a767da9ba763 /lib/northbound_notif.c | |
| parent | 709b2ae23f1b74e8c319ce88625d621e0d6f7beb (diff) | |
mgmtd: add notify selectors to filter datastore notifications
- Additionally push the selectors down to the backends
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound_notif.c')
| -rw-r--r-- | lib/northbound_notif.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/northbound_notif.c b/lib/northbound_notif.c index c64771ebed..b75c865613 100644 --- a/lib/northbound_notif.c +++ b/lib/northbound_notif.c @@ -64,6 +64,8 @@ struct event_loop *nb_notif_master; struct event *nb_notif_timer; void *nb_notif_walk; +const char **nb_notif_filters; + /* * We maintain a queue of change lists one entry per query and notification send * action @@ -635,6 +637,20 @@ static void nb_notif_set_walk_timer(void) &nb_notif_timer); } +void nb_notif_set_filters(const char **selectors, bool replace) +{ + const char **csp; + + if (replace) { + darr_free_free(nb_notif_filters); + nb_notif_filters = selectors; + return; + } + darr_foreach_p (selectors, csp) + *darr_append(nb_notif_filters) = *csp; + darr_free(selectors); +} + void nb_notif_init(struct event_loop *tm) { nb_notif_master = tm; @@ -659,4 +675,6 @@ void nb_notif_terminate(void) while ((group = op_changes_group_next())) op_changes_group_free(group); + + darr_free_free(nb_notif_filters); } |
