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 static struct option longopts
[] =
44 { "retain", no_argument
, NULL
, 'r'},
49 zebra_capabilities_t _caps_p
[] =
55 struct zebra_privs_t ripd_privs
=
64 .vty_group
= VTY_GROUP
,
71 /* Route retain mode flag. */
74 /* Master of threads. */
75 struct thread_master
*master
;
77 static struct frr_daemon_info ripd_di
;
83 zlog_info ("SIGHUP received");
86 zlog_info ("ripd restarting!");
88 /* Reload config file. */
89 vty_read_config (ripd_di
.config_file
, config_default
);
91 /* Try to return to normal operation. */
98 zlog_notice ("Terminating on signal");
106 /* SIGUSR1 handler. */
113 static struct quagga_signal_t ripd_signals
[] =
133 FRR_DAEMON_INFO(ripd
, RIP
,
134 .vty_port
= RIP_VTY_PORT
,
136 .proghelp
= "Implementation of the RIP routing protocol.",
138 .signals
= ripd_signals
,
139 .n_signals
= array_size(ripd_signals
),
141 .privs
= &ripd_privs
,
144 /* Main routine of ripd. */
146 main (int argc
, char **argv
)
148 frr_preinit (&ripd_di
, argc
, argv
);
149 frr_opt_add ("r", longopts
,
150 " -r, --retain When program terminates, retain added route by ripd.\n");
152 /* Command line option parse. */
157 opt
= frr_getopt (argc
, argv
, NULL
);
175 /* Prepare master thread. */
176 master
= frr_init ();
178 /* Library initialization. */
180 vrf_init (NULL
, NULL
, NULL
, NULL
);
182 /* RIP related initialization. */
185 rip_zclient_init(master
);