API functions

BOOL pf_init(PFEvents * pHandler, const wchar_t * dataFolder);
Initialize the library.
pHandler - Event handler
dataFolder - A path to configuration folder, where the library stores SSL certificates and temporary files
void pf_free();
Free the library.

NF_EventHandler * pf_getNFEventHandler();
Returns a pointer to event handler class for passing to nfapi::nf_init().

BOOL pf_postObject(ENDPOINT_ID id, PFObject * pObject);
Post an object to the specified endpoint.
id - Endpoint id
pObject - Filtered object

BOOL pf_addFilter(ENDPOINT_ID id,
		PF_FilterType type, 
		tPF_FilterFlags flags = FF_DEFAULT,
		PF_OpTarget target = OT_LAST, 
		PF_FilterType typeBase = FT_NONE);
Adds a new filter to session filtering chain.
id - Endpoint id
type - Type of the filter to add
flags - Filter specific flags
target - Position where to add new filter (OT_NEXT, OT_NEXT - relative to typeBase)
typeBase - Type of origin filter

BOOL pf_deleteFilter(NFAPI_NS ENDPOINT_ID id, PF_FilterType type);
Removes the specified filter from chain.
id - Endpoint id
type - Type of the filter to remove

int pf_getFilterCount(NFAPI_NS ENDPOINT_ID id);
Returns the number of active filters for the specified connection.
id - Endpoint id

BOOL pf_isFilterActive(NFAPI_NS ENDPOINT_ID id, PF_FilterType type);
Returns TRUE if there is a filter of the specified type in filtering chain.
id - Endpoint id
type - Type of the filter

void pf_setRootSSLCertSubject(const char * rootSubject);
Specifies a subject of a root certificate, used for generating other SSL certificates.
This name appears in "Issued by" field of certificates assigned to filtered SSL connections. Default value - "NetFilterSDK". If the appropriate certificate doesn't exist in the configuration folder, the library creates it and imports to Windows certificate storage.

BOOL pf_getProcessOwnerA(unsigned long processId, char * buf, int len);
BOOL pf_getProcessOwnerW(unsigned long processId, wchar_t * buf, int len);
Returns an owner of the specified process formatted as <domain>\<user name>.

processId - Process identifier
buf - Buffer
len - Number of elements in buf

BOOL pf_readHeader(PFStream * pStream, PFHeader * ph);
Loads header from stream.

BOOL pf_writeHeader(PFStream * pStream, PFHeader * ph);
Saves header to stream.

Requirements

Header ProtocolFilters.h
Library ProtocolFilters.lib