StatisticMatch

Example:

>>> from linuxnet.iptables import StatisticMatch
>>> m = StatisticMatch()
>>> m.mode().equals('random').probability().equals(0.4)
<linuxnet.iptables.matches.statisticmatch.StatisticMatch object at 0x7fb98c040190>
>>> m.to_iptables_args()
['-m', 'statistic', '--mode', 'random', '--probability', '0.4']
class StatisticMatch[source]

Match packets based on some statistic condition

static get_match_name()[source]

Returns the iptables(8) match extension name

get_criteria() Iterable[Criterion][source]

Returns the set match criteria.

mode() GenericPositiveCriterion[source]

Returns the criterion that identifies the matching mode

probability() GenericCriterion[source]

Set the probability for random mode; the criterion value is a floating-point number.

every() GenericCriterion[source]

Identify the packet to match for the nth mode; the criterion value is an integer.

packet() GenericPositiveCriterion[source]

Set the initial counter value for the nth mode; the criterion value is an integer.