]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_spf.h
Merge remote-tracking branch 'origin/stable/3.0'
[mirror_frr.git] / isisd / isis_spf.h
1 /*
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
27 enum vertextype
28 {
29 VTYPE_PSEUDO_IS = 1,
30 VTYPE_PSEUDO_TE_IS,
31 VTYPE_NONPSEUDO_IS,
32 VTYPE_NONPSEUDO_TE_IS,
33 VTYPE_ES,
34 VTYPE_IPREACH_INTERNAL,
35 VTYPE_IPREACH_EXTERNAL,
36 VTYPE_IPREACH_TE,
37 VTYPE_IP6REACH_INTERNAL,
38 VTYPE_IP6REACH_EXTERNAL
39 };
40
41 #define VTYPE_IS(t) ((t) >= VTYPE_PSEUDO_IS && (t) <= VTYPE_NONPSEUDO_TE_IS)
42 #define VTYPE_ES(t) ((t) == VTYPE_ES)
43 #define VTYPE_IP(t) ((t) >= VTYPE_IPREACH_INTERNAL && (t) <= VTYPE_IP6REACH_EXTERNAL)
44
45 /*
46 * Triple <N, d(N), {Adj(N)}>
47 */
48 struct isis_vertex
49 {
50 enum vertextype type;
51
52 union
53 {
54 u_char id[ISIS_SYS_ID_LEN + 1];
55 struct prefix prefix;
56 } N;
57
58 u_int32_t d_N; /* d(N) Distance from this IS */
59 u_int16_t depth; /* The depth in the imaginary tree */
60 struct list *Adj_N; /* {Adj(N)} next hop or neighbor list */
61 struct list *parents; /* list of parents for ECMP */
62 struct list *children; /* list of children used for tree dump */
63 };
64
65 struct isis_spftree
66 {
67 struct list *paths; /* the SPT */
68 struct list *tents; /* TENT */
69 struct isis_area *area; /* back pointer to area */
70 unsigned int runcount; /* number of runs since uptime */
71 time_t last_run_timestamp; /* last run timestamp for scheduling */
72 time_t last_run_duration; /* last run duration in msec */
73
74 uint16_t mtid;
75 int family;
76 int level;
77 };
78
79 struct isis_spftree * isis_spftree_new (struct isis_area *area);
80 void isis_spftree_del (struct isis_spftree *spftree);
81 void spftree_area_init (struct isis_area *area);
82 void spftree_area_del (struct isis_area *area);
83 void spftree_area_adj_del (struct isis_area *area,
84 struct isis_adjacency *adj);
85 int isis_spf_schedule (struct isis_area *area, int level);
86 void isis_spf_cmds_init (void);
87 #endif /* _ZEBRA_ISIS_SPF_H */