summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-02-06 14:02:11 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2019-02-22 23:12:41 +0100
commit96b1cc6c3f5ab49993ce9373e33f1f8fc04bdc61 (patch)
tree9e53209918bf58d44af9a056a3b13b6524d8d173 /filter
parent7c36eb3e8bd7d06f65dc7319d42b6abe782c5b89 (diff)
Lua filters: connected with no exported vars
Diffstat (limited to 'filter')
-rw-r--r--filter/filter.c9
-rw-r--r--filter/filter.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 37cf16a3..7f3979f3 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -1575,6 +1575,15 @@ interpret(struct f_inst *what)
CALL(bt_assert_hook, res.val.i, what);
break;
+ case P('L','C'): /* Lua include */
+ ONEARG;
+ if (v1.type != T_STRING)
+ runtime("Lua code should be a string argument");
+
+ res.type = T_RETURN;
+ res.val.i = filter_lua_chunk(v1.val.s, f_rte, f_old_rta, f_tmp_attrs, f_pool);
+ break;
+
default:
bug( "Unknown instruction %d (%c)", what->fi_code, what->fi_code & 0xff);
}}
diff --git a/filter/filter.h b/filter/filter.h
index a8c33287..a4eb2913 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -307,4 +307,7 @@ struct f_bt_test_suite {
/* Hook for call bt_assert() function in configuration */
extern void (*bt_assert_hook)(int result, struct f_inst *assert);
+/* Lua */
+int filter_lua_chunk(const char *chunk, struct rte **e, struct rta *a, struct ea_list **ea, struct linpool *lp);
+
#endif