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_te.h"
56 #include "isisd/isis_errors.h"
57 #include "isisd/isis_vty_common.h"
58 #include "isisd/isis_bfd.h"
59 #include "isisd/isis_lsp.h"
60 #include "isisd/isis_mt.h"
61 #include "isisd/fabricd.h"
63 /* Default configuration file name */
64 #define ISISD_DEFAULT_CONFIG "isisd.conf"
65 /* Default vty port */
66 #define ISISD_VTY_PORT 2608
67 #define FABRICD_VTY_PORT 2618
69 /* isisd privileges */
70 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
};
72 struct zebra_privs_t isisd_privs
= {
80 .vty_group
= VTY_GROUP
,
83 .cap_num_p
= sizeof(_caps_p
) / sizeof(*_caps_p
),
87 struct option longopts
[] = {{0}};
89 /* Master of threads. */
90 struct thread_master
*master
;
101 static __attribute__((__noreturn__
)) void terminate(int i
)
113 zlog_notice("SIGHUP/reload is not implemented for isisd");
117 __attribute__((__noreturn__
)) void sigint(void)
119 zlog_notice("Terminating on signal SIGINT");
123 __attribute__((__noreturn__
)) void sigterm(void)
125 zlog_notice("Terminating on signal SIGTERM");
131 zlog_debug("SIGUSR1 received");
135 struct quagga_signal_t isisd_signals
[] = {
154 static const struct frr_yang_module_info
*isisd_yang_modules
[] = {
159 FRR_DAEMON_INFO(fabricd
, OPEN_FABRIC
, .vty_port
= FABRICD_VTY_PORT
,
161 .proghelp
= "Implementation of the OpenFabric routing protocol.",
163 FRR_DAEMON_INFO(isisd
, ISIS
, .vty_port
= ISISD_VTY_PORT
,
165 .proghelp
= "Implementation of the IS-IS routing protocol.",
168 "Copyright (c) 2001-2002 Sampo Saaristo,"
169 " Ofer Wald and Hannes Gredler",
171 .signals
= isisd_signals
,
172 .n_signals
= array_size(isisd_signals
),
174 .privs
= &isisd_privs
, .yang_modules
= isisd_yang_modules
,
175 .n_yang_modules
= array_size(isisd_yang_modules
), )
178 * Main routine of isisd. Parse arguments and handle IS-IS state machine.
180 int main(int argc
, char **argv
, char **envp
)
185 frr_preinit(&fabricd_di
, argc
, argv
);
187 frr_preinit(&isisd_di
, argc
, argv
);
189 frr_opt_add("", longopts
, "");
191 /* Command line argument treatment. */
193 opt
= frr_getopt(argc
, argv
, NULL
);
215 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
220 isis_spf_cmds_init();
222 isis_route_map_init();
227 /* create the global 'isis' instance */
230 isis_zebra_init(master
);