diff --git a/TargetGroup.h b/TargetGroup.h index d7a927faf..5e8a6bce5 100644 --- a/TargetGroup.h +++ b/TargetGroup.h @@ -136,6 +136,7 @@ #define TARGETGROUP_H #include +#include class NetBlock; @@ -157,7 +158,7 @@ public: /* Grab the next host from this expression (if any). Returns 0 and fills in ss if successful. ss must point to a pre-allocated sockaddr_storage structure */ - int get_next_host(struct sockaddr_storage *ss, size_t *sslen); + int get_next_host(struct sockaddr_storage *ss, std::size_t *sslen); /* Returns true iff the given address is the one that was resolved to create this target group; i.e., not one of the addresses derived from it with a netmask. */ diff --git a/nbase/nbase_addrset.h b/nbase/nbase_addrset.h index c4b2bb14b..37eb79d68 100644 --- a/nbase/nbase_addrset.h +++ b/nbase/nbase_addrset.h @@ -131,17 +131,7 @@ #define _NBASE_ADDRSET_H //#define HAVE_IPV6 1 -#include -#include -#include -#include -#include -#include -#ifndef WIN32 -#include -#endif - -#include "nbase.h" +#include /* CHAR_BIT */ /* We use bit vectors to represent what values are allowed in an IPv4 octet. Each vector is built up of an array of bitvector_t (any convenient integer diff --git a/nmap.cc b/nmap.cc index 606e8963c..d3d16c3e5 100644 --- a/nmap.cc +++ b/nmap.cc @@ -1769,7 +1769,7 @@ int nmap_main(int argc, char *argv[]) { struct hostent *target = NULL; time_t timep; char mytime[128]; - addrset exclude_group; + struct addrset exclude_group; #ifndef NOLUA /* Only NSE scripts can add targets */ NewTargets *new_targets = NULL; diff --git a/targets.cc b/targets.cc index fc19fb9b7..b726a9fd9 100644 --- a/targets.cc +++ b/targets.cc @@ -206,7 +206,7 @@ void returnhost(HostGroupState *hs) { /* Is the host passed as Target to be excluded? Much of this logic had to be rewritten from wam's original code to allow for the objects */ static int hostInExclude(struct sockaddr *checksock, size_t checksocklen, - const addrset *exclude_group) { + const struct addrset *exclude_group) { if (exclude_group == NULL) return 0; @@ -219,7 +219,7 @@ static int hostInExclude(struct sockaddr *checksock, size_t checksocklen, } /* Load an exclude list from a file for --excludefile. */ -int load_exclude_file(addrset *excludelist, FILE *fp) { +int load_exclude_file(struct addrset *excludelist, FILE *fp) { char host_spec[1024]; size_t n; @@ -236,7 +236,7 @@ int load_exclude_file(addrset *excludelist, FILE *fp) { /* Load a comma-separated exclude list from a string, the argument to --exclude. */ -int load_exclude_string(addrset *excludelist, const char *s) { +int load_exclude_string(struct addrset *excludelist, const char *s) { const char *begin, *p; p = s; @@ -259,7 +259,7 @@ int load_exclude_string(addrset *excludelist, const char *s) { /* A debug routine to dump some information to stdout. Invoked if debugging is set to 4 or higher. */ -int dumpExclude(addrset *exclude_group) { +int dumpExclude(struct addrset *exclude_group) { const struct addrset_elem *elem; for (elem = exclude_group->head; elem != NULL; elem = elem->next) @@ -495,7 +495,7 @@ bail: return NULL; } -static Target *next_target(HostGroupState *hs, const addrset *exclude_group, +static Target *next_target(HostGroupState *hs, const struct addrset *exclude_group, struct scan_lists *ports, int pingtype) { struct sockaddr_storage ss; size_t sslen; @@ -548,7 +548,7 @@ tryagain: return t; } -static void refresh_hostbatch(HostGroupState *hs, const addrset *exclude_group, +static void refresh_hostbatch(HostGroupState *hs, const struct addrset *exclude_group, struct scan_lists *ports, int pingtype) { int i; bool arpping_done = false; @@ -642,7 +642,7 @@ static void refresh_hostbatch(HostGroupState *hs, const addrset *exclude_group, nmap_mass_rdns(hs->hostbatch, hs->current_batch_sz); } -Target *nexthost(HostGroupState *hs, const addrset *exclude_group, +Target *nexthost(HostGroupState *hs, const struct addrset *exclude_group, struct scan_lists *ports, int pingtype) { if (hs->next_batch_no >= hs->current_batch_sz) refresh_hostbatch(hs, exclude_group, ports, pingtype); diff --git a/targets.h b/targets.h index 24728c3f2..2e4d308dc 100644 --- a/targets.h +++ b/targets.h @@ -133,8 +133,9 @@ #ifndef TARGETS_H #define TARGETS_H -#include #include "TargetGroup.h" +#include +#include class Target; class HostGroupState { @@ -173,12 +174,12 @@ public: }; /* ports is used to pass information about what ports to use for host discovery */ -Target *nexthost(HostGroupState *hs,const addrset *exclude_group, +Target *nexthost(HostGroupState *hs,const struct addrset *exclude_group, struct scan_lists *ports, int pingtype); -int load_exclude_file(addrset *exclude_group, FILE *fp); -int load_exclude_string(addrset *exclude_group, const char *s); +int load_exclude_file(struct addrset *exclude_group, FILE *fp); +int load_exclude_string(struct addrset *exclude_group, const char *s); /* a debugging routine to dump an exclude list to stdout. */ -int dumpExclude(addrset *exclude_group); +int dumpExclude(struct addrset *exclude_group); /* Returns the last host obtained by nexthost. It will be given again the next time you call nexthost(). */ void returnhost(HostGroupState *hs);