Filter.compile

PcapStatus compile(PcapHandle * handle, string filterStr, bool optimize = true, uint netmask = PCAP_NETMASK_UNKNOWN)

Compiles a BPF filter string.

Parameters

handleThe pcap handle to use for compilation (can be a dead handle).
filterStrThe BPF filter expression (e.g. "tcp port 80").
optimizeWhether to optimize the compiled code.
netmaskThe netmask of the interface (use PCAP_NETMASK_UNKNOWN if unknown).

Returns

A PcapStatus indicating success or error.