]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/yang.h
yang: embed models into binaries
[mirror_frr.git] / lib / yang.h
index cd5597ff8c1f5cb0e90733b2ac48798a200a3b7c..b0348e320b3b6ab5b7073e2357c8f53acfe4b150 100644 (file)
@@ -44,6 +44,13 @@ DECLARE_MTYPE(YANG_DATA)
 /* Maximum string length of an YANG value. */
 #define YANG_VALUE_MAXLEN 1024
 
+struct yang_module_embed {
+       struct yang_module_embed *next;
+       const char *mod_name, *mod_rev;
+       const char *data;
+       LYS_INFORMAT format;
+};
+
 struct yang_module {
        RB_ENTRY(yang_module) entry;
        const char *name;
@@ -132,6 +139,16 @@ extern struct yang_module *yang_module_load(const char *module_name);
  */
 extern struct yang_module *yang_module_find(const char *module_name);
 
+/*
+ * Register a YANG module embedded in the binary file.  Should be called
+ * from a constructor function.
+ *
+ * embed
+ *    YANG module embedding structure to register.  (static global provided
+ *    by caller.)
+ */
+extern void yang_module_embed(struct yang_module_embed *embed);
+
 /*
  * Iterate over all libyang schema nodes from the given YANG module.
  *