diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-30 16:47:30 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 16:47:30 +0200 |
commit | d7bec897ab772cdccce10b296d4efd48d9181297 (patch) | |
tree | e71df451de987008921522a2a93b39c505484171 /proto/bgp/bgp.h | |
parent | e16e1e4138cf10fd8f2508fa0e41e5ec98de6d53 (diff) | |
parent | ef4313e1667a8745c8d8813ac78342ec7c035895 (diff) |
Merge commit 'ef4313e1667a8745c8d8813ac78342ec7c035895' into haugesund
Diffstat (limited to 'proto/bgp/bgp.h')
-rw-r--r-- | proto/bgp/bgp.h | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index 0a4b14a8..cf6e2b6f 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -544,32 +544,11 @@ bgp_find_attr(ea_list *attrs, uint code) return ea_find(attrs, EA_CODE(PROTOCOL_BGP, code)); } -eattr * -bgp_set_attr(ea_list **attrs, struct linpool *pool, uint code, uint flags, union bval val); +void bgp_set_attr_u32(ea_list **to, uint code, uint flags, u32 val); +void bgp_set_attr_ptr(ea_list **to, uint code, uint flags, const struct adata *ad); +void bgp_set_attr_data(ea_list **to, uint code, uint flags, void *data, uint len); -static inline void -bgp_set_attr_u32(ea_list **to, struct linpool *pool, uint code, uint flags, u32 val) -{ - union bval bv = { .data = val }; - bgp_set_attr(to, pool, code, flags, bv); -} - -static inline void -bgp_set_attr_ptr(ea_list **to, struct linpool *pool, uint code, uint flags, const struct adata *ad) -{ - union bval bv = { .ptr = ad }; - bgp_set_attr(to, pool, code, flags, bv); -} - -static inline void -bgp_set_attr_data(ea_list **to, struct linpool *pool, uint code, uint flags, void *data, uint len) -{ - struct adata *a = lp_alloc_adata(pool, len); - bmemcpy(a->data, data, len); - bgp_set_attr_ptr(to, pool, code, flags, a); -} - -#define bgp_unset_attr(to, pool, code) ea_unset_attr(to, pool, 0, code) +#define bgp_unset_attr(to, code) ea_unset_attr(to, 0, code) int bgp_encode_mp_reach_mrt(struct bgp_write_state *s, eattr *a, byte *buf, uint size); |