Incompatible mode of HNFileAdapter. Occurs when HNFileAdapter.AutoMode was set
[Get/Set]),
but HNQueue object was not predetermined (see
HNFileAdapter.Queue
[Get/Set]).
HNERR_BAD_MEDIUM_TYPE
Impossible adapter type is set for format of packets to be dumped to the CAP file.
HNERR_MEM_ALLOC_ERROR
The memory for the traffic processing is not allocated. This can happen either because of the
insufficient operating system resources or in case of
HNQueue component using (see
QueAllocItems).
HNERR_UNKNOWN_FILE_FORMAT
Unknown CAP file format is set (see HNFileAdapter.CapFormat
[Get/Set]).
hFAdp parameter is not the HNFileAdapter object handle.
Description:
Use FAdpCreateFile to create a new CAP file. If the function succeeds, you can begin to
dump network traffic to the CAP file using FAdpSyncSend and
FAdpSyncSendEx functions.
If HNFileAdapter.Queue property
[Get/Set] was
set before the network adapter opening, and HNFileAdapter object
Automode was set (see HNFileAdapter.AutoMode [Get/
Set]), then the traffic will be processed in the
HNFileAdapter internal thread context together with HNQueue
component.
In this mode you also may use HNFileAdapter.SizeLimit property
[Get/Set]
to set limitation for CAP file size.
On executing FAdpCreateFile function
HNFileAdapter component attempts to close the CAP file which was
opened earlier. So, one instance of HNFileAdapter object can open
only one CAP file.
If you need to open/create several CAP files simultaneously, you may create several
HNFileAdapter objects with appropriate settings.
To read from existing CAP file please use FAdpOpenFile
function.
Example of dumping packets to a CAP file in HNFileAdpater AutoMode: