Filter.compileNoPcap

PcapStatus compileNoPcap(int snaplen, int linktype, string filterStr, bool optimize = true, uint netmask = PCAP_NETMASK_UNKNOWN)

Compiles a BPF filter string without requiring an open pcap handle.

Parameters

snaplenThe snapshot length.
linktypeThe link-layer type (DLT_*).
filterStrThe BPF filter expression.
optimizeWhether to optimize the compiled code.
netmaskThe netmask of the interface.

Returns

A PcapStatus indicating success or error.