3 * Copyright (C) 2018 Cumulus Networks, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <lib/version.h>
37 #include "vrrp_zebra.h"
40 char backup_config_file
[256];
42 zebra_capabilities_t _caps_p
[] = {
46 struct zebra_privs_t vrrp_privs
= {
47 #if defined(FRR_USER) && defined(FRR_GROUP)
51 #if defined(VTY_GROUP)
52 .vty_group
= VTY_GROUP
,
55 .cap_num_p
= array_size(_caps_p
),
58 struct option longopts
[] = { { 0 } };
60 /* Master of threads. */
61 struct thread_master
*master
;
64 static void sighup(void)
66 zlog_info("SIGHUP received");
69 /* SIGINT / SIGTERM handler. */
70 static void sigint(void)
72 zlog_notice("Terminating on signal");
77 /* SIGUSR1 handler. */
78 static void sigusr1(void)
83 struct quagga_signal_t vrrp_signals
[] = {
102 static const struct frr_yang_module_info
*vrrp_yang_modules
[] = {
106 #define VRRP_VTY_PORT 2617
108 FRR_DAEMON_INFO(vrrpd
, VRRP
, .vty_port
= VRRP_VTY_PORT
,
109 .proghelp
= "Virtual Router Redundancy Protocol",
110 .signals
= vrrp_signals
,
111 .n_signals
= array_size(vrrp_signals
),
112 .privs
= &vrrp_privs
,
113 .yang_modules
= vrrp_yang_modules
,
114 .n_yang_modules
= array_size(vrrp_yang_modules
),
117 int main(int argc
, char **argv
, char **envp
)
119 frr_preinit(&vrrpd_di
, argc
, argv
);
120 frr_opt_add("", longopts
, "");
125 opt
= frr_getopt(argc
, argv
, NULL
);
145 snprintf(backup_config_file
, sizeof(backup_config_file
),
146 "%s/vrrpd.conf", frr_sysconfdir
);
147 vrrpd_di
.backup_config_file
= backup_config_file
;