ipf.h revision 31183
1/* 2 * Copyright (C) 1993-1997 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.12 1997/09/28 07:11:50 darrenr Exp $ 10 */ 11 12#ifndef __IPF_H__ 13#define __IPF_H__ 14 15#ifndef SOLARIS 16#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) 17#endif 18#define OPT_REMOVE 0x00001 19#define OPT_DEBUG 0x00002 20#define OPT_OUTQUE FR_OUTQUE /* 0x0004 */ 21#define OPT_INQUE FR_INQUE /* 0x0008 */ 22#define OPT_LOG FR_LOG /* 0x0010 */ 23#define OPT_SHOWLIST 0x00020 24#define OPT_VERBOSE 0x00040 25#define OPT_DONOTHING 0x00080 26#define OPT_HITS 0x00100 27#define OPT_BRIEF 0x00200 28#define OPT_ACCNT FR_ACCOUNT /* 0x0400 */ 29#define OPT_FRSTATES FR_KEEPFRAG /* 0x0800 */ 30#define OPT_IPSTATES FR_KEEPSTATE /* 0x1000 */ 31#define OPT_INACTIVE FR_INACTIVE /* 0x2000 */ 32#define OPT_SHOWLINENO 0x04000 33#define OPT_PRINTFR 0x08000 34#define OPT_ZERORULEST 0x10000 35#define OPT_SAVEOUT 0x20000 36#define OPT_AUTHSTATS 0x40000 37#define OPT_RAW 0x80000 38 39#ifndef __P 40# ifdef __STDC__ 41# define __P(x) x 42# else 43# define __P(x) () 44# endif 45#endif 46 47#ifdef ultrix 48extern char *strdup __P((char *)); 49#endif 50 51extern struct frentry *parse __P((char *)); 52 53extern void printfr __P((struct frentry *)); 54extern void binprint __P((struct frentry *)), initparse __P((void)); 55extern u_short portnum __P((char *)); 56 57 58struct ipopt_names { 59 int on_value; 60 int on_bit; 61 int on_siz; 62 char *on_name; 63}; 64 65 66extern u_32_t buildopts __P((char *, char *, int)); 67extern u_32_t hostnum __P((char *, int *)); 68extern u_32_t optname __P((char ***, u_short *)); 69extern void printpacket __P((ip_t *)); 70#if SOLARIS 71extern int inet_aton __P((const char *, struct in_addr *)); 72#endif 73 74#ifdef sun 75#define STRERROR(x) sys_errlist[x] 76extern char *sys_errlist[]; 77#else 78#define STRERROR(x) strerror(x) 79#endif 80 81#ifndef MIN 82#define MIN(a,b) ((a) > (b) ? (b) : (a)) 83#endif 84 85#endif /* __IPF_H__ */ 86