static void fabricd_lsp_reset_flooding_info(struct isis_lsp *lsp,
struct isis_circuit *circuit)
{
+ lsp->flooding_time = time(NULL);
+
XFREE(MTYPE_FABRICD_FLOODING_INFO, lsp->flooding_interface);
for (enum isis_tx_type type = TX_LSP_NORMAL;
type <= TX_LSP_CIRCUIT_SCOPED; type++) {
lsp->flooding_interface = XSTRDUP(MTYPE_FABRICD_FLOODING_INFO,
circuit->interface->name);
}
+
+ lsp->flooding_circuit_scoped = false;
}
void fabricd_lsp_flood(struct isis_lsp *lsp, struct isis_circuit *circuit)
list_delete(&lsp->flooding_neighbors[type]);
}
}
+
+void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
+ struct isis_circuit *circuit)
+{
+ if (!fabricd)
+ return;
+
+ fabricd_lsp_reset_flooding_info(lsp, circuit);
+ lsp->flooding_circuit_scoped = true;
+}
void fabricd_trigger_csnp(struct isis_area *area);
struct list *fabricd_ip_addrs(struct isis_circuit *circuit);
void fabricd_lsp_free(struct isis_lsp *lsp);
+void fabricd_update_lsp_no_flood(struct isis_lsp *lsp,
+ struct isis_circuit *circuit);
#endif
struct isis_area *area;
struct isis_tlvs *tlvs;
+ time_t flooding_time;
struct list *flooding_neighbors[TX_LSP_CIRCUIT_SCOPED + 1];
char *flooding_interface;
+ bool flooding_circuit_scoped;
};
dict_t *lsp_db_init(void);
return retval;
}
+static void lsp_flood_or_update(struct isis_lsp *lsp,
+ struct isis_circuit *circuit,
+ bool circuit_scoped)
+{
+ if (!circuit_scoped) {
+ lsp_flood(lsp, circuit);
+ } else {
+ fabricd_update_lsp_no_flood(lsp, circuit);
+ }
+}
+
/*
* Process Level 1/2 Link State
* ISO - 10589
lsp_confusion);
tlvs = NULL;
/* ii */
- if (!circuit_scoped)
- lsp_flood(lsp, NULL);
+ lsp_flood_or_update(lsp, NULL,
+ circuit_scoped);
/* v */
ISIS_FLAGS_CLEAR_ALL(
lsp->SSNflags); /* FIXME:
/* our own LSP -> 7.3.16.4 c) */
if (comp == LSP_NEWER) {
lsp_inc_seqno(lsp, hdr.seqno);
- if (!circuit_scoped)
- lsp_flood(lsp, NULL);
+ lsp_flood_or_update(lsp, NULL, circuit_scoped);
} else {
isis_tx_queue_add(circuit->tx_queue,
lsp, TX_LSP_NORMAL);
circuit->area, level, false);
tlvs = NULL;
}
- if (!circuit_scoped)
- lsp_flood(lsp, circuit);
+ lsp_flood_or_update(lsp, circuit, circuit_scoped);
/* iv */
if (circuit->circ_type != CIRCUIT_T_BROADCAST)
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;