diff options
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nest/route.h b/nest/route.h index 3e835bb1..15aac8f6 100644 --- a/nest/route.h +++ b/nest/route.h @@ -308,8 +308,10 @@ void rte_free(rte *); rte *rte_do_cow(rte *); static inline rte * rte_cow(rte *r) { return (r->flags & REF_COW) ? rte_do_cow(r) : r; } rte *rte_cow_rta(rte *r, linpool *lp); -void rte_make_tmp_attr(struct rte *r, struct ea_list *e, uint id, uint type, u32 val); -uint rte_store_tmp_attr(struct rte *r, uint id); +void rte_init_tmp_attrs(struct rte *r, linpool *lp, uint max); +void rte_make_tmp_attr(struct rte *r, uint id, uint type, uintptr_t val); +void rte_make_tmp_attrs(struct rte **r, struct linpool *pool, struct rta **old_attrs); +uintptr_t rte_store_tmp_attr(struct rte *r, uint id); void rt_dump(rtable *); void rt_dump_all(void); int rt_feed_channel(struct channel *c); @@ -512,7 +514,6 @@ const char *ea_custom_name(uint ea); #define EAF_VAR_LENGTH 0x02 /* Attribute length is variable (part of type spec) */ #define EAF_ORIGINATED 0x20 /* The attribute has originated locally */ #define EAF_FRESH 0x40 /* An uncached attribute (e.g. modified in export filter) */ -#define EAF_TEMP 0x80 /* A temporary attribute (the one stored in the tmp attr list) */ typedef struct adata { uint length; /* Length of data */ @@ -542,6 +543,7 @@ typedef struct ea_list { #define EALF_SORTED 1 /* Attributes are sorted by code */ #define EALF_BISECT 2 /* Use interval bisection for searching */ #define EALF_CACHED 4 /* Attributes belonging to cached rta */ +#define EALF_TEMP 8 /* Temporary ea_list added by make_tmp_attrs hooks */ struct rte_src *rt_find_source(struct proto *p, u32 id); struct rte_src *rt_get_source(struct proto *p, u32 id); @@ -574,6 +576,8 @@ void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **na ea = t; \ } \ ea_sort(ea); \ + if (ea->count == 0) \ + ea = NULL; \ } while(0) \ static inline eattr * |