Nmap Development mailing list archives

Re: Raw IP NSE Functionality (Was Re: [NSE] Raw ethernet frame questions ...)


From: Patrick Donnelly <batrick () batbytes com>
Date: Wed, 17 Feb 2010 22:35:04 -0500

On Wed, Feb 17, 2010 at 8:16 PM, David Fifield <david () bamsoftware com> wrote:
The nmap.is_privileged function I have no objection to. All the above is
fine with me. One thing deserves some further design discussion, which
is the nmap.get_ports function. I think it would be better to wrap
PortList::nextPort more directly, giving scripts one-at-a-time access to
port tables (and avoiding creating a potentially large table of tables,
most of which won't be used by many scripts). A script that needs the
full port list can easily create it by doing just what your C function
does, looping with nextPort. Scripts like ipidseq.nse that need just any
old port wouldn't need to allocate as much memory.

NSE currently iterates over the port tables in the same way Kris does
(create a large array of port tables). We can move to the other
approach but we will need to have some "complicated" userdata for the
for loop invariant (see generic for loops [1]). If we do this it
should be generic enough so that NSE can use it too. I can do this if
Kris doesn't want to.

[1] http://www.lua.org/manual/5.1/manual.html#2.4.5

-- 
- Patrick Donnelly
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: