summaryrefslogtreecommitdiff
path: root/vrrpd/vrrp.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 21:43:36 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 00:27:08 +0000
commit8cd1d2779da8c2188e91c518fcbc18740086e300 (patch)
tree63a01831962f42b85d3d8ffcf9742cd7d720ee48 /vrrpd/vrrp.h
parent6332c77f98481d94c9243cbe6ffb57d131cf9d6a (diff)
vrrpd: allow configuring global defaults
Allow configuring the following as global defaults: - Priority - Advertisement interval - Preempt mode - Administrative shutdown Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp.h')
-rw-r--r--vrrpd/vrrp.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/vrrpd/vrrp.h b/vrrpd/vrrp.h
index 94cd1ca3f6..4ea1a37377 100644
--- a/vrrpd/vrrp.h
+++ b/vrrpd/vrrp.h
@@ -33,8 +33,6 @@
#include "lib/vty.h"
/* Global definitions */
-#define VRRP_DEFAULT_ADVINT 100
-#define VRRP_DEFAULT_PRIORITY 100
#define VRRP_RADV_INT 16
#define VRRP_PRIO_MASTER 255
#define VRRP_MCASTV4_GROUP_STR "224.0.0.18"
@@ -45,6 +43,24 @@
#define VRRP_LOGPFX_VRID "[VRID: %u] "
+/* Default defaults */
+#define VRRP_DEFAULT_PRIORITY 100
+#define VRRP_DEFAULT_ADVINT 100
+#define VRRP_DEFAULT_PREEMPT true
+#define VRRP_DEFAULT_ACCEPT true
+#define VRRP_DEFAULT_SHUTDOWN false
+
+/* Configured defaults */
+struct vrrp_defaults {
+ uint8_t priority;
+ uint16_t advertisement_interval;
+ bool preempt_mode;
+ bool accept_mode;
+ bool shutdown;
+};
+
+extern struct vrrp_defaults vd;
+
/* threadmaster */
extern struct thread_master *master;