have.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. #ifndef TINC_HAVE_H
  2. #define TINC_HAVE_H
  3. /*
  4. have.h -- include headers which are known to exist
  5. Copyright (C) 1998-2005 Ivo Timmermans
  6. 2003-2015 Guus Sliepen <guus@tinc-vpn.org>
  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. 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. You should have received a copy of the GNU General Public License along
  16. with this program; if not, write to the Free Software Foundation, Inc.,
  17. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. */
  19. #ifdef HAVE_MINGW
  20. #ifdef WITH_WINDOWS2000
  21. #define WINVER Windows2000
  22. #else
  23. #define WINVER WindowsXP
  24. #endif
  25. #endif
  26. #include <stdio.h>
  27. #include <stdbool.h>
  28. #include <stdint.h>
  29. #include <inttypes.h>
  30. #include <stdlib.h>
  31. #include <stdarg.h>
  32. #include <string.h>
  33. #include <ctype.h>
  34. #include <errno.h>
  35. #include <limits.h>
  36. #include <fcntl.h>
  37. #include <unistd.h>
  38. #include <signal.h>
  39. #ifdef HAVE_MINGW
  40. #include <w32api.h>
  41. #include <winsock2.h>
  42. #include <windows.h>
  43. #include <ws2tcpip.h>
  44. #endif
  45. #ifdef HAVE_STDBOOL_H
  46. #include <stdbool.h>
  47. #endif
  48. #ifdef HAVE_TERMIOS_H
  49. #include <termios.h>
  50. #endif
  51. #ifdef HAVE_ALLOCA_H
  52. #include <alloca.h>
  53. #endif
  54. /* Include system specific headers */
  55. #ifdef HAVE_SYSLOG_H
  56. #include <syslog.h>
  57. #endif
  58. #ifdef HAVE_SYS_TIME_H
  59. #include <sys/time.h>
  60. #endif
  61. #ifdef HAVE_TIME_H
  62. #include <time.h>
  63. #endif
  64. #ifdef HAVE_SYS_TYPES_H
  65. #include <sys/types.h>
  66. #endif
  67. #ifdef HAVE_SYS_STAT_H
  68. #include <sys/stat.h>
  69. #endif
  70. #ifdef HAVE_SYS_FILE_H
  71. #include <sys/file.h>
  72. #endif
  73. #ifdef HAVE_SYS_WAIT_H
  74. #include <sys/wait.h>
  75. #endif
  76. #ifdef HAVE_SYS_IOCTL_H
  77. #include <sys/ioctl.h>
  78. #endif
  79. #ifdef HAVE_SYS_PARAM_H
  80. #include <sys/param.h>
  81. #endif
  82. #ifdef HAVE_SYS_RESOURCE_H
  83. #include <sys/resource.h>
  84. #endif
  85. #ifdef HAVE_SYS_UIO_H
  86. #include <sys/uio.h>
  87. #endif
  88. #ifdef HAVE_DIRENT_H
  89. #include <dirent.h>
  90. #endif
  91. /* SunOS really wants sys/socket.h BEFORE net/if.h,
  92. and FreeBSD wants these lines below the rest. */
  93. #ifdef HAVE_NETDB_H
  94. #include <netdb.h>
  95. #endif
  96. #ifdef HAVE_SYS_SOCKET_H
  97. #include <sys/socket.h>
  98. #endif
  99. #ifdef HAVE_NET_IF_H
  100. #include <net/if.h>
  101. #endif
  102. #ifdef HAVE_NET_IF_TYPES_H
  103. #include <net/if_types.h>
  104. #endif
  105. #ifdef HAVE_NET_IF_TUN_H
  106. #include <net/if_tun.h>
  107. #endif
  108. #ifdef HAVE_NET_TUN_IF_TUN_H
  109. #include <net/tun/if_tun.h>
  110. #endif
  111. #ifdef HAVE_NET_IF_TAP_H
  112. #include <net/if_tap.h>
  113. #endif
  114. #ifdef HAVE_NET_TAP_IF_TAP_H
  115. #include <net/tap/if_tap.h>
  116. #endif
  117. #ifdef HAVE_NETINET_IN_SYSTM_H
  118. #include <netinet/in_systm.h>
  119. #endif
  120. #ifdef HAVE_NETINET_IN_H
  121. #include <netinet/in.h>
  122. #endif
  123. #ifdef HAVE_ARPA_INET_H
  124. #include <arpa/inet.h>
  125. #endif
  126. #ifdef HAVE_NETINET_IP_H
  127. #include <netinet/ip.h>
  128. #endif
  129. #ifdef HAVE_NETINET_TCP_H
  130. #include <netinet/tcp.h>
  131. #endif
  132. #ifdef HAVE_NETINET_IN6_H
  133. #include <netinet/in6.h>
  134. #endif
  135. #ifdef HAVE_NETINET_IP6_H
  136. #include <netinet/ip6.h>
  137. #endif
  138. #ifdef HAVE_NET_ETHERNET_H
  139. #include <net/ethernet.h>
  140. #endif
  141. #ifdef HAVE_NET_IF_ARP_H
  142. #include <net/if_arp.h>
  143. #endif
  144. #ifdef HAVE_NETINET_IP_ICMP_H
  145. #include <netinet/ip_icmp.h>
  146. #endif
  147. #ifdef HAVE_NETINET_ICMP6_H
  148. #include <netinet/icmp6.h>
  149. #endif
  150. #ifdef HAVE_NETINET_IF_ETHER_H
  151. #include <netinet/if_ether.h>
  152. #endif
  153. #ifdef HAVE_ARPA_NAMESER_H
  154. #include <arpa/nameser.h>
  155. #ifdef STATUS
  156. #undef STATUS
  157. #endif
  158. #endif
  159. #ifdef HAVE_RESOLV_H
  160. #include <resolv.h>
  161. #endif
  162. #ifdef HAVE_LINUX_IF_TUN_H
  163. #include <linux/if_tun.h>
  164. #endif
  165. #endif