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 /proto/rip/rip.c | |
parent | ef4313e1667a8745c8d8813ac78342ec7c035895 (diff) |
Protocols use EA_LITERAL_* to set attributes
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r-- | proto/rip/rip.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c index fa5b1289..2b5babcb 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -195,26 +195,14 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en) struct { ea_list l; - eattr e[3]; + eattr a[3]; struct rip_iface_adata riad; } ea_block = { - .l = { .count = 3, }, - .e = { - { - .id = EA_RIP_METRIC, - .type = T_INT, - .u.data = rt_metric, - }, - { - .id = EA_RIP_TAG, - .type = T_INT, - .u.data = rt_tag, - }, - { - .id = EA_RIP_FROM, - .type = T_IFACE, - .u.ptr = &ea_block.riad.ad, - } + .l.count = 3, + .a = { + EA_LITERAL_EMBEDDED(EA_RIP_METRIC, T_INT, 0, rt_metric), + EA_LITERAL_EMBEDDED(EA_RIP_TAG, T_INT, 0, rt_tag), + EA_LITERAL_DIRECT_ADATA(EA_RIP_FROM, T_IFACE, 0, &ea_block.riad.ad), }, .riad = { .ad = { .length = sizeof(struct rip_iface_adata) - sizeof(struct adata) }, |