]>
Commit | Line | Data |
---|---|---|
eb5d44eb | 1 | /* |
2 | * IS-IS Rout(e)ing protocol - isis_spf.h | |
d62a17ae | 3 | * IS-IS Shortest Path First algorithm |
eb5d44eb | 4 | * |
5 | * Copyright (C) 2001,2002 Sampo Saaristo | |
d62a17ae | 6 | * Tampere University of Technology |
eb5d44eb | 7 | * Institute of Communications Engineering |
8 | * | |
d62a17ae | 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) | |
eb5d44eb | 12 | * any later version. |
13 | * | |
d62a17ae | 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 | |
eb5d44eb | 17 | * more details. |
896014f4 DL |
18 | * |
19 | * You should have received a copy of the GNU General Public License along | |
20 | * with this program; see the file COPYING; if not, write to the Free Software | |
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
eb5d44eb | 22 | */ |
23 | ||
24 | #ifndef _ZEBRA_ISIS_SPF_H | |
25 | #define _ZEBRA_ISIS_SPF_H | |
26 | ||
d62a17ae | 27 | enum vertextype { |
28 | VTYPE_PSEUDO_IS = 1, | |
29 | VTYPE_PSEUDO_TE_IS, | |
30 | VTYPE_NONPSEUDO_IS, | |
31 | VTYPE_NONPSEUDO_TE_IS, | |
32 | VTYPE_ES, | |
33 | VTYPE_IPREACH_INTERNAL, | |
34 | VTYPE_IPREACH_EXTERNAL, | |
35 | VTYPE_IPREACH_TE, | |
36 | VTYPE_IP6REACH_INTERNAL, | |
37 | VTYPE_IP6REACH_EXTERNAL | |
eb5d44eb | 38 | }; |
39 | ||
1b49e4f0 CF |
40 | #define VTYPE_IS(t) ((t) >= VTYPE_PSEUDO_IS && (t) <= VTYPE_NONPSEUDO_TE_IS) |
41 | #define VTYPE_ES(t) ((t) == VTYPE_ES) | |
42 | #define VTYPE_IP(t) ((t) >= VTYPE_IPREACH_INTERNAL && (t) <= VTYPE_IP6REACH_EXTERNAL) | |
43 | ||
eb5d44eb | 44 | /* |
d62a17ae | 45 | * Triple <N, d(N), {Adj(N)}> |
eb5d44eb | 46 | */ |
d62a17ae | 47 | struct isis_vertex { |
48 | enum vertextype type; | |
eb5d44eb | 49 | |
d62a17ae | 50 | union { |
51 | u_char id[ISIS_SYS_ID_LEN + 1]; | |
52 | struct prefix prefix; | |
53 | } N; | |
eb5d44eb | 54 | |
d62a17ae | 55 | u_int32_t d_N; /* d(N) Distance from this IS */ |
56 | u_int16_t depth; /* The depth in the imaginary tree */ | |
57 | struct list *Adj_N; /* {Adj(N)} next hop or neighbor list */ | |
58 | struct list *parents; /* list of parents for ECMP */ | |
59 | struct list *children; /* list of children used for tree dump */ | |
f390d2c7 | 60 | }; |
eb5d44eb | 61 | |
d62a17ae | 62 | struct isis_spftree { |
63 | struct list *paths; /* the SPT */ | |
64 | struct list *tents; /* TENT */ | |
65 | struct isis_area *area; /* back pointer to area */ | |
66 | unsigned int runcount; /* number of runs since uptime */ | |
67 | time_t last_run_timestamp; /* last run timestamp for scheduling */ | |
68 | time_t last_run_duration; /* last run duration in msec */ | |
1b49e4f0 | 69 | |
d62a17ae | 70 | uint16_t mtid; |
71 | int family; | |
72 | int level; | |
eb5d44eb | 73 | }; |
74 | ||
d62a17ae | 75 | struct isis_spftree *isis_spftree_new(struct isis_area *area); |
76 | void isis_spftree_del(struct isis_spftree *spftree); | |
77 | void spftree_area_init(struct isis_area *area); | |
78 | void spftree_area_del(struct isis_area *area); | |
79 | void spftree_area_adj_del(struct isis_area *area, struct isis_adjacency *adj); | |
80 | int isis_spf_schedule(struct isis_area *area, int level); | |
81 | void isis_spf_cmds_init(void); | |
eb5d44eb | 82 | #endif /* _ZEBRA_ISIS_SPF_H */ |