mailing list archives
Re: Portreasons Changes
From: David Fifield <david () bamsoftware com>
Date: Sat, 28 May 2011 23:22:24 -0700
On Fri, May 27, 2011 at 09:55:52PM -0700, David Fifield wrote:
On Mon, May 23, 2011 at 02:46:28PM -0700, Colin L. Rice wrote:
I wrote a small patch to redo the port-reasons mapping system from ICMP
code and type to error type to output strings.
Instead of using icmp_mod_code and icmp_mod_type which was confusing
there is now a single function icmp_to_reason(type,code) which
translates ICMP codes and types to reason codes. This has the additional
benefit of allowing us to not worry about overlapping ICMP types and
codes in the modular system.
Instead of using to arrays to translate the reason codes to plural and
singular strings we now use a map combined with a reason_string class.
This allows us to add more items to the reason_string in the future such
as a detailed description as to how we got this as well as avoiding
Colin, I'm getting some strange output with this change:
$ sudo ./nmap -PE google.com -sn --reason
Starting Nmap 5.51SVN ( http://nmap.org ) at 2011-05-27 21:54 PDT
Nmap scan report for google.com (18.104.22.168)
Host is up, received unknown-responses (0.014s latency).
I expect echo-reply (singular). Do you get the same?
I added handling for echo reply to icmp_to_reason, and swapped the order
of singular and plural definitions, which were backwards. Would you and
make sure that all the reasons that were previously calculated by adding
ER_ICMPTYPE_MOD and ER_ICMPCODE_MOD are handled properly?
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/