diff --git a/FPEngine.cc b/FPEngine.cc index f9319a7ed..07dfdaecd 100644 --- a/FPEngine.cc +++ b/FPEngine.cc @@ -613,7 +613,7 @@ FPEngine::~FPEngine() { * * dst host fe80::250:56ff:fec0:1 */ -const char *FPEngine::bpf_filter(vector &Targets) { +const char *FPEngine::bpf_filter(std::vector &Targets) { static char pcap_filter[2048]; /* 20 IPv6 addresses is max (46 byte addy + 14 (" or src host ")) * 20 == 1200 */ char dst_hosts[1220]; @@ -1047,12 +1047,12 @@ static void classify(FingerPrintResultsIPv6 *FPR) { * results and matching fingerprints. If everything goes well, the internal * state of the supplied target objects will be modified to reflect the results * of the */ -int FPEngine6::os_scan(vector &Targets) { +int FPEngine6::os_scan(std::vector &Targets) { bool osscan_done = false; const char *bpf_filter = NULL; - vector curr_hosts; /* Hosts currently doing OS detection */ - vector done_hosts; /* Hosts for which we already did OSdetect */ - vector left_hosts; /* Hosts we have not yet started with */ + std::vector curr_hosts; /* Hosts currently doing OS detection */ + std::vector done_hosts; /* Hosts for which we already did OSdetect */ + std::vector left_hosts; /* Hosts we have not yet started with */ struct timeval begin_time; if (o.debugging) diff --git a/FPEngine.h b/FPEngine.h index faff8091d..d9523ec5e 100644 --- a/FPEngine.h +++ b/FPEngine.h @@ -98,11 +98,9 @@ #define __FPENGINE_H__ 1 #include "nsock.h" -#include #include #include "nmap.h" #include "libnetutil/npacket.h" -using namespace std; /* Mention some classes here so we don't have to place the declarations in * the right order (otherwise the compiler complains). */ @@ -176,7 +174,7 @@ class FPNetworkControl { bool first_pcap_scheduled; /* True if we scheduled the first pcap read event. */ bool nsock_init; /* True if the nsock pool has been initialized. */ int rawsd; /* Raw socket. */ - vector callers; /* List of users of this instance (used for callbacks).*/ + std::vector callers; /* List of users of this instance (used for callbacks).*/ int probes_sent; /* Number of unique probes sent (not retransmissions). */ int responses_recv; /* Number of probe responses received. */ int probes_timedout; /* Number of probes that timeout after all retransms. */ @@ -228,8 +226,8 @@ class FPEngine { FPEngine(); ~FPEngine(); void reset(); - virtual int os_scan(vector &Targets) = 0; - const char *bpf_filter(vector &Targets); + virtual int os_scan(std::vector &Targets) = 0; + const char *bpf_filter(std::vector &Targets); }; @@ -242,13 +240,13 @@ class FPEngine { class FPEngine6 : public FPEngine { private: - vector fphosts; /* Information about each target to fingerprint */ + std::vector fphosts; /* Information about each target to fingerprint */ public: FPEngine6(); ~FPEngine6(); void reset(); - int os_scan(vector &Targets); + int os_scan(std::vector &Targets); }; diff --git a/osscan2.h b/osscan2.h index 57cf302c2..37b132206 100644 --- a/osscan2.h +++ b/osscan2.h @@ -104,7 +104,6 @@ #include #include "Target.h" class Target; -using namespace std; /****************************************************************************** @@ -212,12 +211,12 @@ class HostOsScanStats { void initScanStats(); struct eth_nfo *fill_eth_nfo(struct eth_nfo *eth, eth_t *ethsd) const; void addNewProbe(OFProbeType type, int subid); - void removeActiveProbe(list::iterator probeI); + void removeActiveProbe(std::list::iterator probeI); /* Get an active probe from active probe list identified by probe type * and subid. returns probesActive.end() if there isn't one. */ - list::iterator getActiveProbe(OFProbeType type, int subid); - void moveProbeToActiveList(list::iterator probeI); - void moveProbeToUnSendList(list::iterator probeI); + std::list::iterator getActiveProbe(OFProbeType type, int subid); + void moveProbeToActiveList(std::list::iterator probeI); + void moveProbeToUnSendList(std::list::iterator probeI); unsigned int numProbesToSend() {return probesToSend.size();} unsigned int numProbesActive() {return probesActive.size();} FingerPrint *getFP() {return FP;} @@ -256,8 +255,8 @@ class HostOsScanStats { * probesToSend and appended to probesActive. If any probes in * probesActive are timedout, they will be moved to probesToSend and * sent again till expired. */ - list probesToSend; - list probesActive; + std::list probesToSend; + std::list probesActive; /* A record of total number of probes that have been sent to this * host, including restranmited ones. */ @@ -432,14 +431,14 @@ private: class OsScanInfo { public: - OsScanInfo(vector &Targets); + OsScanInfo(std::vector &Targets); ~OsScanInfo(); float starttime; /* If you remove from this, you had better adjust nextI too (or call * resetHostIterator() afterward). Don't let this list get empty, * then add to it again, or you may mess up nextI (I'm not sure) */ - list incompleteHosts; + std::list incompleteHosts; unsigned int numIncompleteHosts() {return incompleteHosts.size();} HostOsScanInfo *findIncompleteHost(struct sockaddr_storage *ss); @@ -459,7 +458,7 @@ class OsScanInfo { private: unsigned int numInitialTargets; - list::iterator nextI; + std::list::iterator nextI; }; @@ -493,15 +492,15 @@ class OSScan { private: int ip_ver; /* IP version for the OS Scan (4 or 6) */ - int chunk_and_do_scan(vector &Targets, int family); - int os_scan_ipv4(vector &Targets); - int os_scan_ipv6(vector &Targets); + int chunk_and_do_scan(std::vector &Targets, int family); + int os_scan_ipv4(std::vector &Targets); + int os_scan_ipv6(std::vector &Targets); public: OSScan(); ~OSScan(); void reset(); - int os_scan(vector &Targets); + int os_scan(std::vector &Targets); }; #endif /*OSSCAN2_H*/