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
- mode() GenericPositiveCriterion[source]¶
Returns the criterion that identifies the matching mode
- probability() GenericCriterion[source]¶
Set the probability for
randommode; the criterion value is a floating-point number.
- every() GenericCriterion[source]¶
Identify the packet to match for the
nthmode; the criterion value is an integer.
- packet() GenericPositiveCriterion[source]¶
Set the initial counter value for the
nthmode; the criterion value is an integer.