]>
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
;
34 uint8_t remote_sysid
[ISIS_SYS_ID_LEN
];
40 RB_HEAD(isis_spf_nodes
, isis_spf_node
);
41 RB_PROTOTYPE(isis_spf_nodes
, isis_spf_node
, entry
, isis_spf_node_compare
)
42 struct isis_spf_node
{
43 RB_ENTRY(isis_spf_node
) entry
;
45 /* Node's System ID. */
46 uint8_t sysid
[ISIS_SYS_ID_LEN
];
48 /* Local adjacencies over which this node is reachable. */
49 struct list
*adjacencies
;
51 /* Best metric of all adjacencies used to reach this node. */
55 /* Node's forward SPT. */
56 struct isis_spftree
*spftree
;
58 /* Node's reverse SPT. */
59 struct isis_spftree
*spftree_reverse
;
62 struct isis_spf_nodes p_space
;
66 enum lfa_protection_type
{
67 LFA_LINK_PROTECTION
= 1,
71 struct lfa_protected_resource
{
72 /* The protection type. */
73 enum lfa_protection_type type
;
75 /* The protected adjacency (might be a pseudonode). */
76 uint8_t adjacency
[ISIS_SYS_ID_LEN
+ 1];
78 /* List of nodes reachable over the protected interface. */
79 struct isis_spf_nodes nodes
;
82 /* Forward declaration(s). */
86 void isis_spf_node_list_init(struct isis_spf_nodes
*nodes
);
87 void isis_spf_node_list_clear(struct isis_spf_nodes
*nodes
);
88 struct isis_spf_node
*isis_spf_node_new(struct isis_spf_nodes
*nodes
,
89 const uint8_t *sysid
);
90 struct isis_spf_node
*isis_spf_node_find(const struct isis_spf_nodes
*nodes
,
91 const uint8_t *sysid
);
92 bool isis_lfa_excise_adj_check(const struct isis_spftree
*spftree
,
94 bool isis_lfa_excise_node_check(const struct isis_spftree
*spftree
,
96 struct isis_spftree
*isis_spf_reverse_run(const struct isis_spftree
*spftree
);
97 int isis_spf_run_neighbors(struct isis_spftree
*spftree
);
98 void isis_spf_run_lfa(struct isis_area
*area
, struct isis_spftree
*spftree
);
99 int isis_lfa_check(struct isis_spftree
*spftree
, struct isis_vertex
*vertex
);
100 struct isis_spftree
*
101 isis_tilfa_compute(struct isis_area
*area
, struct isis_spftree
*spftree
,
102 struct isis_spftree
*spftree_reverse
,
103 struct lfa_protected_resource
*protected_resource
);
105 #endif /* _FRR_ISIS_LFA_H */