WinPcap 4.1.2

pcap-plugin-interface.h File Reference

Go to the source code of this file.

Data Structures

struct  _PLUGIN_DEVICE_DESCRIPTION
 Used in conjunction with GetDeviceList and FreeDeviceList to list the available devices. More...
struct  _PLUGIN_STATS
 Used in conjunction with GetStats to retrieve device capture statistics. More...
struct  _PLUGIN_PACKET_HEADER
 Used in conjunction with GetNextPacket to carry the particulars of the delivered packet. More...
struct  _PLUGIN_PACKET_HEADER::_PLUGIN_TIMEVAL

Defines

#define PLUGIN_INSTANCE_TYPE   void
 A plugin defined type that defaults to void. Plugins can override this type by defining it before the inclusion of this header file.
#define PLUGIN_API_VERSION   1
 The API version identifier that is to be used with GetPluginApiVersion.
#define PLUGIN_FUNCTION(type, name)   type name
 Convenience macro to allow the plugin infrastructure to use the same interface definition as the plugins.

Typedefs

typedef struct
_PLUGIN_DEVICE_DESCRIPTION 
PLUGIN_DEVICE_DESCRIPTION
 Used in conjunction with GetDeviceList and FreeDeviceList to list the available devices.
typedef struct _PLUGIN_STATS PLUGIN_STATS
 Used in conjunction with GetStats to retrieve device capture statistics.
typedef struct
_PLUGIN_PACKET_HEADER 
PLUGIN_PACKET_HEADER
 Used in conjunction with GetNextPacket to carry the particulars of the delivered packet.
typedef enum _PLUGIN_DIRECTION PLUGIN_DIRECTION
 Used in conjunction with SetDirection to specify the direction of traffic to capture.
typedef enum _PLUGIN_MODE PLUGIN_MODE
 Used in conjunction with SetMode to specify the capture mode that is to be used.

Enumerations

enum  _PLUGIN_DIRECTION { PLUGIN_DIRECTION_INOUT = 0, PLUGIN_DIRECTION_IN, PLUGIN_DIRECTION_OUT }
 

Used in conjunction with SetDirection to specify the direction of traffic to capture.

More...
enum  _PLUGIN_MODE { PLUGIN_MODE_CAPT = 0, PLUGIN_MODE_STAT }
 

Used in conjunction with SetMode to specify the capture mode that is to be used.

More...

Functions

Required
size_t GetPluginApiVersion ()
 Returns the plugin API version with which the plugin was compiled.
BOOLEAN GetPluginName (OUT char *name, size_t nameSizeInBytes)
 Returns the user-friendly name of the plugin.
