SetTarget¶
- class SetTarget(operation: int, ipset_name: str, ipset_flags: List[str], *, timeout: Optional[int] = None, exist: Optional[bool] = False)[source]¶
This class provides access to the
SETtarget- Parameters:
operation – identifies what ipset operation to perform; possible values include
SetTarget.ADD_SETorSetTarget.DEL_SETipset_name – name of ipset
ipset_flags – list of flags identifying packet data; at least one flag must be present, otherwise an
IptablesErrorexception will be raisedtimeout – timeout value for added entries
exist – if
True, reset timeout when adding an entry that exists already
- ADD_SET = 1¶
Add operation
- DEL_SET = 2¶
Delete operation
- set_timeout(timeout: Optional[int]) Target[source]¶
Set the timeout value for entries added to the ipset.
- get_target_name() str¶
Returns the target name
- is_terminating() bool¶
Returns
Trueif this is a terminating target