ChainTarget

class ChainTarget(*, chain=None, real_chain_name: Optional[str] = None)[source]

This class handles a target that is a chain

At least one of chain, real_chain_name must be present. If both are present, the chain’s real name must be equal to real_chain_name.

The target name is set to the real chain name.

Parameters:
  • chain – a Chain object

  • real_chain_name – a string

get_chain() Optional[Chain][source]

Returns the Chain object

resolve_chain(pft, log_failure=True) Chain[source]

Resolve the target name to the Chain object, and return that object

Parameters:
  • pft – the IptablesPacketFilterTable object that is expected to contain the chain

  • log_failure – if True and resolution fails, log a warning

Return type:

a Chain object or None