Nmap Development mailing list archives
[PATCH] <times> XML element for host's final times
From: Kris Katterjohn <katterjohn () gmail com>
Date: Mon, 25 Jun 2007 12:32:50 -0500
Hey everyone! I have attached a patch for a new <times> XML element for a host's final times (srtt, rttvar, to) The patch is incredibly simple, but something could've gone awry because I'm not fluent in DTD :) I made this patch because I have recently been playing with the Perl Nmap::Parser, and found myself wanting to mimic Nmap's regular output but I noticed the host's final times weren't available. So.. 1) Does the DTD look good? 2) Should I use the XSL and print this in the HTML-rendered output? 3) Are there any reasons to not put this in? Is it being too verbose? Please let me know what you think! Thanks, Kris Katterjohn
Index: nmap.cc =================================================================== --- nmap.cc (revision 5015) +++ nmap.cc (working copy) @@ -1783,6 +1783,8 @@ if (o.debugging) log_write(LOG_STDOUT, "Final times for host: srtt: %d rttvar: %d to: %d\n", currenths->to.srtt, currenths->to.rttvar, currenths->to.timeout); + log_write(LOG_XML, "<times srtt=\"%d\" rttvar=\"%d\" to=\"%d\" />\n", + currenths->to.srtt, currenths->to.rttvar, currenths->to.timeout); log_write(LOG_NORMAL|LOG_SKID|LOG_STDOUT|LOG_MACHINE,"\n"); log_write(LOG_XML, "</host>\n"); } Index: docs/nmap.dtd =================================================================== --- docs/nmap.dtd (revision 5015) +++ docs/nmap.dtd (working copy) @@ -132,7 +132,7 @@ <!ELEMENT host ( status, address , (address | hostnames | smurf | ports | os | distance | uptime | tcpsequence | ipidsequence | tcptssequence | - hostscript | trace)* ) > + hostscript | trace)*, times ) > <!-- these elements are written by output.c:write_xml_initial_hostinfo() --> <!ELEMENT status EMPTY > @@ -297,6 +297,13 @@ errorstr CDATA #IMPLIED
+<!ELEMENT times EMPTY> +<!ATTLIST times + srtt CDATA #REQUIRED + rttvar CDATA #REQUIRED + to CDATA #REQUIRED +> + <!-- these elements are generated in output.c:printfinaloutput() --> <!ELEMENT runstats (finished, hosts) >
_______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- [PATCH] <times> XML element for host's final times Kris Katterjohn (Jun 25)
- Re: [PATCH] <times> XML element for host's final times Fyodor (Jun 25)