diff options
author | Christian Franke <chris@opensourcerouting.org> | 2018-11-23 03:34:16 +0100 |
---|---|---|
committer | Rodny Molina <rmolina@linkedin.com> | 2018-12-07 20:45:14 +0100 |
commit | a6b60da99af0be34919d94564ad3549ed1757804 (patch) | |
tree | ed52825742bc4feebf67bb230016aad97b57cb79 /isisd/isis_vty_fabricd.c | |
parent | fabricd: Add `show openfabric flooding` command (diff) | |
download | frr-a6b60da99af0be34919d94564ad3549ed1757804.tar.xz frr-a6b60da99af0be34919d94564ad3549ed1757804.zip |
fabricd: Improve LSP flooding log
Also track when we received an LSP as do not reflood, as well as the
time when we last considered flooding it.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_vty_fabricd.c')
-rw-r--r-- | isisd/isis_vty_fabricd.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c index 72ee2ac92..bd4020104 100644 --- a/isisd/isis_vty_fabricd.c +++ b/isisd/isis_vty_fabricd.c @@ -65,14 +65,34 @@ static void lsp_print_flooding(struct vty *vty, struct isis_lsp *lsp) vty_out(vty, "Flooding information for %s\n", lspid); if (!lsp->flooding_neighbors[TX_LSP_NORMAL]) { - vty_out(vty, " Never flooded.\n"); + vty_out(vty, " Never received.\n"); return; } - vty_out(vty, " Last received on: %s\n", + vty_out(vty, " Last received on: %s (", lsp->flooding_interface ? lsp->flooding_interface : "(null)"); + time_t uptime = time(NULL) - lsp->flooding_time; + struct tm *tm = gmtime(&uptime); + + if (uptime < ONE_DAY_SECOND) + vty_out(vty, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min, + tm->tm_sec); + else if (uptime < ONE_WEEK_SECOND) + vty_out(vty, "%dd%02dh%02dm", tm->tm_yday, tm->tm_hour, + tm->tm_min); + else + vty_out(vty, "%02dw%dd%02dh", tm->tm_yday / 7, + tm->tm_yday - ((tm->tm_yday / 7) * 7), + tm->tm_hour); + vty_out(vty, " ago)\n"); + + if (lsp->flooding_circuit_scoped) { + vty_out(vty, " Received as circuit-scoped LSP, so not flooded.\n"); + return; + } + for (enum isis_tx_type type = TX_LSP_NORMAL; type <= TX_LSP_CIRCUIT_SCOPED; type++) { struct listnode *node; |