mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +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 "nsock.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "nmap.h"
|
#include "osscan.h"
|
||||||
#include "libnetutil/npacket.h"
|
#include "libnetutil/npacket.h"
|
||||||
|
|
||||||
/* Mention some classes here so we don't have to place the declarations in
|
/* 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 */
|
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 {
|
class FingerPrintResults {
|
||||||
public: /* For now ... a lot of the data members should be made private */
|
public: /* For now ... a lot of the data members should be made private */
|
||||||
FingerPrintResults();
|
FingerPrintResults();
|
||||||
|
|||||||
@@ -126,6 +126,7 @@
|
|||||||
#ifndef NMAP_OPS_H
|
#ifndef NMAP_OPS_H
|
||||||
#define NMAP_OPS_H
|
#define NMAP_OPS_H
|
||||||
|
|
||||||
|
#include "osscan.h" /* FingerPrintDB */
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
#include <nsock.h>
|
#include <nsock.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -127,62 +127,6 @@
|
|||||||
#ifndef GLOBAL_STRUCTURES_H
|
#ifndef GLOBAL_STRUCTURES_H
|
||||||
#define 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 {
|
struct seq_info {
|
||||||
int responses;
|
int responses;
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "dnet.h"
|
#include "dnet.h"
|
||||||
|
#include <nbase.h>
|
||||||
|
|
||||||
/* It is VERY important to never change the value of these two constants.
|
/* 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
|
* 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
|
#ifndef OSSCAN_H
|
||||||
#define OSSCAN_H
|
#define OSSCAN_H
|
||||||
|
|
||||||
#include "FingerPrintResults.h"
|
#include <nbase.h>
|
||||||
#include "Target.h"
|
#include <vector>
|
||||||
|
|
||||||
|
class Target;
|
||||||
|
class FingerPrintResultsIPv4;
|
||||||
|
|
||||||
#define OSSCAN_SUCCESS 0
|
#define OSSCAN_SUCCESS 0
|
||||||
#define OSSCAN_NOMATCHES -1
|
#define OSSCAN_NOMATCHES -1
|
||||||
@@ -136,9 +139,71 @@
|
|||||||
/* We won't even consider matches with a lower accuracy than this */
|
/* We won't even consider matches with a lower accuracy than this */
|
||||||
#define OSSCAN_GUESS_THRESHOLD 0.85
|
#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 ***********************************/
|
/********************** 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 ***********************************/
|
/********************** PROTOTYPES ***********************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user