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