]> git.saurik.com Git - apple/xnu.git/blob - bsd/netinet/ip_frag.h
faff6d5d1408d9c701e36e0e75e15aa1b38f83fa
[apple/xnu.git] / bsd / netinet / ip_frag.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * Copyright (C) 1993-1997 by Darren Reed.
24 *
25 * Redistribution and use in source and binary forms are permitted
26 * provided that this notice is preserved and due credit is given
27 * to the original author and the contributors.
28 *
29 * @(#)ip_frag.h 1.5 3/24/96
30 */
31
32 #ifndef __IP_FRAG_H__
33 #define __IP_FRAG_H__
34
35 #define IPFT_SIZE 257
36
37 typedef struct ipfr {
38 struct ipfr *ipfr_next, *ipfr_prev;
39 void *ipfr_data;
40 struct in_addr ipfr_src;
41 struct in_addr ipfr_dst;
42 u_short ipfr_id;
43 u_char ipfr_p;
44 u_char ipfr_tos;
45 u_short ipfr_off;
46 u_short ipfr_ttl;
47 u_char ipfr_pass;
48 } ipfr_t;
49
50
51 typedef struct ipfrstat {
52 u_long ifs_exists; /* add & already exists */
53 u_long ifs_nomem;
54 u_long ifs_new;
55 u_long ifs_hits;
56 u_long ifs_expire;
57 u_long ifs_inuse;
58 struct ipfr **ifs_table;
59 struct ipfr **ifs_nattab;
60 } ipfrstat_t;
61
62 #define IPFR_CMPSZ (4 + 4 + 2 + 1 + 1)
63
64 extern int fr_ipfrttl;
65 extern ipfrstat_t *ipfr_fragstats __P((void));
66 extern int ipfr_newfrag __P((ip_t *, fr_info_t *, int));
67 extern int ipfr_nat_newfrag __P((ip_t *, fr_info_t *, int, struct nat *));
68 extern nat_t *ipfr_nat_knownfrag __P((ip_t *, fr_info_t *));
69 extern int ipfr_knownfrag __P((ip_t *, fr_info_t *));
70 extern void ipfr_forget __P((void *));
71 extern void ipfr_unload __P((void));
72
73 #if (BSD >= 199306) || SOLARIS || defined(__sgi)
74 extern void ipfr_slowtimer __P((void));
75 #else
76 extern int ipfr_slowtimer __P((void));
77 #endif
78
79 #endif /* __IP_FIL_H__ */