Packet Sniffer SDK DLL Edition

HNUserFilter :: Methods :: BpfAddJmp

 Previous Next

Adds JMP instruction to the user-settable packet filtering program.

Syntax:

DWORD __stdcall BpfAddJmp(HANDLE hFtr, SHORT Code, DWORD k, SHORT TrueOffset, SHORT FalseOffset);

Parameters:

hFtr

[in] HNUserFilter object handle.

Code

[in] Instruction code.

k

[in] Generic BPF multiuse field.

TrueOffset

[in] Jump offset if TRUE.

FalseOffset

[in] Jump offset if FALSE.

Return values:

HNERR_OKNo errors.
HNERR_WRONG_INSTRUCTIONThe wrong Code parameter.
HNERR_WRONG_PARAMETERThe wrong TrueOffset and/or FalseOffset. Must be less or equal to 255.
HNERR_INVALID_HANDLEhFtr parameter is not the HNUserFilter object handle.

Description:

Use BpfAddJmp to add a conditional jump instruction to your filtering program. The TrueOffset and FalseOffset parameters values contain offsets (0-based) to instructions, on which the program will jump, corresponding to these conditions.

Backward jumps are not allowed.
See also:HNUserFilter, BpfAddCmd, BPF Instructions