diff options
author | Maria Matejka <mq@ucw.cz> | 2022-04-10 19:31:50 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:37:41 +0200 |
commit | c1194ab7edbb17cb7371ac38e6eab5ae3ae72163 (patch) | |
tree | 821c04b0900ddc33c6bd20c4ca93dd30aa8a23b4 /lib | |
parent | ef4313e1667a8745c8d8813ac78342ec7c035895 (diff) |
Protocols use EA_LITERAL_* to set attributes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/route.h b/lib/route.h index 49810887..431da4d8 100644 --- a/lib/route.h +++ b/lib/route.h @@ -225,9 +225,14 @@ struct ea_one_attr_list { EA_LITERAL_GENERIC(_id, _type, _flags, .u.i = _val); \ }) -#define EA_LITERAL_ADATA(_id, _type, _flags, _buf, _len) ({ \ +#define EA_LITERAL_STORE_ADATA(_id, _type, _flags, _buf, _len) ({ \ ASSERT_DIE(!(_type & EAF_EMBEDDED)); \ - EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = tmp_store_adata(_buf, _len)); \ + EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = tmp_store_adata((_buf), (_len))); \ + }) + +#define EA_LITERAL_DIRECT_ADATA(_id, _type, _flags, _adata) ({ \ + ASSERT_DIE(!(_type & EAF_EMBEDDED)); \ + EA_LITERAL_GENERIC(_id, _type, _flags, .u.ad = _adata); \ }) #define EA_LITERAL_GENERIC(_id, _type, _flags, ...) \ @@ -261,7 +266,7 @@ ea_set_attr_u32(ea_list **to, uint id, uint flags, uint type, u32 data) static inline void ea_set_attr_data(ea_list **to, uint id, uint flags, uint type, void *data, uint len) -{ ea_set_attr(to, EA_LITERAL_ADATA(id, type, flags, data, len)); } +{ ea_set_attr(to, EA_LITERAL_STORE_ADATA(id, type, flags, data, len)); } #define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK) |