]> git.proxmox.com Git - mirror_frr.git/commit - ldpd/hello.c
ldpd: use red-black trees to store 'adj' elements
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 14 Dec 2016 19:39:28 +0000 (17:39 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 4 Jan 2017 00:07:13 +0000 (22:07 -0200)
commit057d48bd58776c31db20ec8cf3044cb1d20140d5
treefff0a4472f2e1b59b52408f43dc0e97e57897976
parent20bacaeba2381b7b199166e006576606defbaf0f
ldpd: use red-black trees to store 'adj' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/adjacency.c
ldpd/hello.c
ldpd/interface.c
ldpd/lde.c
ldpd/ldpd.h
ldpd/ldpe.c
ldpd/ldpe.h
ldpd/neighbor.c