Nmap Development mailing list archives

Re: Updated DHCP scripts


From: David Fifield <david () bamsoftware com>
Date: Fri, 27 Aug 2010 15:11:36 -0600

On Fri, Aug 27, 2010 at 03:47:11PM -0500, Ron wrote:
On Mon, 16 Aug 2010 10:20:05 -0600 David Fifield <david () bamsoftware com> wrote:
You need to make dhcp.lua into a proper module so it doesn't just
store everything globally. I think you just have to add the line

    module(... or "dhcp", package.seeall)

at the top. Then in the script you need to change everything like

    dhcp_make_request(host.ip, host.interface, request_type,
"0.0.0.0", mac_addr)

to

    dhcp.dhcp_make_request(host.ip, host.interface, request_type,
"0.0.0.0", mac_addr)

In fact, I would get rid of the "dhcp_" prefix on exported names,
because they will already be qualified by "dhcp.".

David Fifield
Thanks, that was a pretty boneheaded mistake. :)

Attached is the new patch. 

I also resolved a conflict that was introduced by a change to the connect() function. 

I have the 'prerule' mode prepared for whenever we figure out how to do broadcasts (I don't believe the issues that 
Patrik was investigating were resolved?)

Cool, please commit it.

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


Current thread: