From 265419a3695b9a5c0a01d9fffc60f66fea8bee13 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 21 Nov 2018 20:37:11 +0100 Subject: Custom route attributes For local route marking purposes, local custom route attributes may be defined. These attributes are seamlessly stripped after export filter to every real protocol like Kernel, BGP or OSPF, they however pass through pipes. We currently allow at most 256 custom attributes. This should be much faster than currently used bgp communities for marking routes. --- nest/rt-attr.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'nest/rt-attr.c') diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 7a91a4f6..eeeaaa4c 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -884,7 +884,18 @@ ea_show(struct cli *c, eattr *e) byte buf[CLI_MSG_SIZE]; byte *pos = buf, *end = buf + sizeof(buf); - if (p = class_to_protocol[EA_PROTO(e->id)]) + if (EA_IS_CUSTOM(e->id)) + { + const char *name = ea_custom_name(e->id); + if (name) + { + pos += bsprintf(pos, "%s", name); + status = GA_NAME; + } + else + pos += bsprintf(pos, "%02x.", EA_PROTO(e->id)); + } + else if (p = class_to_protocol[EA_PROTO(e->id)]) { pos += bsprintf(pos, "%s.", p->name); if (p->get_attr) -- cgit v1.2.3