2 * Copyright (C) 1997, 98 Kunihiro Ishiguro <kunihiro@zebra.org>
4 * This file is part of GNU Zebra.
6 * GNU Zebra 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
8 * Free Software Foundation; either version 2, or (at your option) any
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
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
23 #include <lib/version.h>
28 #include "memory_vty.h"
39 #include "ripd/ripd.h"
40 #include "ripd/rip_errors.h"
43 #if CONFDATE > 20190521
44 CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
46 static struct option longopts
[] = {{"retain", no_argument
, NULL
, 'r'}, {0}};
49 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
};
51 struct zebra_privs_t ripd_privs
= {
59 .vty_group
= VTY_GROUP
,
65 /* Master of threads. */
66 struct thread_master
*master
;
68 static struct frr_daemon_info ripd_di
;
71 static void sighup(void)
73 zlog_info("SIGHUP received");
76 zlog_info("ripd restarting!");
78 /* Reload config file. */
79 vty_read_config(ripd_di
.config_file
, config_default
);
81 /* Try to return to normal operation. */
85 static void sigint(void)
87 zlog_notice("Terminating on signal");
97 /* SIGUSR1 handler. */
98 static void sigusr1(void)
103 static struct quagga_signal_t ripd_signals
[] = {
122 FRR_DAEMON_INFO(ripd
, RIP
, .vty_port
= RIP_VTY_PORT
,
124 .proghelp
= "Implementation of the RIP routing protocol.",
126 .signals
= ripd_signals
, .n_signals
= array_size(ripd_signals
),
128 .privs
= &ripd_privs
, )
130 #if CONFDATE > 20190521
131 CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
133 #define DEPRECATED_OPTIONS "r"
135 /* Main routine of ripd. */
136 int main(int argc
, char **argv
)
138 frr_preinit(&ripd_di
, argc
, argv
);
140 frr_opt_add("" DEPRECATED_OPTIONS
, longopts
, "");
142 /* Command line option parse. */
146 opt
= frr_getopt(argc
, argv
, NULL
);
148 if (opt
&& opt
< 128 && strchr(DEPRECATED_OPTIONS
, opt
)) {
150 "The -%c option no longer exists.\nPlease refer to the manual.\n",
167 /* Prepare master thread. */
170 /* Library initialization. */
173 vrf_init(NULL
, NULL
, NULL
, NULL
);
175 /* RIP related initialization. */
178 rip_zclient_init(master
);