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