1
0
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:
dmiller
2015-06-23 15:53:02 +00:00
parent 764cb886ae
commit 2e602435f5
6 changed files with 71 additions and 71 deletions

View File

@@ -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 ***********************************/