mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 13:19:01 +00:00
86d766a34ed05b05d3dab58fda5e844a65beaf26
lookup. The hash table used linear probing which got very slow as the hash table got full. Using std::map is about 10 times faster. The hash table was slow enough that it took the majority of the time for me in an ARP scan of a single address. # nmap -sP 192.168.0.190 mac_prefix_init took 0.49261 s. Nmap done: 1 IP address (1 host up) scanned in 0.59 seconds # nmap -sP 192.168.0.190 mac_prefix_init took 0.04392 s. Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds The memory usage of std::map is probably greater. The hash table used 19037 pointers and about 13000 structures of size 8 (on a 32-bit architecture), or about 176 KB. Assuming the map has left, right, and parent pointers, and a red-black indicator per node, the usage is 16 bytes per prefix plus 8 bytes for the structure data, or 304 KB total. But this makes fingerdiff so much faster, I want to leave it in place at least until this round of OS integration is done.
Modified UDP-payload-related code to make it independent of the NmapOps class so it can be reused by other apps like Nping. More info at http://seclists.org/nmap-dev/2009/q3/0051.html
Here is some documentation for Nmap, but these files are much less comprehensive than what you'll find at the actual Nmap documentation site ( http://nmap.org ).
Description
Languages
C
37.8%
Lua
28.1%
C++
16.7%
Shell
5.8%
Python
4.2%
Other
7.1%