summaryrefslogtreecommitdiff
path: root/lib/northbound.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-06-04 19:26:42 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-06-04 20:24:52 -0400
commitf7c20aa1fd5b997a6c545f0f064b82ad8a5cd3ce (patch)
treec02e2394dbbff468c651e803ee144d6e818fc649 /lib/northbound.h
parentf981d44931ced06f594b33c54a27d6d843ad0379 (diff)
lib: move all userdata when changing node xpath
All userdata pointers need to be rekeyed to their new xpaths, not just the one associated with the dnode being moved. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/northbound.h')
-rw-r--r--lib/northbound.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/northbound.h b/lib/northbound.h
index 84382eeb60..2a1beeabaa 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -993,6 +993,23 @@ extern int nb_notification_send(const char *xpath, struct list *arguments);
extern void nb_running_set_entry(const struct lyd_node *dnode, void *entry);
/*
+ * Move an entire tree of user pointer nodes.
+ *
+ * Suppose we have xpath A/B/C/D, with user pointers associated to C and D. We
+ * need to move B to be under Z, so the new xpath is Z/B/C/D. Because user
+ * pointers are indexed with their absolute path, We need to move all user
+ * pointers at and below B to their new absolute paths; this function does
+ * that.
+ *
+ * xpath_from
+ * base xpath of tree to move (A/B)
+ *
+ * xpath_to
+ * base xpath of new location of tree (Z/B)
+ */
+extern void nb_running_move_tree(const char *xpath_from, const char *xpath_to);
+
+/*
* Unset the user pointer associated to a configuration node.
*
* This should be called by northbound 'destroy' callbacks in the NB_EV_APPLY