#include "isisd/isis_events.h"
#include "isisd/isis_te.h"
#include "isisd/isis_mt.h"
+#include "isisd/fabricd.h"
struct isis *isis = NULL;
*/
/* isis->debugs = 0xFFFF; */
isisMplsTE.status = disable; /* Only support TE metric */
+
QOBJ_REG(isis, isis);
}
area = XCALLOC(MTYPE_ISIS_AREA, sizeof(struct isis_area));
/*
- * The first instance is level-1-2 rest are level-1, unless otherwise
- * configured
+ * Fabricd runs only as level-2.
+ * For IS-IS, the first instance is level-1-2 rest are level-1,
+ * unless otherwise configured
*/
- if (listcount(isis->area_list) > 0)
+ if (fabricd) {
+ area->is_type = IS_LEVEL_2;
+ } else if (listcount(isis->area_list) > 0)
area->is_type = IS_LEVEL_1;
else
area->is_type = IS_LEVEL_1_AND_2;
*/
if (area->is_type & IS_LEVEL_1) {
area->lspdb[0] = lsp_db_init();
- area->route_table[0] = route_table_init();
- area->route_table6[0] = route_table_init();
}
if (area->is_type & IS_LEVEL_2) {
area->lspdb[1] = lsp_db_init();
- area->route_table[1] = route_table_init();
- area->route_table6[1] = route_table_init();
}
spftree_area_init(area);
listnode_add(isis->area_list, area);
area->isis = isis;
+ if (fabricd)
+ area->fabricd = fabricd_new(area);
+
+ area->lsp_refresh_arg[0].area = area;
+ area->lsp_refresh_arg[0].level = IS_LEVEL_1;
+ area->lsp_refresh_arg[1].area = area;
+ area->lsp_refresh_arg[1].level = IS_LEVEL_2;
+
+
QOBJ_REG(area, isis_area);
return area;
area = isis_area_lookup(area_tag);
if (area) {
- VTY_PUSH_CONTEXT(ISIS_NODE, area);
+ VTY_PUSH_CONTEXT(ROUTER_NODE, area);
return CMD_SUCCESS;
}
if (isis->debugs & DEBUG_EVENTS)
zlog_debug("New IS-IS area instance %s", area->area_tag);
- VTY_PUSH_CONTEXT(ISIS_NODE, area);
+ VTY_PUSH_CONTEXT(ROUTER_NODE, area);
return CMD_SUCCESS;
}
QOBJ_UNREG(area);
+ if (fabricd)
+ fabricd_finish(area->fabricd);
+
if (area->circuit_list) {
for (ALL_LIST_ELEMENTS(area->circuit_list, node, nnode,
circuit)) {
circuit->ipv6_router = 0;
isis_csm_state_change(ISIS_DISABLE, circuit, area);
}
- list_delete_and_null(&area->circuit_list);
+ list_delete(&area->circuit_list);
}
if (area->lspdb[0] != NULL) {
area->lspdb[1] = NULL;
}
+ /* invalidate and verify to delete all routes from zebra */
+ isis_area_invalidate_routes(area, ISIS_LEVEL1 & ISIS_LEVEL2);
+ isis_area_verify_routes(area);
+
spftree_area_del(area);
THREAD_TIMER_OFF(area->spf_timer[0]);
spf_backoff_free(area->spf_delay_ietf[0]);
spf_backoff_free(area->spf_delay_ietf[1]);
- /* invalidate and validate would delete all routes from zebra */
- isis_route_invalidate(area);
- isis_route_validate(area);
-
- if (area->route_table[0]) {
- route_table_finish(area->route_table[0]);
- area->route_table[0] = NULL;
- }
- if (area->route_table[1]) {
- route_table_finish(area->route_table[1]);
- area->route_table[1] = NULL;
- }
- if (area->route_table6[0]) {
- route_table_finish(area->route_table6[0]);
- area->route_table6[0] = NULL;
- }
- if (area->route_table6[1]) {
- route_table_finish(area->route_table6[1]);
- area->route_table6[1] = NULL;
- }
-
isis_redist_area_finish(area);
for (ALL_LIST_ELEMENTS(area->area_addrs, node, nnode, addr)) {
struct area_addr *addrp;
struct listnode *node;
- u_char buff[255];
+ uint8_t buff[255];
/* We check that we are not over the maximal number of addresses */
if (listcount(area->area_addrs) >= isis->max_area_addrs) {
VTY_DECLVAR_CONTEXT(isis_area, area);
struct area_addr addr, *addrp = NULL;
struct listnode *node;
- u_char buff[255];
+ uint8_t buff[255];
addr.addr_len = dotformat2buff(buff, net_title);
if (addr.addr_len < 8 || addr.addr_len > 20) {
DEFUN (show_isis_interface,
show_isis_interface_cmd,
- "show isis interface",
+ "show " PROTO_NAME " interface",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS interface\n")
{
return show_isis_interface_common(vty, NULL, ISIS_UI_LEVEL_BRIEF);
DEFUN (show_isis_interface_detail,
show_isis_interface_detail_cmd,
- "show isis interface detail",
+ "show " PROTO_NAME " interface detail",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS interface\n"
"show detailed information\n")
{
DEFUN (show_isis_interface_arg,
show_isis_interface_arg_cmd,
- "show isis interface WORD",
+ "show " PROTO_NAME " interface WORD",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS interface\n"
"ISIS interface name\n")
{
struct list *adjdb;
struct isis_adjacency *adj;
struct isis_dynhn *dynhn;
- u_char sysid[ISIS_SYS_ID_LEN];
+ uint8_t sysid[ISIS_SYS_ID_LEN];
int i;
if (!isis) {
struct list *adjdb;
struct isis_adjacency *adj;
struct isis_dynhn *dynhn;
- u_char sysid[ISIS_SYS_ID_LEN];
+ uint8_t sysid[ISIS_SYS_ID_LEN];
int i;
if (!isis) {
DEFUN (show_isis_neighbor,
show_isis_neighbor_cmd,
- "show isis neighbor",
+ "show " PROTO_NAME " neighbor",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS neighbor adjacencies\n")
{
return show_isis_neighbor_common(vty, NULL, ISIS_UI_LEVEL_BRIEF);
DEFUN (show_isis_neighbor_detail,
show_isis_neighbor_detail_cmd,
- "show isis neighbor detail",
+ "show " PROTO_NAME " neighbor detail",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS neighbor adjacencies\n"
"show detailed information\n")
{
DEFUN (show_isis_neighbor_arg,
show_isis_neighbor_arg_cmd,
- "show isis neighbor WORD",
+ "show " PROTO_NAME " neighbor WORD",
SHOW_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS neighbor adjacencies\n"
"System id\n")
{
DEFUN (clear_isis_neighbor,
clear_isis_neighbor_cmd,
- "clear isis neighbor",
+ "clear " PROTO_NAME " neighbor",
CLEAR_STR
- "Reset ISIS network information\n"
- "Reset ISIS neighbor adjacencies\n")
+ PROTO_HELP
+ "ISIS neighbor adjacencies\n")
{
return clear_isis_neighbor_common(vty, NULL);
}
DEFUN (clear_isis_neighbor_arg,
clear_isis_neighbor_arg_cmd,
- "clear isis neighbor WORD",
+ "clear " PROTO_NAME " neighbor WORD",
CLEAR_STR
- "ISIS network information\n"
+ PROTO_HELP
"ISIS neighbor adjacencies\n"
"System id\n")
{
vty_out(vty,
"IS-IS Adjacency related packets debugging is %s\n",
onoffs);
- if (flags & DEBUG_CHECKSUM_ERRORS)
- vty_out(vty, "IS-IS checksum errors debugging is %s\n", onoffs);
- if (flags & DEBUG_LOCAL_UPDATES)
- vty_out(vty, "IS-IS local updates debugging is %s\n", onoffs);
- if (flags & DEBUG_PROTOCOL_ERRORS)
- vty_out(vty, "IS-IS protocol errors 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);
if (flags & DEBUG_SPF_EVENTS)
vty_out(vty, "IS-IS SPF events debugging is %s\n", onoffs);
- if (flags & DEBUG_SPF_STATS)
- vty_out(vty,
- "IS-IS SPF Timing and Statistics Data debugging is %s\n",
- onoffs);
- if (flags & DEBUG_SPF_TRIGGERS)
- vty_out(vty, "IS-IS SPF triggering events debugging is %s\n",
- onoffs);
if (flags & DEBUG_UPDATE_PACKETS)
vty_out(vty, "IS-IS Update related packet 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_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);
}
DEFUN_NOSH (show_debugging,
show_debugging_isis_cmd,
- "show debugging [isis]",
+ "show debugging [" PROTO_NAME "]",
SHOW_STR
"State of each debugging option\n"
- ISIS_STR)
+ PROTO_HELP)
{
- vty_out(vty, "IS-IS debugging status:\n");
+ vty_out(vty, PROTO_NAME " debugging status:\n");
if (isis->debugs)
print_debug(vty, isis->debugs, 1);
int flags = isis->debugs;
if (flags & DEBUG_ADJ_PACKETS) {
- vty_out(vty, "debug isis adj-packets\n");
+ vty_out(vty, "debug " PROTO_NAME " adj-packets\n");
write++;
}
- if (flags & DEBUG_CHECKSUM_ERRORS) {
- vty_out(vty, "debug isis checksum-errors\n");
- write++;
- }
- if (flags & DEBUG_LOCAL_UPDATES) {
- vty_out(vty, "debug isis local-updates\n");
- write++;
- }
- if (flags & DEBUG_PROTOCOL_ERRORS) {
- vty_out(vty, "debug isis protocol-errors\n");
+ if (flags & DEBUG_TX_QUEUE) {
+ vty_out(vty, "debug " PROTO_NAME " tx-queue\n");
write++;
}
if (flags & DEBUG_SNP_PACKETS) {
- vty_out(vty, "debug isis snp-packets\n");
+ vty_out(vty, "debug " PROTO_NAME " snp-packets\n");
write++;
}
if (flags & DEBUG_SPF_EVENTS) {
- vty_out(vty, "debug isis spf-events\n");
- write++;
- }
- if (flags & DEBUG_SPF_STATS) {
- vty_out(vty, "debug isis spf-statistics\n");
- write++;
- }
- if (flags & DEBUG_SPF_TRIGGERS) {
- vty_out(vty, "debug isis spf-triggers\n");
+ vty_out(vty, "debug " PROTO_NAME " spf-events\n");
write++;
}
if (flags & DEBUG_UPDATE_PACKETS) {
- vty_out(vty, "debug isis update-packets\n");
+ vty_out(vty, "debug " PROTO_NAME " update-packets\n");
write++;
}
if (flags & DEBUG_RTE_EVENTS) {
- vty_out(vty, "debug isis route-events\n");
+ vty_out(vty, "debug " PROTO_NAME " route-events\n");
write++;
}
if (flags & DEBUG_EVENTS) {
- vty_out(vty, "debug isis events\n");
+ vty_out(vty, "debug " PROTO_NAME " events\n");
write++;
}
if (flags & DEBUG_PACKET_DUMP) {
- vty_out(vty, "debug isis packet-dump\n");
+ vty_out(vty, "debug " PROTO_NAME " packet-dump\n");
write++;
}
if (flags & DEBUG_LSP_GEN) {
- vty_out(vty, "debug isis lsp-gen\n");
+ vty_out(vty, "debug " PROTO_NAME " lsp-gen\n");
write++;
}
if (flags & DEBUG_LSP_SCHED) {
- vty_out(vty, "debug isis lsp-sched\n");
+ vty_out(vty, "debug " PROTO_NAME " lsp-sched\n");
+ write++;
+ }
+ if (flags & DEBUG_FLOODING) {
+ vty_out(vty, "debug " PROTO_NAME " flooding\n");
+ write++;
+ }
+ if (flags & DEBUG_BFD) {
+ vty_out(vty, "debug " PROTO_NAME " bfd\n");
write++;
}
write += spf_backoff_write_config(vty);
DEFUN (debug_isis_adj,
debug_isis_adj_cmd,
- "debug isis adj-packets",
+ "debug " PROTO_NAME " adj-packets",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Adjacency related packets\n")
{
isis->debugs |= DEBUG_ADJ_PACKETS;
DEFUN (no_debug_isis_adj,
no_debug_isis_adj_cmd,
- "no debug isis adj-packets",
+ "no debug " PROTO_NAME " adj-packets",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Adjacency related packets\n")
{
isis->debugs &= ~DEBUG_ADJ_PACKETS;
return CMD_SUCCESS;
}
-DEFUN (debug_isis_csum,
- debug_isis_csum_cmd,
- "debug isis checksum-errors",
- DEBUG_STR
- "IS-IS information\n"
- "IS-IS LSP checksum errors\n")
-{
- isis->debugs |= DEBUG_CHECKSUM_ERRORS;
- print_debug(vty, DEBUG_CHECKSUM_ERRORS, 1);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_isis_csum,
- no_debug_isis_csum_cmd,
- "no debug isis checksum-errors",
- NO_STR
- UNDEBUG_STR
- "IS-IS information\n"
- "IS-IS LSP checksum errors\n")
-{
- isis->debugs &= ~DEBUG_CHECKSUM_ERRORS;
- print_debug(vty, DEBUG_CHECKSUM_ERRORS, 0);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (debug_isis_lupd,
- debug_isis_lupd_cmd,
- "debug isis local-updates",
+DEFUN (debug_isis_tx_queue,
+ debug_isis_tx_queue_cmd,
+ "debug " PROTO_NAME " tx-queue",
DEBUG_STR
- "IS-IS information\n"
- "IS-IS local update packets\n")
+ PROTO_HELP
+ "IS-IS TX queues\n")
{
- isis->debugs |= DEBUG_LOCAL_UPDATES;
- print_debug(vty, DEBUG_LOCAL_UPDATES, 1);
+ isis->debugs |= DEBUG_TX_QUEUE;
+ print_debug(vty, DEBUG_TX_QUEUE, 1);
return CMD_SUCCESS;
}
-DEFUN (no_debug_isis_lupd,
- no_debug_isis_lupd_cmd,
- "no debug isis local-updates",
+DEFUN (no_debug_isis_tx_queue,
+ no_debug_isis_tx_queue_cmd,
+ "no debug " PROTO_NAME " tx-queue",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
- "IS-IS local update packets\n")
+ PROTO_HELP
+ "IS-IS TX queues\n")
{
- isis->debugs &= ~DEBUG_LOCAL_UPDATES;
- print_debug(vty, DEBUG_LOCAL_UPDATES, 0);
+ isis->debugs &= ~DEBUG_TX_QUEUE;
+ print_debug(vty, DEBUG_TX_QUEUE, 0);
return CMD_SUCCESS;
}
-DEFUN (debug_isis_err,
- debug_isis_err_cmd,
- "debug isis protocol-errors",
+DEFUN (debug_isis_flooding,
+ debug_isis_flooding_cmd,
+ "debug " PROTO_NAME " flooding",
DEBUG_STR
- "IS-IS information\n"
- "IS-IS LSP protocol errors\n")
+ PROTO_HELP
+ "Flooding algorithm\n")
{
- isis->debugs |= DEBUG_PROTOCOL_ERRORS;
- print_debug(vty, DEBUG_PROTOCOL_ERRORS, 1);
+ isis->debugs |= DEBUG_FLOODING;
+ print_debug(vty, DEBUG_FLOODING, 1);
return CMD_SUCCESS;
}
-DEFUN (no_debug_isis_err,
- no_debug_isis_err_cmd,
- "no debug isis protocol-errors",
+DEFUN (no_debug_isis_flooding,
+ no_debug_isis_flooding_cmd,
+ "no debug " PROTO_NAME " flooding",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
- "IS-IS LSP protocol errors\n")
+ PROTO_HELP
+ "Flooding algorithm\n")
{
- isis->debugs &= ~DEBUG_PROTOCOL_ERRORS;
- print_debug(vty, DEBUG_PROTOCOL_ERRORS, 0);
+ isis->debugs &= ~DEBUG_FLOODING;
+ print_debug(vty, DEBUG_FLOODING, 0);
return CMD_SUCCESS;
}
DEFUN (debug_isis_snp,
debug_isis_snp_cmd,
- "debug isis snp-packets",
+ "debug " PROTO_NAME " snp-packets",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS CSNP/PSNP packets\n")
{
isis->debugs |= DEBUG_SNP_PACKETS;
DEFUN (no_debug_isis_snp,
no_debug_isis_snp_cmd,
- "no debug isis snp-packets",
+ "no debug " PROTO_NAME " snp-packets",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS CSNP/PSNP packets\n")
{
isis->debugs &= ~DEBUG_SNP_PACKETS;
DEFUN (debug_isis_upd,
debug_isis_upd_cmd,
- "debug isis update-packets",
+ "debug " PROTO_NAME " update-packets",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Update related packets\n")
{
isis->debugs |= DEBUG_UPDATE_PACKETS;
DEFUN (no_debug_isis_upd,
no_debug_isis_upd_cmd,
- "no debug isis update-packets",
+ "no debug " PROTO_NAME " update-packets",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Update related packets\n")
{
isis->debugs &= ~DEBUG_UPDATE_PACKETS;
DEFUN (debug_isis_spfevents,
debug_isis_spfevents_cmd,
- "debug isis spf-events",
+ "debug " PROTO_NAME " spf-events",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Shortest Path First Events\n")
{
isis->debugs |= DEBUG_SPF_EVENTS;
DEFUN (no_debug_isis_spfevents,
no_debug_isis_spfevents_cmd,
- "no debug isis spf-events",
+ "no debug " PROTO_NAME " spf-events",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Shortest Path First Events\n")
{
isis->debugs &= ~DEBUG_SPF_EVENTS;
return CMD_SUCCESS;
}
-DEFUN (debug_isis_spfstats,
- debug_isis_spfstats_cmd,
- "debug isis spf-statistics ",
- DEBUG_STR
- "IS-IS information\n"
- "IS-IS SPF Timing and Statistic Data\n")
-{
- isis->debugs |= DEBUG_SPF_STATS;
- print_debug(vty, DEBUG_SPF_STATS, 1);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_isis_spfstats,
- no_debug_isis_spfstats_cmd,
- "no debug isis spf-statistics",
- NO_STR
- UNDEBUG_STR
- "IS-IS information\n"
- "IS-IS SPF Timing and Statistic Data\n")
-{
- isis->debugs &= ~DEBUG_SPF_STATS;
- print_debug(vty, DEBUG_SPF_STATS, 0);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (debug_isis_spftrigg,
- debug_isis_spftrigg_cmd,
- "debug isis spf-triggers",
- DEBUG_STR
- "IS-IS information\n"
- "IS-IS SPF triggering events\n")
-{
- isis->debugs |= DEBUG_SPF_TRIGGERS;
- print_debug(vty, DEBUG_SPF_TRIGGERS, 1);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_isis_spftrigg,
- no_debug_isis_spftrigg_cmd,
- "no debug isis spf-triggers",
- NO_STR
- UNDEBUG_STR
- "IS-IS information\n"
- "IS-IS SPF triggering events\n")
-{
- isis->debugs &= ~DEBUG_SPF_TRIGGERS;
- print_debug(vty, DEBUG_SPF_TRIGGERS, 0);
-
- return CMD_SUCCESS;
-}
-
DEFUN (debug_isis_rtevents,
debug_isis_rtevents_cmd,
- "debug isis route-events",
+ "debug " PROTO_NAME " route-events",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Route related events\n")
{
isis->debugs |= DEBUG_RTE_EVENTS;
DEFUN (no_debug_isis_rtevents,
no_debug_isis_rtevents_cmd,
- "no debug isis route-events",
+ "no debug " PROTO_NAME " route-events",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Route related events\n")
{
isis->debugs &= ~DEBUG_RTE_EVENTS;
DEFUN (debug_isis_events,
debug_isis_events_cmd,
- "debug isis events",
+ "debug " PROTO_NAME " events",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Events\n")
{
isis->debugs |= DEBUG_EVENTS;
DEFUN (no_debug_isis_events,
no_debug_isis_events_cmd,
- "no debug isis events",
+ "no debug " PROTO_NAME " events",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Events\n")
{
isis->debugs &= ~DEBUG_EVENTS;
DEFUN (debug_isis_packet_dump,
debug_isis_packet_dump_cmd,
- "debug isis packet-dump",
+ "debug " PROTO_NAME " packet-dump",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS packet dump\n")
{
isis->debugs |= DEBUG_PACKET_DUMP;
DEFUN (no_debug_isis_packet_dump,
no_debug_isis_packet_dump_cmd,
- "no debug isis packet-dump",
+ "no debug " PROTO_NAME " packet-dump",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS packet dump\n")
{
isis->debugs &= ~DEBUG_PACKET_DUMP;
DEFUN (debug_isis_lsp_gen,
debug_isis_lsp_gen_cmd,
- "debug isis lsp-gen",
+ "debug " PROTO_NAME " lsp-gen",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS generation of own LSPs\n")
{
isis->debugs |= DEBUG_LSP_GEN;
DEFUN (no_debug_isis_lsp_gen,
no_debug_isis_lsp_gen_cmd,
- "no debug isis lsp-gen",
+ "no debug " PROTO_NAME " lsp-gen",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS generation of own LSPs\n")
{
isis->debugs &= ~DEBUG_LSP_GEN;
DEFUN (debug_isis_lsp_sched,
debug_isis_lsp_sched_cmd,
- "debug isis lsp-sched",
+ "debug " PROTO_NAME " lsp-sched",
DEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS scheduling of LSP generation\n")
{
isis->debugs |= DEBUG_LSP_SCHED;
DEFUN (no_debug_isis_lsp_sched,
no_debug_isis_lsp_sched_cmd,
- "no debug isis lsp-sched",
+ "no debug " PROTO_NAME " lsp-sched",
NO_STR
UNDEBUG_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS scheduling of LSP generation\n")
{
isis->debugs &= ~DEBUG_LSP_SCHED;
return CMD_SUCCESS;
}
+DEFUN (debug_isis_bfd,
+ debug_isis_bfd_cmd,
+ "debug " PROTO_NAME " bfd",
+ DEBUG_STR
+ PROTO_HELP
+ PROTO_NAME " interaction with BFD\n")
+{
+ isis->debugs |= DEBUG_BFD;
+ print_debug(vty, DEBUG_BFD, 1);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_isis_bfd,
+ no_debug_isis_bfd_cmd,
+ "no debug " PROTO_NAME " bfd",
+ NO_STR
+ UNDEBUG_STR
+ PROTO_HELP
+ PROTO_NAME " interaction with BFD\n")
+{
+ isis->debugs &= ~DEBUG_BFD;
+ print_debug(vty, DEBUG_BFD, 0);
+
+ return CMD_SUCCESS;
+}
+
DEFUN (show_hostname,
show_hostname_cmd,
- "show isis hostname",
+ "show " PROTO_NAME " hostname",
SHOW_STR
- "IS-IS information\n"
+ PROTO_HELP
"IS-IS Dynamic hostname mapping\n")
{
dynhn_print_all(vty);
DEFUN (show_isis_spf_ietf,
show_isis_spf_ietf_cmd,
- "show isis spf-delay-ietf",
+ "show " PROTO_NAME " spf-delay-ietf",
SHOW_STR
- "IS-IS information\n"
- "IS-IS SPF delay IETF information\n")
+ PROTO_HELP
+ "SPF delay IETF information\n")
{
if (!isis) {
vty_out(vty, "ISIS is not running\n");
DEFUN (show_isis_summary,
show_isis_summary_cmd,
- "show isis summary",
- SHOW_STR "IS-IS information\n" "IS-IS summary\n")
+ "show " PROTO_NAME " summary",
+ SHOW_STR PROTO_HELP "summary\n")
{
struct listnode *node, *node2;
struct isis_area *area;
int level;
if (isis == NULL) {
- vty_out(vty, "ISIS is not running\n");
+ vty_out(vty, PROTO_NAME " is not running\n");
return CMD_SUCCESS;
}
vty_out(vty, "Area %s:\n",
area->area_tag ? area->area_tag : "null");
+ if (fabricd) {
+ uint8_t tier = fabricd_tier(area);
+ if (tier == ISIS_TIER_UNDEFINED)
+ vty_out(vty, " Tier: undefined\n");
+ else
+ vty_out(vty, " Tier: %" PRIu8 "\n", tier);
+ }
+
if (listcount(area->area_addrs) > 0) {
struct area_addr *area_addr;
for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node2,
}
}
+ 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;
vty_out(vty, "\n");
vty_out(vty, " IPv4 route computation:\n");
- isis_spf_print(area->spftree[level - 1], vty);
+ isis_spf_print(area->spftree[SPFTREE_IPV4][level - 1],
+ vty);
vty_out(vty, " IPv6 route computation:\n");
- isis_spf_print(area->spftree6[level - 1], vty);
+ isis_spf_print(area->spftree[SPFTREE_IPV6][level - 1],
+ vty);
+
+ vty_out(vty, " IPv6 dst-src route computation:\n");
+ isis_spf_print(area->spftree[SPFTREE_DSTSRC][level-1],
+ vty);
}
}
vty_out(vty, "\n");
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;
+ char sysid[255] = {0};
+ uint8_t number[3];
+ const char *pos;
+ uint8_t lspid[ISIS_SYS_ID_LEN + 2] = {0};
struct isis_dynhn *dynhn;
- const char *pos = argv;
- u_char lspid[ISIS_SYS_ID_LEN + 2];
- char sysid[255];
- u_char number[3];
- int level, lsp_count;
+ struct isis_lsp *lsp = NULL;
- if (isis->area_list->count == 0)
- return CMD_SUCCESS;
-
- memset(&lspid, 0, ISIS_SYS_ID_LEN);
- memset(&sysid, 0, 255);
+ if (!argv)
+ return NULL;
/*
* extract fragment and pseudo id from the string argv
if (strncmp(pos, "-", 1) == 0) {
memcpy(number, ++pos, 2);
lspid[ISIS_SYS_ID_LEN + 1] =
- (u_char)strtol((char *)number, NULL, 16);
+ (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);
lspid[ISIS_SYS_ID_LEN] =
- (u_char)strtol((char *)number, NULL, 16);
+ (uint8_t)strtol((char *)number, NULL, 16);
sysid[pos - argv - 1] = '\0';
}
}
+ /*
+ * 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,
DEFUN (show_database,
show_database_cmd,
- "show isis database [detail] [WORD]",
+ "show " PROTO_NAME " database [detail] [WORD]",
SHOW_STR
- "IS-IS information\n"
- "IS-IS link state database\n"
+ PROTO_HELP
+ "Link state database\n"
"Detailed information\n"
"LSP ID\n")
{
*/
DEFUN_NOSH (router_isis,
router_isis_cmd,
- "router isis WORD",
+ "router " PROTO_NAME " WORD",
ROUTER_STR
- "ISO IS-IS\n"
+ PROTO_HELP
"ISO Routing area tag\n")
{
int idx_word = 2;
*/
DEFUN (no_router_isis,
no_router_isis_cmd,
- "no router isis WORD",
- "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag\n")
+ "no router " PROTO_NAME " WORD",
+ NO_STR
+ ROUTER_STR
+ PROTO_HELP
+ "ISO Routing area tag\n")
{
int idx_word = 3;
return isis_area_destroy(vty, argv[idx_word]->arg);
}
static int isis_area_passwd_set(struct isis_area *area, int level,
- u_char passwd_type, const char *passwd,
- u_char snp_auth)
+ uint8_t passwd_type, const char *passwd,
+ uint8_t snp_auth)
{
struct isis_passwd *dest;
struct isis_passwd modified;
}
int isis_area_passwd_cleartext_set(struct isis_area *area, int level,
- const char *passwd, u_char snp_auth)
+ const char *passwd, uint8_t snp_auth)
{
return isis_area_passwd_set(area, level, ISIS_PASSWD_TYPE_CLEARTXT,
passwd, snp_auth);
}
int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level,
- const char *passwd, u_char snp_auth)
+ const char *passwd, uint8_t snp_auth)
{
return isis_area_passwd_set(area, level, ISIS_PASSWD_TYPE_HMAC_MD5,
passwd, snp_auth);
}
+void isis_area_invalidate_routes(struct isis_area *area, int levels)
+{
+ for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
+ if (!(level & levels))
+ continue;
+ for (int tree = SPFTREE_IPV4; tree < SPFTREE_COUNT; tree++) {
+ isis_spf_invalidate_routes(
+ area->spftree[tree][level - 1]);
+ }
+ }
+}
+
+void isis_area_verify_routes(struct isis_area *area)
+{
+ for (int tree = SPFTREE_IPV4; tree < SPFTREE_COUNT; tree++)
+ isis_spf_verify_routes(area, area->spftree[tree]);
+}
+
static void area_resign_level(struct isis_area *area, int level)
{
+ isis_area_invalidate_routes(area, level);
+ isis_area_verify_routes(area);
+
if (area->lspdb[level - 1]) {
lsp_db_destroy(area->lspdb[level - 1]);
area->lspdb[level - 1] = NULL;
}
- if (area->spftree[level - 1]) {
- isis_spftree_del(area->spftree[level - 1]);
- area->spftree[level - 1] = NULL;
- }
- if (area->spftree6[level - 1]) {
- isis_spftree_del(area->spftree6[level - 1]);
- area->spftree6[level - 1] = NULL;
+
+ for (int tree = SPFTREE_IPV4; tree < SPFTREE_COUNT; tree++) {
+ if (area->spftree[tree][level - 1]) {
+ isis_spftree_del(area->spftree[tree][level - 1]);
+ area->spftree[tree][level - 1] = NULL;
+ }
}
+
THREAD_TIMER_OFF(area->spf_timer[level - 1]);
- if (area->route_table[level - 1]) {
- route_table_finish(area->route_table[level - 1]);
- area->route_table[level - 1] = NULL;
- }
- if (area->route_table6[level - 1]) {
- route_table_finish(area->route_table6[level - 1]);
- area->route_table6[level - 1] = NULL;
- }
sched_debug(
"ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
if (area->lspdb[1] == NULL)
area->lspdb[1] = lsp_db_init();
- if (area->route_table[1] == NULL)
- area->route_table[1] = route_table_init();
- if (area->route_table6[1] == NULL)
- area->route_table6[1] = route_table_init();
break;
case IS_LEVEL_1_AND_2:
if (area->lspdb[0] == NULL)
area->lspdb[0] = lsp_db_init();
- if (area->route_table[0] == NULL)
- area->route_table[0] = route_table_init();
- if (area->route_table6[0] == NULL)
- area->route_table6[0] = route_table_init();
break;
default:
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
/* ISIS - Area name */
- vty_out(vty, "router isis %s\n", area->area_tag);
+ vty_out(vty, "router " PROTO_NAME " %s\n", area->area_tag);
write++;
/* ISIS - Net */
if (listcount(area->area_addrs) > 0) {
write++;
}
/* ISIS - Metric-Style - when true displays wide */
- if (area->newmetric) {
- if (!area->oldmetric)
- vty_out(vty, " metric-style wide\n");
- else
- vty_out(vty,
- " metric-style transition\n");
- write++;
- } else {
- vty_out(vty, " metric-style narrow\n");
- write++;
+ if (!fabricd) {
+ if (area->newmetric) {
+ if (!area->oldmetric)
+ vty_out(vty, " metric-style wide\n");
+ else
+ vty_out(vty,
+ " metric-style transition\n");
+ write++;
+ } else {
+ vty_out(vty, " metric-style narrow\n");
+ write++;
+ }
}
/* ISIS - overload-bit */
if (area->overload_bit) {
write++;
}
/* ISIS - Area is-type (level-1-2 is default) */
- if (area->is_type == IS_LEVEL_1) {
- vty_out(vty, " is-type level-1\n");
- write++;
- } else if (area->is_type == IS_LEVEL_2) {
- vty_out(vty, " is-type level-2-only\n");
- write++;
+ if (!fabricd) {
+ if (area->is_type == IS_LEVEL_1) {
+ vty_out(vty, " is-type level-1\n");
+ write++;
+ } else if (area->is_type == IS_LEVEL_2) {
+ vty_out(vty, " is-type level-2-only\n");
+ write++;
+ }
}
write += isis_redist_config_write(vty, area, AF_INET);
write += isis_redist_config_write(vty, area, AF_INET6);
vty_out(vty, " lsp-mtu %u\n", area->lsp_mtu);
write++;
}
+ if (area->purge_originator) {
+ vty_out(vty, " purge-originator\n");
+ write++;
+ }
/* Minimum SPF interval. */
if (area->min_spf_interval[0]
}
write += area_write_mt_settings(area, vty);
+ write += fabricd_write_settings(area, vty);
}
isis_mpls_te_config_write_router(vty);
}
return write;
}
-struct cmd_node isis_node = {ISIS_NODE, "%s(config-router)# ", 1};
+struct cmd_node router_node = {ROUTER_NODE, "%s(config-router)# ", 1};
void isis_init()
{
/* Install IS-IS top node */
- install_node(&isis_node, isis_config_write);
+ install_node(&router_node, isis_config_write);
install_element(VIEW_NODE, &show_isis_summary_cmd);
install_element(ENABLE_NODE, &debug_isis_adj_cmd);
install_element(ENABLE_NODE, &no_debug_isis_adj_cmd);
- install_element(ENABLE_NODE, &debug_isis_csum_cmd);
- install_element(ENABLE_NODE, &no_debug_isis_csum_cmd);
- install_element(ENABLE_NODE, &debug_isis_lupd_cmd);
- install_element(ENABLE_NODE, &no_debug_isis_lupd_cmd);
- install_element(ENABLE_NODE, &debug_isis_err_cmd);
- install_element(ENABLE_NODE, &no_debug_isis_err_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(ENABLE_NODE, &no_debug_isis_upd_cmd);
install_element(ENABLE_NODE, &debug_isis_spfevents_cmd);
install_element(ENABLE_NODE, &no_debug_isis_spfevents_cmd);
- install_element(ENABLE_NODE, &debug_isis_spfstats_cmd);
- install_element(ENABLE_NODE, &no_debug_isis_spfstats_cmd);
- install_element(ENABLE_NODE, &debug_isis_spftrigg_cmd);
- install_element(ENABLE_NODE, &no_debug_isis_spftrigg_cmd);
install_element(ENABLE_NODE, &debug_isis_rtevents_cmd);
install_element(ENABLE_NODE, &no_debug_isis_rtevents_cmd);
install_element(ENABLE_NODE, &debug_isis_events_cmd);
install_element(ENABLE_NODE, &no_debug_isis_lsp_gen_cmd);
install_element(ENABLE_NODE, &debug_isis_lsp_sched_cmd);
install_element(ENABLE_NODE, &no_debug_isis_lsp_sched_cmd);
+ install_element(ENABLE_NODE, &debug_isis_bfd_cmd);
+ install_element(ENABLE_NODE, &no_debug_isis_bfd_cmd);
install_element(CONFIG_NODE, &debug_isis_adj_cmd);
install_element(CONFIG_NODE, &no_debug_isis_adj_cmd);
- install_element(CONFIG_NODE, &debug_isis_csum_cmd);
- install_element(CONFIG_NODE, &no_debug_isis_csum_cmd);
- install_element(CONFIG_NODE, &debug_isis_lupd_cmd);
- install_element(CONFIG_NODE, &no_debug_isis_lupd_cmd);
- install_element(CONFIG_NODE, &debug_isis_err_cmd);
- install_element(CONFIG_NODE, &no_debug_isis_err_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);
install_element(CONFIG_NODE, &no_debug_isis_upd_cmd);
install_element(CONFIG_NODE, &debug_isis_spfevents_cmd);
install_element(CONFIG_NODE, &no_debug_isis_spfevents_cmd);
- install_element(CONFIG_NODE, &debug_isis_spfstats_cmd);
- install_element(CONFIG_NODE, &no_debug_isis_spfstats_cmd);
- install_element(CONFIG_NODE, &debug_isis_spftrigg_cmd);
- install_element(CONFIG_NODE, &no_debug_isis_spftrigg_cmd);
install_element(CONFIG_NODE, &debug_isis_rtevents_cmd);
install_element(CONFIG_NODE, &no_debug_isis_rtevents_cmd);
install_element(CONFIG_NODE, &debug_isis_events_cmd);
install_element(CONFIG_NODE, &no_debug_isis_lsp_gen_cmd);
install_element(CONFIG_NODE, &debug_isis_lsp_sched_cmd);
install_element(CONFIG_NODE, &no_debug_isis_lsp_sched_cmd);
+ install_element(CONFIG_NODE, &debug_isis_bfd_cmd);
+ install_element(CONFIG_NODE, &no_debug_isis_bfd_cmd);
install_element(CONFIG_NODE, &router_isis_cmd);
install_element(CONFIG_NODE, &no_router_isis_cmd);
- install_default(ISIS_NODE);
+ install_default(ROUTER_NODE);
- install_element(ISIS_NODE, &net_cmd);
- install_element(ISIS_NODE, &no_net_cmd);
+ install_element(ROUTER_NODE, &net_cmd);
+ install_element(ROUTER_NODE, &no_net_cmd);
- install_element(ISIS_NODE, &isis_topology_cmd);
- install_element(ISIS_NODE, &no_isis_topology_cmd);
+ install_element(ROUTER_NODE, &isis_topology_cmd);
+ install_element(ROUTER_NODE, &no_isis_topology_cmd);
- install_element(ISIS_NODE, &log_adj_changes_cmd);
- install_element(ISIS_NODE, &no_log_adj_changes_cmd);
+ install_element(ROUTER_NODE, &log_adj_changes_cmd);
+ install_element(ROUTER_NODE, &no_log_adj_changes_cmd);
spf_backoff_cmd_init();
}