Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 2 | include/common/compat.h |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 3 | Operating system compatibility interface. |
| 4 | |
| 5 | Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu |
| 6 | |
| 7 | This library is free software; you can redistribute it and/or |
| 8 | modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation, version 2.1 |
| 10 | exclusively. |
| 11 | |
| 12 | This library is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with this library; if not, write to the Free Software |
| 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | */ |
| 21 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 22 | #ifndef _COMMON_COMPAT_H |
| 23 | #define _COMMON_COMPAT_H |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 24 | |
| 25 | /* This is needed on Linux for Netfilter includes */ |
| 26 | #include <sys/socket.h> |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 27 | #include <common/config.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 28 | |
| 29 | /* INTBITS |
| 30 | * how many bits are needed to code the size of an int on the target platform. |
| 31 | * (eg: 32bits -> 5) |
| 32 | */ |
| 33 | #define INTBITS 5 |
| 34 | |
| 35 | /* this is for libc5 for example */ |
| 36 | #ifndef TCP_NODELAY |
| 37 | #define TCP_NODELAY 1 |
| 38 | #endif |
| 39 | |
| 40 | #ifndef SHUT_RD |
| 41 | #define SHUT_RD 0 |
| 42 | #endif |
| 43 | |
| 44 | #ifndef SHUT_WR |
| 45 | #define SHUT_WR 1 |
| 46 | #endif |
| 47 | |
| 48 | #if defined(TPROXY) && defined(NETFILTER) |
| 49 | #include <linux/netfilter_ipv4.h> |
| 50 | #endif |
| 51 | |
| 52 | #if defined(__dietlibc__) |
| 53 | #include <strings.h> |
| 54 | #endif |
| 55 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 56 | #endif /* _COMMON_COMPAT_H */ |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 57 | |
| 58 | /* |
| 59 | * Local variables: |
| 60 | * c-indent-level: 8 |
| 61 | * c-basic-offset: 8 |
| 62 | * End: |
| 63 | */ |