Skip to content

PCAP.Filter.Compile

Andrew Lambert edited this page Nov 26, 2022 · 6 revisions

PCAP.Filter.Compile

Method signature

 Shared Function Compile(Expression As String, Optional ActiveCapture As PCAP.Capture, Optimize As Boolean = False) As PCAP.Filter
 Protected Shared Function Compile(Expression As String, ActiveCapture As PCAP.Capture, Program As MemoryBlock, Optimize As Integer, Netmask As UInt32 = &hffffff) As Boolean

Parameters

Compile(String, PCAP.Capture, Boolean)

Name Type Comment
Expression String A BPF filter expression
ActiveCapture Capture An instance of Capture, representing either a live device or a dump file
Optimize Boolean If True the compiled filter program will be optimized

Compile(String, PCAP.Capture, MemoryBlock, Integer, UInt32)

Name Type Comment
Expression String A BPF filter expression
ActiveCapture Capture An instance of Capture, representing either a live device or a dump file
Program MemoryBlock A 8-byte block of memory to hold the compiled program reference
Optimize Integer If 1 the compiled filter program will be optimized
Netmask UInt32 Optional. If specified, the netmask to apply filtering to

Remarks

Generates a compiled filter program from the high level filtering expression given as the first parameter. If the program did not compile successfully then this method returns Nil. Check Filter.LastCompileError if this method returns Nil.

Clone this wiki locally