From 53da221b13225695516ec7469ca29d82bb10e594 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Sat, 24 Feb 2018 02:11:19 -0800 Subject: IP6 link-local table - IPv6 link local table is a per-SW interface array of IPv6 unicast FIBs - the per-interface ocst is sizeof(fib_table_t) which is small, w.r.t. the cost of an interface - FE80::/10 in the 'global' table points to a DPO that performs a lookup in the input interface's LL fib. Change-Id: Ice834b25ebeeacb2e929d7c864d7ec8c09918cbe Signed-off-by: Neale Ranns --- src/vnet/fib/fib_table.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/vnet/fib/fib_table.h') diff --git a/src/vnet/fib/fib_table.h b/src/vnet/fib/fib_table.h index 14ac7054059..ddc00e537c2 100644 --- a/src/vnet/fib/fib_table.h +++ b/src/vnet/fib/fib_table.h @@ -28,6 +28,40 @@ #define FIB_TABLE_N_LOCKS (FIB_SOURCE_MAX+1) #define FIB_TABLE_TOTAL_LOCKS FIB_SOURCE_MAX +/** + * Flags for the source data + */ +typedef enum fib_table_attribute_t_ { + /** + * Marker. Add new values after this one. + */ + FIB_TABLE_ATTRIBUTE_FIRST, + /** + * the table is for IP6 link local addresses + */ + FIB_TABLE_ATTRIBUTE_IP6_LL = FIB_TABLE_ATTRIBUTE_FIRST, + /** + * Marker. add new entries before this one. + */ + FIB_TABLE_ATTRIBUTE_LAST = FIB_TABLE_ATTRIBUTE_IP6_LL, +} fib_table_attribute_t; + +#define FIB_TABLE_ATTRIBUTE_MAX (FIB_TABLE_ATTRIBUTE_LAST+1) + +#define FIB_TABLE_ATTRIBUTES { \ + [FIB_TABLE_ATTRIBUTE_IP6_LL] = "ip6-ll", \ +} + +#define FOR_EACH_FIB_TABLE_ATTRIBUTE(_item) \ + for (_item = FIB_TABLE_ATTRIBUTE_FIRST; \ + _item < FIB_TABLE_ATTRIBUTE_MAX; \ + _item++) + +typedef enum fib_table_flags_t_ { + FIB_TABLE_FLAG_NONE = 0, + FIB_TABLE_FLAG_IP6_LL = (1 << FIB_TABLE_ATTRIBUTE_IP6_LL), +} __attribute__ ((packed)) fib_table_flags_t; + /** * @brief * A protocol Independent FIB table @@ -39,6 +73,11 @@ typedef struct fib_table_t_ */ fib_protocol_t ft_proto; + /** + * Table flags + */ + fib_table_flags_t ft_flags; + /** * per-source number of locks on the table */ -- cgit 1.2.3-korg