Aquire serializer before calling ioctl
[dragonfly.git] / sys / contrib / ipfilter / netinet / ip_frag.h
1 /*
2  * Copyright (C) 1993-2001 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * @(#)ip_frag.h        1.5 3/24/96
7  * $Id: ip_frag.h,v 2.4.2.7 2002/07/06 14:17:51 darrenr Exp $
8  * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_frag.h,v 1.12.2.4 2002/08/31 16:24:52 darrenr Exp $
9  * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_frag.h,v 1.4 2004/07/28 00:22:37 hmp Exp $
10  */
11
12 #ifndef __IP_FRAG_H__
13 #define __IP_FRAG_H__
14
15 #define IPFT_SIZE       257
16
17 typedef struct  ipfr    {
18         struct  ipfr    *ipfr_next, *ipfr_prev;
19         void    *ipfr_data;
20         struct  in_addr ipfr_src;
21         struct  in_addr ipfr_dst;
22         void    *ipfr_ifp;
23         u_32_t  ipfr_optmsk;
24         u_short ipfr_secmsk;
25         u_short ipfr_auth;
26         u_short ipfr_id;
27         u_char  ipfr_p;
28         u_char  ipfr_tos;
29         u_short ipfr_off;
30         u_char  ipfr_ttl;
31         u_char  ipfr_seen0;
32         frentry_t *ipfr_rule;
33 } ipfr_t;
34
35
36 typedef struct  ipfrstat {
37         u_long  ifs_exists;     /* add & already exists */
38         u_long  ifs_nomem;
39         u_long  ifs_new;
40         u_long  ifs_hits;
41         u_long  ifs_expire;
42         u_long  ifs_inuse;
43         struct  ipfr    **ifs_table;
44         struct  ipfr    **ifs_nattab;
45 } ipfrstat_t;
46
47 #define IPFR_CMPSZ      (offsetof(ipfr_t, ipfr_off) - \
48                          offsetof(ipfr_t, ipfr_src))
49
50 extern  int     fr_ipfrttl;
51 extern  int     fr_frag_lock;
52 extern  ipfrstat_t      *ipfr_fragstats (void);
53 extern  int     ipfr_newfrag (ip_t *, fr_info_t *);
54 extern  int     ipfr_nat_newfrag (ip_t *, fr_info_t *, struct nat *);
55 extern  nat_t   *ipfr_nat_knownfrag (ip_t *, fr_info_t *);
56 extern  frentry_t *ipfr_knownfrag (ip_t *, fr_info_t *);
57 extern  void    ipfr_forget (void *);
58 extern  void    ipfr_forgetnat (void *);
59 extern  void    ipfr_unload (void);
60 extern  void    ipfr_fragexpire (void);
61
62 #ifdef _KERNEL
63 # if     (BSD >= 199306) || SOLARIS || defined(__sgi)
64 #  if defined(SOLARIS2) && (SOLARIS2 < 7)
65 extern  void    ipfr_slowtimer (void);
66 #  else
67 extern  void    ipfr_slowtimer (void *);
68 #  endif
69 # else
70 extern  int     ipfr_slowtimer (void);
71 # endif /* (BSD >= 199306) || SOLARIS */
72 #else
73 extern  void    ipfr_slowtimer (void);
74 #endif /* _KERNEL */
75
76 #endif  /* __IP_FIL_H__ */