TcpmssMatch¶
Example:
>>> from linuxnet.iptables import TcpmssMatch
>>> m = TcpmssMatch()
>>> m.mss().equals(500,600)
<linuxnet.iptables.matches.tcpmssmatch.TcpmssMatch object at 0x7f4a19799240>
>>> m.to_iptables_args()
['-m', 'tcpmss', '--mss', '500:600']
- class TcpmssMatch[source]¶
Match against the MSS field of the TCP header
- mss() MssCriterion[source]¶
Match against the MSS field of the TCP header
MssCriterion¶
- class MssCriterion(match)[source]¶
Compare with MSS field of the TCP header.
The comparison value is a tuple (int, int|None) to compare against a specific MSS value or a range of values.
- get_value() Tuple[int, Optional[int]][source]¶
Returns the value that the criterion is comparing against.
- Return type:
tuple of (int, int|None)
- equals(mssval: int, endval: Optional[int] = None) Match[source]¶
Check for equality against
mssval, or range equality ifendvalis present.- Parameters:
mssval – the MSS value
endval – range of MSS values from
mssvalto this value
- any() Match¶
Match any value.
This method is used when creating a
Criterionin order to search an existing chain for rules that try to match against certain packet properties (e.g. input interface) without being particular about the specific property value (e.g.eth0).
- compare(is_equal: bool, *args, **kwargs) Match¶
Alternative method used for comparisons. It invokes
equals()(ornot_equals()) withargsandkwargsifis_equalisTrue(orFalse).
- 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