ip_fil.h revision 57126
1/* 2 * Copyright (C) 1993-1998 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 * @(#)ip_fil.h 1.35 6/5/96 9 * $Id: ip_fil.h,v 2.3.2.7 2000/01/27 08:49:41 darrenr Exp $ 10 * $FreeBSD: head/sys/contrib/ipfilter/netinet/ip_fil.h 57126 2000-02-10 21:29:11Z guido $ 11 */ 12 13#ifndef __IP_FIL_H__ 14#define __IP_FIL_H__ 15 16/* 17 * Pathnames for various IP Filter control devices. Used by LKM 18 * and userland, so defined here. 19 */ 20#define IPNAT_NAME "/dev/ipnat" 21#define IPSTATE_NAME "/dev/ipstate" 22#define IPAUTH_NAME "/dev/ipauth" 23 24#ifndef SOLARIS 25# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) 26#endif 27 28#if defined(KERNEL) && !defined(_KERNEL) 29# define _KERNEL 30#endif 31 32#ifndef __P 33# ifdef __STDC__ 34# define __P(x) x 35# else 36# define __P(x) () 37# endif 38#endif 39 40#if defined(__STDC__) || defined(__GNUC__) 41# define SIOCADAFR _IOW('r', 60, struct frentry) 42# define SIOCRMAFR _IOW('r', 61, struct frentry) 43# define SIOCSETFF _IOW('r', 62, u_int) 44# define SIOCGETFF _IOR('r', 63, u_int) 45# define SIOCGETFS _IOR('r', 64, struct friostat) 46# define SIOCIPFFL _IOWR('r', 65, int) 47# define SIOCIPFFB _IOR('r', 66, int) 48# define SIOCADIFR _IOW('r', 67, struct frentry) 49# define SIOCRMIFR _IOW('r', 68, struct frentry) 50# define SIOCSWAPA _IOR('r', 69, u_int) 51# define SIOCINAFR _IOW('r', 70, struct frentry) 52# define SIOCINIFR _IOW('r', 71, struct frentry) 53# define SIOCFRENB _IOW('r', 72, u_int) 54# define SIOCFRSYN _IOW('r', 73, u_int) 55# define SIOCFRZST _IOWR('r', 74, struct friostat) 56# define SIOCZRLST _IOWR('r', 75, struct frentry) 57# define SIOCAUTHW _IOWR('r', 76, struct fr_info) 58# define SIOCAUTHR _IOWR('r', 77, struct fr_info) 59# define SIOCATHST _IOWR('r', 78, struct fr_authstat) 60#else 61# define SIOCADAFR _IOW(r, 60, struct frentry) 62# define SIOCRMAFR _IOW(r, 61, struct frentry) 63# define SIOCSETFF _IOW(r, 62, u_int) 64# define SIOCGETFF _IOR(r, 63, u_int) 65# define SIOCGETFS _IOR(r, 64, struct friostat) 66# define SIOCIPFFL _IOWR(r, 65, int) 67# define SIOCIPFFB _IOR(r, 66, int) 68# define SIOCADIFR _IOW(r, 67, struct frentry) 69# define SIOCRMIFR _IOW(r, 68, struct frentry) 70# define SIOCSWAPA _IOR(r, 69, u_int) 71# define SIOCINAFR _IOW(r, 70, struct frentry) 72# define SIOCINIFR _IOW(r, 71, struct frentry) 73# define SIOCFRENB _IOW(r, 72, u_int) 74# define SIOCFRSYN _IOW(r, 73, u_int) 75# define SIOCFRZST _IOWR(r, 74, struct friostat) 76# define SIOCZRLST _IOWR(r, 75, struct frentry) 77# define SIOCAUTHW _IOWR(r, 76, struct fr_info) 78# define SIOCAUTHR _IOWR(r, 77, struct fr_info) 79# define SIOCATHST _IOWR(r, 78, struct fr_authstat) 80#endif 81#define SIOCADDFR SIOCADAFR 82#define SIOCDELFR SIOCRMAFR 83#define SIOCINSFR SIOCINAFR 84 85typedef struct fr_ip { 86 u_int fi_v:4; /* IP version */ 87 u_int fi_fl:4; /* packet flags */ 88 u_char fi_tos; /* IP packet TOS */ 89 u_char fi_ttl; /* IP packet TTL */ 90 u_char fi_p; /* IP packet protocol */ 91 struct in_addr fi_src; /* source address from packet */ 92 struct in_addr fi_dst; /* destination address from packet */ 93 u_32_t fi_optmsk; /* bitmask composed from IP options */ 94 u_short fi_secmsk; /* bitmask composed from IP security options */ 95 u_short fi_auth; /* authentication code from IP sec. options */ 96} fr_ip_t; 97 98#define FI_OPTIONS (FF_OPTIONS >> 24) 99#define FI_TCPUDP (FF_TCPUDP >> 24) /* TCP/UCP implied comparison*/ 100#define FI_FRAG (FF_FRAG >> 24) 101#define FI_SHORT (FF_SHORT >> 24) 102#define FI_CMP (FI_OPTIONS|FI_TCPUDP|FI_SHORT) 103 104/* 105 * These are both used by the state and NAT code to indicate that one port or 106 * the other should be treated as a wildcard. 107 */ 108#define FI_W_SPORT 0x00000100 109#define FI_W_DPORT 0x00000200 110#define FI_WILD (FI_W_SPORT|FI_W_DPORT) 111 112typedef struct fr_info { 113 void *fin_ifp; /* interface packet is `on' */ 114 struct fr_ip fin_fi; /* IP Packet summary */ 115 u_short fin_data[2]; /* TCP/UDP ports, ICMP code/type */ 116 u_char fin_out; /* in or out ? 1 == out, 0 == in */ 117 u_char fin_rev; /* state only: 1 = reverse */ 118 u_short fin_hlen; /* length of IP header in bytes */ 119 u_char fin_tcpf; /* TCP header flags (SYN, ACK, etc) */ 120 /* From here on is packet specific */ 121 u_char fin_icode; /* ICMP error to return */ 122 u_short fin_rule; /* rule # last matched */ 123 u_short fin_group; /* group number, -1 for none */ 124 struct frentry *fin_fr; /* last matching rule */ 125 char *fin_dp; /* start of data past IP header */ 126 u_short fin_dlen; /* length of data portion of packet */ 127 u_short fin_id; /* IP packet id field */ 128 void *fin_mp; /* pointer to pointer to mbuf */ 129#if SOLARIS && defined(_KERNEL) 130 void *fin_qfm; /* pointer to mblk where pkt starts */ 131 void *fin_qif; 132#endif 133} fr_info_t; 134 135/* 136 * Size for compares on fr_info structures 137 */ 138#define FI_CSIZE offsetof(fr_info_t, fin_icode) 139 140/* 141 * Size for copying cache fr_info structure 142 */ 143#define FI_COPYSIZE offsetof(fr_info_t, fin_dp) 144 145typedef struct frdest { 146 void *fd_ifp; 147 struct in_addr fd_ip; 148 char fd_ifname[IFNAMSIZ]; 149} frdest_t; 150 151typedef struct frentry { 152 struct frentry *fr_next; 153 u_short fr_group; /* group to which this rule belongs */ 154 u_short fr_grhead; /* group # which this rule starts */ 155 struct frentry *fr_grp; 156 int fr_ref; /* reference count - for grouping */ 157 void *fr_ifa; 158#if BSD >= 199306 159 void *fr_oifa; 160#endif 161 /* 162 * These are only incremented when a packet matches this rule and 163 * it is the last match 164 */ 165 U_QUAD_T fr_hits; 166 U_QUAD_T fr_bytes; 167 /* 168 * Fields after this may not change whilst in the kernel. 169 */ 170 struct fr_ip fr_ip; 171 struct fr_ip fr_mip; /* mask structure */ 172 173 u_char fr_tcpfm; /* tcp flags mask */ 174 u_char fr_tcpf; /* tcp flags */ 175 176 u_short fr_icmpm; /* data for ICMP packets (mask) */ 177 u_short fr_icmp; 178 179 u_char fr_scmp; /* data for port comparisons */ 180 u_char fr_dcmp; 181 u_short fr_dport; 182 u_short fr_sport; 183 u_short fr_stop; /* top port for <> and >< */ 184 u_short fr_dtop; /* top port for <> and >< */ 185 u_32_t fr_flags; /* per-rule flags && options (see below) */ 186 u_short fr_skip; /* # of rules to skip */ 187 u_short fr_loglevel; /* syslog log facility + priority */ 188 int (*fr_func) __P((int, ip_t *, fr_info_t *)); /* call this function */ 189 char fr_icode; /* return ICMP code */ 190 char fr_ifname[IFNAMSIZ]; 191#if BSD >= 199306 192 char fr_oifname[IFNAMSIZ]; 193#endif 194 struct frdest fr_tif; /* "to" interface */ 195 struct frdest fr_dif; /* duplicate packet interfaces */ 196} frentry_t; 197 198#define fr_proto fr_ip.fi_p 199#define fr_ttl fr_ip.fi_ttl 200#define fr_tos fr_ip.fi_tos 201#define fr_dst fr_ip.fi_dst 202#define fr_src fr_ip.fi_src 203#define fr_dmsk fr_mip.fi_dst 204#define fr_smsk fr_mip.fi_src 205 206#ifndef offsetof 207#define offsetof(t,m) (int)((&((t *)0L)->m)) 208#endif 209#define FR_CMPSIZ (sizeof(struct frentry) - offsetof(frentry_t, fr_ip)) 210 211/* 212 * fr_flags 213 */ 214#define FR_BLOCK 0x00001 /* do not allow packet to pass */ 215#define FR_PASS 0x00002 /* allow packet to pass */ 216#define FR_OUTQUE 0x00004 /* outgoing packets */ 217#define FR_INQUE 0x00008 /* ingoing packets */ 218#define FR_LOG 0x00010 /* Log */ 219#define FR_LOGB 0x00011 /* Log-fail */ 220#define FR_LOGP 0x00012 /* Log-pass */ 221#define FR_LOGBODY 0x00020 /* Log the body */ 222#define FR_LOGFIRST 0x00040 /* Log the first byte if state held */ 223#define FR_RETRST 0x00080 /* Return TCP RST packet - reset connection */ 224#define FR_RETICMP 0x00100 /* Return ICMP unreachable packet */ 225#define FR_FAKEICMP 0x00180 /* Return ICMP unreachable with fake source */ 226#define FR_NOMATCH 0x00200 /* no match occured */ 227#define FR_ACCOUNT 0x00400 /* count packet bytes */ 228#define FR_KEEPFRAG 0x00800 /* keep fragment information */ 229#define FR_KEEPSTATE 0x01000 /* keep `connection' state information */ 230#define FR_INACTIVE 0x02000 231#define FR_QUICK 0x04000 /* match & stop processing list */ 232#define FR_FASTROUTE 0x08000 /* bypass normal routing */ 233#define FR_CALLNOW 0x10000 /* call another function (fr_func) if matches */ 234#define FR_DUP 0x20000 /* duplicate packet */ 235#define FR_LOGORBLOCK 0x40000 /* block the packet if it can't be logged */ 236#define FR_NOTSRCIP 0x80000 /* not the src IP# */ 237#define FR_NOTDSTIP 0x100000 /* not the dst IP# */ 238#define FR_AUTH 0x200000 /* use authentication */ 239#define FR_PREAUTH 0x400000 /* require preauthentication */ 240#define FR_DONTCACHE 0x800000 /* don't cache the result */ 241 242#define FR_LOGMASK (FR_LOG|FR_LOGP|FR_LOGB) 243#define FR_RETMASK (FR_RETICMP|FR_RETRST|FR_FAKEICMP) 244 245/* 246 * These correspond to #define's for FI_* and are stored in fr_flags 247 */ 248#define FF_OPTIONS 0x01000000 249#define FF_TCPUDP 0x02000000 250#define FF_FRAG 0x04000000 251#define FF_SHORT 0x08000000 252/* 253 * recognized flags for SIOCGETFF and SIOCSETFF, and get put in fr_flags 254 */ 255#define FF_LOGPASS 0x10000000 256#define FF_LOGBLOCK 0x20000000 257#define FF_LOGNOMATCH 0x40000000 258#define FF_LOGGING (FF_LOGPASS|FF_LOGBLOCK|FF_LOGNOMATCH) 259#define FF_BLOCKNONIP 0x80000000 /* Solaris2 Only */ 260 261#define FR_NONE 0 262#define FR_EQUAL 1 263#define FR_NEQUAL 2 264#define FR_LESST 3 265#define FR_GREATERT 4 266#define FR_LESSTE 5 267#define FR_GREATERTE 6 268#define FR_OUTRANGE 7 269#define FR_INRANGE 8 270 271typedef struct filterstats { 272 u_long fr_pass; /* packets allowed */ 273 u_long fr_block; /* packets denied */ 274 u_long fr_nom; /* packets which don't match any rule */ 275 u_long fr_short; /* packets which are short */ 276 u_long fr_ppkl; /* packets allowed and logged */ 277 u_long fr_bpkl; /* packets denied and logged */ 278 u_long fr_npkl; /* packets unmatched and logged */ 279 u_long fr_pkl; /* packets logged */ 280 u_long fr_skip; /* packets to be logged but buffer full */ 281 u_long fr_ret; /* packets for which a return is sent */ 282 u_long fr_acct; /* packets for which counting was performed */ 283 u_long fr_bnfr; /* bad attempts to allocate fragment state */ 284 u_long fr_nfr; /* new fragment state kept */ 285 u_long fr_cfr; /* add new fragment state but complete pkt */ 286 u_long fr_bads; /* bad attempts to allocate packet state */ 287 u_long fr_ads; /* new packet state kept */ 288 u_long fr_chit; /* cached hit */ 289 u_long fr_tcpbad; /* TCP checksum check failures */ 290 u_long fr_pull[2]; /* good and bad pullup attempts */ 291#if SOLARIS 292 u_long fr_notdata; /* PROTO/PCPROTO that have no data */ 293 u_long fr_nodata; /* mblks that have no data */ 294 u_long fr_bad; /* bad IP packets to the filter */ 295 u_long fr_notip; /* packets passed through no on ip queue */ 296 u_long fr_drop; /* packets dropped - no info for them! */ 297#endif 298} filterstats_t; 299 300/* 301 * For SIOCGETFS 302 */ 303typedef struct friostat { 304 struct filterstats f_st[2]; 305 struct frentry *f_fin[2]; 306 struct frentry *f_fout[2]; 307 struct frentry *f_acctin[2]; 308 struct frentry *f_acctout[2]; 309 struct frentry *f_auth; 310 struct frgroup *f_groups[3][2]; 311 u_long f_froute[2]; 312 int f_defpass; /* default pass - from fr_pass */ 313 char f_active; /* 1 or 0 - active rule set */ 314 char f_running; /* 1 if running, else 0 */ 315 char f_logging; /* 1 if enabled, else 0 */ 316#if !SOLARIS && defined(sun) 317 char f_version[25]; /* version string */ 318#else 319 char f_version[32]; /* version string */ 320#endif 321} friostat_t; 322 323typedef struct optlist { 324 u_short ol_val; 325 int ol_bit; 326} optlist_t; 327 328 329/* 330 * Group list structure. 331 */ 332typedef struct frgroup { 333 u_short fg_num; 334 struct frgroup *fg_next; 335 struct frentry *fg_head; 336 struct frentry **fg_start; 337} frgroup_t; 338 339 340/* 341 * Log structure. Each packet header logged is prepended by one of these. 342 * Following this in the log records read from the device will be an ipflog 343 * structure which is then followed by any packet data. 344 */ 345typedef struct iplog { 346 u_32_t ipl_magic; 347 u_int ipl_count; 348 u_long ipl_sec; 349 u_long ipl_usec; 350 size_t ipl_dsize; 351 struct iplog *ipl_next; 352} iplog_t; 353 354#define IPL_MAGIC 0x49504c4d /* 'IPLM' */ 355 356typedef struct ipflog { 357#if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \ 358 (defined(OpenBSD) && (OpenBSD >= 199603)) 359 u_char fl_ifname[IFNAMSIZ]; 360#else 361 u_int fl_unit; 362 u_char fl_ifname[4]; 363#endif 364 u_char fl_plen; /* extra data after hlen */ 365 u_char fl_hlen; /* length of IP headers saved */ 366 u_short fl_rule; /* assume never more than 64k rules, total */ 367 u_short fl_group; 368 u_short fl_loglevel; /* syslog log level */ 369 u_32_t fl_flags; 370 u_32_t fl_lflags; 371} ipflog_t; 372 373 374#ifndef ICMP_UNREACH_FILTER 375# define ICMP_UNREACH_FILTER 13 376#endif 377 378#ifndef IPF_LOGGING 379# define IPF_LOGGING 0 380#endif 381#ifndef IPF_DEFAULT_PASS 382# define IPF_DEFAULT_PASS FR_PASS 383#endif 384 385#define IPMINLEN(i, h) ((i)->ip_len >= ((i)->ip_hl * 4 + sizeof(struct h))) 386#define IPLLOGSIZE 8192 387 388/* 389 * Device filenames for reading log information. Use ipf on Solaris2 because 390 * ipl is already a name used by something else. 391 */ 392#ifndef IPL_NAME 393# if SOLARIS 394# define IPL_NAME "/dev/ipf" 395# else 396# define IPL_NAME "/dev/ipl" 397# endif 398#endif 399#define IPL_NAT IPNAT_NAME 400#define IPL_STATE IPSTATE_NAME 401#define IPL_AUTH IPAUTH_NAME 402 403#define IPL_LOGIPF 0 /* Minor device #'s for accessing logs */ 404#define IPL_LOGNAT 1 405#define IPL_LOGSTATE 2 406#define IPL_LOGAUTH 3 407#define IPL_LOGMAX 3 408 409#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version) && \ 410 (__FreeBSD_version >= 220000) 411# define CDEV_MAJOR 79 412#endif 413 414/* 415 * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns 416 * on those hooks. We don't need any special mods in non-IP Filter code 417 * with this! 418 */ 419#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ 420 (defined(NetBSD1_2) && NetBSD1_2 > 1) 421# if (NetBSD >= 199905) 422# define PFIL_HOOKS 423# endif 424# ifdef PFIL_HOOKS 425# define NETBSD_PF 426# endif 427#endif 428 429 430#ifndef _KERNEL 431struct ifnet; 432extern int fr_check __P((ip_t *, int, void *, int, mb_t **)); 433extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **)); 434extern int send_reset __P((ip_t *, struct ifnet *)); 435extern int icmp_error __P((ip_t *, struct ifnet *)); 436extern int ipf_log __P((void)); 437extern int ipfr_fastroute __P((ip_t *, fr_info_t *, frdest_t *)); 438extern struct ifnet *get_unit __P((char *)); 439# if defined(__NetBSD__) || defined(__OpenBSD__) || \ 440 (_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000) 441extern int iplioctl __P((dev_t, u_long, caddr_t, int)); 442# else 443extern int iplioctl __P((dev_t, int, caddr_t, int)); 444# endif 445extern int iplopen __P((dev_t, int)); 446extern int iplclose __P((dev_t, int)); 447#else /* #ifndef _KERNEL */ 448# if defined(__NetBSD__) && defined(PFIL_HOOKS) 449extern void ipfilterattach __P((int)); 450# endif 451extern int iplattach __P((void)); 452extern int ipl_enable __P((void)); 453extern int ipl_disable __P((void)); 454extern void ipflog_init __P((void)); 455extern int ipflog_clear __P((minor_t)); 456extern int ipflog_read __P((minor_t, struct uio *)); 457extern int ipflog __P((u_int, ip_t *, fr_info_t *, mb_t *)); 458extern int ipllog __P((int, fr_info_t *, void **, size_t *, int *, int)); 459# if SOLARIS 460extern int fr_check __P((ip_t *, int, void *, int, qif_t *, mb_t **)); 461extern int (*fr_checkp) __P((ip_t *, int, void *, 462 int, qif_t *, mb_t **)); 463extern int icmp_error __P((ip_t *, int, int, qif_t *, struct in_addr)); 464# if SOLARIS2 >= 7 465extern int iplioctl __P((dev_t, int, intptr_t, int, cred_t *, int *)); 466# else 467extern int iplioctl __P((dev_t, int, int *, int, cred_t *, int *)); 468# endif 469extern int iplopen __P((dev_t *, int, int, cred_t *)); 470extern int iplclose __P((dev_t, int, int, cred_t *)); 471extern int ipfsync __P((void)); 472extern int send_reset __P((fr_info_t *, ip_t *, qif_t *)); 473extern int ipfr_fastroute __P((qif_t *, ip_t *, mblk_t *, mblk_t **, 474 fr_info_t *, frdest_t *)); 475extern void copyin_mblk __P((mblk_t *, size_t, size_t, char *)); 476extern void copyout_mblk __P((mblk_t *, size_t, size_t, char *)); 477extern int fr_qin __P((queue_t *, mblk_t *)); 478extern int fr_qout __P((queue_t *, mblk_t *)); 479# ifdef IPFILTER_LOG 480extern int iplread __P((dev_t, struct uio *, cred_t *)); 481# endif 482# else /* SOLARIS */ 483extern int fr_check __P((ip_t *, int, void *, int, mb_t **)); 484extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **)); 485# ifdef linux 486extern int send_reset __P((tcpiphdr_t *, struct ifnet *)); 487# else 488extern int send_reset __P((fr_info_t *, struct ip *)); 489extern int send_icmp_err __P((ip_t *, int, int, void *, struct in_addr)); 490# endif 491extern int ipfr_fastroute __P((mb_t *, fr_info_t *, frdest_t *)); 492extern size_t mbufchainlen __P((mb_t *)); 493# ifdef __sgi 494# include <sys/cred.h> 495extern int iplioctl __P((dev_t, int, caddr_t, int, cred_t *, int *)); 496extern int iplopen __P((dev_t *, int, int, cred_t *)); 497extern int iplclose __P((dev_t, int, int, cred_t *)); 498extern int iplread __P((dev_t, struct uio *, cred_t *)); 499extern int ipfsync __P((void)); 500extern int ipfilter_sgi_attach __P((void)); 501extern void ipfilter_sgi_detach __P((void)); 502extern void ipfilter_sgi_intfsync __P((void)); 503# else 504# ifdef IPFILTER_LKM 505extern int iplidentify __P((char *)); 506# endif 507# if (_BSDI_VERSION >= 199510) || (__FreeBSD_version >= 220000) || \ 508 (NetBSD >= 199511) || defined(__OpenBSD__) 509# if defined(__NetBSD__) || (_BSDI_VERSION >= 199701) || \ 510 defined(__OpenBSD__) || (__FreeBSD_version >= 300000) 511extern int iplioctl __P((dev_t, u_long, caddr_t, int, struct proc *)); 512# else 513extern int iplioctl __P((dev_t, int, caddr_t, int, struct proc *)); 514# endif 515extern int iplopen __P((dev_t, int, int, struct proc *)); 516extern int iplclose __P((dev_t, int, int, struct proc *)); 517# else 518# ifndef linux 519extern int iplopen __P((dev_t, int)); 520extern int iplclose __P((dev_t, int)); 521extern int iplioctl __P((dev_t, int, caddr_t, int)); 522# else 523extern int iplioctl(struct inode *, struct file *, u_int, u_long); 524extern int iplopen __P((struct inode *, struct file *)); 525extern void iplclose __P((struct inode *, struct file *)); 526# endif /* !linux */ 527# endif /* (_BSDI_VERSION >= 199510) */ 528# if BSD >= 199306 529extern int iplread __P((dev_t, struct uio *, int)); 530# else 531# ifndef linux 532extern int iplread __P((dev_t, struct uio *)); 533# else 534extern int iplread(struct inode *, struct file *, char *, int); 535# endif /* !linux */ 536# endif /* BSD >= 199306 */ 537# endif /* __ sgi */ 538# endif /* SOLARIS */ 539#endif /* #ifndef _KERNEL */ 540 541extern void fixskip __P((frentry_t **, frentry_t *, int)); 542extern int countbits __P((u_32_t)); 543extern int ipldetach __P((void)); 544extern u_short fr_tcpsum __P((mb_t *, ip_t *, tcphdr_t *)); 545extern int fr_scanlist __P((u_32_t, ip_t *, fr_info_t *, void *)); 546extern u_short ipf_cksum __P((u_short *, int)); 547extern int fr_copytolog __P((int, char *, int)); 548extern void fr_forgetifp __P((void *)); 549extern int frflush __P((minor_t, int)); 550extern void frsync __P((void)); 551extern frgroup_t *fr_addgroup __P((u_int, frentry_t *, minor_t, int)); 552extern frgroup_t *fr_findgroup __P((u_int, u_32_t, minor_t, int, frgroup_t ***)); 553extern void fr_delgroup __P((u_int, u_32_t, minor_t, int)); 554extern void fr_makefrip __P((int, ip_t *, fr_info_t *)); 555extern int fr_ifpaddr __P((void *, struct in_addr *)); 556extern char *memstr __P((char *, char *, int, int)); 557extern int ipl_unreach; 558extern int fr_running; 559extern u_long ipl_frouteok[2]; 560extern int fr_pass; 561extern int fr_flags; 562extern int fr_active; 563extern fr_info_t frcache[2]; 564extern char ipfilter_version[]; 565#ifdef IPFILTER_LOG 566extern iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1]; 567extern size_t iplused[IPL_LOGMAX + 1]; 568#endif 569extern struct frentry *ipfilter[2][2], *ipacct[2][2]; 570extern struct frgroup *ipfgroups[3][2]; 571extern struct filterstats frstats[]; 572 573#endif /* __IP_FIL_H__ */ 574