Age | Commit message (Collapse) | Author |
|
When removing by peer, prev needs to be set to *nptr in order to
traverse that part of the trie.
The other remove by IP function can simply be removed, as it's not in
use.
The root freeing function can use pre-order traversal instead of
post-order.
The pre-order traversal code in general is now a nice iterator macro.
The common bits function can use the fast fls instructions and the match
function can be rewritten to simply compare common bits.
While we're at it, let's add tons of new tests, randomized checking
against a dumb implementation, and graphviz output.
And in general, it's nice to clean things up.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|