From 22f95d9889f07d868ffaec40ab43fd8dd9b0bb31 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sat, 26 Mar 2022 12:37:41 +0100 Subject: Special attribute types for enums --- nest/route.h | 3 +++ nest/rt-attr.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'nest') diff --git a/nest/route.h b/nest/route.h index 7557bf93..d2f60f41 100644 --- a/nest/route.h +++ b/nest/route.h @@ -540,6 +540,9 @@ const char *ea_custom_name(uint ea); #define EAF_TYPE_EC_SET 0x0e /* Set of pairs of u32's - ext. community list */ #define EAF_TYPE_LC_SET 0x08 /* Set of triplets of u32's - large community list */ #define EAF_TYPE_IFACE 0x0c /* Interface pointer stored in adata */ +#define EAF_TYPE_BGP_ORIGIN 0x11 /* BGP Origin enum */ +#define EAF_TYPE_RA_PREFERENCE 0x13 /* RA Preference enum */ + #define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */ /* Otherwise, attribute data is adata */ diff --git a/nest/rt-attr.c b/nest/rt-attr.c index abda5d82..25548dca 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -948,7 +948,7 @@ ea_show(struct cli *c, const eattr *e) if (e->undef) bsprintf(pos, "undefined"); else - switch (e->type & EAF_TYPE_MASK) + switch (e->type) { case EAF_TYPE_INT: bsprintf(pos, "%u", e->u.data); @@ -1008,7 +1008,10 @@ ea_dump(ea_list *e) { eattr *a = &e->attrs[i]; debug(" %02x:%02x.%02x", EA_PROTO(a->id), EA_ID(a->id), a->flags); - debug("=%c", "?iO?I?P???S?????" [a->type & EAF_TYPE_MASK]); + debug("=%c", + "?iO?IRP???S??pE?" + "??L???N?????????" + "?o???r??????????" [a->type]); if (a->originated) debug("o"); if (a->type & EAF_EMBEDDED) -- cgit v1.2.3