2 * Copyright (C) 1999 Yasuhiro Ohara
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
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
23 #include <lib/version.h>
32 #include "memory_vty.h"
45 #include "ospf6_top.h"
46 #include "ospf6_message.h"
47 #include "ospf6_asbr.h"
48 #include "ospf6_lsa.h"
49 #include "ospf6_interface.h"
50 #include "ospf6_zebra.h"
52 /* Default configuration file name for ospf6d. */
53 #define OSPF6_DEFAULT_CONFIG "ospf6d.conf"
55 /* Default port values. */
56 #define OSPF6_VTY_PORT 2606
58 /* ospf6d privileges */
59 zebra_capabilities_t _caps_p
[] =
65 struct zebra_privs_t ospf6d_privs
=
74 .vty_group
= VTY_GROUP
,
81 /* ospf6d options, we use GNU getopt library. */
82 struct option longopts
[] =
87 /* Master of threads. */
88 struct thread_master
*master
;
90 static void __attribute__ ((noreturn
))
91 ospf6_exit (int status
)
93 struct listnode
*node
;
94 struct interface
*ifp
;
101 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
102 if (ifp
->info
!= NULL
)
103 ospf6_interface_delete(ifp
->info
);
105 ospf6_message_terminate ();
106 ospf6_asbr_terminate ();
107 ospf6_lsa_terminate ();
114 zclient_free (zclient
);
117 thread_master_free (master
);
124 /* SIGHUP handler. */
128 zlog_info ("SIGHUP received");
131 /* SIGINT handler. */
135 zlog_notice ("Terminating on signal SIGINT");
139 /* SIGTERM handler. */
143 zlog_notice ("Terminating on signal SIGTERM");
148 /* SIGUSR1 handler. */
152 zlog_info ("SIGUSR1 received");
156 struct quagga_signal_t ospf6_signals
[] =
176 FRR_DAEMON_INFO(ospf6d
, OSPF6
,
177 .vty_port
= OSPF6_VTY_PORT
,
179 .proghelp
= "Implementation of the OSPFv3 routing protocol.",
181 .signals
= ospf6_signals
,
182 .n_signals
= array_size(ospf6_signals
),
184 .privs
= &ospf6d_privs
,
187 /* Main routine of ospf6d. Treatment of argument and starting ospf finite
188 state machine is handled here. */
190 main (int argc
, char *argv
[], char *envp
[])
194 frr_preinit (&ospf6d_di
, argc
, argv
);
195 frr_opt_add ("", longopts
, "");
197 /* Command line argument treatment. */
200 opt
= frr_getopt (argc
, argv
, NULL
);
218 perror (ospf6d_di
.progname
);
223 master
= frr_init ();
229 /* initialize ospf6 */