MarkMatch¶
- class MarkMatch[source]¶
Match against the fwmark
- mark() MarkCriterion[source]¶
Match against the packet’s fwmark.
MarkCriterion¶
- class MarkCriterion(match: Match)[source]¶
A criterion for a mark, used by
MarkMatchandConnmarkMatchsince the iptables(8) option used by the mark/connmark modules is the same.The comparison value is a tuple consisting of an (integer) mark value and an integer mask value (
Nonein case of no mask).- compare(is_equal: bool, *args, **kwargs) Match¶
Alternative method used for comparisons. It invokes
equals()(ornot_equals()) withargsandkwargsifis_equalisTrue(orFalse).
- equals(mark: int, mask: Optional[int] = None) Match[source]¶
Check for equality against
markand optionallymask- Parameters:
mark – the mark value
mask – the mask value
- get_value()[source]¶
Returns the value that the criterion is comparing against.
- Return type:
tuple of (int, int|None)
- 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
- not_equals(*args, **kwargs) Match¶
Express inequality comparison against the argument values.
The method implementation in this class invokes the
equals()method and then reverses the polarity; subclasses should not need to override it.Subclasses overriding this method should invoke the
_set_polarity()method of this class to set the polarity toFalse.Returns this object.
- to_iptables_args() List[str]¶
Returns a list of iptables(8) arguments