mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Move osscan-related structs to osscan.h from global_structures.h
This commit is contained in:
@@ -129,7 +129,7 @@
|
||||
|
||||
#include "nsock.h"
|
||||
#include <vector>
|
||||
#include "nmap.h"
|
||||
#include "osscan.h"
|
||||
#include "libnetutil/npacket.h"
|
||||
|
||||
/* Mention some classes here so we don't have to place the declarations in
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
#ifndef NMAP_OPS_H
|
||||
#define NMAP_OPS_H
|
||||
|
||||
#include "osscan.h" /* FingerPrintDB */
|
||||
#include "output.h"
|
||||
#include <nsock.h>
|
||||
#include <string>
|
||||
|
||||
@@ -127,62 +127,6 @@
|
||||
#ifndef GLOBAL_STRUCTURES_H
|
||||
#define GLOBAL_STRUCTURES_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
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<const char *> 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_Classification> OS_class;
|
||||
|
||||
FingerMatch() {
|
||||
line = -1;
|
||||
OS_name = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
struct FingerTest {
|
||||
const char *name;
|
||||
std::vector<struct AVal> results;
|
||||
bool operator<(const FingerTest& other) const {
|
||||
return strcmp(name, other.name) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct FingerPrint {
|
||||
FingerMatch match;
|
||||
std::vector<FingerTest> tests;
|
||||
FingerPrint();
|
||||
void sort();
|
||||
};
|
||||
|
||||
/* This structure contains the important data from the fingerprint
|
||||
database (nmap-os-db) */
|
||||
struct FingerPrintDB {
|
||||
FingerPrint *MatchPoints;
|
||||
std::vector<FingerPrint *> prints;
|
||||
|
||||
FingerPrintDB();
|
||||
~FingerPrintDB();
|
||||
};
|
||||
|
||||
struct seq_info {
|
||||
int responses;
|
||||
|
||||
@@ -138,7 +138,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "dnet.h"
|
||||
|
||||
#include <nbase.h>
|
||||
|
||||
/* 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
|
||||
|
||||
71
osscan.h
71
osscan.h
@@ -126,8 +126,11 @@
|
||||
#ifndef OSSCAN_H
|
||||
#define OSSCAN_H
|
||||
|
||||
#include "FingerPrintResults.h"
|
||||
#include "Target.h"
|
||||
#include <nbase.h>
|
||||
#include <vector>
|
||||
|
||||
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<const char *> 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_Classification> OS_class;
|
||||
|
||||
FingerMatch() {
|
||||
line = -1;
|
||||
OS_name = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
struct FingerTest {
|
||||
const char *name;
|
||||
std::vector<struct AVal> results;
|
||||
bool operator<(const FingerTest& other) const {
|
||||
return strcmp(name, other.name) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct FingerPrint {
|
||||
FingerMatch match;
|
||||
std::vector<FingerTest> tests;
|
||||
FingerPrint();
|
||||
void sort();
|
||||
};
|
||||
/* This structure contains the important data from the fingerprint
|
||||
database (nmap-os-db) */
|
||||
struct FingerPrintDB {
|
||||
FingerPrint *MatchPoints;
|
||||
std::vector<FingerPrint *> prints;
|
||||
|
||||
FingerPrintDB();
|
||||
~FingerPrintDB();
|
||||
};
|
||||
|
||||
/********************** PROTOTYPES ***********************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user