2000-06-12 14:28:20 +04:00
|
|
|
/* $NetBSD: ip_fil.h,v 1.37 2000/06/12 10:28:21 veego Exp $ */
|
1997-01-06 00:32:18 +03:00
|
|
|
|
1997-01-05 16:47:59 +03:00
|
|
|
/*
|
2000-05-03 15:12:03 +04:00
|
|
|
* Copyright (C) 1993-2000 by Darren Reed.
|
1997-01-05 16:47:59 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms are permitted
|
|
|
|
* provided that this notice is preserved and due credit is given
|
|
|
|
* to the original author and the contributors.
|
|
|
|
*
|
|
|
|
* @(#)ip_fil.h 1.35 6/5/96
|
2000-06-12 14:28:20 +04:00
|
|
|
* Id: ip_fil.h,v 2.29.2.3 2000/06/05 13:12:42 darrenr Exp
|
1997-01-05 16:47:59 +03:00
|
|
|
*/
|
|
|
|
|
1998-02-10 04:26:19 +03:00
|
|
|
#ifndef _NETINET_IP_FIL_H_
|
|
|
|
#define _NETINET_IP_FIL_H_
|
1997-01-05 16:47:59 +03:00
|
|
|
|
1997-03-29 22:50:51 +03:00
|
|
|
/*
|
|
|
|
* Pathnames for various IP Filter control devices. Used by LKM
|
|
|
|
* and userland, so defined here.
|
|
|
|
*/
|
|
|
|
#define IPNAT_NAME "/dev/ipnat"
|
|
|
|
#define IPSTATE_NAME "/dev/ipstate"
|
1997-09-21 22:00:54 +04:00
|
|
|
#define IPAUTH_NAME "/dev/ipauth"
|
1997-03-29 22:50:51 +03:00
|
|
|
|
1997-09-21 22:00:54 +04:00
|
|
|
#ifndef SOLARIS
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
|
|
|
|
1999-12-12 14:11:15 +03:00
|
|
|
#if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL)
|
|
|
|
# define _KERNEL
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
1997-03-29 03:54:55 +03:00
|
|
|
|
|
|
|
#ifndef __P
|
|
|
|
# ifdef __STDC__
|
|
|
|
# define __P(x) x
|
|
|
|
# else
|
|
|
|
# define __P(x) ()
|
1997-01-05 16:47:59 +03:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__STDC__) || defined(__GNUC__)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCADAFR _IOW('r', 60, struct frentry *)
|
|
|
|
# define SIOCRMAFR _IOW('r', 61, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCSETFF _IOW('r', 62, u_int)
|
|
|
|
# define SIOCGETFF _IOR('r', 63, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCGETFS _IOWR('r', 64, struct friostat *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCIPFFL _IOWR('r', 65, int)
|
|
|
|
# define SIOCIPFFB _IOR('r', 66, int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCADIFR _IOW('r', 67, struct frentry *)
|
|
|
|
# define SIOCRMIFR _IOW('r', 68, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCSWAPA _IOR('r', 69, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCINAFR _IOW('r', 70, struct frentry *)
|
|
|
|
# define SIOCINIFR _IOW('r', 71, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCFRENB _IOW('r', 72, u_int)
|
|
|
|
# define SIOCFRSYN _IOW('r', 73, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCFRZST _IOWR('r', 74, struct friostat *)
|
|
|
|
# define SIOCZRLST _IOWR('r', 75, struct frentry *)
|
|
|
|
# define SIOCAUTHW _IOWR('r', 76, struct fr_info *)
|
|
|
|
# define SIOCAUTHR _IOWR('r', 77, struct fr_info *)
|
|
|
|
# define SIOCATHST _IOWR('r', 78, struct fr_authstat *)
|
|
|
|
# define SIOCSTLCK _IOWR('r', 79, u_int)
|
|
|
|
# define SIOCSTPUT _IOWR('r', 80, struct ipstate_save *)
|
|
|
|
# define SIOCSTGET _IOWR('r', 81, struct ipstate_save *)
|
|
|
|
# define SIOCSTGSZ _IOWR('r', 82, struct natget *)
|
|
|
|
# define SIOCGFRST _IOWR('r', 83, struct ipfrstat *)
|
1997-01-05 16:47:59 +03:00
|
|
|
#else
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCADAFR _IOW(r, 60, struct frentry *)
|
|
|
|
# define SIOCRMAFR _IOW(r, 61, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCSETFF _IOW(r, 62, u_int)
|
|
|
|
# define SIOCGETFF _IOR(r, 63, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCGETFS _IOWR(r, 64, struct friostat *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCIPFFL _IOWR(r, 65, int)
|
|
|
|
# define SIOCIPFFB _IOR(r, 66, int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCADIFR _IOW(r, 67, struct frentry *)
|
|
|
|
# define SIOCRMIFR _IOW(r, 68, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCSWAPA _IOR(r, 69, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCINAFR _IOW(r, 70, struct frentry *)
|
|
|
|
# define SIOCINIFR _IOW(r, 71, struct frentry *)
|
1999-12-12 14:11:15 +03:00
|
|
|
# define SIOCFRENB _IOW(r, 72, u_int)
|
|
|
|
# define SIOCFRSYN _IOW(r, 73, u_int)
|
2000-05-03 15:12:03 +04:00
|
|
|
# define SIOCFRZST _IOWR(r, 74, struct friostat *)
|
|
|
|
# define SIOCZRLST _IOWR(r, 75, struct frentry *)
|
|
|
|
# define SIOCAUTHW _IOWR(r, 76, struct fr_info *)
|
|
|
|
# define SIOCAUTHR _IOWR(r, 77, struct fr_info *)
|
|
|
|
# define SIOCATHST _IOWR(r, 78, struct fr_authstat *)
|
|
|
|
# define SIOCSTLCK _IOWR(r, 79, u_int)
|
|
|
|
# define SIOCSTPUT _IOWR(r, 80, struct ipstate_save *)
|
|
|
|
# define SIOCSTGET _IOWR(r, 81, struct ipstate_save *)
|
|
|
|
# define SIOCSTGSZ _IOWR(r, 82, struct natget *)
|
|
|
|
# define SIOCGFRST _IOWR(r, 83, struct ipfrstat *)
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
|
|
|
#define SIOCADDFR SIOCADAFR
|
|
|
|
#define SIOCDELFR SIOCRMAFR
|
|
|
|
#define SIOCINSFR SIOCINAFR
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
|
1997-01-05 16:47:59 +03:00
|
|
|
typedef struct fr_ip {
|
2000-05-03 15:12:03 +04:00
|
|
|
u_32_t fi_v:4; /* IP version */
|
|
|
|
u_32_t fi_fl:4; /* packet flags */
|
|
|
|
u_32_t fi_tos:8; /* IP packet TOS */
|
|
|
|
u_32_t fi_ttl:8; /* IP packet TTL */
|
|
|
|
u_32_t fi_p:8; /* IP packet protocol */
|
|
|
|
union i6addr fi_src; /* source address from packet */
|
|
|
|
union i6addr fi_dst; /* destination address from packet */
|
1997-07-05 09:38:14 +04:00
|
|
|
u_32_t fi_optmsk; /* bitmask composed from IP options */
|
1997-01-05 16:47:59 +03:00
|
|
|
u_short fi_secmsk; /* bitmask composed from IP security options */
|
1998-11-22 18:17:18 +03:00
|
|
|
u_short fi_auth; /* authentication code from IP sec. options */
|
1997-01-05 16:47:59 +03:00
|
|
|
} fr_ip_t;
|
|
|
|
|
1998-05-17 20:50:15 +04:00
|
|
|
#define FI_OPTIONS (FF_OPTIONS >> 24)
|
|
|
|
#define FI_TCPUDP (FF_TCPUDP >> 24) /* TCP/UCP implied comparison*/
|
|
|
|
#define FI_FRAG (FF_FRAG >> 24)
|
|
|
|
#define FI_SHORT (FF_SHORT >> 24)
|
1999-12-12 14:11:15 +03:00
|
|
|
#define FI_CMP (FI_OPTIONS|FI_TCPUDP|FI_SHORT)
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
#define fi_saddr fi_src.in4.s_addr
|
|
|
|
#define fi_daddr fi_dst.in4.s_addr
|
|
|
|
|
|
|
|
|
1999-12-12 14:11:15 +03:00
|
|
|
/*
|
|
|
|
* These are both used by the state and NAT code to indicate that one port or
|
|
|
|
* the other should be treated as a wildcard.
|
|
|
|
*/
|
|
|
|
#define FI_W_SPORT 0x00000100
|
|
|
|
#define FI_W_DPORT 0x00000200
|
2000-05-03 15:12:03 +04:00
|
|
|
#define FI_WILDP (FI_W_SPORT|FI_W_DPORT)
|
|
|
|
#define FI_W_SADDR 0x00000400
|
|
|
|
#define FI_W_DADDR 0x00000800
|
|
|
|
#define FI_WILDA (FI_W_SADDR|FI_W_DADDR)
|
|
|
|
#define FI_NEWFR 0x00001000
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
typedef struct fr_info {
|
1999-12-12 14:11:15 +03:00
|
|
|
void *fin_ifp; /* interface packet is `on' */
|
1998-11-22 18:17:18 +03:00
|
|
|
struct fr_ip fin_fi; /* IP Packet summary */
|
|
|
|
u_short fin_data[2]; /* TCP/UDP ports, ICMP code/type */
|
1999-12-12 14:11:15 +03:00
|
|
|
u_char fin_out; /* in or out ? 1 == out, 0 == in */
|
|
|
|
u_char fin_rev; /* state only: 1 = reverse */
|
1998-11-22 18:17:18 +03:00
|
|
|
u_short fin_hlen; /* length of IP header in bytes */
|
|
|
|
u_char fin_tcpf; /* TCP header flags (SYN, ACK, etc) */
|
|
|
|
/* From here on is packet specific */
|
|
|
|
u_char fin_icode; /* ICMP error to return */
|
|
|
|
u_short fin_rule; /* rule # last matched */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_32_t fin_group; /* group number, -1 for none */
|
1998-11-22 18:17:18 +03:00
|
|
|
struct frentry *fin_fr; /* last matching rule */
|
1997-09-21 22:00:54 +04:00
|
|
|
char *fin_dp; /* start of data past IP header */
|
1999-12-12 14:11:15 +03:00
|
|
|
u_short fin_dlen; /* length of data portion of packet */
|
|
|
|
u_short fin_id; /* IP packet id field */
|
1998-11-22 18:17:18 +03:00
|
|
|
void *fin_mp; /* pointer to pointer to mbuf */
|
2000-05-03 15:12:03 +04:00
|
|
|
#if SOLARIS
|
1998-11-22 18:17:18 +03:00
|
|
|
void *fin_qfm; /* pointer to mblk where pkt starts */
|
1999-12-12 14:11:15 +03:00
|
|
|
void *fin_qif;
|
1998-07-12 19:23:59 +04:00
|
|
|
#endif
|
2000-05-03 15:12:03 +04:00
|
|
|
u_short fin_plen;
|
|
|
|
u_short fin_off;
|
1997-01-05 16:47:59 +03:00
|
|
|
} fr_info_t;
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
#define fin_v fin_fi.fi_v
|
|
|
|
|
1997-09-21 22:00:54 +04:00
|
|
|
/*
|
|
|
|
* Size for compares on fr_info structures
|
|
|
|
*/
|
1998-11-22 18:17:18 +03:00
|
|
|
#define FI_CSIZE offsetof(fr_info_t, fin_icode)
|
|
|
|
|
1997-09-21 22:00:54 +04:00
|
|
|
/*
|
|
|
|
* Size for copying cache fr_info structure
|
|
|
|
*/
|
1998-11-22 18:17:18 +03:00
|
|
|
#define FI_COPYSIZE offsetof(fr_info_t, fin_dp)
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
typedef struct frdest {
|
|
|
|
void *fd_ifp;
|
|
|
|
struct in_addr fd_ip;
|
|
|
|
char fd_ifname[IFNAMSIZ];
|
|
|
|
} frdest_t;
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
typedef struct frpcmp {
|
|
|
|
int frp_cmp; /* data for port comparisons */
|
|
|
|
u_short frp_port; /* top port for <> and >< */
|
|
|
|
u_short frp_top; /* top port for <> and >< */
|
|
|
|
} frpcmp_t;
|
|
|
|
|
|
|
|
typedef struct frtuc {
|
|
|
|
u_char ftu_tcpfm; /* tcp flags mask */
|
|
|
|
u_char ftu_tcpf; /* tcp flags */
|
|
|
|
frpcmp_t ftu_src;
|
|
|
|
frpcmp_t ftu_dst;
|
|
|
|
} frtuc_t;
|
|
|
|
|
|
|
|
#define ftu_scmp ftu_src.frp_cmp
|
|
|
|
#define ftu_dcmp ftu_dst.frp_cmp
|
|
|
|
#define ftu_sport ftu_src.frp_port
|
|
|
|
#define ftu_dport ftu_dst.frp_port
|
|
|
|
#define ftu_stop ftu_src.frp_top
|
|
|
|
#define ftu_dtop ftu_dst.frp_top
|
|
|
|
|
1997-01-05 16:47:59 +03:00
|
|
|
typedef struct frentry {
|
|
|
|
struct frentry *fr_next;
|
2000-05-03 15:12:03 +04:00
|
|
|
u_32_t fr_group; /* group to which this rule belongs */
|
|
|
|
u_32_t fr_grhead; /* group # which this rule starts */
|
1997-09-21 22:00:54 +04:00
|
|
|
struct frentry *fr_grp;
|
|
|
|
int fr_ref; /* reference count - for grouping */
|
|
|
|
void *fr_ifa;
|
1999-12-12 14:11:15 +03:00
|
|
|
#if BSD >= 199306
|
|
|
|
void *fr_oifa;
|
|
|
|
#endif
|
1997-05-25 16:40:11 +04:00
|
|
|
/*
|
1997-09-21 22:00:54 +04:00
|
|
|
* These are only incremented when a packet matches this rule and
|
1997-05-25 16:40:11 +04:00
|
|
|
* it is the last match
|
|
|
|
*/
|
|
|
|
U_QUAD_T fr_hits;
|
|
|
|
U_QUAD_T fr_bytes;
|
1997-01-05 16:47:59 +03:00
|
|
|
/*
|
|
|
|
* Fields after this may not change whilst in the kernel.
|
|
|
|
*/
|
|
|
|
struct fr_ip fr_ip;
|
|
|
|
struct fr_ip fr_mip; /* mask structure */
|
|
|
|
|
|
|
|
|
|
|
|
u_short fr_icmpm; /* data for ICMP packets (mask) */
|
|
|
|
u_short fr_icmp;
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
frtuc_t fr_tuc;
|
1997-07-05 09:38:14 +04:00
|
|
|
u_32_t fr_flags; /* per-rule flags && options (see below) */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_int fr_skip; /* # of rules to skip */
|
|
|
|
u_int fr_loglevel; /* syslog log facility + priority */
|
1997-11-14 15:40:06 +03:00
|
|
|
int (*fr_func) __P((int, ip_t *, fr_info_t *)); /* call this function */
|
2000-05-03 15:12:03 +04:00
|
|
|
int fr_sap; /* For solaris only */
|
|
|
|
u_char fr_icode; /* return ICMP code */
|
1997-01-05 16:47:59 +03:00
|
|
|
char fr_ifname[IFNAMSIZ];
|
1999-12-12 14:11:15 +03:00
|
|
|
#if BSD >= 199306
|
|
|
|
char fr_oifname[IFNAMSIZ];
|
|
|
|
#endif
|
1997-01-05 16:47:59 +03:00
|
|
|
struct frdest fr_tif; /* "to" interface */
|
|
|
|
struct frdest fr_dif; /* duplicate packet interfaces */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_int fr_cksum; /* checksum on filter rules for performance */
|
1997-01-05 16:47:59 +03:00
|
|
|
} frentry_t;
|
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
#define fr_v fr_ip.fi_v
|
1997-01-05 16:47:59 +03:00
|
|
|
#define fr_proto fr_ip.fi_p
|
|
|
|
#define fr_ttl fr_ip.fi_ttl
|
|
|
|
#define fr_tos fr_ip.fi_tos
|
2000-05-03 15:12:03 +04:00
|
|
|
#define fr_tcpfm fr_tuc.ftu_tcpfm
|
|
|
|
#define fr_tcpf fr_tuc.ftu_tcpf
|
|
|
|
#define fr_scmp fr_tuc.ftu_scmp
|
|
|
|
#define fr_dcmp fr_tuc.ftu_dcmp
|
|
|
|
#define fr_dport fr_tuc.ftu_dport
|
|
|
|
#define fr_sport fr_tuc.ftu_sport
|
|
|
|
#define fr_stop fr_tuc.ftu_stop
|
|
|
|
#define fr_dtop fr_tuc.ftu_dtop
|
|
|
|
#define fr_dst fr_ip.fi_dst.in4
|
|
|
|
#define fr_src fr_ip.fi_src.in4
|
|
|
|
#define fr_dmsk fr_mip.fi_dst.in4
|
|
|
|
#define fr_smsk fr_mip.fi_src.in4
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
#ifndef offsetof
|
|
|
|
#define offsetof(t,m) (int)((&((t *)0L)->m))
|
|
|
|
#endif
|
|
|
|
#define FR_CMPSIZ (sizeof(struct frentry) - offsetof(frentry_t, fr_ip))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* fr_flags
|
1997-03-29 03:54:55 +03:00
|
|
|
*/
|
1997-09-21 22:00:54 +04:00
|
|
|
#define FR_BLOCK 0x00001 /* do not allow packet to pass */
|
|
|
|
#define FR_PASS 0x00002 /* allow packet to pass */
|
|
|
|
#define FR_OUTQUE 0x00004 /* outgoing packets */
|
|
|
|
#define FR_INQUE 0x00008 /* ingoing packets */
|
1997-01-05 16:47:59 +03:00
|
|
|
#define FR_LOG 0x00010 /* Log */
|
|
|
|
#define FR_LOGB 0x00011 /* Log-fail */
|
|
|
|
#define FR_LOGP 0x00012 /* Log-pass */
|
|
|
|
#define FR_LOGBODY 0x00020 /* Log the body */
|
|
|
|
#define FR_LOGFIRST 0x00040 /* Log the first byte if state held */
|
|
|
|
#define FR_RETRST 0x00080 /* Return TCP RST packet - reset connection */
|
|
|
|
#define FR_RETICMP 0x00100 /* Return ICMP unreachable packet */
|
1999-12-12 14:11:15 +03:00
|
|
|
#define FR_FAKEICMP 0x00180 /* Return ICMP unreachable with fake source */
|
1997-09-21 22:00:54 +04:00
|
|
|
#define FR_NOMATCH 0x00200 /* no match occured */
|
1997-01-05 16:47:59 +03:00
|
|
|
#define FR_ACCOUNT 0x00400 /* count packet bytes */
|
|
|
|
#define FR_KEEPFRAG 0x00800 /* keep fragment information */
|
|
|
|
#define FR_KEEPSTATE 0x01000 /* keep `connection' state information */
|
|
|
|
#define FR_INACTIVE 0x02000
|
|
|
|
#define FR_QUICK 0x04000 /* match & stop processing list */
|
|
|
|
#define FR_FASTROUTE 0x08000 /* bypass normal routing */
|
|
|
|
#define FR_CALLNOW 0x10000 /* call another function (fr_func) if matches */
|
|
|
|
#define FR_DUP 0x20000 /* duplicate packet */
|
|
|
|
#define FR_LOGORBLOCK 0x40000 /* block the packet if it can't be logged */
|
1997-05-25 16:40:11 +04:00
|
|
|
#define FR_NOTSRCIP 0x80000 /* not the src IP# */
|
|
|
|
#define FR_NOTDSTIP 0x100000 /* not the dst IP# */
|
1997-07-05 09:38:14 +04:00
|
|
|
#define FR_AUTH 0x200000 /* use authentication */
|
|
|
|
#define FR_PREAUTH 0x400000 /* require preauthentication */
|
1999-12-12 14:11:15 +03:00
|
|
|
#define FR_DONTCACHE 0x800000 /* don't cache the result */
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
#define FR_LOGMASK (FR_LOG|FR_LOGP|FR_LOGB)
|
1999-12-12 14:11:15 +03:00
|
|
|
#define FR_RETMASK (FR_RETICMP|FR_RETRST|FR_FAKEICMP)
|
1997-07-05 09:38:14 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* These correspond to #define's for FI_* and are stored in fr_flags
|
|
|
|
*/
|
|
|
|
#define FF_OPTIONS 0x01000000
|
|
|
|
#define FF_TCPUDP 0x02000000
|
|
|
|
#define FF_FRAG 0x04000000
|
|
|
|
#define FF_SHORT 0x08000000
|
1997-01-05 16:47:59 +03:00
|
|
|
/*
|
1997-07-05 09:38:14 +04:00
|
|
|
* recognized flags for SIOCGETFF and SIOCSETFF, and get put in fr_flags
|
1997-01-05 16:47:59 +03:00
|
|
|
*/
|
1997-05-25 16:40:11 +04:00
|
|
|
#define FF_LOGPASS 0x10000000
|
|
|
|
#define FF_LOGBLOCK 0x20000000
|
|
|
|
#define FF_LOGNOMATCH 0x40000000
|
1997-01-05 16:47:59 +03:00
|
|
|
#define FF_LOGGING (FF_LOGPASS|FF_LOGBLOCK|FF_LOGNOMATCH)
|
1997-05-25 16:40:11 +04:00
|
|
|
#define FF_BLOCKNONIP 0x80000000 /* Solaris2 Only */
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
#define FR_NONE 0
|
|
|
|
#define FR_EQUAL 1
|
|
|
|
#define FR_NEQUAL 2
|
|
|
|
#define FR_LESST 3
|
|
|
|
#define FR_GREATERT 4
|
|
|
|
#define FR_LESSTE 5
|
|
|
|
#define FR_GREATERTE 6
|
|
|
|
#define FR_OUTRANGE 7
|
|
|
|
#define FR_INRANGE 8
|
|
|
|
|
|
|
|
typedef struct filterstats {
|
|
|
|
u_long fr_pass; /* packets allowed */
|
|
|
|
u_long fr_block; /* packets denied */
|
|
|
|
u_long fr_nom; /* packets which don't match any rule */
|
2000-02-02 00:29:15 +03:00
|
|
|
u_long fr_short; /* packets which are short */
|
1997-01-05 16:47:59 +03:00
|
|
|
u_long fr_ppkl; /* packets allowed and logged */
|
|
|
|
u_long fr_bpkl; /* packets denied and logged */
|
|
|
|
u_long fr_npkl; /* packets unmatched and logged */
|
|
|
|
u_long fr_pkl; /* packets logged */
|
|
|
|
u_long fr_skip; /* packets to be logged but buffer full */
|
|
|
|
u_long fr_ret; /* packets for which a return is sent */
|
|
|
|
u_long fr_acct; /* packets for which counting was performed */
|
|
|
|
u_long fr_bnfr; /* bad attempts to allocate fragment state */
|
|
|
|
u_long fr_nfr; /* new fragment state kept */
|
|
|
|
u_long fr_cfr; /* add new fragment state but complete pkt */
|
|
|
|
u_long fr_bads; /* bad attempts to allocate packet state */
|
|
|
|
u_long fr_ads; /* new packet state kept */
|
|
|
|
u_long fr_chit; /* cached hit */
|
1997-11-14 15:40:06 +03:00
|
|
|
u_long fr_tcpbad; /* TCP checksum check failures */
|
1997-01-05 16:47:59 +03:00
|
|
|
u_long fr_pull[2]; /* good and bad pullup attempts */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_long fr_badsrc; /* source received doesn't match route */
|
1997-01-05 16:47:59 +03:00
|
|
|
#if SOLARIS
|
1998-11-22 18:17:18 +03:00
|
|
|
u_long fr_notdata; /* PROTO/PCPROTO that have no data */
|
|
|
|
u_long fr_nodata; /* mblks that have no data */
|
1997-01-05 16:47:59 +03:00
|
|
|
u_long fr_bad; /* bad IP packets to the filter */
|
|
|
|
u_long fr_notip; /* packets passed through no on ip queue */
|
|
|
|
u_long fr_drop; /* packets dropped - no info for them! */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_long fr_copy; /* messages copied due to db_ref > 1 */
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
2000-05-03 15:12:03 +04:00
|
|
|
u_long fr_ipv6[2]; /* IPv6 packets in/out */
|
1997-01-05 16:47:59 +03:00
|
|
|
} filterstats_t;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For SIOCGETFS
|
|
|
|
*/
|
|
|
|
typedef struct friostat {
|
|
|
|
struct filterstats f_st[2];
|
|
|
|
struct frentry *f_fin[2];
|
|
|
|
struct frentry *f_fout[2];
|
|
|
|
struct frentry *f_acctin[2];
|
|
|
|
struct frentry *f_acctout[2];
|
2000-05-03 15:12:03 +04:00
|
|
|
struct frentry *f_fin6[2];
|
|
|
|
struct frentry *f_fout6[2];
|
|
|
|
struct frentry *f_acctin6[2];
|
|
|
|
struct frentry *f_acctout6[2];
|
1997-07-05 09:38:14 +04:00
|
|
|
struct frentry *f_auth;
|
1999-12-12 14:11:15 +03:00
|
|
|
struct frgroup *f_groups[3][2];
|
1997-10-30 19:08:54 +03:00
|
|
|
u_long f_froute[2];
|
1999-12-12 14:11:15 +03:00
|
|
|
int f_defpass; /* default pass - from fr_pass */
|
1999-12-28 10:14:53 +03:00
|
|
|
char f_active; /* 1 or 0 - active rule set */
|
|
|
|
char f_running; /* 1 if running, else 0 */
|
|
|
|
char f_logging; /* 1 if enabled, else 0 */
|
1999-12-12 14:11:15 +03:00
|
|
|
char f_version[32]; /* version string */
|
2000-05-03 15:12:03 +04:00
|
|
|
int f_locks[4];
|
1997-01-05 16:47:59 +03:00
|
|
|
} friostat_t;
|
|
|
|
|
1997-09-21 22:00:54 +04:00
|
|
|
typedef struct optlist {
|
1997-01-05 16:47:59 +03:00
|
|
|
u_short ol_val;
|
1997-09-21 22:00:54 +04:00
|
|
|
int ol_bit;
|
1997-01-05 16:47:59 +03:00
|
|
|
} optlist_t;
|
|
|
|
|
1997-09-21 22:00:54 +04:00
|
|
|
|
1997-01-05 16:47:59 +03:00
|
|
|
/*
|
1997-09-21 22:00:54 +04:00
|
|
|
* Group list structure.
|
1997-01-05 16:47:59 +03:00
|
|
|
*/
|
1997-09-21 22:00:54 +04:00
|
|
|
typedef struct frgroup {
|
2000-05-03 15:12:03 +04:00
|
|
|
u_32_t fg_num;
|
1997-09-21 22:00:54 +04:00
|
|
|
struct frgroup *fg_next;
|
|
|
|
struct frentry *fg_head;
|
|
|
|
struct frentry **fg_start;
|
|
|
|
} frgroup_t;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Log structure. Each packet header logged is prepended by one of these.
|
|
|
|
* Following this in the log records read from the device will be an ipflog
|
|
|
|
* structure which is then followed by any packet data.
|
|
|
|
*/
|
1997-11-14 15:40:06 +03:00
|
|
|
typedef struct iplog {
|
1999-12-12 14:11:15 +03:00
|
|
|
u_32_t ipl_magic;
|
|
|
|
u_int ipl_count;
|
1997-09-21 22:00:54 +04:00
|
|
|
u_long ipl_sec;
|
|
|
|
u_long ipl_usec;
|
|
|
|
size_t ipl_dsize;
|
|
|
|
struct iplog *ipl_next;
|
|
|
|
} iplog_t;
|
|
|
|
|
1997-10-30 19:08:54 +03:00
|
|
|
#define IPL_MAGIC 0x49504c4d /* 'IPLM' */
|
1997-09-21 22:00:54 +04:00
|
|
|
|
|
|
|
typedef struct ipflog {
|
1997-10-30 19:08:54 +03:00
|
|
|
#if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199603)) || \
|
|
|
|
(defined(OpenBSD) && (OpenBSD >= 199603))
|
1997-09-21 22:00:54 +04:00
|
|
|
u_char fl_ifname[IFNAMSIZ];
|
1997-01-05 16:47:59 +03:00
|
|
|
#else
|
1997-09-21 22:00:54 +04:00
|
|
|
u_int fl_unit;
|
|
|
|
u_char fl_ifname[4];
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
1997-09-21 22:00:54 +04:00
|
|
|
u_char fl_plen; /* extra data after hlen */
|
|
|
|
u_char fl_hlen; /* length of IP headers saved */
|
1999-12-12 14:11:15 +03:00
|
|
|
u_short fl_loglevel; /* syslog log level */
|
2000-05-03 15:12:03 +04:00
|
|
|
u_32_t fl_rule;
|
|
|
|
u_32_t fl_group;
|
1997-09-21 22:00:54 +04:00
|
|
|
u_32_t fl_flags;
|
1999-12-12 14:11:15 +03:00
|
|
|
u_32_t fl_lflags;
|
1997-09-21 22:00:54 +04:00
|
|
|
} ipflog_t;
|
1997-01-05 16:47:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef ICMP_UNREACH_FILTER
|
1999-12-12 14:11:15 +03:00
|
|
|
# define ICMP_UNREACH_FILTER 13
|
1997-01-05 16:47:59 +03:00
|
|
|
#endif
|
|
|
|
|
1997-05-25 16:40:11 +04:00
|
|
|
#ifndef IPF_LOGGING
|
1999-12-12 14:11:15 +03:00
|
|
|
# define IPF_LOGGING 0
|
1997-05-25 16:40:11 +04:00
|
|
|
#endif
|
1997-09-21 22:00:54 +04:00
|
|
|
#ifndef IPF_DEFAULT_PASS
|
1999-12-12 14:11:15 +03:00
|
|
|
# define IPF_DEFAULT_PASS FR_PASS
|
1997-09-21 22:00:54 +04:00
|
|
|
#endif
|
1997-05-25 16:40:11 +04:00
|
|
|
|
1997-01-05 16:47:59 +03:00
|
|
|
#define IPMINLEN(i, h) ((i)->ip_len >= ((i)->ip_hl * 4 + sizeof(struct h)))
|
|
|
|
#define IPLLOGSIZE 8192
|
|
|
|
|
1997-05-25 16:40:11 +04:00
|
|
|
/*
|
1997-09-21 22:00:54 +04:00
|
|
|
* Device filenames for reading log information. Use ipf on Solaris2 because
|
|
|
|
* ipl is already a name used by something else.
|
1997-05-25 16:40:11 +04:00
|
|
|
*/
|
|
|
|
#ifndef IPL_NAME
|
|
|
|
# if SOLARIS
|
|
|
|
# define IPL_NAME "/dev/ipf"
|
|
|
|
# else
|
|
|
|
# define IPL_NAME "/dev/ipl"
|
|
|
|
# endif
|
|
|
|
#endif
|
1997-09-21 22:00:54 +04:00
|
|
|
#define IPL_NAT IPNAT_NAME
|
|
|
|
#define IPL_STATE IPSTATE_NAME
|
|
|
|
#define IPL_AUTH IPAUTH_NAME
|
|
|
|
|
1997-05-25 16:40:11 +04:00
|
|
|
#define IPL_LOGIPF 0 /* Minor device #'s for accessing logs */
|
|
|
|
#define IPL_LOGNAT 1
|
|
|
|
#define IPL_LOGSTATE 2
|
1997-07-05 09:38:14 +04:00
|
|
|
#define IPL_LOGAUTH 3
|
|
|
|
#define IPL_LOGMAX 3
|
1997-05-25 16:40:11 +04:00
|
|
|
|
|
|
|
#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version) && \
|
|
|
|
(__FreeBSD_version >= 220000)
|
|
|
|
# define CDEV_MAJOR 79
|
|
|
|
#endif
|
|
|
|
|
1999-12-12 14:11:15 +03:00
|
|
|
/*
|
|
|
|
* Post NetBSD 1.2 has the PFIL interface for packet filters. This turns
|
|
|
|
* on those hooks. We don't need any special mods in non-IP Filter code
|
|
|
|
* with this!
|
|
|
|
*/
|
|
|
|
#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \
|
|
|
|
(defined(NetBSD1_2) && NetBSD1_2 > 1)
|
|
|
|
# if (NetBSD >= 199905)
|
|
|
|
# define PFIL_HOOKS
|
|
|
|
# endif
|
|
|
|
# ifdef PFIL_HOOKS
|
|
|
|
# define NETBSD_PF
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1997-03-29 03:54:55 +03:00
|
|
|
#ifndef _KERNEL
|
1997-11-14 15:40:06 +03:00
|
|
|
extern int fr_check __P((ip_t *, int, void *, int, mb_t **));
|
|
|
|
extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **));
|
|
|
|
extern int send_reset __P((ip_t *, struct ifnet *));
|
|
|
|
extern int icmp_error __P((ip_t *, struct ifnet *));
|
1997-09-21 22:00:54 +04:00
|
|
|
extern int ipf_log __P((void));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int ipfr_fastroute __P((ip_t *, fr_info_t *, frdest_t *));
|
2000-05-03 15:12:03 +04:00
|
|
|
extern struct ifnet *get_unit __P((char *, int));
|
1999-12-12 14:11:15 +03:00
|
|
|
# if defined(__NetBSD__) || defined(__OpenBSD__) || \
|
|
|
|
(_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000)
|
1997-05-27 05:17:04 +04:00
|
|
|
extern int iplioctl __P((dev_t, u_long, caddr_t, int));
|
1997-07-05 09:38:14 +04:00
|
|
|
# else
|
1997-05-25 16:40:11 +04:00
|
|
|
extern int iplioctl __P((dev_t, int, caddr_t, int));
|
1997-07-05 09:38:14 +04:00
|
|
|
# endif
|
1997-05-25 16:40:11 +04:00
|
|
|
extern int iplopen __P((dev_t, int));
|
|
|
|
extern int iplclose __P((dev_t, int));
|
|
|
|
#else /* #ifndef _KERNEL */
|
1997-07-06 09:13:40 +04:00
|
|
|
# if defined(__NetBSD__)
|
1997-09-21 22:00:54 +04:00
|
|
|
/* Pesudo-device attach routine; no-op, really. */
|
1997-07-06 09:13:40 +04:00
|
|
|
extern void ipfilterattach __P((int));
|
|
|
|
# else
|
1997-09-21 22:00:54 +04:00
|
|
|
extern int iplattach __P((void));
|
1997-05-27 05:17:04 +04:00
|
|
|
# endif
|
|
|
|
extern int ipl_enable __P((void));
|
|
|
|
extern int ipl_disable __P((void));
|
1997-09-21 22:00:54 +04:00
|
|
|
extern void ipflog_init __P((void));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int ipflog_clear __P((minor_t));
|
|
|
|
extern int ipflog_read __P((minor_t, struct uio *));
|
1997-11-14 15:40:06 +03:00
|
|
|
extern int ipflog __P((u_int, ip_t *, fr_info_t *, mb_t *));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int ipllog __P((int, fr_info_t *, void **, size_t *, int *, int));
|
2000-05-23 10:07:42 +04:00
|
|
|
extern int send_icmp_err __P((ip_t *, int, fr_info_t *, int));
|
|
|
|
extern int send_reset __P((ip_t *, fr_info_t *));
|
1997-01-05 16:47:59 +03:00
|
|
|
# if SOLARIS
|
1997-11-14 15:40:06 +03:00
|
|
|
extern int fr_check __P((ip_t *, int, void *, int, qif_t *, mb_t **));
|
|
|
|
extern int (*fr_checkp) __P((ip_t *, int, void *,
|
1997-07-05 09:38:14 +04:00
|
|
|
int, qif_t *, mb_t **));
|
1999-12-12 14:11:15 +03:00
|
|
|
# if SOLARIS2 >= 7
|
|
|
|
extern int iplioctl __P((dev_t, int, intptr_t, int, cred_t *, int *));
|
|
|
|
# else
|
|
|
|
extern int iplioctl __P((dev_t, int, int *, int, cred_t *, int *));
|
|
|
|
# endif
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplopen __P((dev_t *, int, int, cred_t *));
|
|
|
|
extern int iplclose __P((dev_t, int, int, cred_t *));
|
|
|
|
extern int ipfsync __P((void));
|
2000-06-12 14:28:20 +04:00
|
|
|
extern int ipfr_fastroute __P((ip_t *, mblk_t *, mblk_t **,
|
|
|
|
fr_info_t *, frdest_t *));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern void copyin_mblk __P((mblk_t *, size_t, size_t, char *));
|
|
|
|
extern void copyout_mblk __P((mblk_t *, size_t, size_t, char *));
|
1997-07-05 09:38:14 +04:00
|
|
|
extern int fr_qin __P((queue_t *, mblk_t *));
|
|
|
|
extern int fr_qout __P((queue_t *, mblk_t *));
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplread __P((dev_t, struct uio *, cred_t *));
|
1997-05-25 16:40:11 +04:00
|
|
|
# else /* SOLARIS */
|
1997-11-14 15:40:06 +03:00
|
|
|
extern int fr_check __P((ip_t *, int, void *, int, mb_t **));
|
|
|
|
extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int ipfr_fastroute __P((mb_t *, fr_info_t *, frdest_t *));
|
1997-11-14 15:40:06 +03:00
|
|
|
extern size_t mbufchainlen __P((mb_t *));
|
1997-10-30 19:08:54 +03:00
|
|
|
# ifdef __sgi
|
|
|
|
# include <sys/cred.h>
|
|
|
|
extern int iplioctl __P((dev_t, int, caddr_t, int, cred_t *, int *));
|
|
|
|
extern int iplopen __P((dev_t *, int, int, cred_t *));
|
|
|
|
extern int iplclose __P((dev_t, int, int, cred_t *));
|
|
|
|
extern int iplread __P((dev_t, struct uio *, cred_t *));
|
|
|
|
extern int ipfsync __P((void));
|
|
|
|
extern int ipfilter_sgi_attach __P((void));
|
|
|
|
extern void ipfilter_sgi_detach __P((void));
|
|
|
|
extern void ipfilter_sgi_intfsync __P((void));
|
|
|
|
# else
|
|
|
|
# ifdef IPFILTER_LKM
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplidentify __P((char *));
|
1997-10-30 19:08:54 +03:00
|
|
|
# endif
|
|
|
|
# if (_BSDI_VERSION >= 199510) || (__FreeBSD_version >= 220000) || \
|
1999-12-12 14:11:15 +03:00
|
|
|
(NetBSD >= 199511) || defined(__OpenBSD__)
|
|
|
|
# if defined(__NetBSD__) || (_BSDI_VERSION >= 199701) || \
|
|
|
|
defined(__OpenBSD__) || (__FreeBSD_version >= 300000)
|
1997-05-27 05:17:04 +04:00
|
|
|
extern int iplioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
|
1997-10-30 19:08:54 +03:00
|
|
|
# else
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplioctl __P((dev_t, int, caddr_t, int, struct proc *));
|
1997-10-30 19:08:54 +03:00
|
|
|
# endif
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplopen __P((dev_t, int, int, struct proc *));
|
|
|
|
extern int iplclose __P((dev_t, int, int, struct proc *));
|
1997-10-30 19:08:54 +03:00
|
|
|
# else
|
1999-12-12 14:11:15 +03:00
|
|
|
# ifndef linux
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplopen __P((dev_t, int));
|
|
|
|
extern int iplclose __P((dev_t, int));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int iplioctl __P((dev_t, int, caddr_t, int));
|
1997-11-14 15:40:06 +03:00
|
|
|
# else
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int iplioctl(struct inode *, struct file *, u_int, u_long);
|
1997-11-14 15:40:06 +03:00
|
|
|
extern int iplopen __P((struct inode *, struct file *));
|
|
|
|
extern void iplclose __P((struct inode *, struct file *));
|
|
|
|
# endif /* !linux */
|
1997-10-30 19:08:54 +03:00
|
|
|
# endif /* (_BSDI_VERSION >= 199510) */
|
|
|
|
# if BSD >= 199306
|
1997-03-29 03:54:55 +03:00
|
|
|
extern int iplread __P((dev_t, struct uio *, int));
|
1997-10-30 19:08:54 +03:00
|
|
|
# else
|
1997-11-14 15:40:06 +03:00
|
|
|
# ifndef linux
|
1997-04-15 04:44:42 +04:00
|
|
|
extern int iplread __P((dev_t, struct uio *));
|
1997-11-14 15:40:06 +03:00
|
|
|
# else
|
|
|
|
extern int iplread(struct inode *, struct file *, char *, int);
|
|
|
|
# endif /* !linux */
|
1997-10-30 19:08:54 +03:00
|
|
|
# endif /* BSD >= 199306 */
|
|
|
|
# endif /* __ sgi */
|
1997-03-29 03:54:55 +03:00
|
|
|
# endif /* SOLARIS */
|
1997-05-25 16:40:11 +04:00
|
|
|
#endif /* #ifndef _KERNEL */
|
1997-03-29 06:05:14 +03:00
|
|
|
|
2000-05-03 15:12:03 +04:00
|
|
|
extern char *memstr __P((char *, char *, int, int));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern void fixskip __P((frentry_t **, frentry_t *, int));
|
|
|
|
extern int countbits __P((u_32_t));
|
1997-09-21 22:00:54 +04:00
|
|
|
#ifndef __NetBSD__
|
|
|
|
extern int ipldetach __P((void));
|
|
|
|
#endif
|
1997-05-25 16:40:11 +04:00
|
|
|
extern u_short ipf_cksum __P((u_short *, int));
|
2000-05-03 15:12:03 +04:00
|
|
|
extern int ircopyptr __P((void *, void *, size_t));
|
|
|
|
extern int iwcopyptr __P((void *, void *, size_t));
|
|
|
|
|
1999-12-12 14:11:15 +03:00
|
|
|
extern int frflush __P((minor_t, int));
|
|
|
|
extern void frsync __P((void));
|
2000-05-03 15:12:03 +04:00
|
|
|
extern frgroup_t *fr_addgroup __P((u_32_t, frentry_t *, minor_t, int));
|
|
|
|
extern void fr_delgroup __P((u_32_t, u_32_t, minor_t, int));
|
|
|
|
extern frgroup_t *fr_findgroup __P((u_32_t, u_32_t, minor_t, int,
|
|
|
|
frgroup_t ***));
|
|
|
|
|
|
|
|
extern int fr_copytolog __P((int, char *, int));
|
|
|
|
extern void fr_forgetifp __P((void *));
|
|
|
|
extern void fr_getstat __P((struct friostat *));
|
|
|
|
extern int fr_ifpaddr __P((int, void *, struct in_addr *));
|
|
|
|
extern int fr_lock __P((caddr_t, int *));
|
1999-12-12 14:11:15 +03:00
|
|
|
extern void fr_makefrip __P((int, ip_t *, fr_info_t *));
|
2000-05-03 15:12:03 +04:00
|
|
|
extern u_short fr_tcpsum __P((mb_t *, ip_t *, tcphdr_t *));
|
|
|
|
extern int fr_scanlist __P((u_32_t, ip_t *, fr_info_t *, void *));
|
|
|
|
extern int fr_tcpudpchk __P((frtuc_t *, fr_info_t *));
|
|
|
|
extern int fr_verifysrc __P((struct in_addr, void *));
|
|
|
|
|
1997-05-25 16:40:11 +04:00
|
|
|
extern int ipl_unreach;
|
2000-02-02 00:29:15 +03:00
|
|
|
extern int fr_running;
|
1997-11-14 15:40:06 +03:00
|
|
|
extern u_long ipl_frouteok[2];
|
1997-05-25 16:40:11 +04:00
|
|
|
extern int fr_pass;
|
|
|
|
extern int fr_flags;
|
|
|
|
extern int fr_active;
|
2000-05-03 15:12:03 +04:00
|
|
|
extern int fr_chksrc;
|
1997-09-21 22:00:54 +04:00
|
|
|
extern fr_info_t frcache[2];
|
1999-12-12 14:11:15 +03:00
|
|
|
extern char ipfilter_version[];
|
1997-09-21 22:00:54 +04:00
|
|
|
extern iplog_t **iplh[IPL_LOGMAX+1], *iplt[IPL_LOGMAX+1];
|
1999-12-12 14:11:15 +03:00
|
|
|
extern size_t iplused[IPL_LOGMAX + 1];
|
1997-05-25 16:40:11 +04:00
|
|
|
extern struct frentry *ipfilter[2][2], *ipacct[2][2];
|
2000-05-03 15:12:03 +04:00
|
|
|
#ifdef USE_INET6
|
|
|
|
extern struct frentry *ipfilter6[2][2], *ipacct6[2][2];
|
|
|
|
extern int icmptoicmp6types[ICMP_MAXTYPE+1];
|
|
|
|
extern int icmptoicmp6unreach[ICMP_MAX_UNREACH];
|
|
|
|
#endif
|
1997-09-21 22:00:54 +04:00
|
|
|
extern struct frgroup *ipfgroups[3][2];
|
1997-05-25 16:40:11 +04:00
|
|
|
extern struct filterstats frstats[];
|
1998-02-10 04:26:19 +03:00
|
|
|
|
|
|
|
#endif /* _NETINET_IP_FIL_H_ */
|