diff options
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter.c | 9 | ||||
-rw-r--r-- | filter/filter.h | 3 |
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 |