]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_spf.h
ospfd,ospf6d: make clear the comparison of routemap name
[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; see the file COPYING; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24 #ifndef _ZEBRA_ISIS_SPF_H
25 #define _ZEBRA_ISIS_SPF_H
26
27 #include "isisd/isis_lfa.h"
28
29 struct isis_spftree;
30
31 enum spf_type {
32 SPF_TYPE_FORWARD = 1,
33 SPF_TYPE_REVERSE,
34 SPF_TYPE_RLFA,
35 SPF_TYPE_TI_LFA,
36 };
37
38 struct isis_spf_adj {
39 uint8_t id[ISIS_SYS_ID_LEN + 1];
40 struct isis_adjacency *adj;
41 uint32_t metric;
42 struct isis_ext_subtlvs *subtlvs;
43 struct isis_lsp *lsp;
44 struct {
45 uint8_t desig_is_id[ISIS_SYS_ID_LEN + 1];
46 } lan;
47 uint8_t flags;
48 #define F_ISIS_SPF_ADJ_BROADCAST 0x01
49 #define F_ISIS_SPF_ADJ_OLDMETRIC 0x02
50 #define F_ISIS_SPF_ADJ_METRIC_INFINITY 0x04
51 };
52
53 struct isis_spftree *isis_spftree_new(struct isis_area *area,
54 struct lspdb_head *lspdb,
55 const uint8_t *sysid, int level,
56 enum spf_tree_id tree_id,
57 enum spf_type type, uint8_t flags);
58 struct isis_vertex *isis_spf_prefix_sid_lookup(struct isis_spftree *spftree,
59 struct isis_prefix_sid *psid);
60 void isis_spf_invalidate_routes(struct isis_spftree *tree);
61 void isis_spf_verify_routes(struct isis_area *area,
62 struct isis_spftree **trees);
63 void isis_spftree_del(struct isis_spftree *spftree);
64 void spftree_area_init(struct isis_area *area);
65 void spftree_area_del(struct isis_area *area);
66 struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb,
67 const uint8_t *sysid);
68 #define isis_spf_schedule(area, level) \
69 _isis_spf_schedule((area), (level), __func__, \
70 __FILE__, __LINE__)
71 int _isis_spf_schedule(struct isis_area *area, int level,
72 const char *func, const char *file, int line);
73 void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree);
74 void isis_print_routes(struct vty *vty, struct isis_spftree *spftree,
75 bool prefix_sid, bool backup);
76 void isis_spf_init(void);
77 void isis_spf_print(struct isis_spftree *spftree, struct vty *vty);
78 void isis_run_spf(struct isis_spftree *spftree);
79 struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area,
80 uint8_t *sysid,
81 struct isis_spftree *spftree);
82
83 void isis_spf_timer_free(void *run);
84 #endif /* _ZEBRA_ISIS_SPF_H */