CommentMatch¶
Example:
>>> from linuxnet.iptables import CommentMatch
>>> m = CommentMatch()
>>> m.comment().equals("some random text")
<linuxnet.iptables.matches.commentmatch.CommentMatch object at 0x7f6adbe86208>
>>> m.to_iptables_args()
['-m', 'comment', '--comment', 'some random text']
- class CommentMatch[source]¶
Provide a way to add a comment to a rule
- comment() CommentCriterion[source]¶
The rule comment
CommentCriterion¶
- class CommentCriterion(match: Match)[source]¶
Not really a criterion.
The value is the comment string and is set using the
equals()method.- 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).
- get_iptables_option() str¶
Returns the iptables(8) option
- 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