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/isis_constants.h"
45 #include "isisd/isis_common.h"
46 #include "isisd/isis_flags.h"
47 #include "isisd/isis_circuit.h"
48 #include "isisd/isisd.h"
49 #include "isisd/isis_dynhn.h"
50 #include "isisd/isis_spf.h"
51 #include "isisd/isis_route.h"
52 #include "isisd/isis_routemap.h"
53 #include "isisd/isis_zebra.h"
54 #include "isisd/isis_te.h"
55 #include "isisd/isis_errors.h"
56 #include "isisd/isis_bfd.h"
57 #include "isisd/isis_lsp.h"
58 #include "isisd/isis_mt.h"
59 #include "isisd/fabricd.h"
60 #include "isisd/isis_nb.h"
62 /* Default configuration file name */
63 #define ISISD_DEFAULT_CONFIG "isisd.conf"
64 /* Default vty port */
65 #define ISISD_VTY_PORT 2608
66 #define FABRICD_VTY_PORT 2618
68 /* isisd privileges */
69 zebra_capabilities_t _caps_p
[] = {ZCAP_NET_RAW
, ZCAP_BIND
};
71 struct zebra_privs_t isisd_privs
= {
79 .vty_group
= VTY_GROUP
,
82 .cap_num_p
= array_size(_caps_p
),
86 struct option longopts
[] = {{0}};
88 /* Master of threads. */
89 struct thread_master
*master
;
100 static __attribute__((__noreturn__
)) void terminate(int i
)
112 zlog_notice("SIGHUP/reload is not implemented for fabricd");
116 static struct frr_daemon_info isisd_di
;
119 zlog_info("SIGHUP received");
121 /* Reload config file. */
122 vty_read_config(NULL
, isisd_di
.config_file
, config_default
);
127 __attribute__((__noreturn__
)) void sigint(void)
129 zlog_notice("Terminating on signal SIGINT");
133 __attribute__((__noreturn__
)) void sigterm(void)
135 zlog_notice("Terminating on signal SIGTERM");
141 zlog_debug("SIGUSR1 received");
145 struct quagga_signal_t isisd_signals
[] = {
165 static const struct frr_yang_module_info
*const isisd_yang_modules
[] = {
169 #endif /* ifndef FABRICD */
173 FRR_DAEMON_INFO(fabricd
, OPEN_FABRIC
, .vty_port
= FABRICD_VTY_PORT
,
175 .proghelp
= "Implementation of the OpenFabric routing protocol.",
177 FRR_DAEMON_INFO(isisd
, ISIS
, .vty_port
= ISISD_VTY_PORT
,
179 .proghelp
= "Implementation of the IS-IS routing protocol.",
182 "Copyright (c) 2001-2002 Sampo Saaristo,"
183 " Ofer Wald and Hannes Gredler",
185 .signals
= isisd_signals
,
186 .n_signals
= array_size(isisd_signals
),
188 .privs
= &isisd_privs
, .yang_modules
= isisd_yang_modules
,
189 .n_yang_modules
= array_size(isisd_yang_modules
), )
192 * Main routine of isisd. Parse arguments and handle IS-IS state machine.
194 int main(int argc
, char **argv
, char **envp
)
199 frr_preinit(&fabricd_di
, argc
, argv
);
201 frr_preinit(&isisd_di
, argc
, argv
);
203 frr_opt_add("", longopts
, "");
205 /* Command line argument treatment. */
207 opt
= frr_getopt(argc
, argv
, NULL
);
229 vrf_init(NULL
, NULL
, NULL
, NULL
, NULL
);
234 isis_vty_daemon_init();
238 #endif /* ifdef FABRICD */
239 isis_spf_cmds_init();
241 isis_route_map_init();
246 /* create the global 'isis' instance */
247 isis_new(1, VRF_DEFAULT
);
249 isis_zebra_init(master
);