summaryrefslogtreecommitdiff
path: root/lib/yang.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-04-03 19:43:02 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-04-03 22:34:55 -0300
commitb90204a8e99808378621e50f8e586e6eabb30b76 (patch)
tree1c9b73b4eabb8de2257c409dda4640738faf89c9 /lib/yang.h
parent5f37f5304f337a7fe5e0e80afaa85a108b8bc809 (diff)
lib, tools: silence harmless warnings in the northbound tools
Our two northbound tools don't have embedded YANG modules like the other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be called when the YANG subsystem it being initialized by a northbound tool. To make that possible, add a new "embedded_modules" parameter to the yang_init() function to control whether libyang should look for embedded modules or not. With this fix, "gen_northbound_callbacks" and "gen_yang_deviations" won't emit "YANG model X not embedded, trying external file" warnings anymore. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.h')
-rw-r--r--lib/yang.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/yang.h b/lib/yang.h
index 6892e36019..8af440d3ed 100644
--- a/lib/yang.h
+++ b/lib/yang.h
@@ -482,8 +482,11 @@ extern struct yang_data *yang_data_list_find(const struct list *list,
/*
* Create and set up a libyang context (for use by the translator)
+ *
+ * embedded_modules
+ * Specify whether libyang should attempt to look for embedded YANG modules.
*/
-extern struct ly_ctx *yang_ctx_new_setup(void);
+extern struct ly_ctx *yang_ctx_new_setup(bool embedded_modules);
/*
* Enable or disable libyang verbose debugging.
@@ -496,8 +499,11 @@ extern void yang_debugging_set(bool enable);
/*
* Initialize the YANG subsystem. Should be called only once during the
* daemon initialization process.
+ *
+ * embedded_modules
+ * Specify whether libyang should attempt to look for embedded YANG modules.
*/
-extern void yang_init(void);
+extern void yang_init(bool embedded_modules);
/*
* Finish the YANG subsystem gracefully. Should be called only when the daemon