blob: 8912add35934e26aa72a5866b1d7d675352e27c2 [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isis_spf.h
3 * IS-IS Shortest Path First algorithm
4 *
5 * Copyright (C) 2001,2002 Sampo Saaristo
6 * Tampere University of Technology
7 * Institute of Communications Engineering
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public Licenseas published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * more details.
18
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef _ZEBRA_ISIS_SPF_H
25#define _ZEBRA_ISIS_SPF_H
26
hassof390d2c2004-09-10 20:48:21 +000027enum vertextype
28{
jardineb5d44e2003-12-23 08:09:43 +000029 VTYPE_PSEUDO_IS = 1,
30 VTYPE_NONPSEUDO_IS,
31 VTYPE_ES,
32 VTYPE_IPREACH_INTERNAL,
33 VTYPE_IPREACH_EXTERNAL
34#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +000035 ,
jardineb5d44e2003-12-23 08:09:43 +000036 VTYPE_IP6REACH_INTERNAL,
37 VTYPE_IP6REACH_EXTERNAL
hassof390d2c2004-09-10 20:48:21 +000038#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +000039};
40
41/*
42 * Triple <N, d(N), {Adj(N)}>
43 */
44struct isis_vertex
45{
46 enum vertextype type;
47
hassof390d2c2004-09-10 20:48:21 +000048 union
49 {
50 u_char id[ISIS_SYS_ID_LEN + 1];
jardineb5d44e2003-12-23 08:09:43 +000051 struct prefix prefix;
52 } N;
hassof390d2c2004-09-10 20:48:21 +000053
jardineb5d44e2003-12-23 08:09:43 +000054 struct isis_lsp *lsp;
hassof390d2c2004-09-10 20:48:21 +000055 u_int32_t d_N; /* d(N) Distance from this IS */
56 u_int16_t depth; /* The depth in the imaginary tree */
jardineb5d44e2003-12-23 08:09:43 +000057
hassof390d2c2004-09-10 20:48:21 +000058 struct list *Adj_N; /* {Adj(N)} */
59};
jardineb5d44e2003-12-23 08:09:43 +000060
61struct isis_spftree
62{
hasso12a5cae2004-09-19 19:39:26 +000063 struct thread *t_spf; /* spf threads */
hassof390d2c2004-09-10 20:48:21 +000064 time_t lastrun; /* for scheduling */
65 int pending; /* already scheduled */
66 struct list *paths; /* the SPT */
67 struct list *tents; /* TENT */
jardineb5d44e2003-12-23 08:09:43 +000068
hassof390d2c2004-09-10 20:48:21 +000069 u_int32_t timerun; /* statistics */
jardineb5d44e2003-12-23 08:09:43 +000070};
71
72void spftree_area_init (struct isis_area *area);
73int isis_spf_schedule (struct isis_area *area, int level);
74void isis_spf_cmds_init (void);
75#ifdef HAVE_IPV6
76int isis_spf_schedule6 (struct isis_area *area, int level);
77#endif
78#endif /* _ZEBRA_ISIS_SPF_H */