aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/fib/fib_entry_src_rr.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-02-21 04:57:17 -0800
committerNeale Ranns <nranns@cisco.com>2018-03-20 23:59:06 +0000
commit2303cb181b51f63c909cd506125c1f832432865a (patch)
treeea2389593abc50790e06b6ac2e80f2a38c536942 /src/vnet/fib/fib_entry_src_rr.h
parentf55957e71c58e38770b12af0720e9d19a8f6a8d6 (diff)
FIB Interpose Source
The interpose source allows the source/provider to insert/interpose a DPO in the forwarding chain of the FIB entry ahead of the forwarding provided by the next best source. For example if the API source (i.e the 'control plane') has provided an adjacency for forwarding, then an interpose source (e.g. a monitoring service) couold interpose a replicatte DPO to copy the traffic to another location AND forward using the API's adjacency. To use the interose feature an existing source (i.e FIB_SOURCE_PLUGIN_HI) cn specifiy as a flag FIB_ENTRY_FLAG_INTERPOSE and provide a DPO to interpose. One might also consider using interpose in conjunction with FIB_ENTRY_FLAG_COVER_INHERIT to ensure the interpose object affects all prefixes in the sub-tree. Change-Id: I8b2737b985f8f7c08123406d0491881def347b52 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/fib/fib_entry_src_rr.h')
-rw-r--r--src/vnet/fib/fib_entry_src_rr.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/vnet/fib/fib_entry_src_rr.h b/src/vnet/fib/fib_entry_src_rr.h
new file mode 100644
index 00000000000..e8592d9e53b
--- /dev/null
+++ b/src/vnet/fib/fib_entry_src_rr.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __FIB_ENTRY_SRC_RR_H__
+#define __FIB_ENTRY_SRC_RR_H__
+
+#include "fib_entry_src.h"
+
+/*
+ * the flags that an RR sourced entry can inherit from its cover
+ */
+#define FIB_ENTRY_FLAGS_RR_INHERITED (FIB_ENTRY_FLAG_CONNECTED | \
+ FIB_ENTRY_FLAG_ATTACHED)
+
+/*
+ * fib_entry_src_rr_resolve_via_connected
+ *
+ * Resolve via a connected cover.
+ */
+void
+fib_entry_src_rr_resolve_via_connected (fib_entry_src_t *src,
+ const fib_entry_t *fib_entry,
+ const fib_entry_t *cover);
+
+/*
+ * use the path-list of the cover, unless it would form a loop.
+ * that is unless the cover is via this entry.
+ * If a loop were to form it would be a 1 level loop (i.e. X via X),
+ * and there would be 2 locks on the path-list; one since its used
+ * by the cover, and 1 from here. The first lock will go when the
+ * cover is removed, the second, and last, when the covered walk
+ * occurs during the cover's removel - this is not a place where
+ * we can handle last lock gone.
+ * In short, don't let the loop form. The usual rules of 'we must
+ * let it form so we know when it breaks' don't apply here, since
+ * the loop will break when the cover changes, and this function
+ * will be called again when that happens.
+ */
+void
+fib_entry_src_rr_use_covers_pl (fib_entry_src_t *src,
+ const fib_entry_t *fib_entry,
+ const fib_entry_t *cover);
+
+
+/*
+ * fib_entry_src_rr_cover_update
+ *
+ * This entry's cover has changed. This entry
+ * will need to re-inheret.
+ */
+fib_entry_src_cover_res_t
+fib_entry_src_rr_cover_change (fib_entry_src_t *src,
+ const fib_entry_t *fib_entry);
+
+/*
+ * fib_entry_src_rr_cover_update
+ *
+ * This entry's cover has updated its forwarding info. This entry
+ * will need to re-inheret.
+ */
+fib_entry_src_cover_res_t
+fib_entry_src_rr_cover_update (fib_entry_src_t *src,
+ const fib_entry_t *fib_entry);
+
+#endif