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.- 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