blob: d2efacacbc026f408a67ea03940ff926c3988b52 [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isisd.h
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
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)
11 * any later version.
12 *
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
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22
23#ifndef ISISD_H
24#define ISISD_H
25
26#define ISISD_VERSION "0.0.7"
jardineb5d44e2003-12-23 08:09:43 +000027
Christian Frankeacf98652015-11-12 14:24:22 +010028#include "isisd/isis_redist.h"
29
jardineb5d44e2003-12-23 08:09:43 +000030/* uncomment if you are a developer in bug hunt */
31/* #define EXTREME_DEBUG */
32/* #define EXTREME_TLV_DEBUG */
33
jardineb5d44e2003-12-23 08:09:43 +000034struct isis
35{
36 u_long process_id;
37 int sysid_set;
hassof390d2c2004-09-10 20:48:21 +000038 u_char sysid[ISIS_SYS_ID_LEN]; /* SystemID for this IS */
Josh Bailey3f045a02012-03-24 08:35:20 -070039 u_int32_t router_id; /* Router ID from zebra */
hassof390d2c2004-09-10 20:48:21 +000040 struct list *area_list; /* list of IS-IS areas */
jardineb5d44e2003-12-23 08:09:43 +000041 struct list *init_circ_list;
hassof390d2c2004-09-10 20:48:21 +000042 struct list *nexthops; /* IPv4 next hops from this IS */
jardineb5d44e2003-12-23 08:09:43 +000043#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +000044 struct list *nexthops6; /* IPv6 next hops from this IS */
45#endif /* HAVE_IPV6 */
46 u_char max_area_addrs; /* maximumAreaAdresses */
47 struct area_addr *man_area_addrs; /* manualAreaAddresses */
48 u_int32_t debugs; /* bitmap for debug */
49 time_t uptime; /* when did we start */
hassod3d74742005-09-28 18:30:51 +000050 struct thread *t_dync_clean; /* dynamic hostname cache cleanup thread */
hassof390d2c2004-09-10 20:48:21 +000051
Christian Frankeacf98652015-11-12 14:24:22 +010052 struct route_table *ext_info[REDIST_PROTOCOL_COUNT];
jardineb5d44e2003-12-23 08:09:43 +000053};
54
Josh Bailey3f045a02012-03-24 08:35:20 -070055extern struct isis *isis;
56
hassof390d2c2004-09-10 20:48:21 +000057struct isis_area
jardineb5d44e2003-12-23 08:09:43 +000058{
hassofac1f7c2005-09-26 18:26:26 +000059 struct isis *isis; /* back pointer */
60 dict_t *lspdb[ISIS_LEVELS]; /* link-state dbs */
61 struct isis_spftree *spftree[ISIS_LEVELS]; /* The v4 SPTs */
62 struct route_table *route_table[ISIS_LEVELS]; /* IPv4 routes */
jardineb5d44e2003-12-23 08:09:43 +000063#ifdef HAVE_IPV6
hassofac1f7c2005-09-26 18:26:26 +000064 struct isis_spftree *spftree6[ISIS_LEVELS]; /* The v6 SPTs */
65 struct route_table *route_table6[ISIS_LEVELS]; /* IPv6 routes */
jardineb5d44e2003-12-23 08:09:43 +000066#endif
Christian Frankef1fc1db2015-11-10 18:43:31 +010067#define DEFAULT_LSP_MTU 1497
68 unsigned int lsp_mtu; /* Size of LSPs to generate */
hassof390d2c2004-09-10 20:48:21 +000069 struct list *circuit_list; /* IS-IS circuits */
70 struct flags flags;
71 struct thread *t_tick; /* LSP walker */
jardineb5d44e2003-12-23 08:09:43 +000072 struct thread *t_lsp_refresh[ISIS_LEVELS];
Christian Franke61010c32015-11-10 18:43:34 +010073 /* t_lsp_refresh is used in two ways:
74 * a) regular refresh of LSPs
75 * b) (possibly throttled) updates to LSPs
76 *
77 * The lsp_regenerate_pending flag tracks whether the timer is active
78 * for the a) or the b) case.
79 *
80 * It is of utmost importance to clear this flag when the timer is
81 * rescheduled for normal refresh, because otherwise, updates will
82 * be delayed until the next regular refresh.
83 */
Josh Bailey3f045a02012-03-24 08:35:20 -070084 int lsp_regenerate_pending[ISIS_LEVELS];
hassof390d2c2004-09-10 20:48:21 +000085
jardineb5d44e2003-12-23 08:09:43 +000086 /*
87 * Configurables
88 */
89 struct isis_passwd area_passwd;
90 struct isis_passwd domain_passwd;
91 /* do we support dynamic hostnames? */
92 char dynhostname;
93 /* do we support new style metrics? */
hassof390d2c2004-09-10 20:48:21 +000094 char newmetric;
hasso2984d262005-09-26 16:49:07 +000095 char oldmetric;
jardineb5d44e2003-12-23 08:09:43 +000096 /* identifies the routing instance */
hassof390d2c2004-09-10 20:48:21 +000097 char *area_tag;
jardineb5d44e2003-12-23 08:09:43 +000098 /* area addresses for this area */
hassof390d2c2004-09-10 20:48:21 +000099 struct list *area_addrs;
100 u_int16_t max_lsp_lifetime[ISIS_LEVELS];
101 char is_type; /* level-1 level-1-2 or level-2-only */
Josh Bailey3f045a02012-03-24 08:35:20 -0700102 /* are we overloaded? */
103 char overload_bit;
Amritha Nambiarc8ee9402015-08-24 16:40:14 -0700104 /* L1/L2 router identifier for inter-area traffic */
105 char attached_bit;
jardineb5d44e2003-12-23 08:09:43 +0000106 u_int16_t lsp_refresh[ISIS_LEVELS];
107 /* minimum time allowed before lsp retransmission */
108 u_int16_t lsp_gen_interval[ISIS_LEVELS];
109 /* min interval between between consequtive SPFs */
hassof390d2c2004-09-10 20:48:21 +0000110 u_int16_t min_spf_interval[ISIS_LEVELS];
jardineb5d44e2003-12-23 08:09:43 +0000111 /* the percentage of LSP mtu size used, before generating a new frag */
hassof390d2c2004-09-10 20:48:21 +0000112 int lsp_frag_threshold;
jardineb5d44e2003-12-23 08:09:43 +0000113 int ip_circuits;
Josh Bailey3f045a02012-03-24 08:35:20 -0700114 /* logging adjacency changes? */
115 u_char log_adj_changes;
jardineb5d44e2003-12-23 08:09:43 +0000116#ifdef HAVE_IPV6
117 int ipv6_circuits;
hassof390d2c2004-09-10 20:48:21 +0000118#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000119 /* Counters */
120 u_int32_t circuit_state_changes;
Christian Frankeacf98652015-11-12 14:24:22 +0100121 struct isis_redist redist_settings[REDIST_PROTOCOL_COUNT]
122 [ZEBRA_ROUTE_MAX + 1][ISIS_LEVELS];
123 struct route_table *ext_reach[REDIST_PROTOCOL_COUNT][ISIS_LEVELS];
hassof1082d12005-09-19 04:23:34 +0000124
jardineb5d44e2003-12-23 08:09:43 +0000125#ifdef TOPOLOGY_GENERATE
hassof390d2c2004-09-10 20:48:21 +0000126 struct list *topology;
Josh Bailey3f045a02012-03-24 08:35:20 -0700127 u_char topology_baseis[ISIS_SYS_ID_LEN]; /* IS for the first IS emulated. */
hassof1082d12005-09-19 04:23:34 +0000128 char *topology_basedynh; /* Dynamic hostname base. */
129 char top_params[200]; /* FIXME: what is reasonable? */
130#endif /* TOPOLOGY_GENERATE */
jardineb5d44e2003-12-23 08:09:43 +0000131};
132
hassof390d2c2004-09-10 20:48:21 +0000133void isis_init (void);
Josh Bailey3f045a02012-03-24 08:35:20 -0700134void isis_new(unsigned long);
135struct isis_area *isis_area_create(const char *);
hassof90a5f62004-10-11 13:11:56 +0000136struct isis_area *isis_area_lookup (const char *);
Josh Bailey3f045a02012-03-24 08:35:20 -0700137int isis_area_get (struct vty *vty, const char *area_tag);
138void print_debug(struct vty *, int, int);
139
140/* Master of threads. */
141extern struct thread_master *master;
jardineb5d44e2003-12-23 08:09:43 +0000142
143#define DEBUG_ADJ_PACKETS (1<<0)
144#define DEBUG_CHECKSUM_ERRORS (1<<1)
145#define DEBUG_LOCAL_UPDATES (1<<2)
146#define DEBUG_PROTOCOL_ERRORS (1<<3)
147#define DEBUG_SNP_PACKETS (1<<4)
148#define DEBUG_UPDATE_PACKETS (1<<5)
149#define DEBUG_SPF_EVENTS (1<<6)
150#define DEBUG_SPF_STATS (1<<7)
151#define DEBUG_SPF_TRIGGERS (1<<8)
152#define DEBUG_RTE_EVENTS (1<<9)
153#define DEBUG_EVENTS (1<<10)
hassoc89c05d2005-09-04 21:36:36 +0000154#define DEBUG_ZEBRA (1<<11)
Josh Bailey3f045a02012-03-24 08:35:20 -0700155#define DEBUG_PACKET_DUMP (1<<12)
Christian Franke80a8f722015-11-12 14:21:47 +0100156#define DEBUG_LSP_GEN (1<<13)
Christian Franke61010c32015-11-10 18:43:34 +0100157#define DEBUG_LSP_SCHED (1<<14)
Christian Franke80a8f722015-11-12 14:21:47 +0100158
159#define lsp_debug(...) \
160 do \
161 { \
162 if (isis->debugs & DEBUG_LSP_GEN) \
163 zlog_debug(__VA_ARGS__); \
164 } \
165 while (0)
jardineb5d44e2003-12-23 08:09:43 +0000166
Christian Franke61010c32015-11-10 18:43:34 +0100167#define sched_debug(...) \
168 do \
169 { \
170 if (isis->debugs & DEBUG_LSP_SCHED) \
171 zlog_debug(__VA_ARGS__); \
172 } \
173 while (0)
174
Olivier Dugeon4f593572016-04-19 19:03:05 +0200175#define DEBUG_TE (1<<13)
176
177#define IS_DEBUG_ISIS(x) (isis->debugs & x)
178
jardineb5d44e2003-12-23 08:09:43 +0000179#endif /* ISISD_H */