summaryrefslogtreecommitdiffstats
path: root/lib/nexthop.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-01-16 22:24:16 +0100
committerMark Stapp <mjs@voltanet.io>2020-03-27 14:37:02 +0100
commitdefd2ea4a188072a79b050c00b96ef22344210a9 (patch)
tree1e7f513621d865ee2d1c7cb45b1f196a92acfee7 /lib/nexthop.h
parentzebra: clean up a debug and an api in netlink code (diff)
downloadfrr-defd2ea4a188072a79b050c00b96ef22344210a9.tar.xz
frr-defd2ea4a188072a79b050c00b96ef22344210a9.zip
lib: add backup-nexthop value to nexthop
Add a field supporting a backup nexthop. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/nexthop.h')
-rw-r--r--lib/nexthop.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/nexthop.h b/lib/nexthop.h
index 8d7580f6b..2e7b6e78f 100644
--- a/lib/nexthop.h
+++ b/lib/nexthop.h
@@ -86,6 +86,8 @@ struct nexthop {
* active one
*/
#define NEXTHOP_FLAG_RNH_FILTERED (1 << 5) /* rmap filtered, used by rnh */
+#define NEXTHOP_FLAG_HAS_BACKUP (1 << 6) /* Backup nexthop index is set */
+
#define NEXTHOP_IS_ACTIVE(flags) \
(CHECK_FLAG(flags, NEXTHOP_FLAG_ACTIVE) \
&& !CHECK_FLAG(flags, NEXTHOP_FLAG_DUPLICATE))
@@ -116,8 +118,15 @@ struct nexthop {
/* Weight of the nexthop ( for unequal cost ECMP ) */
uint8_t weight;
+
+ /* Index of a corresponding backup nexthop in a backup list;
+ * only meaningful if the HAS_BACKUP flag is set.
+ */
+ uint8_t backup_idx;
};
+/* Backup index value is limited */
+#define NEXTHOP_BACKUP_IDX_MAX 255
/* Utility to append one nexthop to another. */
#define NEXTHOP_APPEND(to, new) \