1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Move FP_NOVELTY_THRESHOLD to FPEngine.h.

This commit is contained in:
david
2012-01-17 20:33:21 +00:00
parent 4b3bfeb7d9
commit d47ae571c0
2 changed files with 6 additions and 4 deletions

View File

@@ -925,8 +925,6 @@ int label_prob_cmp(const void *a, const void *b) {
return 0; return 0;
} }
#define NOVELTY_THRESHOLD 10.0
static double novelty_of(const struct feature_node *features, int label) { static double novelty_of(const struct feature_node *features, int label) {
const double *means, *variances; const double *means, *variances;
int i, nr_feature; int i, nr_feature;
@@ -998,12 +996,12 @@ static void classify(FingerPrintResultsIPv6 *FPR) {
if (o.debugging > 1) if (o.debugging > 1)
log_write(LOG_PLAIN, "Novelty of closest match is %.3f.\n", novelty); log_write(LOG_PLAIN, "Novelty of closest match is %.3f.\n", novelty);
if (novelty < NOVELTY_THRESHOLD) { if (novelty < FP_NOVELTY_THRESHOLD) {
FPR->overall_results = OSSCAN_SUCCESS; FPR->overall_results = OSSCAN_SUCCESS;
} else { } else {
if (o.debugging > 0) { if (o.debugging > 0) {
log_write(LOG_PLAIN, "Novelty of closest match is %.3f > %.3f; ignoring.\n", log_write(LOG_PLAIN, "Novelty of closest match is %.3f > %.3f; ignoring.\n",
novelty, NOVELTY_THRESHOLD); novelty, FP_NOVELTY_THRESHOLD);
} }
FPR->overall_results = OSSCAN_NOMATCHES; FPR->overall_results = OSSCAN_NOMATCHES;
FPR->num_perfect_matches = 0; FPR->num_perfect_matches = 0;

View File

@@ -122,6 +122,10 @@ class FingerPrintResultsIPv6;
/* Total number of IPv6 OS detection probes. */ /* Total number of IPv6 OS detection probes. */
#define NUM_FP_PROBES_IPv6 (NUM_FP_PROBES_IPv6_TCP+NUM_FP_PROBES_IPv6_ICMPv6+NUM_FP_PROBES_IPv6_UDP) #define NUM_FP_PROBES_IPv6 (NUM_FP_PROBES_IPv6_TCP+NUM_FP_PROBES_IPv6_ICMPv6+NUM_FP_PROBES_IPv6_UDP)
/* Even with a successful classification, we may not consider a match good if it
is too different from other members of the class. */
#define FP_NOVELTY_THRESHOLD 10.0
const unsigned int OSDETECT_FLOW_LABEL = 0x12345; const unsigned int OSDETECT_FLOW_LABEL = 0x12345;