ipf.h revision 24583
1/*
2 * (C)opyright 1993-1996 by Darren Reed.
3 *
4 * Redistribution and use in source and binary forms are permitted
5 * provided that this notice is preserved and due credit is given
6 * to the original author and the contributors.
7 *
8 * @(#)ipf.h	1.12 6/5/96
9 * $Id: ipf.h,v 2.0.2.4 1997/03/27 13:45:18 darrenr Exp $
10 */
11
12#ifndef	SOLARIS
13#define	SOLARIS	(defined(sun) && (defined(__svr4__) || defined(__SVR4)))
14#endif
15#define	OPT_REMOVE	0x00001
16#define	OPT_DEBUG	0x00002
17#define	OPT_OUTQUE	FR_OUTQUE	/* 0x0004 */
18#define	OPT_INQUE	FR_INQUE	/* 0x0008 */
19#define	OPT_LOG		FR_LOG		/* 0x0010 */
20#define	OPT_SHOWLIST	0x00020
21#define	OPT_VERBOSE	0x00040
22#define	OPT_DONOTHING	0x00080
23#define	OPT_HITS	0x00100
24#define	OPT_BRIEF	0x00200
25#define OPT_ACCNT	FR_ACCOUNT	/* 0x0400 */
26#define	OPT_FRSTATES	FR_KEEPFRAG	/* 0x0800 */
27#define	OPT_IPSTATES	FR_KEEPSTATE	/* 0x1000 */
28#define	OPT_INACTIVE	FR_INACTIVE	/* 0x2000 */
29#define	OPT_SHOWLINENO	0x04000
30#define	OPT_PRINTFR	0x08000
31#define	OPT_ZERORULEST	0x10000
32#define	OPT_SAVEOUT	0x20000
33
34#ifndef __P
35# ifdef	__STDC__
36#  define	__P(x)	x
37# else
38#  define	__P(x)	()
39# endif
40#endif
41
42extern	struct	frentry	*parse __P((char *));
43
44extern	void	printfr __P((struct frentry *));
45extern	void	binprint __P((struct frentry *)), initparse __P((void));
46extern	u_short	portnum __P((char *));
47
48
49#if defined(__SVR4) || defined(__svr4__)
50#define	index	strchr
51#define	bzero(a,b)	memset(a, 0, b)
52#define	bcopy(a,b,c)	memmove(b,a,c)
53#endif
54
55struct	ipopt_names	{
56	int	on_value;
57	int	on_bit;
58	int	on_siz;
59	char	*on_name;
60};
61
62
63extern	u_long	buildopts __P((char *, char *));
64extern	u_long	hostnum __P((char *, int *));
65extern	u_long	optname __P((char ***, u_short *));
66extern	void	printpacket __P((struct ip *));
67#if SOLARIS
68extern	int	inet_aton __P((const char *, struct in_addr *));
69#endif
70
71#ifdef	sun
72#define	STRERROR(x)	sys_errlist[x]
73extern	char	*sys_errlist[];
74#else
75#define	STRERROR(x)	strerror(x)
76#endif
77
78#ifndef	MIN
79#define	MIN(a,b)	((a) > (b) ? (b) : (a))
80#endif
81
82