summaryrefslogtreecommitdiff
path: root/lib/frrscript.h
diff options
context:
space:
mode:
authorDonald Lee <dlqs@gmx.com>2021-07-04 23:05:37 +0800
committerDonald Lee <dlqs@gmx.com>2021-07-18 06:32:03 +0800
commitf0cddf950f928b6f9a8d56c688235cea728fda41 (patch)
treed5df71aa5906405f8abead40901e1afc64043184 /lib/frrscript.h
parent105ba9af8f0bd9a116f2571625b2ea39c49c20c1 (diff)
lib: create new frrscript_new
frrscript_new now creates a new frrscript frrscript_load now loads a function (by allocating a new lua stack) Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.h')
-rw-r--r--lib/frrscript.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h
index 97e543eb00..df72bba4cd 100644
--- a/lib/frrscript.h
+++ b/lib/frrscript.h
@@ -79,8 +79,13 @@ struct frrscript_env {
/*
* Create new FRR script.
*/
-struct frrscript *frrscript_load(const char *name,
- int (*load_cb)(struct frrscript *));
+struct frrscript *frrscript_new(const char *name);
+
+/*
+ * Load a function into frrscript, run callback if any
+ */
+int frrscript_load(struct frrscript *fs, const char *function_name,
+ int (*load_cb)(struct frrscript *));
/*
* Destroy FRR script.