blob: 3ca421adccd43ffc8c0cb4477b5128df6c0c5e29 [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
28/* uncomment if you are a developer in bug hunt */
29/* #define EXTREME_DEBUG */
30/* #define EXTREME_TLV_DEBUG */
31
32/* If you want topology stuff compiled in */
33/* #define TOPOLOGY_GENERATE */
34
35struct rmap{
36 char *name;
37 struct route_map *map;
38};
39
40struct isis
41{
42 u_long process_id;
43 int sysid_set;
44 u_char sysid[ISIS_SYS_ID_LEN]; /* SystemID for this IS */
45 struct list *area_list; /* list of IS-IS areas */
46 struct list *init_circ_list;
47 struct list *nexthops; /* IPv4 next hops from this IS */
48#ifdef HAVE_IPV6
49 struct list *nexthops6; /* IPv6 next hops from this IS */
50#endif /* HAVE_IPV6 */
51 u_char max_area_addrs; /* maximumAreaAdresses */
52 struct area_addr *man_area_addrs; /* manualAreaAddresses */
53 u_int32_t debugs; /* bitmap for debug */
54 time_t uptime; /* when did we start */
55
56 /* Redistributed external information. */
57 struct route_table *external_info[ZEBRA_ROUTE_MAX + 1];
58 /* Redistribute metric info. */
59 struct {
60 int type; /* Internal or External */
61 int value; /* metric value */
62 } dmetric [ZEBRA_ROUTE_MAX + 1];
63
64 struct {
65 char *name;
66 struct route_map *map;
67 } rmap [ZEBRA_ROUTE_MAX + 1];
68#ifdef HAVE_IPV6
69 struct {
70 struct {
71 char *name;
72 struct route_map *map;
73 } rmap [ZEBRA_ROUTE_MAX + 1];
74 } inet6_afmode;
75#endif
76};
77
78struct isis_area
79{
80 struct isis *isis; /* back pointer */
81 dict_t *lspdb[ISIS_LEVELS]; /* link-state dbs */
82 struct isis_spftree *spftree[ISIS_LEVELS]; /* The v4 SPTs */
83 struct route_table *route_table; /* IPv4 routes */
84#ifdef HAVE_IPV6
85 struct isis_spftree *spftree6[ISIS_LEVELS]; /* The v4 SPTs */
86 struct route_table *route_table6; /* IPv6 routes */
87#endif
88 int min_bcast_mtu;
89 struct list *circuit_list; /* IS-IS circuits */
90 struct flags flags;
91 struct thread *t_tick; /* LSP walker */
92 struct thread *t_remove_aged;
93 int lsp_regenerate_pending[ISIS_LEVELS];
94 struct thread *t_lsp_refresh[ISIS_LEVELS];
95
96 /*
97 * Configurables
98 */
99 struct isis_passwd area_passwd;
100 struct isis_passwd domain_passwd;
101 /* do we support dynamic hostnames? */
102 char dynhostname;
103 /* do we support new style metrics? */
104 char newmetric;
105 /* identifies the routing instance */
106 char *area_tag;
107 /* area addresses for this area */
108 struct list *area_addrs;
109 u_int16_t max_lsp_lifetime[ISIS_LEVELS];
110 char is_type; /* level-1 level-1-2 or level-2-only */
111 u_int16_t lsp_refresh[ISIS_LEVELS];
112 /* minimum time allowed before lsp retransmission */
113 u_int16_t lsp_gen_interval[ISIS_LEVELS];
114 /* min interval between between consequtive SPFs */
115 u_int16_t min_spf_interval[ISIS_LEVELS];
116 /* the percentage of LSP mtu size used, before generating a new frag */
117 int lsp_frag_threshold;
118 int ip_circuits;
119#ifdef HAVE_IPV6
120 int ipv6_circuits;
121#endif /* HAVE_IPV6 */
122 /* Counters */
123 u_int32_t circuit_state_changes;
124#ifdef TOPOLOGY_GENERATE
125 struct list *topology;
126 char topology_baseis[ISIS_SYS_ID_LEN]; /* is for the first is emulated */
127 char top_params[200]; /* FIXME: what is reasonable? */
128#endif /* TOPOLOGY_GENERATE */
129};
130
131void isis_init(void);
132struct isis_area *isis_area_lookup (char *);
133
134#define DEBUG_ADJ_PACKETS (1<<0)
135#define DEBUG_CHECKSUM_ERRORS (1<<1)
136#define DEBUG_LOCAL_UPDATES (1<<2)
137#define DEBUG_PROTOCOL_ERRORS (1<<3)
138#define DEBUG_SNP_PACKETS (1<<4)
139#define DEBUG_UPDATE_PACKETS (1<<5)
140#define DEBUG_SPF_EVENTS (1<<6)
141#define DEBUG_SPF_STATS (1<<7)
142#define DEBUG_SPF_TRIGGERS (1<<8)
143#define DEBUG_RTE_EVENTS (1<<9)
144#define DEBUG_EVENTS (1<<10)
145
146#endif /* ISISD_H */