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 uint32_t zebra_ecmp_count
= MULTIPATH_NUM
;
39 struct zebra_privs_t ripd_privs
= {
47 .vty_group
= VTY_GROUP
,
50 .cap_num_p
= array_size(_caps_p
),
53 /* Master of threads. */
54 struct event_loop
*master
;
56 static struct frr_daemon_info ripd_di
;
59 static void sighup(void)
61 zlog_info("SIGHUP received");
63 /* Reload config file. */
64 vty_read_config(NULL
, ripd_di
.config_file
, config_default
);
68 static void sigint(void)
70 zlog_notice("Terminating on signal");
72 bfd_protocol_integration_set_shutdown(true);
81 /* SIGUSR1 handler. */
82 static void sigusr1(void)
87 static struct frr_signal_t ripd_signals
[] = {
106 static const struct frr_yang_module_info
*const ripd_yang_modules
[] = {
114 FRR_DAEMON_INFO(ripd
, RIP
, .vty_port
= RIP_VTY_PORT
,
116 .proghelp
= "Implementation of the RIP routing protocol.",
118 .signals
= ripd_signals
, .n_signals
= array_size(ripd_signals
),
120 .privs
= &ripd_privs
, .yang_modules
= ripd_yang_modules
,
121 .n_yang_modules
= array_size(ripd_yang_modules
),
124 #define DEPRECATED_OPTIONS ""
126 /* Main routine of ripd. */
127 int main(int argc
, char **argv
)
129 frr_preinit(&ripd_di
, argc
, argv
);
131 frr_opt_add("" DEPRECATED_OPTIONS
, longopts
, "");
133 /* Command line option parse. */
137 opt
= frr_getopt(argc
, argv
, NULL
);
139 if (opt
&& opt
< 128 && strchr(DEPRECATED_OPTIONS
, opt
)) {
141 "The -%c option no longer exists.\nPlease refer to the manual.\n",
157 /* Prepare master thread. */
160 /* Library initialization. */
165 /* RIP related initialization. */
169 rip_zclient_init(master
);
170 rip_bfd_init(master
);