p->withdraw_bucket = NULL;
fib_init(&p->prefix_fib, p->p.pool, sizeof(struct bgp_prefix), 0, bgp_init_prefix);
}
+
+void
+bgp_get_route_info(rte *e, byte *buf, ea_list *attrs)
+{
+ eattr *p = ea_find(attrs, EA_CODE(EAP_BGP, BA_AS_PATH));
+ eattr *o = ea_find(attrs, EA_CODE(EAP_BGP, BA_ORIGIN));
+ int origas;
+
+ buf += bsprintf(buf, " (%d) [", e->pref);
+ if (p && (origas = as_path_get_first(p->u.ptr)) >= 0)
+ buf += bsprintf(buf, "AS%d", origas);
+ if (o)
+ buf += bsprintf(buf, "%c", "ie?"[o->u.data]);
+ strcpy(buf, "]");
+}
get_status: bgp_get_status,
get_attr: bgp_get_attr,
reconfigure: bgp_reconfigure,
-#if 0
- dump: bgp_dump,
get_route_info: bgp_get_route_info,
-#endif
};
void bgp_attr_init(struct bgp_proto *);
unsigned int bgp_encode_attrs(byte *w, struct ea_list *attrs, int remains);
void bgp_free_bucket(struct bgp_proto *p, struct bgp_bucket *buck);
+void bgp_get_route_info(struct rte *, byte *buf, struct ea_list *attrs);
/* packets.c */