MarkTarget

class MarkTarget(mark: Optional[int] = None)[source]

This class provides access to the MARK target

Parameters:

mark – value used to set the mark value in the packet

and_mark(mask: int) Target

Clear the bits identified by mask

get_mark() Optional[int]

Returns the mark value set by this target

get_mask() Optional[int]

Returns the mask used by this target

get_op() Optional[int]

Returns the operation

Return type:

an integer with one of the following values: SET, XSET, AND, OR, XOR, or None

mark_iptables_args(args: List[str]) List[str]

Converts the op/value/mask to a list of iptables(8) arguments for the MARK target

or_mark(mask) Target

Set the bits identified by mask

parse_op(val: str, field_iter) bool

Parse the operation identified by ‘val’

set_mark(value: int, mask: Optional[int] = None) Target

Set the mark

set_xmark(value: int, mask: Optional[int] = None) Target

Alternative way of setting the mark

to_iptables_args() List[str][source]

Returns a list of iptables(8) arguments

xor_mark(mask) Target

Xor the bits identified by mask