]> git.proxmox.com Git - mirror_frr.git/commit - ldpd/interface.c
ldpd: use red-black trees to store 'iface' elements
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 13 Dec 2016 17:29:35 +0000 (15:29 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 4 Jan 2017 00:07:13 +0000 (22:07 -0200)
commit7d3d7491a0bc4b04ee6f65e26ae5f115df5a34f1
treeaec70f72465b112b1acf7135169c8678fd49d967
parentd3e1887ad6b5ae2199710b3278c277838e6ef913
ldpd: use red-black trees to store 'iface' 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/interface.c
ldpd/lde.c
ldpd/ldp_debug.c
ldpd/ldp_vty_conf.c
ldpd/ldpd.c
ldpd/ldpd.h
ldpd/ldpe.c