summaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_entry.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-04-06 04:41:02 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-01-18 14:37:24 +0000
commit89541992000433b743cbbe8cb396faab42bcf6ae (patch)
tree2b09b2178270ad6de191e2eeaa5d3f49148d5a8e /src/vnet/fib/fib_entry.h
parentbf246dff1b4ea0792c0083f7e5495930b3b225f7 (diff)
FIB Inherited Srouce
forwarding provided by the source is pushed to all other entries it covers in the sub-tree Change-Id: I2a45222ef653358f55c2436de3e3c6353cfadba2 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_entry.h')
-rw-r--r--src/vnet/fib/fib_entry.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h
index cd2a685b765..273a5e66b15 100644
--- a/src/vnet/fib/fib_entry.h
+++ b/src/vnet/fib/fib_entry.h
@@ -213,9 +213,14 @@ typedef enum fib_entry_attribute_t_ {
*/
FIB_ENTRY_ATTRIBUTE_URPF_EXEMPT,
/**
+ * This FIB entry imposes its source information on all prefixes
+ * that is covers
+ */
+ FIB_ENTRY_ATTRIBUTE_COVERED_INHERIT,
+ /**
* Marker. add new entries before this one.
*/
- FIB_ENTRY_ATTRIBUTE_LAST = FIB_ENTRY_ATTRIBUTE_URPF_EXEMPT,
+ FIB_ENTRY_ATTRIBUTE_LAST = FIB_ENTRY_ATTRIBUTE_COVERED_INHERIT,
} fib_entry_attribute_t;
#define FIB_ENTRY_ATTRIBUTES { \
@@ -227,6 +232,7 @@ typedef enum fib_entry_attribute_t_ {
[FIB_ENTRY_ATTRIBUTE_LOCAL] = "local", \
[FIB_ENTRY_ATTRIBUTE_URPF_EXEMPT] = "uRPF-exempt", \
[FIB_ENTRY_ATTRIBUTE_MULTICAST] = "multicast", \
+ [FIB_ENTRY_ATTRIBUTE_COVERED_INHERIT] = "covered-inherit", \
}
#define FOR_EACH_FIB_ATTRIBUTE(_item) \
@@ -244,6 +250,7 @@ typedef enum fib_entry_flag_t_ {
FIB_ENTRY_FLAG_IMPORT = (1 << FIB_ENTRY_ATTRIBUTE_IMPORT),
FIB_ENTRY_FLAG_LOOSE_URPF_EXEMPT = (1 << FIB_ENTRY_ATTRIBUTE_URPF_EXEMPT),
FIB_ENTRY_FLAG_MULTICAST = (1 << FIB_ENTRY_ATTRIBUTE_MULTICAST),
+ FIB_ENTRY_FLAG_COVERED_INHERIT = (1 << FIB_ENTRY_ATTRIBUTE_COVERED_INHERIT),
} __attribute__((packed)) fib_entry_flag_t;
/**
@@ -263,9 +270,13 @@ typedef enum fib_entry_src_attribute_t_ {
*/
FIB_ENTRY_SRC_ATTRIBUTE_ACTIVE,
/**
+ * the source is inherited from its cover
+ */
+ FIB_ENTRY_SRC_ATTRIBUTE_INHERITED,
+ /**
* Marker. add new entries before this one.
*/
- FIB_ENTRY_SRC_ATTRIBUTE_LAST = FIB_ENTRY_SRC_ATTRIBUTE_ACTIVE,
+ FIB_ENTRY_SRC_ATTRIBUTE_LAST = FIB_ENTRY_SRC_ATTRIBUTE_INHERITED,
} fib_entry_src_attribute_t;
#define FIB_ENTRY_SRC_ATTRIBUTE_MAX (FIB_ENTRY_SRC_ATTRIBUTE_LAST+1)
@@ -273,12 +284,19 @@ typedef enum fib_entry_src_attribute_t_ {
#define FIB_ENTRY_SRC_ATTRIBUTES { \
[FIB_ENTRY_SRC_ATTRIBUTE_ADDED] = "added", \
[FIB_ENTRY_SRC_ATTRIBUTE_ACTIVE] = "active", \
+ [FIB_ENTRY_SRC_ATTRIBUTE_INHERITED] = "inherited", \
}
+#define FOR_EACH_FIB_SRC_ATTRIBUTE(_item) \
+ for (_item = FIB_ENTRY_SRC_ATTRIBUTE_FIRST; \
+ _item < FIB_ENTRY_SRC_ATTRIBUTE_MAX; \
+ _item++)
+
typedef enum fib_entry_src_flag_t_ {
FIB_ENTRY_SRC_FLAG_NONE = 0,
FIB_ENTRY_SRC_FLAG_ADDED = (1 << FIB_ENTRY_SRC_ATTRIBUTE_ADDED),
FIB_ENTRY_SRC_FLAG_ACTIVE = (1 << FIB_ENTRY_SRC_ATTRIBUTE_ACTIVE),
+ FIB_ENTRY_SRC_FLAG_INHERITED = (1 << FIB_ENTRY_SRC_ATTRIBUTE_INHERITED),
} __attribute__ ((packed)) fib_entry_src_flag_t;
/*
@@ -477,6 +495,10 @@ extern fib_entry_src_flag_t fib_entry_special_remove(fib_node_index_t fib_entry_
extern fib_entry_src_flag_t fib_entry_path_remove(fib_node_index_t fib_entry_index,
fib_source_t source,
const fib_route_path_t *rpath);
+
+extern void fib_entry_inherit(fib_node_index_t cover,
+ fib_node_index_t covered);
+
extern fib_entry_src_flag_t fib_entry_delete(fib_node_index_t fib_entry_index,
fib_source_t source);