1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Revert r32528, was not tested on Windows

This commit is contained in:
dmiller
2013-11-27 13:32:05 +00:00
parent 8ab92b3214
commit 866db7eea3
34 changed files with 178 additions and 32 deletions

View File

@@ -132,7 +132,6 @@
#include "osscan.h" #include "osscan.h"
#include "libnetutil/npacket.h" #include "libnetutil/npacket.h"
#include "linear.h" #include "linear.h"
#include <math.h>
extern NmapOps o; extern NmapOps o;

View File

@@ -130,6 +130,7 @@
class FingerPrintResults; class FingerPrintResults;
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "FPEngine.h" #include "FPEngine.h"
/* Maximum number of results allowed in one of these things ... */ /* Maximum number of results allowed in one of these things ... */

View File

@@ -124,6 +124,7 @@
/* $Id$ */ /* $Id$ */
#include "nmap.h" #include "nmap.h"
#include "nbase.h"
#include "NmapOps.h" #include "NmapOps.h"
#include "services.h" #include "services.h"
#include "utils.h" #include "utils.h"

View File

@@ -124,10 +124,8 @@
/* $Id$ */ /* $Id$ */
#ifndef NMAPOPS_H
#define NMAPOPS_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "output.h" #include "output.h"
#include <nsock.h> #include <nsock.h>
#include <string> #include <string>
@@ -426,4 +424,4 @@ class NmapOps {
u8 spoof_mac[6]; u8 spoof_mac[6];
bool spoof_mac_set; bool spoof_mac_set;
}; };
#endif /* NMAPOPS_H */

View File

@@ -132,6 +132,8 @@
#define IDLE_SCAN_H #define IDLE_SCAN_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include <nbase.h>
class Target; class Target;

View File

@@ -129,10 +129,12 @@
#include "osscan2.h" #include "osscan2.h"
#include "scan_engine.h" #include "scan_engine.h"
#include "idle_scan.h" #include "idle_scan.h"
#include "timing.h"
#include "NmapOps.h" #include "NmapOps.h"
#include "MACLookup.h" #include "MACLookup.h"
#include "traceroute.h" #include "traceroute.h"
#include "nmap_tty.h" #include "nmap_tty.h"
#include "nmap_dns.h"
#include "services.h" #include "services.h"
#include "protocols.h" #include "protocols.h"
#include "targets.h" #include "targets.h"
@@ -143,10 +145,6 @@
#include "utils.h" #include "utils.h"
#include "xml.h" #include "xml.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef NOLUA #ifndef NOLUA
#include "nse_main.h" #include "nse_main.h"
#endif #endif

12
nmap.h
View File

@@ -173,6 +173,9 @@ void *realloc();
#include <bstring.h> #include <bstring.h>
#endif #endif
#include <ctype.h>
#include <sys/types.h>
#ifndef WIN32 /* from nmapNT -- seems to work */ #ifndef WIN32 /* from nmapNT -- seems to work */
#include <sys/wait.h> #include <sys/wait.h>
#endif /* !WIN32 */ #endif /* !WIN32 */
@@ -181,6 +184,8 @@ void *realloc();
#include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/ #include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
#endif #endif
#include <stdio.h>
#if HAVE_RPC_TYPES_H #if HAVE_RPC_TYPES_H
#include <rpc/types.h> #include <rpc/types.h>
#endif #endif
@@ -189,10 +194,14 @@ void *realloc();
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#include <sys/stat.h>
#if HAVE_NETINET_IN_H #if HAVE_NETINET_IN_H
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif
#include <errno.h>
#if HAVE_NETDB_H #if HAVE_NETDB_H
#include <netdb.h> #include <netdb.h>
#endif #endif
@@ -208,6 +217,8 @@ void *realloc();
# endif # endif
#endif #endif
#include <fcntl.h>
#include <stdarg.h>
#ifdef HAVE_PWD_H #ifdef HAVE_PWD_H
#include <pwd.h> #include <pwd.h>
@@ -225,6 +236,7 @@ void *realloc();
/* Keep assert() defined for security reasons */ /* Keep assert() defined for security reasons */
#undef NDEBUG #undef NDEBUG
#include <math.h>
#include <assert.h> #include <assert.h>
#if HAVE_SYS_RESOURCE_H #if HAVE_SYS_RESOURCE_H

View File

@@ -194,6 +194,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <list> #include <list>
#include <vector>
#include <algorithm> #include <algorithm>
extern NmapOps o; extern NmapOps o;

View File

@@ -120,8 +120,6 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef NMAP_DNS_H
#define NMAP_DNS_H
class Target; class Target;
#include "nbase.h" #include "nbase.h"
@@ -133,4 +131,3 @@ void nmap_mass_rdns(Target ** targets, int num_targets);
const char *lookup_cached_host(u32 ip); const char *lookup_cached_host(u32 ip);
std::list<std::string> get_dns_servers(); std::list<std::string> get_dns_servers();
#endif /* NMAP_DNS_H */

