From 8ebac84bc8d51e2404ce6d6dc5e35fb261830596 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 20 Apr 2022 13:56:04 +0200 Subject: Moved advertising router info (FROM attribute) to eattrs --- lib/route.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/route.h') diff --git a/lib/route.h b/lib/route.h index be72bb16..e02c63b3 100644 --- a/lib/route.h +++ b/lib/route.h @@ -84,7 +84,6 @@ typedef struct rta { u32 hash_key; /* Hash over important fields */ struct ea_list *eattrs; /* Extended Attribute chain */ struct hostentry *hostentry; /* Hostentry for recursive next-hops */ - ip_addr from; /* Advertising router */ u16 cached:1; /* Are attributes cached? */ u16 source:7; /* Route source (RTS_...) */ u16 scope:4; /* Route scope (SCOPE_... -- see ip.h) */ @@ -219,6 +218,13 @@ static inline eattr *ea_find_by_name(ea_list *l, const char *name) (ea ? ea->u.data : (_def)); \ }) +#define ea_get_ip(_l, _ident, _def) ({ \ + struct ea_class *cls = ea_class_find((_ident)); \ + ASSERT_DIE(cls->type == T_IP); \ + const eattr *ea = ea_find((_l), cls->id); \ + (ea ? *((const ip_addr *) ea->u.ptr->data) : (_def)); \ + }) + eattr *ea_walk(struct ea_walk_state *s, uint id, uint max); void ea_dump(ea_list *); int ea_same(ea_list *x, ea_list *y); /* Test whether two ea_lists are identical */ @@ -300,6 +306,8 @@ u32 rt_get_igp_metric(rte *rt); #define IGP_METRIC_UNKNOWN 0x80000000 /* Default igp_metric used when no other protocol-specific metric is availabe */ +/* From: Advertising router */ +extern struct ea_class ea_gen_from; /* Next hop structures */ -- cgit v1.2.3 From 702c04fbef222e802ca4dfac645dc75ede522db6 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 4 May 2022 12:41:54 +0200 Subject: Removing the route scope attribute. Use custom attributes instead. The route scope attribute was used for simple user route marking. As there is a better tool for this (custom attributes), the old and limited way can be dropped. --- doc/bird.sgml | 8 -------- filter/config.Y | 1 - filter/data.h | 1 - filter/f-inst.c | 5 ----- filter/test.conf2 | 6 ------ lib/route.h | 1 - nest/rt-attr.c | 8 +++----- nest/rt-dev.c | 1 - proto/babel/babel.c | 2 -- proto/bgp/packets.c | 1 - proto/ospf/rt.c | 1 - proto/perf/perf.c | 1 - proto/rip/rip.c | 1 - proto/rpki/rpki.c | 1 - proto/static/static.c | 1 - sysdep/bsd/krt-sock.c | 1 - sysdep/linux/netlink.c | 1 - 17 files changed, 3 insertions(+), 38 deletions(-) (limited to 'lib/route.h') diff --git a/doc/bird.sgml b/doc/bird.sgml index a71624aa..aa058b37 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1723,14 +1723,6 @@ Common route attributes are: primary key of the routing table. Read-only. (See the .) -