Additional error checking and documentation.
Implementation of topfilter options
This commit is contained in:
@ -135,6 +135,19 @@ FILTER_DEF *filter;
|
||||
return filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a parameter to see if it is a standard filter parameter
|
||||
*
|
||||
* @param name Parameter name to check
|
||||
*/
|
||||
int
|
||||
filter_standard_parameter(char *name)
|
||||
{
|
||||
if (strcmp(name, "type") == 0 || strcmp(name, "module") == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print all filters to a DCB
|
||||
*
|
||||
@ -285,6 +298,17 @@ int i;
|
||||
spinlock_release(&filter->spin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect the downstream filter chain for a filter.
|
||||
*
|
||||
* This will create the filter instance, loading the filter module, and
|
||||
* conenct the fitler into the downstream chain.
|
||||
*
|
||||
* @param filter The filter to add into the chain
|
||||
* @param session The client session
|
||||
* @param downstream The filter downstream of this filter
|
||||
* @return The downstream component for the next filter
|
||||
*/
|
||||
DOWNSTREAM *
|
||||
filterApply(FILTER_DEF *filter, SESSION *session, DOWNSTREAM *downstream)
|
||||
{
|
||||
@ -315,6 +339,19 @@ DOWNSTREAM *me;
|
||||
return me;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect a filter in the up stream filter chain for a session
|
||||
*
|
||||
* Note, the filter will have been created when the downstream chian was
|
||||
* previously setup.
|
||||
* Note all filters require to be in the upstream chain, so this routine
|
||||
* may skip a filter if it does not provide an upstream interface.
|
||||
*
|
||||
* @param filter The fitler to add to the chain
|
||||
* @param fsession The filter session
|
||||
* @param upstream The filter that should be upstream of this filter
|
||||
* @return The upstream component for the next filter
|
||||
*/
|
||||
UPSTREAM *
|
||||
filterUpstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user