summaryrefslogtreecommitdiff
path: root/lib/route.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-04 14:41:51 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-04 15:39:53 +0200
commit1c30b689ddd032ef8000fb7836348a48ba3184ff (patch)
treec2fdb9a74c235af77e3587eb7c5c762dcdc62dd4 /lib/route.h
parent702c04fbef222e802ca4dfac645dc75ede522db6 (diff)
Moved route source attribute (RTS_*) to eattrs
Diffstat (limited to 'lib/route.h')
-rw-r--r--lib/route.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/route.h b/lib/route.h
index 40ba150d..8fdb5d8b 100644
--- a/lib/route.h
+++ b/lib/route.h
@@ -85,7 +85,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;
@@ -131,12 +130,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;
@@ -308,6 +308,12 @@ u32 rt_get_igp_metric(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(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)