You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
5.0 KiB

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