Sun Java System Web Server 7.0 Update 7 NSAPI Developer's Guide

I

insert() Function

The insert filter method is called when a filter is inserted into a filter stack by the filter_insert function or insert-filter SAF.

Syntax

int insert(FilterLayer *layer, pblock *pb);

Return Values

REQ_PROCEED if the filter should be inserted into the filter stack, REQ_NOACTION if the filter should not be inserted because it is not required, or REQ_ABORTED if the filter should not be inserted because of an error.

Parameters

FilterLayer *layer is the filter layer at which the filter is being inserted.

pblock *pb is the set of parameters passed to filter_insert or specified by the fn="insert-filter" directive.

Example

int myfilter_insert(FilterLayer *layer, pblock *pb)
{    
	    if (pblock_findval("dont-insert-filter", pb))
        return REQ_NOACTION;
        return REQ_PROCEED;
}
...

FilterMethods myfilter_methods = FILTER_METHODS_INITIALIZER;
const Filter *myfilter;

myfilter_methods.insert = &myfilter_insert;    
myfilter = filter_create("myfilter", &myfilter_methods);
...

See Also

filter_insert() Function, filter_create() Function