]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_spf.h
Merge pull request #7184 from opensourcerouting/anycast-sids-v4
[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_TI_LFA,
35 };
36
37 struct isis_spf_adj {
38 uint8_t id[ISIS_SYS_ID_LEN + 1];
39 struct isis_adjacency *adj;
40 uint32_t metric;
41 struct isis_ext_subtlvs *subtlvs;
42 struct {
43 uint8_t desig_is_id[ISIS_SYS_ID_LEN + 1];
44 struct isis_lsp *lsp_pseudo;
45 } lan;
46 uint8_t flags;
47 #define F_ISIS_SPF_ADJ_BROADCAST 0x01
48 #define F_ISIS_SPF_ADJ_OLDMETRIC 0x02
49 };
50
51 struct isis_spftree *isis_spftree_new(struct isis_area *area,
52 struct lspdb_head *lspdb,
53 const uint8_t *sysid, int level,
54 enum spf_tree_id tree_id,
55 enum spf_type type, uint8_t flags);
56 void isis_spf_invalidate_routes(struct isis_spftree *tree);
57 void isis_spf_verify_routes(struct isis_area *area,
58 struct isis_spftree **trees);
59 void isis_spftree_del(struct isis_spftree *spftree);
60 void spftree_area_init(struct isis_area *area);
61 void spftree_area_del(struct isis_area *area);
62 struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb,
63 const uint8_t *sysid);
64 #define isis_spf_schedule(area, level) \
65 _isis_spf_schedule((area), (level), __func__, \
66 __FILE__, __LINE__)
67 int _isis_spf_schedule(struct isis_area *area, int level,
68 const char *func, const char *file, int line);
69 void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree);
70 void isis_print_routes(struct vty *vty, struct isis_spftree *spftree,
71 bool prefix_sid, bool backup);
72 void isis_spf_init(void);
73 void isis_spf_print(struct isis_spftree *spftree, struct vty *vty);
74 void isis_run_spf(struct isis_spftree *spftree);
75 struct isis_spftree *isis_run_hopcount_spf(struct isis_area *area,
76 uint8_t *sysid,
77 struct isis_spftree *spftree);
78
79 #endif /* _ZEBRA_ISIS_SPF_H */