summaryrefslogtreecommitdiff
path: root/lib/yang.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-04 19:08:10 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-18 16:15:41 -0200
commitfcb7bffdda0b122c34978e3f7390b6f26689848a (patch)
tree882984513c5a7f469f9a3e1fd8c4af398279dd41 /lib/yang.h
parent02fe07c7b8f2191d1f53b31888e95d6c12c48ad9 (diff)
lib: introduce new YANG helper function
One use case for the new yang_data_list_find() function is to find input parameters in RPC northbound callbacks easily, without the need to iterate over the input parameters manually. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.h')
-rw-r--r--lib/yang.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/yang.h b/lib/yang.h
index 3259189e98..09d92cafdd 100644
--- a/lib/yang.h
+++ b/lib/yang.h
@@ -510,6 +510,21 @@ extern void yang_data_free(struct yang_data *data);
extern struct list *yang_data_list_new(void);
/*
+ * Find the yang_data structure corresponding to an XPath in a list.
+ *
+ * list
+ * list of yang_data structures to operate on.
+ *
+ * xpath_fmt
+ * XPath to search for (format string).
+ *
+ * Returns:
+ * Pointer to yang_data if found, NULL otherwise.
+ */
+extern struct yang_data *yang_data_list_find(const struct list *list,
+ const char *xpath_fmt, ...);
+
+/*
* Initialize the YANG subsystem. Should be called only once during the
* daemon initialization process.
*/