BOOLEAN GetDeviceList (OUT PLUGIN_DEVICE_DESCRIPTION **devices, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Returns the devices to which the plugin has access.
void FreeDeviceList (IN OUT PLUGIN_DEVICE_DESCRIPTION *devices)
 Releases a device list retrieved from GetDeviceList.
BOOLEAN OpenInstance (IN char *deviceName, OUT PLUGIN_INSTANCE_TYPE **instanceHandle, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Creates an instance of the specified device for use with many other functions.
void CloseInstance (IN PLUGIN_INSTANCE_TYPE *instanceHandle)
 Releases the device that was retrieved from OpenInstance.
int GetLinkType (IN PLUGIN_INSTANCE_TYPE *instanceHandle)
 Returns the link type of packets retrieved with GetNextPacket.
Optional
BOOLEAN GetSupportedDlts (IN PLUGIN_INSTANCE_TYPE *instanceHandle, IN OUT UINT *dltList, size_t dltListSizeInBytes, OUT size_t *dltCount)
 Returns a list of Data Link Types that the device supports.
BOOLEAN GetStats (IN PLUGIN_INSTANCE_TYPE *instanceHandle, OUT PLUGIN_STATS *stats, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Returns packet reception statistics.
BOOLEAN SetPacketFilter (IN PLUGIN_INSTANCE_TYPE *instanceHandle, IN const void *filter, size_t filterSizeInBytes, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the Berkeley Packet Filter (BPF) that is to be used to filter packets.
BOOLEAN SetReadTimeout (IN PLUGIN_INSTANCE_TYPE *instanceHandle, int timeoutMs, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the maximum time to wait for new packets to arrive.
BOOLEAN GetNextPacket (IN PLUGIN_INSTANCE_TYPE *instanceHandle, OUT PLUGIN_PACKET_HEADER **packetHeader, OUT void **packet, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Returns the location of the next packet received by the device and its header.
BOOLEAN GetReadEvent (IN PLUGIN_INSTANCE_TYPE *instanceHandle, OUT HANDLE *readEvent, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Returns the event that gets signaled when the device has at least the minimum bytes to copy available for read.
BOOLEAN InjectPacket (IN PLUGIN_INSTANCE_TYPE *instanceHandle, IN const void *packet, size_t packetSizeInBytes, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Injects a given packet into the device's network medium.
BOOLEAN SetDirection (IN PLUGIN_INSTANCE_TYPE *instanceHandle, PLUGIN_DIRECTION direction, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets a filter indicating from which direction to capture network traffic.
BOOLEAN SetDatalink (IN PLUGIN_INSTANCE_TYPE *instanceHandle, int dlt, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the data link to use for delivering network traffic.
BOOLEAN IsNonBlocking (IN PLUGIN_INSTANCE_TYPE *instanceHandle, OUT BOOLEAN *nonBlocking, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Retrieves the blocking state of the plugin.
BOOLEAN SetNonBlocking (IN PLUGIN_INSTANCE_TYPE *instanceHandle, BOOLEAN nonBlocking, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the blocking state of the plugin.
BOOLEAN SetBufferSize (IN PLUGIN_INSTANCE_TYPE *instanceHandle, size_t sizeInBytes, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the kernel mode buffer size of the plugin.
BOOLEAN SetMode (IN PLUGIN_INSTANCE_TYPE *instanceHandle, PLUGIN_MODE mode, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the capture mode of the plugin.
BOOLEAN SetMinToCopy (IN PLUGIN_INSTANCE_TYPE *instanceHandle, size_t sizeInBytes, OUT char *errorMsg, size_t errorMsgSizeInBytes)
 Sets the minimum amount of data that must be present in the device before it is made accessible.

Define Documentation

#define PLUGIN_API_VERSION   1

The API version identifier that is to be used with GetPluginApiVersion.

Definition at line 38 of file pcap-plugin-interface.h.

#define PLUGIN_FUNCTION (   type,
  name 
)    type name

Convenience macro to allow the plugin infrastructure to use the same interface definition as the plugins.

Definition at line 120 of file pcap-plugin-interface.h.

#define PLUGIN_INSTANCE_TYPE   void

A plugin defined type that defaults to void. Plugins can override this type by defining it before the inclusion of this header file.

Definition at line 34 of file pcap-plugin-interface.h.


Typedef Documentation

Used in conjunction with GetDeviceList and FreeDeviceList to list the available devices.

Parameters:
nameThe machine identifier for the device. This parameter will be passed to OpenInstance to specify which device to open.
descriptionThe user-friendly description description string for the device.
nextA pointer to the next device description in the linked list. If no such device exists or the end of the list has been reached then this parameter must be NULL.
Remarks:
This structure is allocated and released by the plugin.
See also:
GetDeviceList FreeDeviceList OpenInstance

Used in conjunction with SetDirection to specify the direction of traffic to capture.

See also:
SetDirection
typedef enum _PLUGIN_MODE PLUGIN_MODE

Used in conjunction with SetMode to specify the capture mode that is to be used.

See also:
SetMode

Used in conjunction with GetNextPacket to carry the particulars of the delivered packet.

Parameters:
tv_secThe number of seconds that has elapsed since January 1st 1970.
tv_usecThe number of microseconds that has elapsed since the last full second.
caplenThe number of the packet's bytes that are present in the packet buffer and are available to be read.
lenThe number of bytes originally available when the packet was read into the device.
See also:
GetNextPacket
typedef struct _PLUGIN_STATS PLUGIN_STATS

Used in conjunction with GetStats to retrieve device capture statistics.

Parameters:
receivedThe number of packets received by the interface since it was opened.
droppedThe number of packets dropped by the interface since it was opened.
See also:
GetStats

Enumeration Type Documentation

Used in conjunction with SetDirection to specify the direction of traffic to capture.

See also:
SetDirection
Enumerator:
PLUGIN_DIRECTION_INOUT 
PLUGIN_DIRECTION_IN 
PLUGIN_DIRECTION_OUT 

Definition at line 98 of file pcap-plugin-interface.h.

Used in conjunction with SetMode to specify the capture mode that is to be used.

See also:
SetMode
Enumerator:
PLUGIN_MODE_CAPT 
PLUGIN_MODE_STAT 

Definition at line 110 of file pcap-plugin-interface.h.


Function Documentation

void CloseInstance ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle)

Releases the device that was retrieved from OpenInstance.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
Remarks:
This function cannot fail. After invocation, instanceHandle is no longer valid and should be discarded.
This function must return the system to a state such that repeated calls to open and close a device produces no accumulating effects.
See also:
OpenInstance
void FreeDeviceList ( IN OUT PLUGIN_DEVICE_DESCRIPTION devices)

Releases a device list retrieved from GetDeviceList.

Parameters:
[in,out]devicesThe device list to be released.
Remarks:
This function cannot fail. After calling this function, memory pointed to by devices is no longer accessible.
See also:
GetDeviceList
BOOLEAN GetDeviceList ( OUT PLUGIN_DEVICE_DESCRIPTION **  devices,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Returns the devices to which the plugin has access.

Parameters:
[out]devicesPointer to a linked list of device descriptions.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the request succeeds, FALSE otherwise.
Remarks:
If this function fails it is to return FALSE and set errorMsg accordingly. In the event of such a failure, the devices parameter may be set to anything as it will be discarded.
If TRUE is returned then the devices parameter must point to a linked list of device descriptions. If TRUE is returned, the errorMsg parameter is ignored.
See also:
FreeDeviceList OpenInstance
int GetLinkType ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle)

Returns the link type of packets retrieved with GetNextPacket.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
Returns:
The link type of packets retrieved with GetNextPacket as defined in bpf.h.
Remarks:
This function cannot fail.
See also:
GetSupportedDlts GetNextPacket
BOOLEAN GetNextPacket ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
OUT PLUGIN_PACKET_HEADER **  packetHeader,
OUT void **  packet,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Returns the location of the next packet received by the device and its header.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[out]packetHeaderA pointer to the header of the next packet read from the device.
[out]packetA pointer to the packet data for the next packet read from the device.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the capture direction was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
Remarks:
Packet and header data as returned by packetHeader and packet respectively need only remain valid from one call of GetNextPacket to the next, allowing for the header and packet data memory to be reused by the plugin.
size_t GetPluginApiVersion ( )

Returns the plugin API version with which the plugin was compiled.

Returns:
This function is to always return PLUGIN_API_VERSION.
Remarks:
This function serves to allow a simple version scheme that gives the plugin framework some ability to change over time.
The plugin framework will determine if it is compatible with the API version returned. If the plugin is not compatible it will not be loaded.
BOOLEAN GetPluginName ( OUT char *  name,
size_t  nameSizeInBytes 
)

Returns the user-friendly name of the plugin.

Parameters:
[out]namePointer to a buffer in which to place the plugin's user-friendly name.
[in]nameSizeInBytesThe size in bytes of the buffer referenced by name.
Returns:
TRUE if the request succeeds, FALSE otherwise.
Remarks:
If this function fails it is to return FALSE. In the event of such a failure, the name parameter may be set to anything as it will be discarded.
If TRUE is returned then the name parameter must point to a null terminated ASCII string that is no longer than the supplied nameSizeInBytes parameter.
BOOLEAN GetReadEvent ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
OUT HANDLE *  readEvent,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Returns the event that gets signaled when the device has at least the minimum bytes to copy available for read.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[out]readEventA handle to the read event for the device instance.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the read event was returned successfully. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
GetNextPacket SetMinToCopy
BOOLEAN GetStats ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
OUT PLUGIN_STATS stats,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Returns packet reception statistics.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[out]statsA pointer to a structure that is to be populated with device statistics.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if stats has been set to the current statistics for the device. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
BOOLEAN GetSupportedDlts ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
IN OUT UINT *  dltList,
size_t  dltListSizeInBytes,
OUT size_t *  dltCount 
)

Returns a list of Data Link Types that the device supports.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in,out]dltListA pointer to an array that will hold the DLT list. This array must be at least dltListSizeInBytes bytes long.
[in]dltListSizeInBytesThe size in bytes of the memory pointed to by dltList.
[out]dltCountThe number of DLTs that were stored in dltList.
Returns:
FALSE if dltListSizeInBytes is not large enough to populate all supported DLTs into dltList. TRUE in all other cases.
Remarks:
This function may only be implemented if SetDatalink is also implemented.
This may by called multiple times with a larger dltListSizeInBytes each succeeding time until success is reported.
See also:
SetDatalink
BOOLEAN InjectPacket ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
IN const void *  packet,
size_t  packetSizeInBytes,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Injects a given packet into the device's network medium.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]packetA pointer to the packet data to be sent by the device.
[in]packetSizeInBytesThe size in bytes of packet pointed to by packet.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the capture direction was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
BOOLEAN IsNonBlocking ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
OUT BOOLEAN *  nonBlocking,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Retrieves the blocking state of the plugin.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[out]nonBlockingTRUE if the device is operating in non-blocking mode, FALSE otherwise.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the requested non-blocking mode was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
SetNonBlocking
BOOLEAN OpenInstance ( IN char *  deviceName,
OUT PLUGIN_INSTANCE_TYPE **  instanceHandle,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Creates an instance of the specified device for use with many other functions.

Parameters:
[in]deviceNameThe name of the device to open as found in the device list retrieved from GetDeviceList.
[out]instanceHandleA pointer to a plugin-defined instance handle. The plugin will use this handle to store instance-specific information.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Remarks:
If this function fails it is to return FALSE and set errorMsg accordingly. In the event of such a failure, the instanceHandle parameter may be set to anything as it will be discarded.
If TRUE is returned then instanceHandle must point to a valid plugin-specific instance handle. If TRUE is returned, the errorMsg parameter is ignored.
See also:
GetDeviceList CloseInstance
BOOLEAN SetBufferSize ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
size_t  sizeInBytes,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the kernel mode buffer size of the plugin.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]sizeInBytesThe size in bytes of the kernel mode buffer.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the kernel mode buffered was successfully configured with the requested size. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
SetMinToCopy
BOOLEAN SetDatalink ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
int  dlt,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the data link to use for delivering network traffic.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]dltThe Data Link Type (DLT) that packets delivered via GetNextPacket are to have.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the DLT was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
GetSupportedDlts
BOOLEAN SetDirection ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
PLUGIN_DIRECTION  direction,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets a filter indicating from which direction to capture network traffic.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]directionThe direction from which to capture network traffic. All other traffic is to be ignored.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the capture direction was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
BOOLEAN SetMinToCopy ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
size_t  sizeInBytes,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the minimum amount of data that must be present in the device before it is made accessible.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]sizeInBytesThe size in bytes that must be present in the device before it is made accessible for a read operation.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the minimum to copy was successfully configured with the requested size. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
SetBufferSize
BOOLEAN SetMode ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
PLUGIN_MODE  mode,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the capture mode of the plugin.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]modeThe capture mode in which the device is to operate.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the capture mode was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
BOOLEAN SetNonBlocking ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
BOOLEAN  nonBlocking,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the blocking state of the plugin.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]nonBlockingTRUE if the device is to operate in non-blocking mode, FALSE otherwise.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the requested non-blocking mode was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
See also:
IsNonBlocking
BOOLEAN SetPacketFilter ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
IN const void *  filter,
size_t  filterSizeInBytes,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the Berkeley Packet Filter (BPF) that is to be used to filter packets.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]filterCompiled BPF filter that is to be set in the device.
[in]filterSizeInBytesThe size in bytes of filter.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the BPF filter was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.
BOOLEAN SetReadTimeout ( IN PLUGIN_INSTANCE_TYPE *  instanceHandle,
int  timeoutMs,
OUT char *  errorMsg,
size_t  errorMsgSizeInBytes 
)

Sets the maximum time to wait for new packets to arrive.

Parameters:
[in]instanceHandleThe plugin specific handle for the device as returned by OpenInstance.
[in]timeoutMsThe maximum number of milliseconds to wait for new packets to arrive before fulfilling a read request.
[out]errorMsgPointer to a character buffer of length errorMsgSizeInBytes. If an error occurs, this buffer must contain a null-terminated and user-friendly error description.
[in]errorMsgSizeInBytesThe size in bytes of the buffer referenced by errorMsg.
Returns:
TRUE if the read timeout was successfully configured. FALSE in all other cases. If FALSE is returned errorMsg must contain a null-terminated and user-friendly error description.