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"
42 #if CONFDATE > 20190521
43 CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
45 static struct option longopts
[] = {{"retain", no_argument
, NULL
, 'r'}, {0}};
48 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
};
50 struct zebra_privs_t ripd_privs
= {
58 .vty_group
= VTY_GROUP
,
64 /* Master of threads. */
65 struct thread_master
*master
;
67 static struct frr_daemon_info ripd_di
;
70 static void sighup(void)
72 zlog_info("SIGHUP received");
75 zlog_info("ripd restarting!");
77 /* Reload config file. */
78 vty_read_config(ripd_di
.config_file
, config_default
);
80 /* Try to return to normal operation. */
84 static void sigint(void)
86 zlog_notice("Terminating on signal");
96 /* SIGUSR1 handler. */
97 static void sigusr1(void)
102 static struct quagga_signal_t ripd_signals
[] = {
121 FRR_DAEMON_INFO(ripd
, RIP
, .vty_port
= RIP_VTY_PORT
,
123 .proghelp
= "Implementation of the RIP routing protocol.",
125 .signals
= ripd_signals
, .n_signals
= array_size(ripd_signals
),
127 .privs
= &ripd_privs
, )
129 #if CONFDATE > 20190521
130 CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
132 #define DEPRECATED_OPTIONS "r"
134 /* Main routine of ripd. */
135 int main(int argc
, char **argv
)
137 frr_preinit(&ripd_di
, argc
, argv
);
139 frr_opt_add("" DEPRECATED_OPTIONS
, longopts
, "");
141 /* Command line option parse. */
145 opt
= frr_getopt(argc
, argv
, NULL
);
147 if (opt
&& opt
< 128 && strchr(DEPRECATED_OPTIONS
, opt
)) {
149 "The -%c option no longer exists.\nPlease refer to the manual.\n",
166 /* Prepare master thread. */
169 /* Library initialization. */
171 vrf_init(NULL
, NULL
, NULL
, NULL
);
173 /* RIP related initialization. */
176 rip_zclient_init(master
);