LuaRegisterExtensions(t->luastate);
- lua_pushinteger(t->luastate, (lua_Integer)(lua->sid));
- lua_setglobal(t->luastate, "SCRuleSid");
- lua_pushinteger(t->luastate, (lua_Integer)(lua->rev));
- lua_setglobal(t->luastate, "SCRuleRev");
- lua_pushinteger(t->luastate, (lua_Integer)(lua->gid));
- lua_setglobal(t->luastate, "SCRuleGid");
-
/* hackish, needed to allow unittests to pass buffers as scripts instead of files */
#ifdef UNITTESTS
if (ut_script != NULL) {
return -1;
}
-/** \brief post-sig parse function to set the sid,rev,gid into the
- * ctx, as this isn't available yet during parsing.
- */
-void DetectLuaPostSetup(Signature *s)
-{
- int i;
- SigMatch *sm;
-
- for (i = 0; i < DETECT_SM_LIST_MAX; i++) {
- for (sm = s->init_data->smlists[i]; sm != NULL; sm = sm->next) {
- if (sm->type != DETECT_LUA)
- continue;
-
- DetectLuaData *ld = (DetectLuaData *)sm->ctx;
- ld->sid = s->id;
- ld->rev = s->rev;
- ld->gid = s->gid;
- }
- }
-}
-
/**
* \brief this function will free memory associated with DetectLuaData
*
uint32_t flowvar[DETECT_LUA_MAX_FLOWVARS];
uint16_t bytevars;
uint32_t bytevar[DETECT_LUA_MAX_BYTEVARS];
- uint32_t sid;
- uint32_t rev;
- uint32_t gid;
uint64_t alloc_limit;
uint64_t instruction_limit;
int allow_restricted_functions;
const uint8_t *buffer, uint32_t buffer_len, uint32_t offset,
Flow *f);
-void DetectLuaPostSetup(Signature *s);
void LuaDumpStack(lua_State *state, const char *prefix);
#endif /* SURICATA_DETECT_LUA_H */