summaryrefslogtreecommitdiff
path: root/isisd/fabricd.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-08-23 00:22:32 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-08-26 20:16:19 -0300
commit7b36d36e0ed2a233c3a908c9e821e3f45c68d4e8 (patch)
treea6c1a1da3e1a61a63a891f0d84d9ab06557b28e4 /isisd/fabricd.c
parent675269d48324ab42c63fc0ed79da0bbad06ecdb1 (diff)
isisd: make the SPF code more modular
The goal of modularizing the SPF code is to make it possible for isisd to run SPF in the behalf of other nodes in the network, which is going to be necessary later when implementing the R-LFA/TI-LFA solutions. On top of that, a modularized SPF opens the door for much needed unit testing. Summary of the changes: * Change the isis_spf_preload_tent() function to use the local LSP as an input (as per the ISO specification) instead of populating the TENT based on the list of local interfaces; * Introduce the "isis_spf_adj" structure to represent an SPF adjacency. SPF adjacencies are inferred from the LSPDB, different from normal adjacencies formed using IIH messages; * Introduce the F_SPFTREE_NO_ROUTES flag to control whether the SPT should create routes or not; * Introduce the F_SPFTREE_NO_ADJACENCIES flag to specify whether IS-IS adjacency information is available or not. When running SPF in the behalf of other nodes, or under the context of an unit test, no adjacency information will be present. * On isis_area_create(), move some code around so that the area's isis backpointer is set as early as possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'isisd/fabricd.c')
-rw-r--r--isisd/fabricd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c
index ebaf14461e..2953ee681c 100644
--- a/isisd/fabricd.c
+++ b/isisd/fabricd.c
@@ -221,7 +221,9 @@ struct fabricd *fabricd_new(struct isis_area *area)
rv->area = area;
rv->initial_sync_state = FABRICD_SYNC_PENDING;
- rv->spftree = isis_spftree_new(area);
+ rv->spftree = isis_spftree_new(area, &area->lspdb[IS_LEVEL_2 - 1],
+ area->isis->sysid, ISIS_LEVEL2,
+ SPFTREE_IPV4, F_SPFTREE_HOPCOUNT_METRIC);
rv->neighbors = skiplist_new(0, neighbor_entry_list_cmp,
neighbor_entry_del_void);
rv->neighbors_neighbors = hash_create(neighbor_entry_hash_key,