Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / dist / ipf / netinet / ip_frag.h
blobb898442d6d541fec1283eb9804bed416179193e6
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 1993-2001 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * @(#)ip_frag.h 1.5 3/24/96
9 * Id: ip_frag.h,v 2.23.2.7 2009/01/01 03:53:17 darrenr Exp
12 #ifndef _NETINET_IP_FRAG_H_
13 #define _NETINET_IP_FRAG_H_
15 #define IPFT_SIZE 257
17 typedef struct ipfr {
18 struct ipfr *ipfr_hnext, **ipfr_hprev;
19 struct ipfr *ipfr_next, **ipfr_prev;
20 void *ipfr_data;
21 frentry_t *ipfr_rule;
22 u_long ipfr_ttl;
23 int ipfr_ref;
24 u_short ipfr_off;
25 u_short ipfr_seen0;
27 * All of the fields, from ipfr_ifp to ipfr_pass, are compared
28 * using bcmp to see if an identical entry is present. It is
29 * therefore important for this set to remain together.
31 void *ipfr_ifp;
32 i6addr_t ipfr_src;
33 i6addr_t ipfr_dst;
34 u_32_t ipfr_optmsk;
35 u_short ipfr_secmsk;
36 u_short ipfr_auth;
37 u_32_t ipfr_id;
38 u_32_t ipfr_p;
39 u_32_t ipfr_tos;
40 u_32_t ipfr_pass;
41 } ipfr_t;
44 typedef struct ipfrstat {
45 u_long ifs_exists; /* add & already exists */
46 u_long ifs_nomem;
47 u_long ifs_new;
48 u_long ifs_hits;
49 u_long ifs_expire;
50 u_long ifs_inuse;
51 u_long ifs_retrans0;
52 u_long ifs_short;
53 struct ipfr **ifs_table;
54 struct ipfr **ifs_nattab;
55 } ipfrstat_t;
57 #define IPFR_CMPSZ (offsetof(ipfr_t, ipfr_pass) - \
58 offsetof(ipfr_t, ipfr_ifp))
60 extern ipfr_t *ipfr_list, **ipfr_tail;
61 extern ipfr_t *ipfr_natlist, **ipfr_nattail;
62 extern int ipfr_size;
63 extern int fr_ipfrttl;
64 extern int fr_frag_lock;
65 extern int fr_fraginit __P((void));
66 extern void fr_fragunload __P((void));
67 extern ipfrstat_t *fr_fragstats __P((void));
69 extern int fr_newfrag __P((fr_info_t *, u_32_t));
70 extern frentry_t *fr_knownfrag __P((fr_info_t *, u_32_t *));
72 extern int fr_nat_newfrag __P((fr_info_t *, u_32_t, struct nat *));
73 extern nat_t *fr_nat_knownfrag __P((fr_info_t *));
75 extern int fr_ipid_newfrag __P((fr_info_t *, u_32_t));
76 extern u_32_t fr_ipid_knownfrag __P((fr_info_t *));
77 #ifdef USE_MUTEXES
78 extern void fr_fragderef __P((ipfr_t **, ipfrwlock_t *));
79 extern int fr_nextfrag __P((ipftoken_t *, ipfgeniter_t *, ipfr_t **, \
80 ipfr_t ***, ipfrwlock_t *));
81 #else
82 extern void fr_fragderef __P((ipfr_t **));
83 extern int fr_nextfrag __P((ipftoken_t *, ipfgeniter_t *, ipfr_t **, \
84 ipfr_t ***));
85 #endif
87 extern void fr_forget __P((void *));
88 extern void fr_forgetnat __P((void *));
89 extern void fr_fragclear __P((void));
90 extern void fr_fragexpire __P((void));
92 #if defined(_KERNEL) && ((defined(BSD) && (BSD >= 199306)) || SOLARIS || \
93 defined(__sgi) || defined(__osf__) || (defined(__sgi) && (IRIX >= 60500)))
94 # if defined(SOLARIS2) && (SOLARIS2 < 7)
95 extern void fr_slowtimer __P((void));
96 # else
97 extern void fr_slowtimer __P((void *));
98 # endif
99 #else
100 # if defined(linux) && defined(_KERNEL)
101 extern void fr_slowtimer __P((long));
102 # else
103 extern int fr_slowtimer __P((void));
104 # endif
105 #endif
107 #endif /* _NETINET_IP_FRAG_H_ */