1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-07 06:59:03 +00:00

Add an enclosing host element in XML output for timed-out hosts.

The lack of this was noticed by Rémi Mollon.
This commit is contained in:
david
2011-07-08 17:08:53 +00:00
parent 4ca48ea450
commit f3e5a3f113
2 changed files with 10 additions and 0 deletions

View File

@@ -1920,7 +1920,13 @@ int nmap_main(int argc, char *argv[]) {
currenths = Targets[targetno];
/* Now I can do the output and such for each host */
if (currenths->timedOut(NULL)) {
xml_open_start_tag("host");
xml_attribute("starttime", "%lu", (unsigned long) currenths->StartTime());
xml_attribute("endtime", "%lu", (unsigned long) currenths->EndTime());
xml_close_start_tag();
write_host_header(currenths);
xml_end_tag(); /* host */
xml_newline();
log_write(LOG_PLAIN,"Skipping host %s due to host timeout\n",
currenths->NameIP(hostname, sizeof(hostname)));
log_write(LOG_MACHINE,"Host: %s (%s)\tStatus: Timeout",