]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_lfa.h
2 * Copyright (C) 2020 NetDEF, Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _FRR_ISIS_LFA_H
21 #define _FRR_ISIS_LFA_H
23 enum isis_tilfa_sid_type
{
28 struct isis_tilfa_sid
{
29 enum isis_tilfa_sid_type type
;
36 RB_HEAD(isis_spf_nodes
, isis_spf_node
);
37 RB_PROTOTYPE(isis_spf_nodes
, isis_spf_node
, entry
, isis_spf_node_compare
)
38 struct isis_spf_node
{
39 RB_ENTRY(isis_spf_node
) entry
;
41 /* Node's System ID. */
42 uint8_t sysid
[ISIS_SYS_ID_LEN
];
44 /* Local adjacencies over which this node is reachable. */
45 struct list
*adjacencies
;
47 /* Best metric of all adjacencies used to reach this node. */
51 /* Node's forward SPT. */
52 struct isis_spftree
*spftree
;
54 /* Node's reverse SPT. */
55 struct isis_spftree
*spftree_reverse
;
58 struct isis_spf_nodes p_space
;
62 enum lfa_protection_type
{
63 LFA_LINK_PROTECTION
= 1,
67 struct lfa_protected_resource
{
68 /* The protection type. */
69 enum lfa_protection_type type
;
71 /* The protected adjacency (might be a pseudonode). */
72 uint8_t adjacency
[ISIS_SYS_ID_LEN
+ 1];
74 /* List of nodes reachable over the protected interface. */
75 struct isis_spf_nodes nodes
;
78 /* Forward declaration(s). */
82 void isis_spf_node_list_init(struct isis_spf_nodes
*nodes
);
83 void isis_spf_node_list_clear(struct isis_spf_nodes
*nodes
);
84 struct isis_spf_node
*isis_spf_node_new(struct isis_spf_nodes
*nodes
,
85 const uint8_t *sysid
);
86 struct isis_spf_node
*isis_spf_node_find(const struct isis_spf_nodes
*nodes
,
87 const uint8_t *sysid
);
88 bool isis_lfa_excise_adj_check(const struct isis_spftree
*spftree
,
90 bool isis_lfa_excise_node_check(const struct isis_spftree
*spftree
,
92 struct isis_spftree
*isis_spf_reverse_run(const struct isis_spftree
*spftree
);
93 int isis_spf_run_neighbors(struct isis_spftree
*spftree
);
94 void isis_spf_run_lfa(struct isis_area
*area
, struct isis_spftree
*spftree
);
95 int isis_lfa_check(struct isis_spftree
*spftree
, struct isis_vertex
*vertex
);
97 isis_tilfa_compute(struct isis_area
*area
, struct isis_spftree
*spftree
,
98 struct isis_spftree
*spftree_reverse
,
99 struct lfa_protected_resource
*protected_resource
);
101 #endif /* _FRR_ISIS_LFA_H */