View File

@@ -127,7 +127,6 @@
#include "output.h" #include "output.h"
#include "NmapOps.h" #include "NmapOps.h"
#include "xml.h" #include "xml.h"
#include <errno.h>
extern NmapOps o; extern NmapOps o;

View File

@@ -121,6 +121,10 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef WIN32
#include "nmap_config.h"
#endif
#include "nmap.h" #include "nmap.h"
#include <sys/types.h> #include <sys/types.h>

View File

@@ -121,9 +121,6 @@
* * * *
***************************************************************************/ ***************************************************************************/
#ifndef NMAP_TTY_H
#define NMAP_TTY_H
/* /*
* Initializes the terminal for unbuffered non-blocking input. Also * Initializes the terminal for unbuffered non-blocking input. Also
* registers tty_done() via atexit(). You need to call this before * registers tty_done() via atexit(). You need to call this before
@@ -136,4 +133,4 @@ void tty_init();
being returned means a nonstandard key has been pressed and the being returned means a nonstandard key has been pressed and the
calling method should print a status message */ calling method should print a status message */
bool keyWasPressed(); bool keyWasPressed();
#endif /* NMAP_TTY_H */

View File

@@ -1,4 +1,5 @@
#include "nmap.h" #include "nmap.h"
#include "nbase.h"
#include "nmap_error.h" #include "nmap_error.h"
#include "portlist.h" #include "portlist.h"
#include "nsock.h" #include "nsock.h"
@@ -7,7 +8,6 @@
#include "Target.h" #include "Target.h"
#include "nmap_tty.h" #include "nmap_tty.h"
#include "xml.h" #include "xml.h"
#include <math.h>
#include "nse_main.h" #include "nse_main.h"
#include "nse_utility.h" #include "nse_utility.h"

View File

