/*
- * VRRP
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP entry point.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
#include <zebra.h>
#include <lib/version.h>
-#include "getopt.h"
-#include "thread.h"
-#include "command.h"
-#include "log.h"
-#include "memory.h"
-#include "privs.h"
-#include "sigevent.h"
-#include "libfrr.h"
-#include "vrf.h"
-#include "nexthop.h"
-#include "filter.h"
-#include "if.h"
+
+#include "lib/command.h"
+#include "lib/filter.h"
+#include "lib/getopt.h"
+#include "lib/if.h"
+#include "lib/libfrr.h"
+#include "lib/log.h"
+#include "lib/memory.h"
+#include "lib/nexthop.h"
+#include "lib/privs.h"
+#include "lib/sigevent.h"
+#include "lib/thread.h"
+#include "lib/vrf.h"
+#include "lib/vty.h"
#include "vrrp.h"
-#include "vrrp_zebra.h"
+#include "vrrp_debug.h"
#include "vrrp_vty.h"
+#include "vrrp_zebra.h"
+
+DEFINE_MGROUP(VRRPD, "vrrpd")
char backup_config_file[256];
.cap_num_p = array_size(_caps_p),
.cap_num_i = 0};
-struct option longopts[] = { { 0 } };
+struct option longopts[] = { {0} };
/* Master of threads. */
struct thread_master *master;
+static struct frr_daemon_info vrrpd_di;
+
/* SIGHUP handler. */
static void sighup(void)
{
zlog_info("SIGHUP received");
+
+ vty_read_config(NULL, vrrpd_di.config_file, config_default);
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static void __attribute__((noreturn)) sigint(void)
{
zlog_notice("Terminating on signal");
+ vrrp_fini();
+
exit(0);
}
},
};
-static const struct frr_yang_module_info *vrrp_yang_modules[] = {
+static const struct frr_yang_module_info *const vrrp_yang_modules[] = {
&frr_interface_info,
+ &frr_vrrpd_info,
};
-#define VRRP_VTY_PORT 2617
+#define VRRP_VTY_PORT 2619
FRR_DAEMON_INFO(vrrpd, VRRP, .vty_port = VRRP_VTY_PORT,
.proghelp = "Virtual Router Redundancy Protocol",
master = frr_init();
+ access_list_init();
+ vrrp_debug_init();
vrrp_zebra_init();
vrrp_vty_init();
vrrp_init();