summaryrefslogtreecommitdiff
path: root/zebra/zebra_rnh.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-03-01 10:48:05 -0500
committerMark Stapp <mjs@voltanet.io>2021-04-07 15:38:09 -0400
commitaef1d5404fabe113e66bbc49499a7eb2b96aaab4 (patch)
tree9616c8e85329f88318741a49157eb217bed7782b /zebra/zebra_rnh.c
parent964788a11ffa185c89054144a53a2e1a6be69036 (diff)
zebra: add config control to hide backup nh events in nht
Add a config that can control hiding of backup-nexthop activation changes in nexthop-tracking. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_rnh.c')
-rw-r--r--zebra/zebra_rnh.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c
index 3b0ef71987..0a9ef244b6 100644
--- a/zebra/zebra_rnh.c
+++ b/zebra/zebra_rnh.c
@@ -52,6 +52,11 @@
DEFINE_MTYPE_STATIC(ZEBRA, RNH, "Nexthop tracking object");
+/* UI controls whether to notify about changes that only involve backup
+ * nexthops. Default is to notify all changes.
+ */
+static bool rnh_hide_backups;
+
static void free_state(vrf_id_t vrf_id, struct route_entry *re,
struct route_node *rn);
static void copy_state(struct rnh *rnh, const struct route_entry *re,
@@ -1321,3 +1326,16 @@ int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family)
else
return 0;
}
+
+/*
+ * UI control to avoid notifications if backup nexthop status changes
+ */
+void rnh_set_hide_backups(bool hide_p)
+{
+ rnh_hide_backups = hide_p;
+}
+
+bool rnh_get_hide_backups(void)
+{
+ return rnh_hide_backups;
+}