2 * IS-IS Rout(e)ing protocol - isis_main.c
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #include <lib/version.h>
32 #include "memory_vty.h"
44 #include "isisd/dict.h"
45 #include "isisd/isis_constants.h"
46 #include "isisd/isis_common.h"
47 #include "isisd/isis_flags.h"
48 #include "isisd/isis_circuit.h"
49 #include "isisd/isisd.h"
50 #include "isisd/isis_dynhn.h"
51 #include "isisd/isis_spf.h"
52 #include "isisd/isis_route.h"
53 #include "isisd/isis_routemap.h"
54 #include "isisd/isis_zebra.h"
55 #include "isisd/isis_tlv.h"
56 #include "isisd/isis_te.h"
58 /* Default configuration file name */
59 #define ISISD_DEFAULT_CONFIG "isisd.conf"
60 /* Default vty port */
61 #define ISISD_VTY_PORT 2608
63 /* isisd privileges */
64 zebra_capabilities_t _caps_p
[] = {
69 struct zebra_privs_t isisd_privs
= {
77 .vty_group
= VTY_GROUP
,
80 .cap_num_p
= sizeof (_caps_p
) / sizeof (*_caps_p
),
85 struct option longopts
[] = {
89 /* Master of threads. */
90 struct thread_master
*master
;
101 static __attribute__((__noreturn__
)) void
114 zlog_err ("SIGHUP/reload is not implemented for isisd");
118 __attribute__((__noreturn__
)) void
121 zlog_notice ("Terminating on signal SIGINT");
125 __attribute__((__noreturn__
)) void
128 zlog_notice ("Terminating on signal SIGTERM");
135 zlog_debug ("SIGUSR1 received");
139 struct quagga_signal_t isisd_signals
[] =
159 FRR_DAEMON_INFO(isisd
, ISIS
,
160 .vty_port
= ISISD_VTY_PORT
,
162 .proghelp
= "Implementation of the IS-IS routing protocol.",
163 .copyright
= "Copyright (c) 2001-2002 Sampo Saaristo,"
164 " Ofer Wald and Hannes Gredler",
166 .signals
= isisd_signals
,
167 .n_signals
= array_size(isisd_signals
),
169 .privs
= &isisd_privs
,
173 * Main routine of isisd. Parse arguments and handle IS-IS state machine.
176 main (int argc
, char **argv
, char **envp
)
180 frr_preinit (&isisd_di
, argc
, argv
);
181 frr_opt_add ("", longopts
, "");
183 /* Command line argument treatment. */
186 opt
= frr_getopt (argc
, argv
, NULL
);
201 vty_config_lockless ();
203 master
= frr_init ();
212 isis_circuit_init ();
213 isis_spf_cmds_init ();
215 isis_route_map_init();
218 /* create the global 'isis' instance */
221 isis_zebra_init(master
);