mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-14 06:13:09 +00:00
nfqws2: alternative representation of payload filter in execution_plan item
This commit is contained in:
@@ -175,3 +175,4 @@ v0.8.1
|
||||
* winws2: fix loopback large packets processing (up to 64K)
|
||||
* zapret-lib, zapret-antidpi: use numeric indexes in http dissects
|
||||
* nfqws2: move ctx from lightuserdata to userdata. prevents crashes on specific ARM cpus
|
||||
* nfqws2: alternative representation of payload filter in execution_plan item
|
||||
|
||||
@@ -2055,6 +2055,7 @@ Returns an array of information about all subsequent, pending instances in the c
|
||||
| func_n | number | instance number within the profile |
|
||||
| func_instance | string | instance name (derived from the function name, instance number, and profile number) |
|
||||
| range | table | effective range of [counters](#in-profile-filters) `--in-range` or `--out-range` depending on the current direction |
|
||||
| payload | table | effective `--payload-filter` . payload name indexed table. |
|
||||
| payload_filter | string | effective `--payload-filter`. A comma-separated list of payload names. |
|
||||
|
||||
**range**
|
||||
|
||||
@@ -2212,7 +2212,8 @@ function execution_plan(ctx)
|
||||
| func_n | number | номер инстанса внутри профиля |
|
||||
| func_instance | string | название инстанса | производная имени функции, номера инстанса и номера профиля |
|
||||
| range | table | эффективный диапазон [счетчиков](#внутрипрофильные-фильтры) `--in-range` или `--out-range` в зависимости от текущего направления |
|
||||
| payload_filter | string | эффективный `--payload-filter` . список названий пейлоадов через запятую |
|
||||
| payload | table | эффективный `--payload-filter` . таблица с индексами - названиями типа пейлоада |
|
||||
| payload_filter | string | эффективный `--payload-filter` . список названий пейлоадов через запятую (иное представление payload) |
|
||||
|
||||
**range**
|
||||
|
||||
|
||||
39
nfq2/lua.c
39
nfq2/lua.c
@@ -932,24 +932,55 @@ static int luacall_execution_plan(lua_State *L)
|
||||
lua_newtable(L);
|
||||
|
||||
struct func_list *func;
|
||||
char instance[256], pls[2048];
|
||||
char instance[256], plsl[2048];
|
||||
struct packet_range *range;
|
||||
unsigned int n=1;
|
||||
t_l7payload pl;
|
||||
const char *pls;
|
||||
|
||||
LIST_FOREACH(func, &ctx->dp->lua_desync, next)
|
||||
{
|
||||
if (n > ctx->func_n)
|
||||
{
|
||||
desync_instance(func->func, ctx->dp->n, n, instance, sizeof(instance));
|
||||
range = ctx->incoming ? &func->range_in : &func->range_out;
|
||||
|
||||
lua_pushinteger(L, n - ctx->func_n);
|
||||
lua_createtable(L, 0, 6);
|
||||
lua_createtable(L, 0, 7);
|
||||
|
||||
lua_pushf_args(L,&func->args, -1, false);
|
||||
lua_pushf_str(L,"func", func->func);
|
||||
lua_pushf_int(L,"func_n", ctx->func_n);
|
||||
lua_pushf_str(L,"func_instance", instance);
|
||||
lua_pushf_range(L,"range", range);
|
||||
if (l7_payload_str_list(func->payload_type, pls, sizeof(pls)))
|
||||
lua_pushf_str(L,"payload_filter", pls);
|
||||
|
||||
lua_pushstring(L, "payload");
|
||||
lua_newtable(L);
|
||||
if (func->payload_type==L7P_ALL)
|
||||
{
|
||||
lua_pushliteral(L,"all");
|
||||
lua_pushboolean(L,true);
|
||||
lua_rawset(L,-3);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (pl=0 ; pl<L7P_LAST ; pl++)
|
||||
{
|
||||
if (func->payload_type & (1<<pl))
|
||||
{
|
||||
if ((pls = l7payload_str(pl)))
|
||||
{
|
||||
lua_pushstring(L,pls);
|
||||
lua_pushboolean(L,true);
|
||||
lua_rawset(L,-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lua_rawset(L,-3);
|
||||
|
||||
if (l7_payload_str_list(func->payload_type, plsl, sizeof(plsl)))
|
||||
lua_pushf_str(L,"payload_filter", plsl);
|
||||
else
|
||||
lua_pushf_nil(L,"payload_filter");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user