includes.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * Dropbear - a SSH2 server
  3. *
  4. * Copyright (c) 2002,2003 Matt Johnston
  5. * All rights reserved.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8. * of this software and associated documentation files (the "Software"), to deal
  9. * in the Software without restriction, including without limitation the rights
  10. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. * copies of the Software, and to permit persons to whom the Software is
  12. * furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in
  15. * all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  23. * SOFTWARE. */
  24. #ifndef DROPBEAR_INCLUDES_H_
  25. #define DROPBEAR_INCLUDES_H_
  26. #include "options.h"
  27. #include "debug.h"
  28. #include <sys/types.h>
  29. #include <sys/ioctl.h>
  30. #include <sys/param.h> /* required for BSD4_4 define */
  31. #include <sys/socket.h>
  32. #include <sys/stat.h>
  33. #include <sys/time.h>
  34. #include <sys/un.h>
  35. #include <sys/wait.h>
  36. #include <sys/resource.h>
  37. #include <stdio.h>
  38. #include <errno.h>
  39. #include <fcntl.h>
  40. #include <grp.h>
  41. #include <limits.h>
  42. #include <pwd.h>
  43. #include <signal.h>
  44. #include <stdlib.h>
  45. #include <string.h>
  46. #include <termios.h>
  47. #include <unistd.h>
  48. #include <syslog.h>
  49. #include <netdb.h>
  50. #include <ctype.h>
  51. #include <stdarg.h>
  52. #include <dirent.h>
  53. #include <time.h>
  54. #include <setjmp.h>
  55. #ifdef HAVE_UTMP_H
  56. #include <utmp.h>
  57. #endif
  58. #ifdef HAVE_UTMPX_H
  59. #include <utmpx.h>
  60. #endif
  61. #ifdef HAVE_PATHS_H
  62. #include <paths.h>
  63. #endif
  64. #ifdef HAVE_LASTLOG_H
  65. #include <lastlog.h>
  66. #endif
  67. #ifdef HAVE_NETINET_IN_H
  68. #include <netinet/in.h>
  69. #endif
  70. #include <arpa/inet.h>
  71. /* netbsd 1.6 needs this to be included before netinet/ip.h for some
  72. * undocumented reason */
  73. #ifdef HAVE_NETINET_IN_SYSTM_H
  74. #include <netinet/in_systm.h>
  75. #endif
  76. #include <netinet/ip.h>
  77. #ifdef HAVE_NETINET_TCP_H
  78. #include <netinet/tcp.h>
  79. #endif
  80. #ifdef HAVE_INTTYPES_H
  81. #include <inttypes.h>
  82. #endif
  83. #ifdef HAVE_LIBUTIL_H
  84. #include <libutil.h>
  85. #endif
  86. #ifdef HAVE_CRYPT_H
  87. #include <crypt.h>
  88. #endif
  89. #ifndef DISABLE_ZLIB
  90. #include <zlib.h>
  91. #endif
  92. #ifdef HAVE_UTIL_H
  93. #include <util.h>
  94. #endif
  95. #ifdef HAVE_SHADOW_H
  96. #include <shadow.h>
  97. #endif
  98. #ifdef HAVE_LIBGEN_H
  99. #include <libgen.h>
  100. #endif
  101. #ifdef HAVE_SYS_UIO_H
  102. #include <sys/uio.h>
  103. #endif
  104. #ifdef HAVE_SYS_RANDOM_H
  105. #include <sys/random.h>
  106. #endif
  107. #ifdef HAVE_SYS_PRCTL_H
  108. #include <sys/prctl.h>
  109. #endif
  110. #ifdef BUNDLED_LIBTOM
  111. #include "libtomcrypt/src/headers/tomcrypt.h"
  112. #include "libtommath/tommath.h"
  113. #else
  114. #include <tomcrypt.h>
  115. #include <tommath.h>
  116. #endif
  117. #include "compat.h"
  118. #ifndef HAVE_U_INT8_T
  119. typedef unsigned char u_int8_t;
  120. #endif /* HAVE_U_INT8_T */
  121. #ifndef HAVE_UINT8_T
  122. typedef u_int8_t uint8_t;
  123. #endif /* HAVE_UINT8_T */
  124. #ifndef HAVE_U_INT16_T
  125. typedef unsigned short u_int16_t;
  126. #endif /* HAVE_U_INT16_T */
  127. #ifndef HAVE_UINT16_T
  128. typedef u_int16_t uint16_t;
  129. #endif /* HAVE_UINT16_T */
  130. #ifndef HAVE_U_INT32_T
  131. typedef unsigned int u_int32_t;
  132. #endif /* HAVE_U_INT32_T */
  133. #ifndef HAVE_UINT32_T
  134. typedef u_int32_t uint32_t;
  135. #endif /* HAVE_UINT32_T */
  136. #ifndef SIZE_T_MAX
  137. #define SIZE_T_MAX ULONG_MAX
  138. #endif /* SIZE_T_MAX */
  139. #ifdef HAVE_LINUX_PKT_SCHED_H
  140. #include <linux/types.h>
  141. #include <linux/pkt_sched.h>
  142. #endif
  143. #if DROPBEAR_PLUGIN
  144. #include <dlfcn.h>
  145. #endif
  146. extern char** environ;
  147. #include "fake-rfc2553.h"
  148. #include "fuzz.h"
  149. #ifndef LOG_AUTHPRIV
  150. #define LOG_AUTHPRIV LOG_AUTH
  151. #endif
  152. /* so we can avoid warnings about unused params (ie in signal handlers etc) */
  153. #ifdef UNUSED
  154. #elif defined(__GNUC__)
  155. # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
  156. #elif defined(__LCLINT__)
  157. # define UNUSED(x) /*@unused@*/ x
  158. #else
  159. # define UNUSED(x) x
  160. #endif
  161. #endif /* DROPBEAR_INCLUDES_H_ */