ConntrackMatch¶
Example:
>>> from linuxnet.iptables import ConntrackMatch
>>> m = ConntrackMatch()
>>> m.ctstate().equals('NEW')
<linuxnet.iptables.matches.conntrackmatch.ConntrackMatch object at 0x7ffab737e208>
>>> m.to_iptables_args()
['-m', 'conntrack', '--ctstate', 'NEW']
- class ConntrackMatch[source]¶
Match against the connection tracking attributes.
- ctstate() CtStateCriterion[source]¶
Match against the connection tracking state
- ctstatus() CtStatusCriterion[source]¶
Matching against the connection tracking status
CtStateCriterion¶
- class CtStateCriterion(match)[source]¶
Compare against the connection tracking state
The comparison value is a string.
- compare(is_equal: bool, *args, **kwargs) Match¶
Alternative method used for comparisons. It invokes
equals()(ornot_equals()) withargsandkwargsifis_equalisTrue(orFalse).
- get_value() Any¶
Returns the criterion value
- is_positive() bool¶
Returns the ‘polarity’ of the criterion;
Trueforequals()orFalsefornot_equals()Raises
IptablesErrorif the criterion is not set
- is_set() bool¶
Returns
Trueif the criterion has been set
CtStatusCriterion¶
- class CtStatusCriterion(match)[source]¶
Compare against the connection tracking status
The comparison value is a string.
- compare(is_equal: bool, *args, **kwargs) Match¶
Alternative method used for comparisons. It invokes
equals()(ornot_equals()) withargsandkwargsifis_equalisTrue(orFalse).
- get_value() Any¶
Returns the criterion value
- is_positive() bool¶
Returns the ‘polarity’ of the criterion;
Trueforequals()orFalsefornot_equals()Raises
IptablesErrorif the criterion is not set
- is_set() bool¶
Returns
Trueif the criterion has been set