Nmap Development mailing list archives

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


From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 26 Jul 2012 16:34:27 -0500

I think that it would be easy enough to roll into the datafiles library. Here's a patch to do just that. I really prefer this to my previous solution, but welcome any comments.

Dan

On 07/26/2012 01:17 PM, Toni Ruottu wrote:
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

Attachment: datafiles-caching.patch
Description:

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

Current thread: