TcpMatch

class TcpMatch[source]

Match against the fields of the TCP header

dest_port() DestPortCriterion[source]

Match against the destination port

source_port() SourcePortCriterion[source]

Matching against the source port

syn() TcpFlagsCriterion[source]

Criterion for matching against a SYN packet

tcp_flags() TcpFlagsCriterion[source]

Compare with TCP flags

to_iptables_args() List[str][source]

Returns iptables(8) arguments for this match


TcpFlagsCriterion

class TcpFlagsCriterion(match: Match, syn_only=False)[source]

A criterion for comparing against packets with an arbitrary set of TCP flags set. As a special case, it also serves for comparing against SYN packets.

The value is the tuple (flags-checked, flags-set); both flags-checked and flags-set are comma-separated lists of TCP flag names.


SourcePortCriterion

class SourcePortCriterion(match: Match)[source]

Compare with a source port or check for inclusion in port-range


DestPortCriterion

class DestPortCriterion(match: Match)[source]

Compare against a destination port or check for inclusion in port-range