vty_out(vty,
"IS-IS Adjacency related packets debugging is %s\n",
onoffs);
+ if (flags & DEBUG_TX_QUEUE)
+ vty_out(vty, "IS-IS TX queue debugging is %s\n",
+ onoffs);
if (flags & DEBUG_SNP_PACKETS)
vty_out(vty, "IS-IS CSNP/PSNP packets debugging is %s\n",
onoffs);
vty_out(vty, "IS-IS LSP generation debugging is %s\n", onoffs);
if (flags & DEBUG_LSP_SCHED)
vty_out(vty, "IS-IS LSP scheduling debugging is %s\n", onoffs);
- if (flags & DEBUG_FABRICD_FLOODING)
- vty_out(vty, "OpenFabric Flooding debugging is %s\n", onoffs);
+ if (flags & DEBUG_FLOODING)
+ vty_out(vty, "IS-IS Flooding debugging is %s\n", onoffs);
if (flags & DEBUG_BFD)
vty_out(vty, "IS-IS BFD debugging is %s\n", onoffs);
}
vty_out(vty, "debug " PROTO_NAME " adj-packets\n");
write++;
}
+ if (flags & DEBUG_TX_QUEUE) {
+ vty_out(vty, "debug " PROTO_NAME " tx-queue\n");
+ write++;
+ }
if (flags & DEBUG_SNP_PACKETS) {
vty_out(vty, "debug " PROTO_NAME " snp-packets\n");
write++;
vty_out(vty, "debug " PROTO_NAME " lsp-sched\n");
write++;
}
- if (flags & DEBUG_FABRICD_FLOODING) {
+ if (flags & DEBUG_FLOODING) {
vty_out(vty, "debug " PROTO_NAME " flooding\n");
write++;
}
return CMD_SUCCESS;
}
+DEFUN (debug_isis_tx_queue,
+ debug_isis_tx_queue_cmd,
+ "debug " PROTO_NAME " tx-queue",
+ DEBUG_STR
+ PROTO_HELP
+ "IS-IS TX queues\n")
+{
+ isis->debugs |= DEBUG_TX_QUEUE;
+ print_debug(vty, DEBUG_TX_QUEUE, 1);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_isis_tx_queue,
+ no_debug_isis_tx_queue_cmd,
+ "no debug " PROTO_NAME " tx-queue",
+ NO_STR
+ UNDEBUG_STR
+ PROTO_HELP
+ "IS-IS TX queues\n")
+{
+ isis->debugs &= ~DEBUG_TX_QUEUE;
+ print_debug(vty, DEBUG_TX_QUEUE, 0);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (debug_isis_flooding,
+ debug_isis_flooding_cmd,
+ "debug " PROTO_NAME " flooding",
+ DEBUG_STR
+ PROTO_HELP
+ "Flooding algorithm\n")
+{
+ isis->debugs |= DEBUG_FLOODING;
+ print_debug(vty, DEBUG_FLOODING, 1);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_isis_flooding,
+ no_debug_isis_flooding_cmd,
+ "no debug " PROTO_NAME " flooding",
+ NO_STR
+ UNDEBUG_STR
+ PROTO_HELP
+ "Flooding algorithm\n")
+{
+ isis->debugs &= ~DEBUG_FLOODING;
+ print_debug(vty, DEBUG_FLOODING, 0);
+
+ return CMD_SUCCESS;
+}
+
DEFUN (debug_isis_snp,
debug_isis_snp_cmd,
"debug " PROTO_NAME " snp-packets",
}
}
+ vty_out(vty, " TX counters per PDU type:\n");
+ pdu_counter_print(vty, " ", area->pdu_tx_counters);
+ vty_out(vty, " RX counters per PDU type:\n");
+ pdu_counter_print(vty, " ", area->pdu_rx_counters);
+
for (level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) {
if ((area->is_type & level) == 0)
continue;
return CMD_SUCCESS;
}
-/*
- * This function supports following display options:
- * [ show isis database [detail] ]
- * [ show isis database <sysid> [detail] ]
- * [ show isis database <hostname> [detail] ]
- * [ show isis database <sysid>.<pseudo-id> [detail] ]
- * [ show isis database <hostname>.<pseudo-id> [detail] ]
- * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ]
- * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ]
- * [ show isis database detail <sysid> ]
- * [ show isis database detail <hostname> ]
- * [ show isis database detail <sysid>.<pseudo-id> ]
- * [ show isis database detail <hostname>.<pseudo-id> ]
- * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ]
- * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ]
- */
-static int show_isis_database(struct vty *vty, const char *argv, int ui_level)
+struct isis_lsp *lsp_for_arg(const char *argv, dict_t *lspdb)
{
- struct listnode *node;
- struct isis_area *area;
- struct isis_lsp *lsp;
- struct isis_dynhn *dynhn;
- const char *pos;
- uint8_t lspid[ISIS_SYS_ID_LEN + 2];
- char sysid[255];
+ char sysid[255] = {0};
uint8_t number[3];
- int level, lsp_count;
-
- if (isis->area_list->count == 0)
- return CMD_SUCCESS;
+ const char *pos;
+ uint8_t lspid[ISIS_SYS_ID_LEN + 2] = {0};
+ struct isis_dynhn *dynhn;
+ struct isis_lsp *lsp = NULL;
- memset(&lspid, 0, ISIS_SYS_ID_LEN);
- memset(&sysid, 0, 255);
+ if (!argv)
+ return NULL;
/*
* extract fragment and pseudo id from the string argv
(uint8_t)strtol((char *)number, NULL, 16);
pos -= 4;
if (strncmp(pos, ".", 1) != 0)
- return CMD_WARNING;
+ return NULL;
}
if (strncmp(pos, ".", 1) == 0) {
memcpy(number, ++pos, 2);
}
}
+ /*
+ * Try to find the lsp-id if the argv
+ * string is in
+ * the form
+ * hostname.<pseudo-id>-<fragment>
+ */
+ if (sysid2buff(lspid, sysid)) {
+ lsp = lsp_search(lspid, lspdb);
+ } else if ((dynhn = dynhn_find_by_name(sysid))) {
+ memcpy(lspid, dynhn->id, ISIS_SYS_ID_LEN);
+ lsp = lsp_search(lspid, lspdb);
+ } else if (strncmp(cmd_hostname_get(), sysid, 15) == 0) {
+ memcpy(lspid, isis->sysid, ISIS_SYS_ID_LEN);
+ lsp = lsp_search(lspid, lspdb);
+ }
+
+ return lsp;
+}
+
+/*
+ * This function supports following display options:
+ * [ show isis database [detail] ]
+ * [ show isis database <sysid> [detail] ]
+ * [ show isis database <hostname> [detail] ]
+ * [ show isis database <sysid>.<pseudo-id> [detail] ]
+ * [ show isis database <hostname>.<pseudo-id> [detail] ]
+ * [ show isis database <sysid>.<pseudo-id>-<fragment-number> [detail] ]
+ * [ show isis database <hostname>.<pseudo-id>-<fragment-number> [detail] ]
+ * [ show isis database detail <sysid> ]
+ * [ show isis database detail <hostname> ]
+ * [ show isis database detail <sysid>.<pseudo-id> ]
+ * [ show isis database detail <hostname>.<pseudo-id> ]
+ * [ show isis database detail <sysid>.<pseudo-id>-<fragment-number> ]
+ * [ show isis database detail <hostname>.<pseudo-id>-<fragment-number> ]
+ */
+static int show_isis_database(struct vty *vty, const char *argv, int ui_level)
+{
+ struct listnode *node;
+ struct isis_area *area;
+ struct isis_lsp *lsp;
+ int level, lsp_count;
+
+ if (isis->area_list->count == 0)
+ return CMD_SUCCESS;
+
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
vty_out(vty, "Area %s:\n",
area->area_tag ? area->area_tag : "null");
for (level = 0; level < ISIS_LEVELS; level++) {
if (area->lspdb[level]
&& dict_count(area->lspdb[level]) > 0) {
- lsp = NULL;
- if (argv != NULL) {
- /*
- * Try to find the lsp-id if the argv
- * string is in
- * the form
- * hostname.<pseudo-id>-<fragment>
- */
- if (sysid2buff(lspid, sysid)) {
- lsp = lsp_search(
- lspid,
- area->lspdb[level]);
- } else if ((dynhn = dynhn_find_by_name(
- sysid))) {
- memcpy(lspid, dynhn->id,
- ISIS_SYS_ID_LEN);
- lsp = lsp_search(
- lspid,
- area->lspdb[level]);
- } else if (strncmp(cmd_hostname_get(),
- sysid, 15)
- == 0) {
- memcpy(lspid, isis->sysid,
- ISIS_SYS_ID_LEN);
- lsp = lsp_search(
- lspid,
- area->lspdb[level]);
- }
- }
+ lsp = lsp_for_arg(argv, area->lspdb[level]);
if (lsp != NULL || argv == NULL) {
vty_out(vty,
install_element(ENABLE_NODE, &debug_isis_adj_cmd);
install_element(ENABLE_NODE, &no_debug_isis_adj_cmd);
+ install_element(ENABLE_NODE, &debug_isis_tx_queue_cmd);
+ install_element(ENABLE_NODE, &no_debug_isis_tx_queue_cmd);
+ install_element(ENABLE_NODE, &debug_isis_flooding_cmd);
+ install_element(ENABLE_NODE, &no_debug_isis_flooding_cmd);
install_element(ENABLE_NODE, &debug_isis_snp_cmd);
install_element(ENABLE_NODE, &no_debug_isis_snp_cmd);
install_element(ENABLE_NODE, &debug_isis_upd_cmd);
install_element(CONFIG_NODE, &debug_isis_adj_cmd);
install_element(CONFIG_NODE, &no_debug_isis_adj_cmd);
+ install_element(CONFIG_NODE, &debug_isis_tx_queue_cmd);
+ install_element(CONFIG_NODE, &no_debug_isis_tx_queue_cmd);
+ install_element(CONFIG_NODE, &debug_isis_flooding_cmd);
+ install_element(CONFIG_NODE, &no_debug_isis_flooding_cmd);
install_element(CONFIG_NODE, &debug_isis_snp_cmd);
install_element(CONFIG_NODE, &no_debug_isis_snp_cmd);
install_element(CONFIG_NODE, &debug_isis_upd_cmd);