diff --git a/docs/changes.txt b/docs/changes.txt index aa1d288..4c19bc0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -232,3 +232,4 @@ winws2: fixed lost windivert deinit on logical network disappear 0.9.3 nfqws2: handling of incoming fragmented packets (no reconstruct, raw ip payload) +zapret-auto: per_instance_condition orchestrator diff --git a/docs/manual.en.md b/docs/manual.en.md index f922958..2c3427f 100644 --- a/docs/manual.en.md +++ b/docs/manual.en.md @@ -218,6 +218,7 @@ - [circular](#circular) - [repeater](#repeater) - [condition](#condition) + - [per_instance_condition](#per_instance_condition) - [stopif](#stopif) - [iff functions](#iff-functions) - [cond\_true](#cond_true) @@ -2330,6 +2331,7 @@ Returns an array of information about all subsequent, pending instances in the c | 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. | +| arg | table | instance arguments | **range** @@ -4386,6 +4388,16 @@ function condition(ctx, desync) `condition` calls `iff`. If `iff xor neg = true`, all instances in the `plan` are executed; otherwise, the plan is cleared. +### per_instance_condition + +``` +function per_instance_condition(ctx, desync) +``` + +All following instanced are called only if they have "cond" argument with the "iff" function name and it returns true. The "cond_neg" argument inverts "cond" result. +Names are not iff/neg to avoid conflict with other orchestrators. + + ### stopif ``` diff --git a/docs/manual.md b/docs/manual.md index c40389e..819be83 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -215,6 +215,7 @@ - [circular](#circular) - [repeater](#repeater) - [condition](#condition) + - [per_instance_condition](#per_instance_condition) - [stopif](#stopif) - [iff функции](#iff-функции) - [cond\_true](#cond_true) @@ -2484,6 +2485,7 @@ function execution_plan(ctx) | range | table | эффективный диапазон [счетчиков](#внутрипрофильные-фильтры) `--in-range` или `--out-range` в зависимости от текущего направления | | payload | table | эффективный фильтр payload . таблица с индексами - названиями типа пейлоада | | payload_filter | string | эффективный фильтр payload . список названий пейлоадов через запятую (иное представление payload) | +| arg | table | аргументы инстанса | **range** @@ -4566,6 +4568,15 @@ function condition(ctx, desync) condition вызывает iff. если iff xor neg = true, выполняются все инстансы plan, иначе план очищается. +### per_instance_condition + +``` +function per_instance_condition(ctx, desync) +``` + +Все последующие инстасы вызываются только, если у них есть аргумент "cond", содержащий iff функцию, и она возвращает true. Аргумент "cond_neg" инвертирует ее значение. +Имена аргументов не iff/neg, чтобы исключить конфликт с другими оркестраторами. + ### stopif ```