Skip to content

Commit

Permalink
Fixes compilation error in LuaEngineInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoBiscosi committed Nov 28, 2024
1 parent d11b0a9 commit 5a8c3a6
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/LuaEngineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2020,12 +2020,13 @@ static int ntop_get_interface_obs_points_info(lua_State *vm) {
/* ****************************************** */

static int ntop_interface_insert_ip_acl(lua_State *vm) {
bool res = false;
#ifdef NTOPNG_PRO
NetworkInterface *curr_iface = getCurrentInterface(vm);
u_int8_t protocol = 0;
u_int16_t port = 0, l7_proto = 0;
bool is_allowed = true, res = false;
bool is_allowed = true;
char *src, *dst;
#ifdef NTOPNG_PRO
if (ntop_lua_check(vm, __FUNCTION__, 1, LUA_TNUMBER) != CONST_LUA_OK)
return (ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_ERROR));
protocol = (u_int8_t) lua_tointeger(vm, 1);
Expand Down Expand Up @@ -2059,13 +2060,13 @@ static int ntop_interface_insert_ip_acl(lua_State *vm) {
/* ****************************************** */

static int ntop_interface_remove_ip_acl(lua_State *vm) {
bool res = false;

#ifdef NTOPNG_PRO
NetworkInterface *curr_iface = getCurrentInterface(vm);
u_int8_t protocol = 0;
u_int16_t port = 0, l7_proto = 0;
bool res = false;
char *src, *dst;

#ifdef NTOPNG_PRO
if (ntop_lua_check(vm, __FUNCTION__, 1, LUA_TNUMBER) != CONST_LUA_OK)
return (ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_ERROR));
protocol = (u_int8_t) lua_tointeger(vm, 1);
Expand Down Expand Up @@ -2095,12 +2096,12 @@ static int ntop_interface_remove_ip_acl(lua_State *vm) {
/* ****************************************** */

static int ntop_interface_insert_mac_acl(lua_State *vm) {
bool res;
#ifdef NTOPNG_PRO
NetworkInterface *curr_iface = getCurrentInterface(vm);
char *mac_string;
u_int32_t _mac[6];
bool is_allowed = true, res = false;

#ifdef NTOPNG_PRO
bool is_allowed = true;
if (ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING) != CONST_LUA_OK)
return (ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_ERROR));
mac_string = (char *) lua_tostring(vm, 1);
Expand All @@ -2123,12 +2124,11 @@ static int ntop_interface_insert_mac_acl(lua_State *vm) {
/* ****************************************** */

static int ntop_interface_remove_mac_acl(lua_State *vm) {
bool res = false;
#ifdef NTOPNG_PRO
NetworkInterface *curr_iface = getCurrentInterface(vm);
char *mac_string;
bool res = false;
u_int32_t _mac[6];

#ifdef NTOPNG_PRO
if (ntop_lua_check(vm, __FUNCTION__, 1, LUA_TSTRING) != CONST_LUA_OK)
return (ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_ERROR));
mac_string = (char *) lua_tostring(vm, 1);
Expand All @@ -2148,12 +2148,13 @@ static int ntop_interface_remove_mac_acl(lua_State *vm) {
/* ****************************************** */

static int ntop_interface_get_acl_info(lua_State *vm) {
lua_newtable(vm);
#ifdef NTOPNG_PRO
NetworkInterface *curr_iface = getCurrentInterface(vm);
if (curr_iface) {
lua_newtable(vm);
curr_iface->getACLInfo(vm);
}

#endif
return (ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_OK));
}

Expand Down

0 comments on commit 5a8c3a6

Please sign in to comment.