opnsense-src/sys/netinet/libalias
Lutz Donnerhacke d261e57dea libalias: Switch to efficient data structure for incoming traffic
Current data structure is using a hash of unordered lists.  Those
unordered lists are quite efficient, because the least recently
inserted entries are most likely to be used again.  In order to avoid
long search times in other cases, the lists are hashed into many
buckets.  Unfortunatly a search for a miss needs an exhaustive
inspection and a careful definition of the hash.

Splay trees offer a similar feature: Almost O(1) for access of the
least recently used entries, and amortized O(ln(n)) for almost all
other cases.  Get rid of the hash.

Now the data structure should able to quickly react to external
packets without eating CPU cycles for breakfast, preventing a DoS.

PR:		192888
Discussed with:	Dimitry Luhtionov
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D30536
2021-06-19 22:12:28 +02:00
..
alias.c libalias: Remove unused function LibAliasCheckNewLink 2021-05-31 12:53:57 +02:00
alias.h libalias: Remove LibAliasCheckNewLink 2021-05-31 13:04:11 +02:00
alias_db.c libalias: Switch to efficient data structure for incoming traffic 2021-06-19 22:12:28 +02:00
alias_dummy.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_ftp.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_irc.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_local.h libalias: Switch to efficient data structure for incoming traffic 2021-06-19 22:12:28 +02:00
alias_mod.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_mod.h malloc: try to use builtins for zeroing at the callsite 2018-06-02 22:20:09 +00:00
alias_nbt.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_pptp.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_proxy.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_sctp.c libalias: Promote per instance global variable timeStamp 2021-06-19 18:25:44 +02:00
alias_sctp.h libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_skinny.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_smedia.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
alias_util.c libalias: Style cleanup 2021-05-15 08:57:55 +02:00
HISTORY libalias: Restructure - Finalize 2021-06-19 21:58:56 +02:00
libalias.3 libalias: Remove unused function LibAliasCheckNewLink 2021-05-31 12:53:57 +02:00