summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 17:26:25 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 17:26:25 +0200
commit41508ceac3cdd74ca705d3bfc6a79464bf38e0b5 (patch)
tree4a0506a93849b3b7e61faeeaba1af289e13d646a /lib
parent65254128e105903b6b470c6b4bb4729f56cf81bc (diff)
parent1c30b689ddd032ef8000fb7836348a48ba3184ff (diff)
Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesund
Diffstat (limited to 'lib')
-rw-r--r--lib/route.h12
-rw-r--r--lib/type_test.c1
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/route.h b/lib/route.h
index 30ac2672..cfb08bbe 100644
--- a/lib/route.h
+++ b/lib/route.h
@@ -87,7 +87,6 @@ typedef struct rta {
struct ea_list *eattrs; /* Extended Attribute chain */
struct hostentry *hostentry; /* Hostentry for recursive next-hops */
u16 cached:1; /* Are attributes cached? */
- u16 source:7; /* Route source (RTS_...) */
u16 dest:4; /* Route destination type (RTD_...) */
struct nexthop nh; /* Next hop */
} rta;
@@ -133,12 +132,13 @@ static inline int rte_is_reachable(rte *r)
typedef struct eattr {
word id; /* EA_CODE(PROTOCOL_..., protocol-dependent ID) */
byte flags; /* Protocol-dependent flags */
- byte type:5; /* Attribute type */
+ byte type; /* Attribute type */
+ byte rfu:5;
byte originated:1; /* The attribute has originated locally */
byte fresh:1; /* An uncached attribute (e.g. modified in export filter) */
byte undef:1; /* Explicitly undefined */
- PADDING(unused, 0, 4);
+ PADDING(unused, 3, 3);
union bval u;
} eattr;
@@ -310,6 +310,12 @@ u32 rt_get_igp_metric(const rte *rt);
/* From: Advertising router */
extern struct ea_class ea_gen_from;
+/* Source: An old method to devise the route source protocol and kind.
+ * To be superseded in a near future by something more informative. */
+extern struct ea_class ea_gen_source;
+static inline u32 rt_get_source_attr(const rte *rt)
+{ return ea_get_int(rt->attrs->eattrs, &ea_gen_source, 0); }
+
/* Next hop structures */
#define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK)
diff --git a/lib/type_test.c b/lib/type_test.c
index 20e7630b..b526db69 100644
--- a/lib/type_test.c
+++ b/lib/type_test.c
@@ -54,6 +54,7 @@ t_eattr(void)
e.id = ~0;
e.flags = ~0;
e.type = ~0;
+ e.rfu = ~0;
e.originated = ~0;
e.fresh = ~0;
e.undef = ~0;