diff options
author | Jan Maria Matejka <mq@ucw.cz> | 2018-05-29 12:08:12 +0200 |
---|---|---|
committer | Jan Maria Matejka <mq@ucw.cz> | 2018-05-30 17:08:49 +0200 |
commit | 13c0be19d3d2acc9c1636bbab9222aabdf27d7ac (patch) | |
tree | 8df5514a7d995becaa85ab8a9de700cfa93cb302 /nest/route.h | |
parent | ee7e2ffd265fd76dbc8c94d9c2d48da54c27ff76 (diff) |
Nest: Removing separate tmpa from route propagation
This is a fundamental change of an original (1999) concept of route
processing inside BIRD. During import/export, there was a temporary
ea_list created which was to be used instead of the another one inside
the route itself.
This led to some confusion, quirks, and strange filter code that handled
extended route attributes. Dropping it now.
The protocol interface has changed in an uniform way -- the
`struct ea_list *attrs` argument has been removed from store_tmp_attrs(),
import_control(), rt_notify() and get_route_info().
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nest/route.h b/nest/route.h index 1391b357..cad15440 100644 --- a/nest/route.h +++ b/nest/route.h @@ -294,7 +294,7 @@ rte *rte_get_temp(struct rta *); void rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src); /* rte_update() moved to protocol.h to avoid dependency conflicts */ int rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter); -rte *rt_export_merged(struct channel *c, net *net, rte **rt_free, struct ea_list **tmpa, linpool *pool, int silent); +rte *rt_export_merged(struct channel *c, net *net, rte **rt_free, linpool *pool, int silent); void rt_refresh_begin(rtable *t, struct channel *c); void rt_refresh_end(rtable *t, struct channel *c); void rt_schedule_prune(rtable *t); @@ -546,6 +546,15 @@ uint ea_hash(ea_list *e); /* Calculate 16-bit hash value */ ea_list *ea_append(ea_list *to, ea_list *what); void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max); +#define ea_normalize(ea) do { \ + if (ea->next) { \ + ea_list *t = alloca(ea_scan(ea)); \ + ea_merge(ea, t); \ + ea = t; \ + } \ + ea_sort(ea); \ +} while(0) \ + static inline eattr * ea_set_attr(ea_list **to, struct linpool *pool, uint id, uint flags, uint type, uintptr_t val) { @@ -611,7 +620,7 @@ rta *rta_do_cow(rta *o, linpool *lp); static inline rta * rta_cow(rta *r, linpool *lp) { return rta_is_cached(r) ? rta_do_cow(r, lp) : r; } void rta_dump(rta *); void rta_dump_all(void); -void rta_show(struct cli *, rta *, ea_list *); +void rta_show(struct cli *, rta *); struct hostentry * rt_get_hostentry(rtable *tab, ip_addr a, ip_addr ll, rtable *dep); void rta_apply_hostentry(rta *a, struct hostentry *he, mpls_label_stack *mls); |