mirror_frr/tests
Avneesh Sachdev 28971c8cb1 lib/table: add route_table_get_next() and iterator
* lib/table.[ch]

    - Add a function (route_table_get_next()) to get the route_node in
      a tree that succeeds a given prefix in iteration order.

      This allows one to reliably walk nodes in a tree while allowing
      modifications, and is useful for achieving scale and
      performance. Other approaches are also possible -- the main plus
      point of this one is that it does not require any state about
      the walk to be maintained in the table data structures.

    - Add an iterator for walking the nodes in a tree. This introduces
      a new structure (route_table_iter_t) and the following main
      functions.

        route_table_iter_init()
        route_table_iter_pause()
        route_table_iter_next()
        route_table_iter_cleanup()

      The iterator normally uses node pointers and the existing
      route_next() function to walk nodes efficiently. When an
      iteration is 'paused' with route_table_iter_pause(), it stores
      the last prefix processed. The next call to
      route_table_iter_next() transparently invokes
      route_table_get_next() with the prefix to resume iteration.

  * bgpd/bgp_table.[ch]

    Add wrappers for the new table features described above.

  * tests/table_test.c

    Add tests for the new table code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-09-26 21:50:48 +02:00
..
.gitignore lib/table: add route_table_get_next() and iterator 2012-09-26 21:50:48 +02:00
aspath_test.c tests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run 2012-06-19 13:40:22 +01:00
bgp_capability_test.c tests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run 2012-06-19 13:40:22 +01:00
bgp_mp_attr_test.c tests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run 2012-06-19 13:40:22 +01:00
bgp_mpath_test.c tests: BGP unit tests to set BGP_OPT_NO_LISTEN so they can run 2012-06-19 13:40:22 +01:00
ecommunity_test.c tests: Fix some compile errors and warnings 2012-05-02 11:02:10 +01:00
heavy-thread.c 2004-05-25 Paul Jakma <paul@dishone.st> 2005-04-25 16:42:24 +00:00
heavy-wq.c delete CVS keywords 2011-09-27 21:34:26 +04:00
heavy.c 2004-05-25 Paul Jakma <paul@dishone.st> 2005-04-25 16:42:24 +00:00
main.c all: check return value from daemon() call 2009-08-13 10:21:13 +01:00
Makefile.am lib/table: add route_table_get_next() and iterator 2012-09-26 21:50:48 +02:00
table_test.c lib/table: add route_table_get_next() and iterator 2012-09-26 21:50:48 +02:00
test-buffer.c 2004-09-06 Paul Jakma <paul@dishone.st> 2005-09-06 23:08:01 +00:00
test-checksum.c tests: Fix some compile errors and warnings 2012-05-02 11:02:10 +01:00
test-memory.c 2004-05-13 Paul Jakma <paul@dishone.st> 2005-04-13 03:31:35 +00:00
test-privs.c 2005-10-11 Paul Jakma <paul.jakma@sun.com> 2005-10-11 03:48:28 +00:00
test-sig.c [tests] Fix stray character in previous commit 2006-05-28 08:32:44 +00:00
test-stream.c [tests] Add small unit test for the new stream functions 2006-01-10 14:49:04 +00:00