/*
 * firewall policy tables
 */

#define FIREWALL_CONFIG	"/etc/gatekeeper.cf"

#define FW_HASH_BITS	8
#define FW_HASH_SZ	(1<<FW_HASH_SZ)
#define FW_HASH_MASK	(FW_HASH_SZ-1)
#define ROL(x,b)	(x<<(b)|x>>(8-(b))
#define HASHV4(a,p)	((a[0] ^ ROL(a[1],1) ^ \
                                ROL(a[2],2) ^ \
				ROL(a[3],3) ^ 
				(p[0] + p[1]) ) & FW_HASH_MASK)

#define	DENY	0
#define ALLOW	1

struct chainv4 {
    long addr;	/* assume sizeof(long) >= 4 */
    short port;	/* assume sizeof(short) >= 2 */
    short action;	/* ALLOW/DENY/PROXY(x) */
    struct chainv4* next, *prev;
};

extern struct chainv4 *hash;