@@ -14,6 +14,7 @@ extern "C" {
} }
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
class ScriptResult class ScriptResult
{ {

View File

@@ -122,9 +122,6 @@
***************************************************************************/ ***************************************************************************/
/* $Id:$ */ /* $Id:$ */
#ifndef NSE_SSL_CERT_H
#define NSE_SSL_CERT_H
int l_get_ssl_certificate(lua_State *L); int l_get_ssl_certificate(lua_State *L);
void nse_nsock_init_ssl_cert(lua_State *L); void nse_nsock_init_ssl_cert(lua_State *L);
#endif /* NSE_SSL_CERT_H */

View File

@@ -64,7 +64,9 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h>
#include <assert.h> #include <assert.h>
#include <sys/time.h> #include <sys/time.h>

View File

@@ -64,6 +64,7 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h>
#include <time.h> #include <time.h>
#include <assert.h> #include <assert.h>

View File

@@ -128,6 +128,7 @@
#define OSSCAN_H #define OSSCAN_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "FingerPrintResults.h" #include "FingerPrintResults.h"
#include "Target.h" #include "Target.h"

View File

@@ -137,7 +137,6 @@
#include "struct_ip.h" #include "struct_ip.h"
#include <list> #include <list>
#include <math.h>
extern NmapOps o; extern NmapOps o;

View File

@@ -129,6 +129,8 @@
#define OSSCAN2_H #define OSSCAN2_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "nbase.h"
#include <vector> #include <vector>
#include <list> #include <list>
#include "Target.h" #include "Target.h"

View File

@@ -139,10 +139,12 @@
#include "Target.h" #include "Target.h"
#include "utils.h" #include "utils.h"
#include "xml.h" #include "xml.h"
#include "nbase.h"
#include "libnetutil/netutil.h" #include "libnetutil/netutil.h"
#include <math.h> #include <math.h>
#include <set>
#include <vector> #include <vector>
#include <list> #include <list>
#include <sstream> #include <sstream>

View File

@@ -165,6 +165,7 @@
#include "portlist.h" #include "portlist.h"
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include <nsock.h> #include <nsock.h>
#include <string> #include <string>

View File

@@ -134,6 +134,7 @@
#include <map> #include <map>
#include "NmapOps.h" #include "NmapOps.h"
#include "nbase.h"
#include "payload.h" #include "payload.h"
#include "utils.h" #include "utils.h"

View File

@@ -132,6 +132,8 @@
#endif #endif
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "nbase.h"
#define PROTOCOL_TABLE_SIZE 256 #define PROTOCOL_TABLE_SIZE 256

View File

@@ -129,6 +129,7 @@
#define SCAN_ENGINE_H #define SCAN_ENGINE_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include <vector> #include <vector>
struct probespec_tcpdata { struct probespec_tcpdata {

View File

@@ -129,6 +129,7 @@
#define SERVICE_SCAN_H #define SERVICE_SCAN_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "portlist.h" #include "portlist.h"
#include <vector> #include <vector>

View File

@@ -128,7 +128,15 @@
#ifndef SERVICES_H #ifndef SERVICES_H
#define SERVICES_H #define SERVICES_H
#ifdef WIN32
#include "mswin32\winclude.h"
#else
#include <netdb.h>
#endif
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "nbase.h"
#define SERVICE_TABLE_SIZE 1024 #define SERVICE_TABLE_SIZE 1024

View File

@@ -127,7 +127,29 @@
#ifndef TARGETS_H #ifndef TARGETS_H
#define TARGETS_H #define TARGETS_H
#ifdef HAVE_CONFIG_H
#include "nmap_config.h"
#else
#ifdef WIN32
#include "nmap_winconfig.h"
#endif /* WIN32 */
#endif /* HAVE_CONFIG_H */
/* This contains pretty much everything we need ... */
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
#endif
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
#include "TargetGroup.h" #include "TargetGroup.h"
class TargetGroup { class TargetGroup {

80
tcpip.h
View File

@@ -129,7 +129,78 @@
#ifndef TCPIP_H #ifndef TCPIP_H
#define TCPIP_H #define TCPIP_H
#include "nmap.h" #ifdef HAVE_CONFIG_H
#include "nmap_config.h"
#endif
#include "nbase.h"
#ifdef WIN32
#include "mswin32\winclude.h"
#else
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
void *malloc();
void *realloc();
#endif
#if STDC_HEADERS || HAVE_STRING_H
#include <string.h>
#if !STDC_HEADERS && HAVE_MEMORY_H
#include <memory.h>
#endif
#endif
#if HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_BSTRING_H
#include <bstring.h>
#endif
#include <ctype.h>
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
#endif
#include <stdio.h>
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_RPC_TYPES_H
#include <rpc/types.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <arpa/inet.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -144,14 +215,17 @@ extern "C" {
#if HAVE_SYS_SOCKIO_H #if HAVE_SYS_SOCKIO_H
#include <sys/sockio.h> /* SIOCGIFCONF for Solaris */ #include <sys/sockio.h> /* SIOCGIFCONF for Solaris */
#endif #endif
#endif /* WIN32 */
#include <setjmp.h> #include <setjmp.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <dnet.h> #include <dnet.h>
/* from Target.h */
class Target;
#include "nmap.h"
#include "global_structures.h"
#ifndef INET_ADDRSTRLEN #ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16 #define INET_ADDRSTRLEN 16

View File

@@ -130,7 +130,6 @@
#include "NmapOps.h" #include "NmapOps.h"
#include "utils.h" #include "utils.h"
#include "xml.h" #include "xml.h"
#include <math.h>
extern NmapOps o; extern NmapOps o;

View File

@@ -130,6 +130,7 @@
#define NMAP_TIMING_H #define NMAP_TIMING_H
#include "nmap.h" #include "nmap.h"
#include "global_structures.h"
/* Call this function on a newly allocated struct timeout_info to /* Call this function on a newly allocated struct timeout_info to
initialize the values appropriately */ initialize the values appropriately */

View File

@@ -123,8 +123,6 @@
/* $Id: nmap.h 6676 2008-01-12 22:39:34Z fyodor $ */ /* $Id: nmap.h 6676 2008-01-12 22:39:34Z fyodor $ */
#ifndef NMAP_TRACEROUTE_H
#define NMAP_TRACEROUTE_H
#include "Target.h" #include "Target.h"
#include <vector> #include <vector>
@@ -132,4 +130,3 @@
int traceroute(std::vector<Target *> &Targets); int traceroute(std::vector<Target *> &Targets);
void traceroute_hop_cache_clear(); void traceroute_hop_cache_clear();
#endif /* NMAP_TRACEROUTE_H */

View File

@@ -126,7 +126,6 @@
#include "nmap.h" #include "nmap.h"
#include "utils.h" #include "utils.h"
#include "NmapOps.h" #include "NmapOps.h"
#include <fcntl.h>
extern NmapOps o; extern NmapOps o;

30
utils.h
View File

@@ -133,12 +133,38 @@
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>
#include "nmap.h" #include "nmap.h"
#ifdef WIN32
#include "mswin32\winclude.h"
#else
#include <sys/types.h>
#ifndef WIN32 #if HAVE_NETINET_IN_H
#include <sys/mman.h> #include <netinet/in.h>
#endif #endif
#include <sys/mman.h>
#include "nmap_config.h"
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include "nbase.h"
#include "nmap_error.h" #include "nmap_error.h"
#include "global_structures.h"
/* Arithmatic difference modulo 2^32 */ /* Arithmatic difference modulo 2^32 */
#ifndef MOD_DIFF #ifndef MOD_DIFF