From c1194ab7edbb17cb7371ac38e6eab5ae3ae72163 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sun, 10 Apr 2022 19:31:50 +0200 Subject: Protocols use EA_LITERAL_* to set attributes --- proto/rip/rip.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'proto/rip') 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) }, -- cgit v1.2.3