diff --git a/FPEngine.h b/FPEngine.h index da1b0a95f..7b7200dd0 100644 --- a/FPEngine.h +++ b/FPEngine.h @@ -129,7 +129,7 @@ #include "nsock.h" #include -#include "nmap.h" +#include "osscan.h" #include "libnetutil/npacket.h" /* Mention some classes here so we don't have to place the declarations in diff --git a/FingerPrintResults.h b/FingerPrintResults.h index fb3f33081..f8b0d2ff8 100644 --- a/FingerPrintResults.h +++ b/FingerPrintResults.h @@ -141,16 +141,6 @@ struct OS_Classification_Results { int overall_results; /* OSSCAN_TOOMANYMATCHES, OSSCAN_NOMATCHES, OSSCAN_SUCCESS, etc */ }; -/* The method used to calculate the Target::distance, included in OS - fingerprints. */ -enum dist_calc_method { - DIST_METHOD_NONE, - DIST_METHOD_LOCALHOST, - DIST_METHOD_DIRECT, - DIST_METHOD_ICMP, - DIST_METHOD_TRACEROUTE -}; - class FingerPrintResults { public: /* For now ... a lot of the data members should be made private */ FingerPrintResults(); diff --git a/NmapOps.h b/NmapOps.h index 0b9c849ce..405c31562 100644 --- a/NmapOps.h +++ b/NmapOps.h @@ -126,6 +126,7 @@ #ifndef NMAP_OPS_H #define NMAP_OPS_H +#include "osscan.h" /* FingerPrintDB */ #include "output.h" #include #include diff --git a/global_structures.h b/global_structures.h index 0c4335bb8..0fea520fb 100644 --- a/global_structures.h +++ b/global_structures.h @@ -127,62 +127,6 @@ #ifndef GLOBAL_STRUCTURES_H #define GLOBAL_STRUCTURES_H -#include - -struct AVal { - const char *attribute; - const char *value; - - bool operator<(const AVal& other) const { - return strcmp(attribute, other.attribute) < 0; - } -}; - -struct OS_Classification { - const char *OS_Vendor; - const char *OS_Family; - const char *OS_Generation; /* Can be NULL if unclassified */ - const char *Device_Type; - std::vector cpe; -}; - -/* A description of an operating system: a human-readable name and a list of - classifications. */ -struct FingerMatch { - int line; /* For reference prints, the line # in nmap-os-db */ - char *OS_name; - std::vector OS_class; - - FingerMatch() { - line = -1; - OS_name = NULL; - } -}; - -struct FingerTest { - const char *name; - std::vector results; - bool operator<(const FingerTest& other) const { - return strcmp(name, other.name) < 0; - } -}; - -struct FingerPrint { - FingerMatch match; - std::vector tests; - FingerPrint(); - void sort(); -}; - -/* This structure contains the important data from the fingerprint - database (nmap-os-db) */ -struct FingerPrintDB { - FingerPrint *MatchPoints; - std::vector prints; - - FingerPrintDB(); - ~FingerPrintDB(); -}; struct seq_info { int responses; diff --git a/libnetutil/netutil.h b/libnetutil/netutil.h index 3e4f16f06..520a1904a 100644 --- a/libnetutil/netutil.h +++ b/libnetutil/netutil.h @@ -138,7 +138,7 @@ extern "C" { #endif #include "dnet.h" - +#include /* It is VERY important to never change the value of these two constants. * Specially, OP_FAILURE should never be positive, as some pieces of code take diff --git a/osscan.h b/osscan.h index e3f8525ed..d241eee3e 100644 --- a/osscan.h +++ b/osscan.h @@ -126,8 +126,11 @@ #ifndef OSSCAN_H #define OSSCAN_H -#include "FingerPrintResults.h" -#include "Target.h" +#include +#include + +class Target; +class FingerPrintResultsIPv4; #define OSSCAN_SUCCESS 0 #define OSSCAN_NOMATCHES -1 @@ -136,9 +139,71 @@ /* We won't even consider matches with a lower accuracy than this */ #define OSSCAN_GUESS_THRESHOLD 0.85 +/* The method used to calculate the Target::distance, included in OS + fingerprints. */ +enum dist_calc_method { + DIST_METHOD_NONE, + DIST_METHOD_LOCALHOST, + DIST_METHOD_DIRECT, + DIST_METHOD_ICMP, + DIST_METHOD_TRACEROUTE +}; + /********************** STRUCTURES ***********************************/ -/* moved to global_structures.h */ +struct AVal { + const char *attribute; + const char *value; + + bool operator<(const AVal& other) const { + return strcmp(attribute, other.attribute) < 0; + } +}; + +struct OS_Classification { + const char *OS_Vendor; + const char *OS_Family; + const char *OS_Generation; /* Can be NULL if unclassified */ + const char *Device_Type; + std::vector cpe; +}; + +/* A description of an operating system: a human-readable name and a list of + classifications. */ +struct FingerMatch { + int line; /* For reference prints, the line # in nmap-os-db */ + char *OS_name; + std::vector OS_class; + + FingerMatch() { + line = -1; + OS_name = NULL; + } +}; + +struct FingerTest { + const char *name; + std::vector results; + bool operator<(const FingerTest& other) const { + return strcmp(name, other.name) < 0; + } +}; + +struct FingerPrint { + FingerMatch match; + std::vector tests; + FingerPrint(); + void sort(); +}; +/* This structure contains the important data from the fingerprint + database (nmap-os-db) */ +struct FingerPrintDB { + FingerPrint *MatchPoints; + std::vector prints; + + FingerPrintDB(); + ~FingerPrintDB(); +}; /********************** PROTOTYPES ***********************************/