+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* IS-IS Rout(e)ing protocol - isis_spf_private.h
*
* Tampere University of Technology
* Institute of Communications Engineering
* Copyright (C) 2017 Christian Franke <chris@opensourcerouting.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public Licenseas published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ISIS_SPF_PRIVATE_H
#define ISIS_SPF_PRIVATE_H
struct isis_spf_adj *sadj;
struct isis_sr_psid_info sr;
struct mpls_label_stack *label_stack;
+ uint32_t lfa_metric;
};
/*
struct {
struct prefix_pair p;
struct isis_sr_psid_info sr;
+ enum spf_prefix_priority priority;
} ip;
} N;
uint32_t d_N; /* d(N) Distance from this IS */
struct list *parents; /* list of parents for ECMP */
struct hash *firsthops; /* first two hops to neighbor */
uint64_t insert_counter;
+ uint8_t flags;
};
+#define F_ISIS_VERTEX_LFA_PROTECTED 0x01
/* Vertex Queue and associated functions */
isis_vertex_queue_hash_cmp, name);
}
-__attribute__((__unused__))
-static void isis_vertex_del(struct isis_vertex *vertex)
-{
- list_delete(&vertex->Adj_N);
- list_delete(&vertex->parents);
- if (vertex->firsthops) {
- hash_clean(vertex->firsthops, NULL);
- hash_free(vertex->firsthops);
- vertex->firsthops = NULL;
- }
-
- memset(vertex, 0, sizeof(struct isis_vertex));
- XFREE(MTYPE_ISIS_VERTEX, vertex);
-}
+void isis_vertex_del(struct isis_vertex *vertex);
bool isis_vertex_adj_exists(const struct isis_spftree *spftree,
const struct isis_vertex *vertex,
const struct isis_spf_adj *sadj);
+void isis_vertex_adj_free(void *arg);
+struct isis_vertex_adj *
+isis_vertex_adj_add(struct isis_spftree *spftree, struct isis_vertex *vertex,
+ struct list *vadj_list, struct isis_spf_adj *sadj,
+ struct isis_prefix_sid *psid, bool last_hop);
__attribute__((__unused__))
static void isis_vertex_queue_clear(struct isis_vertex_queue *queue)
struct route_table *route_table;
struct route_table *route_table_backup;
struct lspdb_head *lspdb; /* link-state db */
+ struct hash *prefix_sids; /* SR Prefix-SIDs. */
struct list *sadj_list;
struct isis_spf_nodes adj_nodes;
struct isis_area *area; /* back pointer to area */
/* P-space and Q-space. */
struct isis_spf_nodes p_space;
struct isis_spf_nodes q_space;
+
+ /* Remote LFA related information. */
+ struct {
+ /* List of RLFAs eligible to be installed. */
+ struct rlfa_tree_head rlfas;
+
+ /*
+ * RLFA post-convergence SPTs (needed to activate RLFAs
+ * once label information is received from LDP).
+ */
+ struct list *pc_spftrees;
+
+ /* RLFA maximum metric (or zero if absent). */
+ uint32_t max_metric;
+ } remote;
+
+ /* Protection counters. */
+ struct {
+ uint32_t lfa[SPF_PREFIX_PRIO_MAX];
+ uint32_t rlfa[SPF_PREFIX_PRIO_MAX];
+ uint32_t tilfa[SPF_PREFIX_PRIO_MAX];
+ uint32_t ecmp[SPF_PREFIX_PRIO_MAX];
+ uint32_t total[SPF_PREFIX_PRIO_MAX];
+ } protection_counters;
} lfa;
uint8_t flags;
};