summaryrefslogtreecommitdiff
path: root/nest/route.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-06-13 15:49:53 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-22 21:38:33 +0100
commitf2010f9c65ca69584c34c762fb3e5e957958478e (patch)
tree821f3c498cef0e17feb50e5074ac29854f991175 /nest/route.h
parent33ad6e0188b56f682a012ca1b782812c96285d51 (diff)
Static: Protocol rework wrt. struct nexthop changes; MPLS label support
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/nest/route.h b/nest/route.h
index d9a1737b..c293fbb1 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -513,6 +513,7 @@ ea_list *ea_append(ea_list *to, ea_list *what);
void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max);
#define NEXTHOP_MAX_LABEL_STACK 8
+#define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK)
static inline size_t nexthop_size(const struct nexthop *nh)
{ return sizeof(struct nexthop) + sizeof(u32)*nh->labels; }
@@ -527,6 +528,7 @@ int nexthop_is_sorted(struct nexthop *x);
void rta_init(void);
static inline size_t rta_size(const rta *a) { return sizeof(rta) + sizeof(u32)*a->nh.labels; }
+#define RTA_MAX_SIZE (sizeof(rta) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK)
rta *rta_lookup(rta *); /* Get rta equivalent to this one, uc++ */
static inline int rta_is_cached(rta *r) { return r->aflags & RTAF_CACHED; }
static inline rta *rta_clone(rta *r) { r->uc++; return r; }