#include "bgpd/bgp_table.h"
#include "linklist.h"
+/* Satisfy link requirements from including bgpd.h */
+struct zebra_privs_t bgpd_privs = {0};
/*
* test_node_t
*
assert(prefix_count == listcount(list));
}
-static void do_test(struct bgp_table *table, const char *prefix, uint8_t maxlen,
- ...)
+static void do_test(struct bgp_table *table, const char *prefix,
+ uint32_t maxlen, ...)
{
va_list arglist;
struct list *list = list_new();
check_lookup_result(list, arglist);
- list_delete_and_null(&list);
+ list_delete(&list);
va_end(arglist);
"1.16.160.0/19", "1.16.32.0/20",
"1.16.32.0/21", "16.0.0.0/16"};
- int num_prefixes = sizeof(prefixes) / sizeof(prefixes[0]);
+ int num_prefixes = array_size(prefixes);
for (int i = 0; i < num_prefixes; i++)
add_node(table, prefixes[i]);
do_test(table, "16.0.0.0/8", 16, "16.0.0.0/16", NULL);
- do_test(table, "0.0.0.0/3", 21, "1.16.0.0/16", "1.16.128.0/18",
+ do_test(table, "0.0.0.0/2", 21, "1.16.0.0/16", "1.16.128.0/18",
"1.16.192.0/18", "1.16.64.0/19", "1.16.160.0/19",
"1.16.32.0/20", "1.16.32.0/21", "16.0.0.0/16", NULL);
}