Nmap Development mailing list archives

Re: [NSE][patch] Keep only one copy of mac_prefixes table in registry


From: Toni Ruottu <toni.ruottu () iki fi>
Date: Thu, 26 Jul 2012 21:17:44 +0300

Should we have a library for this, just so people realize they don't need
to duplicate the functionality?

On Thursday, 26 July 2012, Daniel Miller wrote:

List,

The scripts address-info, lltd-discovery, snmp-interfaces, and nbstat all
make use of the datafiles.parse_mac_prefixes function, which parses the
nmap-mac-prefixes file and returns a table with the results. The file is
almost 400K, so the data structure is probably at least that large. In
order to avoid parsing the file multiple times, each script stores the
results of the parsing in a different area of the nmap.registry. I've
attached a patch to allow them to all make use of the same table, avoiding
up to 3 extra file parses and 3 extra copies of the table in memory.

I'd appreciate a second look to be sure I didn't mess something up.

Dan

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


Current thread: