Packet Sniffer SDK DLL Edition

HNUserFilter :: Methods :: BpfLoadFromFile

 Previous Next

Loads the BPF program from the file.

Syntax:

DWORD __stdcall BpfLoadFromFile(HANDLE hFtr, LPCTSTR FileName);

Parameters:

hFtr

[in] HNUserFilter object handle.

FileName

[in] A path to a file containing the BPF program.

Return values:

HNERR_OKNo errors.
HNERR_LOAD_FILE_ERRORNo file, bad file (zero len).
HNERR_INVALID_HANDLEhFtr parameter is not the HNUserFilter object handle.

Description:

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

Use the BpfLoadFromFile function to load the BPF program saved to a file (i.e., by the BpfSaveToFile function).

Requirements:

Unicode

Implemented as BpfLoadFromFileW (Unicode) and BpfLoadFromFileA (ANSI).

See also:HNUserFilter, BpfCheckFilter, BpfSaveToFile