nf_srv_init

Call this function to initialize an attachment with the hooking driver and set the event handler object. The library calls NF_EventHandler methods from a separate thread.
NF_STATUS nf_srv_init(const char * driverName, NF_EventHandler * pHandler, NF_SRV_OPTIONS * options)

Parameters

driverName
The name of network filtering driver, without ".sys" extension.
pHandler
Pointer to NF_EventHandler object.
options
Pointer to NF_SRV_OPTIONS structure.

Return Values

NF_STATUS_SUCCESS on success, or other NF_STATUS error code on fail.

Remarks

By default the driver uses NF_ALLOW filtering flag and doesn't filter the transmitted data. To filter the transmitted packets add the filtering rules with necessary flags using the function nf_srv_addRule.

The function returns NF_STATUS_FAIL in case if some other process is already attached to driver. The driver doesn't allow multiple attachments. If additional process must filter the network data on the same system, rename and register another copy of the driver, then use the new name in nf_srv_init call from another process.

Requirements

Header nfsrvapi.h
Library nfsrvapi.lib