diff options
| author | Olivier Dugeon <olivier.dugeon@orange.com> | 2021-01-12 19:25:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-12 19:25:15 +0100 |
| commit | 4683138cdabe97db182d35147d74b6fb01a8e557 (patch) | |
| tree | 3aa64eae0e8c5aceca0991fd1db3fd72143542b3 /tests/isisd/test_common.c | |
| parent | 484eabb1d70fe00478ce30cc866f219df5c183ab (diff) | |
| parent | 27cb633df6c9fa9113a858dceb9528f2524c425d (diff) | |
Merge pull request #7707 from opensourcerouting/isisd-rlfa
isisd, ldpd: add Remote LFA support
Diffstat (limited to 'tests/isisd/test_common.c')
| -rw-r--r-- | tests/isisd/test_common.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/isisd/test_common.c b/tests/isisd/test_common.c index 5fa604c749..5b2028ffd4 100644 --- a/tests/isisd/test_common.c +++ b/tests/isisd/test_common.c @@ -69,6 +69,24 @@ test_find_adjacency(const struct isis_test_node *tnode, const char *hostname) return NULL; } +mpls_label_t test_topology_node_ldp_label(const struct isis_topology *topology, + struct in_addr router_id) +{ + for (size_t i = 0; topology->nodes[i].hostname[0]; i++) { + const struct isis_test_node *tnode = &topology->nodes[i]; + struct in_addr node_router_id; + + if (!tnode->router_id) + continue; + + (void)inet_pton(AF_INET, tnode->router_id, &node_router_id); + if (IPV4_ADDR_SAME(&router_id, &node_router_id)) + return (50000 + (i + 1) * 100); + } + + return MPLS_INVALID_LABEL; +} + static struct isis_lsp *lsp_add(struct lspdb_head *lspdb, struct isis_area *area, int level, const uint8_t *sysid, uint8_t pseudonode_id) |
