* #ident "$Revision: 1.7 $"
*
* IP packet filtering driver
*
*FLAG	PREFIX	SOFT	#DEV	DEPENDENCIES
cos	ipfilter 59	 -	bsd
				ipfilter_kernel(){false}
$$$

#include <netinet/in.h>
#include <netinet/ipfilter.h>

/*
 * The kernel cache of filtering verdicts is configurable in size. The size 
 * is defined by NUMIPKFLT, which specifies the number of entries in the cache.
 * To change the size, redefine NUMIPKFLT here, then lboot a new kernel.
 */
#define NUMIPKFLT 32				    /* size of kernel cache */
struct ipkernelfilter	ipfiltercache[NUMIPKFLT];   /* kernel verdict cache */

int numipkflt = NUMIPKFLT;

/*
 * filtercache_search_depth:
 * The most recently used entry in the kernel cache gets moved to the
 * head of the cache. To prevent thrashing, this only happens when the
 * cache search depth has exceeded filtercache_search_depth. The default
 * value is four (two simultaneous TCP file transfers). This value should
 * be tuned based on expected system workload.
 */

int filtercache_search_depth = 4;

/* 
 * ipfilterd_inactive_behavior
 * Define IP packet behavior when daemon is killed or dies.
 * 0 => accept all packets when filtering turned off. Acts as though filtering
 *	is not configured; routing and other IP traffic unaffected.
 * 1 => reject all packets when filtering turned off. This has the effect of
 *      preventing any routing when the daemon has been active, but has died.
 *	This is the preferred behavior for a firewall-type gateway. Note: even
 *	when the value is 1, all IP packets destined for and sent from the
 *	local host will still be accepted. It's only foreign-source packets
 *	that get clobbered.
 */
int     ipfilterd_inactive_behavior = 0;

/*
 * ipfilter_ttl
 * Specify lifetime in seconds of inactive kernel cache entries.
 * Must fit in unsigned short, hence maximum value is 64K (65535),
 * a bit more than 18 hours.
 * Default will be 60 seconds.
 */
int ipfilter_ttl = 60;
