nmap/nbase
dmiller 324965d1d2 Use a radix tree (trie) to match exclude addresses
Current exclusions list from --excludefile takes linear time to match
against. Using a trie structure, we can do matching in O(log n) time,
with a hard maximum of 32 comparisons for IPv4 and 128 comparisons for
IPv6. Each node of the trie represents an address prefix that all
subsequent nodes share; matching stops when one is matched exactly or
when the candidate address does not match any prefix of the addresses in
the trie.

For now, only numeric addresses without netmask are supported. We plan
to extend this to addresses with netmasks, including resolved names.
Storing IPv4 ranges and wildcards in this structure would be
prohibitively complex, so the existing linear match method will be used
for those. It is unlikely that any users are using large exclusion lists
of these types of specifications, so performance impact is small.

Potential future features could use the trie structure to implement
custom routing or scope-limiting.

This was a todo list item based on this report:
https://seclists.org/nmap-dev/2012/q4/420
2018-10-31 14:01:34 +00:00
..
test
acinclude.m4 Silence autoreconf warnings. Closes #1009 2017-09-19 17:01:39 +00:00
CHANGELOG
configure Check for additional libs required for inet_pton/ntop, as on Solaris 2018-07-02 16:20:39 +00:00
configure.ac Check for additional libs required for inet_pton/ntop, as on Solaris 2018-07-02 16:20:39 +00:00
getaddrinfo.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
getnameinfo.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
getopt.c Spellcheck on Nmap, Nsock, Nbase source files 2014-02-20 18:44:12 +00:00
getopt.h Remove trailing whitespace from C/C++ files 2014-02-12 20:25:51 +00:00
inet_ntop.c Allow use of Windows' own inet_pton and inet_ntop functions 2016-06-04 02:46:12 +00:00
inet_pton.c Allow use of Windows' own inet_pton and inet_ntop functions 2016-06-04 02:46:12 +00:00
Makefile.in Silence warnings: 'Makefile.in seems to ignore the --datarootdir setting' 2015-03-11 04:14:24 +00:00
nbase.h Use a radix tree (trie) to match exclude addresses 2018-10-31 14:01:34 +00:00
nbase.vcxproj Update platform toolset to remove XP compatibility 2016-06-04 02:46:11 +00:00
nbase_addrset.c Use a radix tree (trie) to match exclude addresses 2018-10-31 14:01:34 +00:00
nbase_addrset.h Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_config.h.in Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_crc32ct.h Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_ipv6.h Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_memalloc.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_misc.c Remove the old optparse function; options must be specified with hyphens. 2018-02-20 17:37:47 +00:00
nbase_rnd.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_str.c Corrects a few issues related to snprintf return values 2018-08-26 02:29:14 +00:00
nbase_time.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_winconfig.h Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_winunix.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
nbase_winunix.h Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
snprintf.c Rectifies incorrect use of va_start/va_end from stdarg.h. Closes #1297 2018-08-09 22:11:15 +00:00
strcasecmp.c Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00