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
17 * along with GNU Zebra; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 #include <lib/version.h>
29 #include "memory_vty.h"
40 #include "ripd/ripd.h"
43 static struct option longopts
[] = {{"retain", no_argument
, NULL
, 'r'}, {0}};
46 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
};
48 struct zebra_privs_t ripd_privs
= {
56 .vty_group
= VTY_GROUP
,
62 /* Route retain mode flag. */
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");
95 /* SIGUSR1 handler. */
96 static void sigusr1(void)
101 static struct quagga_signal_t ripd_signals
[] = {
120 FRR_DAEMON_INFO(ripd
, RIP
, .vty_port
= RIP_VTY_PORT
,
122 .proghelp
= "Implementation of the RIP routing protocol.",
124 .signals
= ripd_signals
, .n_signals
= array_size(ripd_signals
),
126 .privs
= &ripd_privs
, )
128 /* Main routine of ripd. */
129 int main(int argc
, char **argv
)
131 frr_preinit(&ripd_di
, argc
, argv
);
134 " -r, --retain When program terminates, retain added route by ripd.\n");
136 /* Command line option parse. */
140 opt
= frr_getopt(argc
, argv
, NULL
);
157 /* Prepare master thread. */
160 /* Library initialization. */
164 /* RIP related initialization. */
167 rip_zclient_init(master
);