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

Strip or relocate more includes from nmap.h

This commit is contained in:
dmiller
2015-07-01 21:25:39 +00:00
parent 982e08749f
commit ea4096c681
8 changed files with 18 additions and 65 deletions

View File

@@ -133,6 +133,7 @@
#include "libnetutil/netutil.h"
#include <sstream>
#include <errno.h>
#define BITVECTOR_BITS (sizeof(bitvector_t) * CHAR_BIT)
#define BIT_SET(v, n) ((v)[(n) / BITVECTOR_BITS] |= 1UL << ((n) % BITVECTOR_BITS))

View File

@@ -155,6 +155,12 @@
#include <signal.h>
#endif
#include <fcntl.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef WIN32
#include "winfix.h"
/* This name collides in the following include. */

66
nmap.h
View File

@@ -151,79 +151,19 @@
#include <unistd.h>
#endif
#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>
#ifndef WIN32 /* from nmapNT -- seems to work */
#include <sys/wait.h>
#endif /* !WIN32 */
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
#endif
#if HAVE_RPC_TYPES_H
/* Is this needed any more since rpcgrind was converted to NSE? */
#include <rpc/types.h>
#endif
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/stat.h>
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <errno.h>
#if HAVE_NETDB_H
#include <netdb.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 <fcntl.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#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 <assert.h>
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
/*#include <net/if_arp.h> *//* defines struct arphdr needed for if_ether.h */
// #if HAVE_NET_IF_H
// #ifndef NET_IF_H /* why doesn't OpenBSD do this?! */

View File

@@ -127,6 +127,8 @@
#include "NmapOps.h"
#include "xml.h"
#include <errno.h>
extern NmapOps o;
#ifdef WIN32

View File

@@ -133,6 +133,7 @@
#include "Target.h"
#include "nmap_error.h"
#include <errno.h>
#include <stdarg.h>
#if TIME_WITH_SYS_TIME
# include <sys/time.h>

View File

@@ -129,6 +129,8 @@
#include "libnetutil/netutil.h" /* for max_sd() */
#include "NmapOps.h"
#include <errno.h>
extern NmapOps o;
/* Sets this UltraProbe as type UP_CONNECT, preparing to connect to given

View File

@@ -135,6 +135,8 @@
#include "nmap_tty.h"
#include <errno.h>
#if HAVE_OPENSSL
/* OpenSSL 1.0.0 needs _WINSOCKAPI_ to be defined, otherwise it loads
<windows.h> (through openssl/dtls1.h), which is incompatible with the

View File

@@ -126,6 +126,9 @@
#include "utils.h"
#include "NmapOps.h"
#include <fcntl.h>
#include <errno.h>
extern NmapOps o;
/* Test a wildcard mask against a test string. Wildcard mask can include '*' and