One directory for source code.
[tinc] / system.h
1 /*
2     system.h -- system headers
3
4     Copyright (C) 1998-2004 Ivo Timmermans <ivo@tinc-vpn.org>
5                        2004 Guus Sliepen <guus@tinc-vpn.org>
6
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     This program 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
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21     $Id$
22 */
23
24 #ifndef __TINC_SYSTEM_H__
25 #define __TINC_SYSTEM_H__
26
27 #include "config.h"
28
29 /* Include standard headers */
30
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <stdarg.h>
34 #include <string.h>
35 #include <ctype.h>
36 #include <signal.h>
37 #include <errno.h>
38 #include <fcntl.h>
39 #include <unistd.h>
40
41 #ifdef HAVE_STDBOOL_H
42 #include <stdbool.h>
43 #else
44 typedef int bool;
45 #define true 1
46 #define false 0
47 #endif
48
49 #ifdef HAVE_TERMIOS_H
50 #include <termios.h>
51 #endif
52
53 #ifdef HAVE_INTTYPES_H
54 #include <inttypes.h>
55 #endif
56
57 /* Include system specific headers */
58
59 #ifdef HAVE_SYSLOG_H
60 #include <syslog.h>
61 #endif
62
63 #ifdef HAVE_SYS_TIME_H
64 #include <sys/time.h>
65 #endif
66
67 #ifdef HAVE_SYS_TYPES_H
68 #include <sys/types.h>
69 #endif
70
71 #ifdef HAVE_SYS_STAT_H
72 #include <sys/stat.h>
73 #endif
74
75 #ifdef HAVE_SYS_FILE_H
76 #include <sys/file.h>
77 #endif
78
79 #ifdef HAVE_SYS_WAIT_H
80 #include <sys/wait.h>
81 #endif
82
83 #ifdef HAVE_SYS_IOCTL_H
84 #include <sys/ioctl.h>
85 #endif
86
87 #ifdef HAVE_SYS_PARAM_H
88 #include <sys/param.h>
89 #endif
90
91 /* SunOS really wants sys/socket.h BEFORE net/if.h,
92    and FreeBSD wants these lines below the rest. */
93
94 #ifdef HAVE_NETDB_H
95 #include <netdb.h>
96 #endif
97
98 #ifdef HAVE_SYS_SOCKET_H
99 #include <sys/socket.h>
100 #endif
101
102 #ifdef HAVE_NET_IF_H
103 #include <net/if.h>
104 #endif
105
106 #ifdef HAVE_NETINET_IN_SYSTM_H
107 #include <netinet/in_systm.h>
108 #endif
109
110 #ifdef HAVE_NETINET_IN_H
111 #include <netinet/in.h>
112 #endif
113
114 #ifdef HAVE_ARPA_INET_H
115 #include <arpa/inet.h>
116 #endif
117
118 #ifdef HAVE_NETINET_IP_H
119 #include <netinet/ip.h>
120 #endif
121
122 #ifdef HAVE_NETINET_TCP_H
123 #include <netinet/tcp.h>
124 #endif
125
126 #ifdef HAVE_NETINET_IN6_H
127 #include <netinet/in6.h>
128 #endif
129
130 #ifdef HAVE_NETINET_IP6_H
131 #include <netinet/ip6.h>
132 #endif
133
134 #ifdef HAVE_MINGW
135 #include <windows.h>
136 #include <winsock2.h>
137 #endif
138
139 /* Include localisation support */
140
141 #include "support/gettext.h"
142
143 #if 0
144
145 #ifndef HAVE_STRSIGNAL
146 # define strsignal(p) ""
147 #endif
148
149 /* Other functions */
150
151 #include "dropin.h"
152
153 #endif
154
155 #ifndef HAVE_SOCKLEN_T
156 typedef int socklen_t;
157 #endif
158
159 #endif /* __TINC_SYSTEM_H__ */