Nmap Development mailing list archives

Refactoring changes to target parsing


From: David Fifield <david () bamsoftware com>
Date: Tue, 22 Jan 2013 13:05:58 -0800

In r30539 I merged some changes to how targets are parsed. The main
change is the breaking up of one class, TargetGroup, which knew what
type of target it contained and had data members for each possible type,
into several subclasses of a new class NetBlock, which have mostly
common methods but their own data members.

This is part of a larger project to simplify how target handling works,
with the concrete goal of doing automatic multicast host discovery of
locally connected IPv6 networks. Now there is a specific type
(NetBlockIPv6Netmask) that represents an IPv6 target specification with
a netmask, before being broken into its individual addresses. While
IPv6 multicast discovery is not yet implemented in Nmap in C++ yet, an
instance of such a type can in principle be passed to a function doing
multicast discovery, with the resulting up hosts being passed to later
phases for scanning.

I did not make as much progress on this task as I hoped, as the code
surrounding target parsing and host discovery is quite complex. I hope
to be able to revisit this; alternatively, beginning to port the various
targets-ipv6-multicast scripts to a single C++ IPv6 multicast discovery
function would be a nice thing for someone to work on.

David Fifield
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: