summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index aa2a3b46..9d23374a 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -934,6 +934,15 @@ bgp_init_prefix_table(struct bgp_proto *p, u32 order)
p->prefix_slab = sl_new(p->p.pool, sizeof(struct bgp_prefix));
}
+void
+bgp_free_prefix_table(struct bgp_proto *p)
+{
+ HASH_FREE(p->prefix_hash);
+
+ rfree(p->prefix_slab);
+ p->prefix_slab = NULL;
+}
+
static struct bgp_prefix *
bgp_get_prefix(struct bgp_proto *p, ip_addr prefix, int pxlen, u32 path_id)
{
@@ -1941,6 +1950,23 @@ bgp_init_bucket_table(struct bgp_proto *p)
}
void
+bgp_free_bucket_table(struct bgp_proto *p)
+{
+ mb_free(p->bucket_hash);
+ p->bucket_hash = NULL;
+
+ struct bgp_bucket *b;
+ WALK_LIST_FIRST(b, p->bucket_queue)
+ {
+ rem_node(&b->send_node);
+ mb_free(b);
+ }
+
+ mb_free(p->withdraw_bucket);
+ p->withdraw_bucket = NULL;
+}
+
+void
bgp_get_route_info(rte *e, byte *buf, ea_list *attrs)
{
eattr *p = ea_find(attrs, EA_CODE(EAP_BGP, BA_AS_PATH));