Skip to content

Commit

Permalink
Merge pull request #16182 from pguibert6WIND/isis_show_route_paths_json
Browse files Browse the repository at this point in the history
Isis show route paths json
  • Loading branch information
riw777 authored Jun 25, 2024
2 parents aeeceef + 611f83f commit cc3519f
Show file tree
Hide file tree
Showing 16 changed files with 3,761 additions and 3,447 deletions.
262 changes: 206 additions & 56 deletions isisd/isis_spf.c

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion isisd/isis_spf.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ struct isis_lsp *isis_root_system_lsp(struct lspdb_head *lspdb,
__FILE__, __LINE__)
int _isis_spf_schedule(struct isis_area *area, int level,
const char *func, const char *file, int line);
void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree);
void isis_print_spftree(struct vty *vty, struct isis_spftree *spftree,
struct json_object **json);
void isis_print_routes(struct vty *vty, struct isis_spftree *spftree,
json_object **json, bool prefix_sid, bool backup);
void isis_spf_init(void);
Expand Down
10 changes: 5 additions & 5 deletions tests/isisd/test_isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void test_run_spf(struct vty *vty, const struct isis_topology *topology,
isis_run_spf(spftree);

/* Print the SPT and the corresponding routing table. */
isis_print_spftree(vty, spftree);
isis_print_spftree(vty, spftree, NULL);
isis_print_routes(vty, spftree, NULL, false, false);

/* Cleanup SPF tree. */
Expand Down Expand Up @@ -85,7 +85,7 @@ static void test_run_lfa(struct vty *vty, const struct isis_topology *topology,
isis_lfa_compute(area, NULL, spftree_self, protected_resource);

/* Print the SPT and the corresponding main/backup routing tables. */
isis_print_spftree(vty, spftree_self);
isis_print_spftree(vty, spftree_self, NULL);
vty_out(vty, "Main:\n");
isis_print_routes(vty, spftree_self, NULL, false, false);
vty_out(vty, "Backup:\n");
Expand Down Expand Up @@ -148,7 +148,7 @@ static void test_run_rlfa(struct vty *vty, const struct isis_topology *topology,
vty_out(vty, "\n");

/* Print the post-convergence SPT. */
isis_print_spftree(vty, spftree_pc);
isis_print_spftree(vty, spftree_pc, NULL);

/*
* Activate the computed RLFAs (if any) using artificial LDP labels for
Expand All @@ -164,7 +164,7 @@ static void test_run_rlfa(struct vty *vty, const struct isis_topology *topology,
}

/* Print the SPT and the corresponding main/backup routing tables. */
isis_print_spftree(vty, spftree_self);
isis_print_spftree(vty, spftree_self, NULL);
vty_out(vty, "Main:\n");
isis_print_routes(vty, spftree_self, NULL, false, false);
vty_out(vty, "Backup:\n");
Expand Down Expand Up @@ -228,7 +228,7 @@ static void test_run_ti_lfa(struct vty *vty,
/*
* Print the post-convergence SPT and the corresponding routing table.
*/
isis_print_spftree(vty, spftree_pc);
isis_print_spftree(vty, spftree_pc, NULL);
isis_print_routes(vty, spftree_self, NULL, false, true);

/* Cleanup everything. */
Expand Down
4,266 changes: 2,246 additions & 2,020 deletions tests/isisd/test_isis_spf.refout

Large diffs are not rendered by default.

188 changes: 95 additions & 93 deletions tests/topotests/isis_topo1/r1/r1_topology.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,98 @@
{
"1": {
"level-1": {
"ipv4": [
{
"vertex": "r1"
}
],
"ipv6": [
{
"vertex": "r1"
}
]
},
"level-2": {
"ipv4": [
{
"vertex": "r1"
},
{
"metric": "0",
"parent": "r1(4)",
"type": "IP internal",
"vertex": "10.0.20.0/24"
},
{
"interface": "r1-eth0",
"metric": "10",
"next-hop": "r3",
"parent": "r1(4)",
"type": "TE-IS",
"vertex": "r3"
},
{
"interface": "r1-eth0",
"metric": "10",
"next-hop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.0.10.0/24"
},
{
"interface": "r1-eth0",
"metric": "10",
"next-hop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.0.20.0/24"
},
{
"interface": "r1-eth0",
"metric": "10",
"next-hop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.254.0.3/32"
}
],
"ipv6": [
{
"vertex": "r1"
},
{
"metric": "0",
"parent": "r1(4)",
"type": "IP6 internal",
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r1-eth0",
"metric": "10",
"next-hop": "r3",
"parent": "r1(4)",
"type": "TE-IS",
"vertex": "r3"
},
{
"metric": "10",
"interface": "r1-eth0",
"next-hop": "r3",
"parent": "r3(4)",
"type": "IP6 internal",
"vertex": "2001:db8:2:1::/64"
[
{
"area": "1",
"algorithm": 0,
"level-1": {
"ipv4-paths": [
{
"vertex": "r1"
}
],
"ipv6-paths": [
{
"vertex": "r1"
}
]
},
{
"metric": "10",
"interface": "r1-eth0",
"next-hop": "r3",
"parent": "r3(4)",
"type": "IP6 internal",
"vertex": "2001:db8:f::3/128"
"level-2": {
"ipv4-paths": [
{
"vertex": "r1"
},
{
"metric": 0,
"parent": "r1(4)",
"type": "IP internal",
"vertex": "10.0.20.0/24"
},
{
"interface": "r1-eth0",
"metric": 10,
"nextHop": "r3",
"parent": "r1(4)",
"type": "TE-IS",
"vertex": "r3"
},
{
"interface": "r1-eth0",
"metric": 10,
"nextHop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.0.10.0/24"
},
{
"interface": "r1-eth0",
"metric": 10,
"nextHop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.0.20.0/24"
},
{
"interface": "r1-eth0",
"metric": 10,
"nextHop": "r3",
"parent": "r3(4)",
"type": "IP TE",
"vertex": "10.254.0.3/32"
}
],
"ipv6-paths": [
{
"vertex": "r1"
},
{
"metric": 0,
"parent": "r1(4)",
"type": "IP6 internal",
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r1-eth0",
"metric": 10,
"nextHop": "r3",
"parent": "r1(4)",
"type": "TE-IS",
"vertex": "r3"
},
{
"metric": 10,
"interface": "r1-eth0",
"nextHop": "r3",
"parent": "r3(4)",
"type": "IP6 internal",
"vertex": "2001:db8:2:1::/64"
},
{
"metric": 10,
"interface": "r1-eth0",
"nextHop": "r3",
"parent": "r3(4)",
"type": "IP6 internal",
"vertex": "2001:db8:f::3/128"
}
]
}
]
}
}
}
]
Loading

0 comments on commit cc3519f

Please sign in to comment.