Implements class AlertCheckLuaEngine and refactors code

This commit is contained in:
Simone Mainardi 2019-07-18 17:01:05 +02:00
parent 0fd3be6b79
commit 54c1df4b4d
6 changed files with 158 additions and 80 deletions

View file

@ -0,0 +1,42 @@
/*
*
* (C) 2019 - ntop.org
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _ALERT_CHECK_LUA_ENGINE_H_
#define _ALERT_CHECK_LUA_ENGINE_H_
class AlertCheckLuaEngine {
private:
ScriptPeriodicity p;
char script_path[MAX_PATH];
LuaEngine le;
public:
AlertCheckLuaEngine(AlertEntity alert_entity, ScriptPeriodicity p, NetworkInterface *iface);
~AlertCheckLuaEngine() {};
void setEntity(AlertableEntity *al);
ScriptPeriodicity getPeriodicity() const;
const char * getGranularity() const;
lua_State * getState() const;
};
#endif