2 * internal definitions for use within the library; do not export!
3 * Copyright (C) 1998, 1999 Henry Spencer.
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Library General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/lgpl.txt>.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 * License for more details.
15 * RCSID $Id: internal.h,v 1.9 2000/08/08 02:34:15 henry Exp $
19 #define ABITS 32 /* bits in an IPv4 address */
22 /* case-independent ASCII character equality comparison */
23 #define CIEQ(c1, c2) ( ((c1)&~040) == ((c2)&~040) )
25 /* syntax for passthrough SA */
26 #ifndef PASSTHROUGHNAME
27 #define PASSTHROUGHNAME "%passthrough"
28 #define PASSTHROUGH4NAME "%passthrough4"
29 #define PASSTHROUGH6NAME "%passthrough6"
30 #define PASSTHROUGHIS "tun0@0.0.0.0"
31 #define PASSTHROUGH4IS "tun0@0.0.0.0"
32 #define PASSTHROUGH6IS "tun0@::"
33 #define PASSTHROUGHTYPE "tun"
34 #define PASSTHROUGHSPI 0
35 #define PASSTHROUGHDST 0
39 * Headers, greatly complicated by stupid and unnecessary inconsistencies
40 * between the user environment and the kernel environment. These are done
41 * here so that this mess need exist in only one place.
43 * It may seem like a -I or two could avoid most of this, but on closer
44 * inspection it is not quite that easy.
47 /* things that need to come from one place or the other, depending */
49 #include <linux/types.h>
50 #include <linux/socket.h>
52 #include <linux/string.h>
53 #include <linux/ctype.h>
54 #define assert(foo) /* nothing */
56 #include <sys/types.h>
57 #include <netinet/in.h>
63 /* things that exist only in userland */
66 /* You'd think this would be okay in the kernel too -- it's just a */
67 /* bunch of constants -- but no, in RH5.1 it screws up other things. */
68 /* (Credit: Mike Warfield tracked this problem down. Thanks Mike!) */
69 /* Fortunately, we don't need it in the kernel subset of the library. */
72 /* header files for things that should never be called in kernel */
75 /* memory allocation, currently user-only, macro-ized just in case */
77 #define MALLOC(n) malloc(n)
78 #define FREE(p) free(p)
80 #endif /* __KERNEL__ */