Expand description
Structured packet filter.
Filters are evaluated per-packet. Rules within the same category are
OR-ed; rules of different categories are AND-ed. An empty Filter
(the default) matches every packet.
§Evaluation order
- Time range (cheapest — no parsing required)
- Packet length
- Protocol, IP, port, flow ID, TCP flags (requires etherparse)
Structs§
- Filter
- Compiled structured packet filter.
- Filter
Rule - A single rule in a
Filterrule chain. - Packet
Meta - Packet metadata extracted for filter evaluation.
- Port
Range - A single port or an inclusive port range.
- TcpFlags
Filter - TCP control-flags filter.
Enums§
- Filter
Error - Error type for filter construction.
- IpNet
- An IP network in CIDR notation, or a single host address (
/32or/128). - Op
- Logical operator used when chaining
FilterRules in aFilter.
Functions§
- parse_
datetime_ ns - Parse an RFC 3339 datetime string or a Unix epoch integer (in seconds) to nanoseconds since the Unix epoch.
- parse_
flow_ ids - Parse a comma-separated list of hex flow IDs.
- parse_
proto_ list - Parse a comma-separated protocol list into IP protocol numbers.