]> git.proxmox.com Git - mirror_frr.git/commit - lib/srcdest_table.h
lib: add second-level route_table for srcdest
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 24 Apr 2014 17:29:07 +0000 (19:29 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Mon, 30 Jan 2017 12:51:50 +0000 (13:51 +0100)
commit0964ad9cecf3e60c843c3e55a26eecb522a98a29
tree16bcb8e70088671ca1c5e4bbfb9a1eb40d965924
parent61cdc88971be14970d2d9ce56275387a246ac1c3
lib: add second-level route_table for srcdest

IPv6 srcdest routes need to be keyed by both destination and source
prefix.  Since the lookup order is destination first, the simplest thing
to do here is to add a second route_table to destination entries, which
then contain source entries.  Sadly, the result is somewhat confusing
since a route_node might now be either a source node or a destination
node.

There are helper functions to get source and destination prefix from a
given route node (which can be either a destination or a source route).

The following bits have been added by Christian Franke
<chris@opensourcerouting.org>:
- make srcdest routing table reusable by moving it into lib
- make the srcdest routing table structure more opaque
- implement a srcdest routing table iterator
- fix a refcounting issue in src_node_lookup
- match route_node_lookup behavior with srcdest_rnode_lookup
- add accessor for the route_node table and table_info
- add string formatter srcdest_rnode2str

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
[v3: adapted for cmaster-next as of 2016-12-05]
lib/Makefile.am
lib/srcdest_table.c [new file with mode: 0644]
lib/srcdest_table.h [new file with mode: 0644]
lib/table.c
lib/table.h