diff options
author | Maria Matejka <mq@ucw.cz> | 2019-03-18 12:54:40 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-03-18 12:54:40 +0100 |
commit | 8d65add626b34256879a3e83855af3c0fa8ce4e7 (patch) | |
tree | dafa110c47bc328f4006d4298fd641e8210381b4 /nest/route.h | |
parent | 2f02c25e36f3946019c24dafe9b894a9e195350d (diff) | |
parent | 5d511948cddee415c2f0f1103bda0468a193f2d6 (diff) |
Merge branch 'master' into HEAD
Diffstat (limited to 'nest/route.h')
-rw-r--r-- | nest/route.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nest/route.h b/nest/route.h index 7c9f3005..9959ea69 100644 --- a/nest/route.h +++ b/nest/route.h @@ -308,6 +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_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); @@ -481,6 +485,7 @@ typedef struct eattr { #define EA_CODE(proto,id) (((proto) << 8) | (id)) #define EA_ID(ea) ((ea) & 0xff) #define EA_PROTO(ea) ((ea) >> 8) +#define EA_ID_FLAG(ea) (1 << EA_ID(ea)) #define EA_CUSTOM(id) ((id) | EA_CUSTOM_BIT) #define EA_IS_CUSTOM(ea) ((ea) & EA_CUSTOM_BIT) #define EA_CUSTOM_ID(ea) ((ea) & ~EA_CUSTOM_BIT) @@ -510,7 +515,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 +546,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 +579,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 * |