Packet Sniffer SDK DLL Edition

HNUserFilter :: Methods :: BpfLoadFromMemory

 Previous Next

Loads the BPF program from the memory block.

Syntax:

DWORD __stdcall BpfLoadFromMemory(HANDLE hFtr, HN_BPF_PROGRAMM *pProgramm, DWORD Size);

Parameters:

hFtr

[in] HNUserFilter object handle.

pProgramm

[in] A pointer to the memory block containing the BPF program, described by the HN_BPF_PROGRAMM structure.

Size

[in] The memory block size.

Return values:

HNERR_OKNo errors.
HNERR_FLT_BAD_LENInstructions count in the filter program is wrong.
HNERR_INVALID_HANDLEhFtr parameter is not the HNUserFilter object handle.

Description:

When the BPF program has been loaded successfully, BpfLoadFromMemory calls the BpfCheckFilter function to check the BPF program accuracy, and returns the error codes of BpfCheckFilter.

Use BpfLoadFromMemory function to load BPF program from memory if you have already created it in HN_BPF_PROGRAMM structure format, or saved it with BpfSaveToMemory function.

See also:HNUserFilter, HN_BPF_PROGRAMM, BpfCheckFilter, BpfSaveToMemory