diff options
author | Maria Matejka <mq@ucw.cz> | 2022-04-20 13:56:04 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-04 15:39:21 +0200 |
commit | 8ebac84bc8d51e2404ce6d6dc5e35fb261830596 (patch) | |
tree | ddf072a6ba02df9647f02e9203a8e4b3f214e108 /lib/route.h | |
parent | 337c04c45e1472d6d9b531a3c55f1f2d30ebf308 (diff) |
Moved advertising router info (FROM attribute) to eattrs
Diffstat (limited to 'lib/route.h')
-rw-r--r-- | lib/route.h | 10 |
1 files changed, 9 insertions, 1 deletions
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 */ |