1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 1997, 98 Kunihiro Ishiguro <kunihiro@zebra.org>
8 #include <lib/version.h>
26 #include "ripd/ripd.h"
27 #include "ripd/rip_bfd.h"
28 #include "ripd/rip_nb.h"
29 #include "ripd/rip_errors.h"
32 static struct option longopts
[] = {{0}};
35 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
, ZCAP_SYS_ADMIN
};
37 struct zebra_privs_t ripd_privs
= {
45 .vty_group
= VTY_GROUP
,
48 .cap_num_p
= array_size(_caps_p
),
51 /* Master of threads. */
52 struct event_loop
*master
;
54 static struct frr_daemon_info ripd_di
;
57 static void sighup(void)
59 zlog_info("SIGHUP received");
61 /* Reload config file. */
62 vty_read_config(NULL
, ripd_di
.config_file
, config_default
);
66 static void sigint(void)
68 zlog_notice("Terminating on signal");
70 bfd_protocol_integration_set_shutdown(true);
79 /* SIGUSR1 handler. */
80 static void sigusr1(void)
85 static struct frr_signal_t ripd_signals
[] = {
104 static const struct frr_yang_module_info
*const ripd_yang_modules
[] = {
112 FRR_DAEMON_INFO(ripd
, RIP
, .vty_port
= RIP_VTY_PORT
,
114 .proghelp
= "Implementation of the RIP routing protocol.",
116 .signals
= ripd_signals
, .n_signals
= array_size(ripd_signals
),
118 .privs
= &ripd_privs
, .yang_modules
= ripd_yang_modules
,
119 .n_yang_modules
= array_size(ripd_yang_modules
),
122 #define DEPRECATED_OPTIONS ""
124 /* Main routine of ripd. */
125 int main(int argc
, char **argv
)
127 frr_preinit(&ripd_di
, argc
, argv
);
129 frr_opt_add("" DEPRECATED_OPTIONS
, longopts
, "");
131 /* Command line option parse. */
135 opt
= frr_getopt(argc
, argv
, NULL
);
137 if (opt
&& opt
< 128 && strchr(DEPRECATED_OPTIONS
, opt
)) {
139 "The -%c option no longer exists.\nPlease refer to the manual.\n",
155 /* Prepare master thread. */
158 /* Library initialization. */
163 /* RIP related initialization. */
167 rip_zclient_init(master
);
168 rip_bfd_init(master
);