new(usespace/falco): transmit output sources

Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato 2019-09-13 11:49:32 +00:00 committed by Leo Di Donato
parent 286d7b1cd5
commit bef491ae20

View File

@ -320,7 +320,15 @@ int falco_outputs::handle_grpc(lua_State *ls)
// rule
grpc_res.set_rule((char *)lua_tostring(ls, 2));
// source
source s = source::SYSCALL;
string sstr = (char *)lua_tostring(ls, 3);
if(!source_Parse(sstr, &s))
{
lua_pushstring(ls, "Unknown source passed to to handle_grpc()");
lua_error(ls);
}
grpc_res.set_source(s);
// priority
priority p = priority::EMERGENCY;