Functions

Sourcefire policy configuration module

Functions

tSfPolicyUserContextId sfPolicyConfigCreate (void)
void sfPolicyConfigDelete (tSfPolicyUserContextId pContext)
int sfPolicyUserDataSet (tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config)
void * sfPolicyUserDataClear (tSfPolicyUserContextId pContext, tSfPolicyId policyId)
int sfPolicyUserDataIterate (tSfPolicyUserContextId pContext, int(*callback)(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config))

Detailed Description

Create a user policy configuration context. A context provides facility for creating policy specific data instances. User can create as many policy instances as memory resources will allow. User can create/delete context, set/clear/get user date for a specific policy, default policy or current policy. User can also iterate over all instances user data.

In current design, preprocessor use this module directly to manage policy specific data instances. A future enhancement can be to extract policy management code from each processor and put it in a new policy management module. Policy management module will set a single pointer to user data before calling appropriate callback function in a preprocessor. As an example, policy module will iterate over all policies and call CleanExit functions in every preprocessor for each policy. This will make policy management module will hide policies from preprocessors and make them policy agnostic.


Function Documentation

tSfPolicyUserContextId sfPolicyConfigCreate ( void   ) 

Create a user context. Allocates a new context and return it to user. All transactions within a context are independent from any other transactions in a different context.

Returns:
tSfPolicyUserContextId
void sfPolicyConfigDelete ( tSfPolicyUserContextId  pContext  ) 

Delete a user policy data context.

Parameters:
pContext 
void* sfPolicyUserDataClear ( tSfPolicyUserContextId  pContext,
tSfPolicyId  policyId 
)

user is responsible for freeing any memory.

int sfPolicyUserDataIterate ( tSfPolicyUserContextId  pContext,
int(*)(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config callback 
)
int sfPolicyUserDataSet ( tSfPolicyUserContextId  pContext,
tSfPolicyId  policyId,
void *  config 
)

Store a pointer to user data.

Parameters:
pContext 
policyId is 0 based.
config - pointer to user configuration.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines