includes.h
上传用户:tjescc
上传日期:2021-02-23
资源大小:419k
文件大小:5k
源码类别:

Telnet服务器

开发平台:

Unix_Linux

  1. #ifndef ___INCLUDES_H__
  2. #define ___INCLUDES_H__
  3. /*
  4.  * Nessus system includes 
  5.  */
  6. #ifdef _CYGWIN_
  7. #undef _WIN32
  8. #endif
  9. #ifdef _WIN32
  10. #include "config.w32"
  11. #else
  12. #include "config.h"
  13. #endif
  14. #ifdef HAVE_UNISTD_H
  15. #include <unistd.h>
  16. #endif /* HAVE_UNISTD_H */
  17. #ifdef linux
  18. /* avoid symbol clash with librpcsvc.a(xmount.o) */
  19. #define xdr_fhstatus xDr_fHsTaTuS
  20. #endif
  21. #ifdef HAVE_STDLIB_H
  22. #include <stdlib.h>
  23. #endif
  24. #ifdef HAVE_STDIO_H
  25. #include <stdio.h>
  26. #endif
  27. #if HAVE_SYS_TYPES_H
  28. #include <sys/types.h>
  29. #endif
  30. #ifdef HAVE_CTYPE_H
  31. #include <ctype.h>
  32. #endif
  33. #ifdef HAVE_ERRNO_H
  34. #include <errno.h>
  35. #endif
  36. #ifdef HAVE_FCNTL_H
  37. #include <fcntl.h>
  38. #endif
  39. #ifdef HAVE_MEMORY_H
  40. #include <memory.h>
  41. #endif
  42. #if defined (STDC_HEADERS) && defined (HAVE_STRING_H)
  43. # include <string.h>
  44. #else                                                     
  45. # ifndef HAVE_STRCHR                                                     
  46. #  define strchr index                                                   
  47. #  define strrchr rindex                                                
  48. # endif /* not defined HAVE_STRCHR */
  49.   char *strchr (), *strrchr ();                 
  50. # ifndef HAVE_MEMCPY
  51. #  define memcpy(d, s, n) bcopy ((s), (d), (n))                      
  52. #  define memmove(d, s, n) bcopy ((s), (d), (n))                        
  53. # endif  /* not HAVE_MEMCPY */
  54. #endif  /* STDC_HEADERS && HAVE_STRING_H */
  55. #ifdef HAVE_STRINGS_H
  56. #include <strings.h>
  57. #endif /* HAVE_STRINGS_H */
  58. #ifdef HAVE_LIMITS_H
  59. #include <limits.h>
  60. #endif
  61. #ifdef HAVE_NETDB_H
  62. #include <netdb.h>
  63. #endif
  64. #ifdef HAVE_SYS_SOCKET_H
  65. #include <sys/socket.h>
  66. #endif
  67. #ifdef HAVE_NETINET_IN_SYSTM_H
  68. #include <netinet/in_systm.h>
  69. #endif
  70. #ifdef HAVE_NETINET_IN_H
  71. #include <netinet/in.h>
  72. #endif
  73. #ifdef HAVE_SYS_UN_H
  74. #include <sys/un.h>
  75. #endif
  76. #ifdef HAVE_ARPA_INET_H
  77. #include <arpa/inet.h>
  78. #endif
  79. #ifdef HAVE_SIGNAL_H
  80. #include <signal.h>
  81. #endif
  82. #ifdef HAVE_DLFCN_H
  83. #include <dlfcn.h>
  84. #endif
  85. #if HAVE_SYS_WAIT_H                                                     
  86. #include <sys/wait.h>                                                
  87. #endif                                                                
  88. #ifndef WEXITSTATUS
  89. #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)               
  90. #endif                                                                
  91. #ifndef WIFEXITED                                                        
  92. #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)                 
  93. #endif    
  94. #ifdef TIME_WITH_SYS_TIME                                           
  95. # include <sys/time.h>                                                
  96. # include <time.h>                                               
  97. #else                
  98. # ifdef HAVE_SYS_TIME_H
  99. #  include <sys/time.h> 
  100. # else                                                                
  101. #  include <time.h>                                                  
  102. # endif                                                                
  103. #endif   
  104. #ifdef HAVE_SYS_IOCTL_H
  105. #include <sys/ioctl.h>
  106. #endif
  107. #ifdef HAVE_SYS_STAT_H
  108. #include <sys/stat.h>
  109. #endif
  110. #ifdef HAVE_SYS_FILIO_H
  111. #include <sys/filio.h>
  112. #endif
  113. #ifdef HAVE_SYS_PARAM_H
  114. #include <sys/param.h>
  115. #endif
  116. #ifdef HAVE_DIRENT_H                                                     
  117. # include <dirent.h>
  118. # define NAMLEN(dirent) strlen((dirent)->d_name)                 
  119. #else                                                                  
  120. # define dirent direct
  121. # define NAMLEN(dirent) (dirent)->d_namlen                         
  122. # ifdef HAVE_SYS_NDIR_H                                                     
  123. #  include <sys/ndir.h>                                                  
  124. # endif                                                             
  125. # ifdef HAVE_SYS_DIR_H
  126. #  include <sys/dir.h>                                                
  127. # endif                                                               
  128. # ifdef HAVE_NDIR_H                                                         
  129. #  include <ndir.h>                                         
  130. # endif            
  131. #endif   
  132. #ifdef HAVE_SETJMP_H
  133. #include <setjmp.h>
  134. #endif
  135. #ifdef HAVE_SSL
  136. #include <openssl/ssl.h>
  137. #include <openssl/x509.h>
  138. #endif
  139. /*
  140.  * Threads management
  141.  *
  142.  * Nessus is currently able to deal with 
  143.  * 3 kinds of threads API :
  144.  *
  145.  * - the POSIX Threads
  146.  * - the WindowsNT Threads
  147.  * - fork() used as Threads
  148.  *
  149.  */
  150. #ifdef NESSUSNT
  151. #define USE_NT_THREADS
  152. #else
  153. #ifndef USE_PTHREADS
  154. #define USE_FORK_THREADS
  155. #endif
  156. #endif
  157. #ifdef USE_PTHREADS
  158. # ifdef HAVE_PTHREAD_H
  159. #  include <pthread.h>
  160. # else
  161. #  error "Your system is lacking pthread support"
  162. # endif
  163. #endif
  164. #ifdef HAVE_SYS_MMAN_H
  165. #include <sys/mman.h>
  166. #endif
  167. #ifdef HAVE_LINUX_MSG_H
  168. #include <linux/msg.h>
  169. #else
  170. #ifdef HAVE_SYS_IPC_H
  171. #include <sys/ipc.h>
  172. #endif
  173. #ifdef HAVE_SYS_MSG_H
  174. #include <sys/msg.h>
  175. #endif
  176. #endif
  177. #ifdef HAVE_SYS_RESOURCE_H
  178. #include <sys/resource.h>
  179. #endif
  180. #ifdef HAVE_SYS_UIO_H
  181. #include <sys/uio.h>
  182. #endif
  183. #ifndef MSGMAX
  184. #define MSGMAX 4000  /* This is awkwardly arbitrary */
  185. #endif
  186. #ifdef BSD_BYTE_ORDERING
  187. # define FIX(n) (n)
  188. # define UNFIX(n) (n)
  189. #else
  190. # define FIX(n) htons(n)
  191. # define UNFIX(n) ntohs(n)
  192. #endif
  193. #include <pcap.h>
  194. #include <ntcompat.h>
  195. #include <libnessus.h>
  196. #include <nessus-devel.h>
  197. #endif /* not defined(___INCLUDES_H) */