Version 1.8.0.0
[socat.git] / sysincludes.h
blob0c2aff3dd3e9f54400b03ef15001314a4a2ac39f
1 /* source: sysincludes.h */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 #ifndef __sysincludes_h_included
6 #define __sysincludes_h_included 1
8 /* Sorry for this... */
9 #if defined(__sun) || defined(__sun__) || defined(__SunOS)
10 # define BSD_COMP 1 /* for SIOCGIFFLAGS */
11 #endif
13 #include <stddef.h> /* ptrdiff_t */
14 #if HAVE_STDBOOL_H
15 #include <stdbool.h> /* bool, true, false */
16 #endif
17 #if HAVE_INTTYPES_H
18 #include <inttypes.h> /* uint16_t */
19 #endif
20 #if HAVE_LIMITS_H
21 #include <limits.h> /* USHRT_MAX */
22 #endif
23 #include <math.h> /* HUGE_VAL */
24 #include <assert.h>
25 #include <stdarg.h> /* for msg() */
26 #include <string.h> /* strerror(), strchr() */
27 #if HAVE_STRINGS_H
28 #include <strings.h> /* strcasecmp(), bzero() for FD_ZERO */
29 #endif
30 #include <stdlib.h> /* malloc(), free() */
31 #include <ctype.h> /* isdigit() */
32 #include <stdio.h> /* FILE */
33 #include <errno.h> /* errno */
34 #if HAVE_SYSLOG_H
35 #include <syslog.h> /* openlog(), syslog(), closelog() */
36 #endif
37 #include <signal.h> /* signal(), SIGPIPE, SIG_IGN */
38 #include <time.h> /* struct timeval, strftime(), clock_gettime() */
39 #if 0
40 #include <sys/timeb.h> /* struct timeb */
41 #endif
42 #if HAVE_UNISTD_H
43 #include <unistd.h> /* select(), read(), write(), stat(), fork() */
44 #endif
45 #if HAVE_PWD_H
46 #include <pwd.h> /* getpwnam() */
47 #endif
48 #if HAVE_GRP_H
49 #include <grp.h> /* getgrnam() */
50 #endif
51 #if HAVE_PTY_H && (_WITH_TERMIOS || HAVE_OPENPTY)
52 #include <pty.h>
53 #endif
54 #if HAVE_SYS_PARAM_H
55 #include <sys/param.h> /* Linux 2.4 NGROUPS */
56 #endif
57 #if HAVE_SYS_TIME_H
58 #include <sys/time.h> /* select(); OpenBSD: struct timespec */
59 #endif
60 #if HAVE_STDINT_H
61 #include <stdint.h> /* uint8_t */
62 #endif
63 #if HAVE_SYS_TYPES_H
64 #include <sys/types.h> /* pid_t, select(), socket(), connect(), open(), u_short */
65 #endif
66 #if HAVE_POLL_H
67 #include <poll.h> /* poll() */
68 #elif HAVE_SYS_POLL_H
69 #include <sys/poll.h> /* poll() */
70 #endif
71 #if HAVE_SYS_SOCKET_H
72 #include <sys/socket.h> /* struct sockaddr, struct linger, socket(), connect() */
73 #endif
74 #if HAVE_SYS_UIO_H
75 #include <sys/uio.h> /* struct iovec */
76 #endif
77 #if HAVE_SYS_STAT_H
78 #include <sys/stat.h> /* struct stat, stat(), open() */
79 #endif
80 #if HAVE_SYS_WAIT_H
81 #include <sys/wait.h> /* WNOHANG */
82 #endif
83 #if HAVE_FCNTL_H
84 #include <fcntl.h> /* open(), O_RDWR */
85 #endif
86 #if HAVE_NETDB_H && (_WITH_IP4 || _WITH_IP6)
87 #include <netdb.h> /* struct hostent, gethostbyname() */
88 #endif
89 #if HAVE_SYS_UN_H && WITH_UNIX
90 #include <sys/un.h> /* struct sockaddr_un, unix domain sockets */
91 #endif
92 #if HAVE_SYS_IOCTL_H
93 #include <sys/ioctl.h> /* ioctl() */
94 #endif
95 #if HAVE_SYS_SELECT_H
96 #include <sys/select.h> /* select(), fdset on AIX 4.1 */
97 #endif
98 #if HAVE_SYS_FILE_H
99 #include <sys/file.h> /* LOCK_EX, on AIX directly included */
100 #endif
101 #if WITH_IP4 || WITH_IP6
102 # if HAVE_NETINET_IN_H
103 #include <netinet/in.h> /* struct sockaddr_in, htonl() */
104 # endif
105 #endif /* _WITH_SOCKET */
106 #if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6)
107 # if HAVE_NETINET_IN_SYSTM_H
108 #include <netinet/in_systm.h> /* Solaris, FreeBSD: n_long */
109 # endif
110 # if HAVE_NETINET_IP_H
111 #include <netinet/ip.h> /* struct ip - past netinet/in.h on AIX! */
112 # endif
113 # if HAVE_NETINET_TCP_H
114 #include <netinet/tcp.h> /* TCP_RFC1323 */
115 # endif
116 # if HAVE_NETINET_IP6_H && _WITH_IP6
117 #include <netinet/ip6.h>
118 # endif
119 # if HAVE_NETINET6_IN6_H && _WITH_IP6
120 #include <netinet6/in6.h>
121 # endif
122 #include <arpa/inet.h> /* Linux: inet_aton() */
123 #if HAVE_ARPA_NAMESER_H
124 #include <arpa/nameser.h> /* req for resolv.h (esp. on MacOSX) */
125 #endif
126 #include <net/if.h>
127 #if HAVE_NET_IF_DL_H
128 #include <net/if_dl.h> /* FreeBSD: struct sockaddr_dl */
129 #endif
130 #if HAVE_RESOLV_H
131 #include <resolv.h> /* _res */
132 #endif
133 #endif /* _WITH_IP4 || _WITH_IP6 */
134 /*#include <linux/sockios.h>*/
135 #if HAVE_NET_IF_H
136 #include <net/if.h>
137 #endif /* HAVE_NET_IF_H */
138 #if HAVE_LINUX_TYPES_H
139 #include <linux/types.h> /* __u32 for linux/errqueue.h */
140 #endif
141 #if HAVE_LINUX_ERRQUEUE_H
142 #include <linux/errqueue.h> /* struct sock_extended_err */
143 #endif
144 #if HAVE_LINUX_IF_PACKET_H
145 #include <linux/if_packet.h>
146 #endif
147 #if HAVE_NETINET_IF_ETHER_H
148 #include <netinet/if_ether.h>
149 #endif
150 #if HAVE_LINUX_IF_TUN_H
151 #include <linux/if_tun.h>
152 #endif
153 #if HAVE_LINUX_DCCP_H
154 #include <linux/dccp.h>
155 #endif
156 #if HAVE_TERMIOS_H && _WITH_TERMIOS
157 #include <termios.h>
158 #endif
159 #if HAVE_SYS_UTSNAME_H
160 #include <sys/utsname.h> /* uname(), struct utsname */
161 #endif
162 #if HAVE_UTIL_H
163 #include <util.h> /* NetBSD, OpenBSD openpty() */
164 #endif
165 #if HAVE_BSD_LIBUTIL_H
166 #include <bsd/libutil.h> /* FreeBSD openpty() */
167 #elif HAVE_LIBUTIL_H
168 #include <libutil.h> /* FreeBSD openpty() */
169 #endif
170 #if HAVE_SYS_STROPTS_H
171 #include <sys/stropts.h> /* SunOS I_PUSH ... */
172 #endif
173 #if HAVE_REGEX_H
174 #include <regex.h>
175 #endif
176 #if HAVE_LINUX_FS_H
177 #include <linux/fs.h> /* Linux filesystem definitions */
178 #endif
179 #if HAVE_LINUX_EXT2_FS_H
180 #include <linux/ext2_fs.h> /* Linux ext2 filesystem definitions */
181 #endif
182 #if WITH_NAMESPACES && HAVE_SCHED_H
183 #include <sched.h>
184 #endif
185 #if WITH_POSIXMQ
186 #include <mqueue.h> /* POSIX MQ */
187 #endif
188 #if WITH_READLINE
189 # if HAVE_READLINE_READLINE_H
190 #include <readline/readline.h>
191 # endif
192 # if HAVE_READLINE_HISTORY_H
193 #include <readline/history.h>
194 # endif
195 #endif /* WITH_READLINE */
196 #if WITH_OPENSSL
197 #include <openssl/ssl.h>
198 #include <openssl/err.h>
199 #include <openssl/rand.h>
200 #include <openssl/dh.h>
201 #include <openssl/bn.h>
202 #endif
203 #if HAVE_LINUX_VM_SOCKETS_H
204 #include <linux/vm_sockets.h>
205 #endif
207 #endif /* !defined(__sysincludes_h_included) */