diff --git a/TargetGroup.cc b/TargetGroup.cc index 8b1aad0e3..8f5d0891a 100644 --- a/TargetGroup.cc +++ b/TargetGroup.cc @@ -133,6 +133,7 @@ #include "libnetutil/netutil.h" #include +#include #define BITVECTOR_BITS (sizeof(bitvector_t) * CHAR_BIT) #define BIT_SET(v, n) ((v)[(n) / BITVECTOR_BITS] |= 1UL << ((n) % BITVECTOR_BITS)) diff --git a/nmap.cc b/nmap.cc index 5dea08801..97f85f168 100644 --- a/nmap.cc +++ b/nmap.cc @@ -155,6 +155,12 @@ #include #endif +#include + +#ifdef HAVE_PWD_H +#include +#endif + #ifdef WIN32 #include "winfix.h" /* This name collides in the following include. */ diff --git a/nmap.h b/nmap.h index 469433f93..15f18b217 100644 --- a/nmap.h +++ b/nmap.h @@ -151,79 +151,19 @@ #include #endif -#ifdef STDC_HEADERS -#include -#else -void *malloc(); -void *realloc(); -#endif - -#if STDC_HEADERS || HAVE_STRING_H -#include -#if !STDC_HEADERS && HAVE_MEMORY_H -#include -#endif -#endif -#if HAVE_STRINGS_H -#include -#endif - #ifdef HAVE_BSTRING_H #include #endif -#include -#include - -#ifndef WIN32 /* from nmapNT -- seems to work */ -#include -#endif /* !WIN32 */ - #ifdef HAVE_SYS_PARAM_H #include /* Defines MAXHOSTNAMELEN on BSD*/ #endif #if HAVE_RPC_TYPES_H +/* Is this needed any more since rpcgrind was converted to NSE? */ #include #endif -#if HAVE_SYS_SOCKET_H -#include -#endif - -#include - -#if HAVE_NETINET_IN_H -#include -#endif - -#include - -#if HAVE_NETDB_H -#include -#endif - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include - -#ifdef HAVE_PWD_H -#include -#endif - -#if HAVE_ARPA_INET_H -#include -#endif - /* For systems without SCTP in netinet/in.h, such as MacOS X */ #ifndef IPPROTO_SCTP #define IPPROTO_SCTP 132 @@ -234,10 +174,6 @@ void *realloc(); #include -#if HAVE_SYS_RESOURCE_H -#include -#endif - /*#include *//* defines struct arphdr needed for if_ether.h */ // #if HAVE_NET_IF_H // #ifndef NET_IF_H /* why doesn't OpenBSD do this?! */ diff --git a/nmap_error.cc b/nmap_error.cc index 30f8c19ec..7ff5f0f80 100644 --- a/nmap_error.cc +++ b/nmap_error.cc @@ -127,6 +127,8 @@ #include "NmapOps.h" #include "xml.h" +#include + extern NmapOps o; #ifdef WIN32 diff --git a/osscan.cc b/osscan.cc index 745139a68..d0023d2f6 100644 --- a/osscan.cc +++ b/osscan.cc @@ -133,6 +133,7 @@ #include "Target.h" #include "nmap_error.h" +#include #include #if TIME_WITH_SYS_TIME # include diff --git a/scan_engine_connect.cc b/scan_engine_connect.cc index 3d97fffb9..a4ed4643d 100644 --- a/scan_engine_connect.cc +++ b/scan_engine_connect.cc @@ -129,6 +129,8 @@ #include "libnetutil/netutil.h" /* for max_sd() */ #include "NmapOps.h" +#include + extern NmapOps o; /* Sets this UltraProbe as type UP_CONNECT, preparing to connect to given diff --git a/service_scan.cc b/service_scan.cc index 31636fcd8..bfdf2fbb3 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -135,6 +135,8 @@ #include "nmap_tty.h" +#include + #if HAVE_OPENSSL /* OpenSSL 1.0.0 needs _WINSOCKAPI_ to be defined, otherwise it loads (through openssl/dtls1.h), which is incompatible with the diff --git a/utils.cc b/utils.cc index 4e33ab50b..94c93d622 100644 --- a/utils.cc +++ b/utils.cc @@ -126,6 +126,9 @@ #include "utils.h" #include "NmapOps.h" +#include +#include + extern NmapOps o; /* Test a wildcard mask against a test string. Wildcard mask can include '*' and