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

merge soc07 r4959 - Put <extrareasons> inside <extraports> as this should really simplify XML parsers' jobs because they won't have to keep track of what states and reasons go together

This commit is contained in:
fyodor
2007-08-11 04:30:24 +00:00
parent 2af8e785f8
commit abc402ebe7
3 changed files with 1 additions and 23 deletions

View File

@@ -113,7 +113,6 @@ FingerPrintResults::FingerPrintResults() {
osscan_opentcpport = osscan_closedtcpport = osscan_closedudpport = -1; osscan_opentcpport = osscan_closedtcpport = osscan_closedudpport = -1;
distance = -1; distance = -1;
distance_guess = -1; distance_guess = -1;
max_init_ttl = -1;
/* We keep FPs holding at least 10 records because Gen1 OS detection /* We keep FPs holding at least 10 records because Gen1 OS detection
doesn't support maxOSTries() */ doesn't support maxOSTries() */
FPs = (FingerPrint **) safe_zalloc(MAX(o.maxOSTries(), 10) * sizeof(FingerPrint *)); FPs = (FingerPrint **) safe_zalloc(MAX(o.maxOSTries(), 10) * sizeof(FingerPrint *));
@@ -160,11 +159,6 @@ const char *FingerPrintResults::OmitSubmissionFP() {
if (osscan_closedtcpport <= 0) if (osscan_closedtcpport <= 0)
return "Missing a closed TCP port so results incomplete"; return "Missing a closed TCP port so results incomplete";
if (max_init_ttl > 0xFF) {
snprintf(reason, sizeof(reason), "An initial TTL (%d) is greater than 255", max_init_ttl);
return reason;
}
/* This can happen if the TTL in the response to the UDP probe is somehow /* This can happen if the TTL in the response to the UDP probe is somehow
greater than the TTL in the probe itself. We exclude -1 because that is greater than the TTL in the probe itself. We exclude -1 because that is
used to mean the distance is unknown, though there's a chance it could used to mean the distance is unknown, though there's a chance it could

View File

@@ -148,10 +148,6 @@ class FingerPrintResults {
otherwise -1) */ otherwise -1) */
int distance; /* How "far" is this FP gotten from? */ int distance; /* How "far" is this FP gotten from? */
int distance_guess; /* How "far" is this FP gotten from? by guessing based on ttl. */ int distance_guess; /* How "far" is this FP gotten from? by guessing based on ttl. */
/* What's the highest initial TTL we have calculated? It's possible for the
TTL to be altered in a nonstandard way in transit. If a TTL is ever greater
than 255, we can detect it. */
int max_init_ttl;
/* The largest ratio we have seen of time taken vs. target time /* The largest ratio we have seen of time taken vs. target time
between sending 1st tseq probe and sending first ICMP echo probe. between sending 1st tseq probe and sending first ICMP echo probe.

View File

@@ -1585,19 +1585,7 @@ void HostOsScan::makeFP(HostOsScanStats *hss) {
/* We've gotten response for the UDP probe and thus have /* We've gotten response for the UDP probe and thus have
the "true" hop count. Add the received TTL to the hop the "true" hop count. Add the received TTL to the hop
count to get the initial TTL. */ count to get the initial TTL. */
ttl = ttl + hss->distance; sprintf(pAV->value, "%hX", ttl + hss->distance);
/* Keep track of the highest initial TTL we've seen. */
if (ttl > hss->target->FPR->max_init_ttl)
hss->target->FPR->max_init_ttl = ttl;
/* It's not possible for an initial TTL to be greater
than 255, but we might calculate it to be so if the
TTL was monkeyed with in transit. We cap the TTL at
255 to aid OS detection, while the too-high TTL is
stored in hss->target->FPR->max_init_ttl so we know
what happened. */
if (ttl > 0xFF)
ttl = 0xFF;
sprintf(pAV->value, "%hX", ttl);
} else { } else {
/* Guess the initial TTL value */ /* Guess the initial TTL value */
pAV->attribute = "TG"; pAV->attribute = "TG";