ChainTarget¶
- class ChainTarget(*, chain=None, real_chain_name: Optional[str] = None)[source]¶
This class handles a target that is a chain
Either
chainorreal_chain_namemust be present (and notNone). If both are present, the chain’s real name must be equal toreal_chain_name.The target name is set to the real chain name.
- Parameters:
chain – a
Chainobjectreal_chain_name – a string
- resolve_chain(pft, log_failure=True) Optional[Chain][source]¶
Resolve the target name to the
Chainobject, and return that object.- Parameters:
pft – the
IptablesPacketFilterTableobject that is expected to contain the chainlog_failure – if
Trueand resolution fails, log a warning
- Return type:
a
Chainobject orNone
- get_target_name() str¶
Returns the target name
- is_terminating() bool¶
Returns
Trueif this is a terminating target
- to_iptables_args() List[str]¶
Returns a list of iptables(8) arguments