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");
75 /* Reload config file. */
76 vty_read_config(NULL
, ripd_di
.config_file
, config_default
);
80 static void sigint(void)
82 zlog_notice("Terminating on signal");
92 /* SIGUSR1 handler. */
93 static void sigusr1(void)
98 static struct quagga_signal_t ripd_signals
[] = {
117 static const struct frr_yang_module_info
*ripd_yang_modules
[] = {
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
, .yang_modules
= ripd_yang_modules
,
129 .n_yang_modules
= array_size(ripd_yang_modules
), )
131 #if CONFDATE > 20190521
132 CPP_NOTICE("-r / --retain has reached deprecation EOL, remove")
134 #define DEPRECATED_OPTIONS "r"
136 /* Main routine of ripd. */
137 int main(int argc
, char **argv
)
139 frr_preinit(&ripd_di
, argc
, argv
);
141 frr_opt_add("" DEPRECATED_OPTIONS
, longopts
, "");
143 /* Command line option parse. */
147 opt
= frr_getopt(argc
, argv
, NULL
);
149 if (opt
&& opt
< 128 && strchr(DEPRECATED_OPTIONS
, opt
)) {
151 "The -%c option no longer exists.\nPlease refer to the manual.\n",
168 vty_config_lockless();
170 /* Prepare master thread. */
173 /* Library initialization. */
176 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
178 /* RIP related initialization. */
182 rip_zclient_init(master
);