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
[] =
45 { "retain", no_argument
, NULL
, 'r'},
50 zebra_capabilities_t _caps_p
[] =
56 struct zebra_privs_t ripd_privs
=
65 .vty_group
= VTY_GROUP
,
72 /* Route retain mode flag. */
75 /* Master of threads. */
76 struct thread_master
*master
;
78 static struct frr_daemon_info ripd_di
;
84 zlog_info ("SIGHUP received");
87 zlog_info ("ripd restarting!");
89 /* Reload config file. */
90 vty_read_config (ripd_di
.config_file
, config_default
);
92 /* Try to return to normal operation. */
99 zlog_notice ("Terminating on signal");
107 /* SIGUSR1 handler. */
114 static struct quagga_signal_t ripd_signals
[] =
134 FRR_DAEMON_INFO(ripd
, RIP
,
135 .vty_port
= RIP_VTY_PORT
,
137 .proghelp
= "Implementation of the RIP routing protocol.",
139 .signals
= ripd_signals
,
140 .n_signals
= array_size(ripd_signals
),
142 .privs
= &ripd_privs
,
145 /* Main routine of ripd. */
147 main (int argc
, char **argv
)
149 frr_preinit (&ripd_di
, argc
, argv
);
150 frr_opt_add ("r", longopts
,
151 " -r, --retain When program terminates, retain added route by ripd.\n");
153 /* Command line option parse. */
158 opt
= frr_getopt (argc
, argv
, NULL
);
176 /* Prepare master thread. */
177 master
= frr_init ();
179 /* Library initialization. */
181 vrf_init (NULL
, NULL
, NULL
, NULL
);
183 /* RIP related initialization. */
186 rip_zclient_init(master
);