summaryrefslogtreecommitdiff
path: root/isisd/isisd.c
diff options
context:
space:
mode:
Diffstat (limited to 'isisd/isisd.c')
-rw-r--r--isisd/isisd.c420
1 files changed, 287 insertions, 133 deletions
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 0d39aba20b..7bba783b39 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -35,6 +35,7 @@
#include "prefix.h"
#include "table.h"
#include "qobj.h"
+#include "zclient.h"
#include "vrf.h"
#include "spf_backoff.h"
#include "lib/northbound_cli.h"
@@ -75,6 +76,7 @@ unsigned long debug_flooding;
unsigned long debug_bfd;
unsigned long debug_tx_queue;
unsigned long debug_sr;
+unsigned long debug_ldp_sync;
DEFINE_QOBJ_TYPE(isis_area)
@@ -125,33 +127,37 @@ void isis_vrf_unlink(struct isis *isis, struct vrf *vrf)
struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id)
{
- struct isis *isis = NULL;
- struct listnode *node, *nnode;
+ struct isis *isis;
+ struct listnode *node;
- for (ALL_LIST_ELEMENTS(im->isis, node, nnode, isis))
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
if (isis->vrf_id == vrf_id)
return isis;
+
return NULL;
}
struct isis *isis_lookup_by_vrfname(const char *vrfname)
{
- struct isis *isis = NULL;
- struct listnode *node, *nnode;
+ struct isis *isis;
+ struct listnode *node;
- for (ALL_LIST_ELEMENTS(im->isis, node, nnode, isis))
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
if (isis->name && vrfname && strcmp(isis->name, vrfname) == 0)
return isis;
+
return NULL;
}
-struct isis *isis_lookup_by_sysid(uint8_t *sysid)
+struct isis *isis_lookup_by_sysid(const uint8_t *sysid)
{
- struct isis *isis = NULL;
- struct listnode *node, *nnode;
- for (ALL_LIST_ELEMENTS(im->isis, node, nnode, isis))
+ struct isis *isis;
+ struct listnode *node;
+
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
if (!memcmp(isis->sysid, sysid, ISIS_SYS_ID_LEN))
return isis;
+
return NULL;
}
@@ -163,29 +169,32 @@ void isis_master_init(struct thread_master *master)
im->master = master;
}
-void isis_global_instance_create()
+void isis_global_instance_create(const char *vrf_name)
{
- struct isis *isis = NULL;
+ struct isis *isis;
- isis = isis_lookup_by_vrfid(VRF_DEFAULT);
+ isis = isis_lookup_by_vrfname(vrf_name);
if (isis == NULL) {
- isis = isis_new(VRF_DEFAULT);
+ isis = isis_new(vrf_name);
isis_add(isis);
}
}
-struct isis *isis_new(vrf_id_t vrf_id)
+struct isis *isis_new(const char *vrf_name)
{
- struct vrf *vrf = NULL;
- struct isis *isis = NULL;
+ struct vrf *vrf;
+ struct isis *isis;
isis = XCALLOC(MTYPE_ISIS, sizeof(struct isis));
- isis->vrf_id = vrf_id;
- vrf = vrf_lookup_by_id(vrf_id);
+ vrf = vrf_lookup_by_name(vrf_name);
if (vrf) {
+ isis->vrf_id = vrf->vrf_id;
isis_vrf_link(isis, vrf);
isis->name = XSTRDUP(MTYPE_ISIS, vrf->name);
+ } else {
+ isis->vrf_id = VRF_UNKNOWN;
+ isis->name = XSTRDUP(MTYPE_ISIS, vrf_name);
}
if (IS_DEBUG_EVENTS)
@@ -214,6 +223,32 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
struct vrf *vrf = NULL;
area = XCALLOC(MTYPE_ISIS_AREA, sizeof(struct isis_area));
+ if (vrf_name) {
+ vrf = vrf_lookup_by_name(vrf_name);
+ if (vrf) {
+ isis = isis_lookup_by_vrfid(vrf->vrf_id);
+ if (isis == NULL) {
+ isis = isis_new(vrf_name);
+ isis_add(isis);
+ }
+ } else {
+ isis = isis_lookup_by_vrfid(VRF_UNKNOWN);
+ if (isis == NULL) {
+ isis = isis_new(vrf_name);
+ isis_add(isis);
+ }
+ }
+ } else {
+ isis = isis_lookup_by_vrfid(VRF_DEFAULT);
+ if (isis == NULL) {
+ isis = isis_new(VRF_DEFAULT_NAME);
+ isis_add(isis);
+ }
+ }
+
+ listnode_add(isis->area_list, area);
+ area->isis = isis;
+
/*
* Fabricd runs only as level-2.
* For IS-IS, the default is level-1-2
@@ -237,7 +272,8 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
area->circuit_list = list_new();
area->adjacency_list = list_new();
area->area_addrs = list_new();
- thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
+ if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+ thread_add_timer(master, lsp_tick, area, 1, &area->t_tick);
flags_initialize(&area->flags);
isis_sr_area_init(area);
@@ -293,27 +329,6 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
area->area_tag = strdup(area_tag);
- if (vrf_name) {
- vrf = vrf_lookup_by_name(vrf_name);
- if (vrf) {
- isis = isis_lookup_by_vrfid(vrf->vrf_id);
- if (isis == NULL) {
- isis = isis_new(vrf->vrf_id);
- isis_add(isis);
- }
- } else
- return NULL;
- } else {
- isis = isis_lookup_by_vrfid(VRF_DEFAULT);
- if (isis == NULL) {
- isis = isis_new(VRF_DEFAULT);
- isis_add(isis);
- }
- }
-
- listnode_add(isis->area_list, area);
- area->isis = isis;
-
if (fabricd)
area->fabricd = fabricd_new(area);
@@ -331,12 +346,30 @@ struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
return area;
}
-struct isis_area *isis_area_lookup(const char *area_tag, vrf_id_t vrf_id)
+struct isis_area *isis_area_lookup_by_vrf(const char *area_tag,
+ const char *vrf_name)
{
struct isis_area *area;
struct listnode *node;
struct isis *isis = NULL;
+ isis = isis_lookup_by_vrfname(vrf_name);
+ if (isis == NULL)
+ return NULL;
+
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
+ if (strcmp(area->area_tag, area_tag) == 0)
+ return area;
+
+ return NULL;
+}
+
+struct isis_area *isis_area_lookup(const char *area_tag, vrf_id_t vrf_id)
+{
+ struct isis_area *area;
+ struct listnode *node;
+ struct isis *isis;
+
isis = isis_lookup_by_vrfid(vrf_id);
if (isis == NULL)
return NULL;
@@ -414,7 +447,8 @@ void isis_area_destroy(struct isis_area *area)
spf_backoff_free(area->spf_delay_ietf[0]);
spf_backoff_free(area->spf_delay_ietf[1]);
- isis_redist_area_finish(area);
+ if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
+ isis_redist_area_finish(area);
for (ALL_LIST_ELEMENTS(area->area_addrs, node, nnode, addr)) {
list_delete_node(area->area_addrs, node);
@@ -443,6 +477,95 @@ void isis_area_destroy(struct isis_area *area)
}
+/* This is hook function for vrf create called as part of vrf_init */
+static int isis_vrf_new(struct vrf *vrf)
+{
+ if (IS_DEBUG_EVENTS)
+ zlog_debug("%s: VRF Created: %s(%u)", __func__, vrf->name,
+ vrf->vrf_id);
+
+ return 0;
+}
+
+/* This is hook function for vrf delete call as part of vrf_init */
+static int isis_vrf_delete(struct vrf *vrf)
+{
+ if (IS_DEBUG_EVENTS)
+ zlog_debug("%s: VRF Deletion: %s(%u)", __func__, vrf->name,
+ vrf->vrf_id);
+
+ return 0;
+}
+
+static int isis_vrf_enable(struct vrf *vrf)
+{
+ struct isis *isis;
+ vrf_id_t old_vrf_id;
+
+ if (IS_DEBUG_EVENTS)
+ zlog_debug("%s: VRF %s id %u enabled", __func__, vrf->name,
+ vrf->vrf_id);
+
+ isis = isis_lookup_by_vrfname(vrf->name);
+ if (isis) {
+ if (isis->name && strmatch(vrf->name, VRF_DEFAULT_NAME)) {
+ XFREE(MTYPE_ISIS, isis->name);
+ isis->name = NULL;
+ }
+ old_vrf_id = isis->vrf_id;
+ /* We have instance configured, link to VRF and make it "up". */
+ isis_vrf_link(isis, vrf);
+ if (IS_DEBUG_EVENTS)
+ zlog_debug(
+ "%s: isis linked to vrf %s vrf_id %u (old id %u)",
+ __func__, vrf->name, isis->vrf_id, old_vrf_id);
+ if (old_vrf_id != isis->vrf_id) {
+ frr_with_privs (&isisd_privs) {
+ /* stop zebra redist to us for old vrf */
+ zclient_send_dereg_requests(zclient,
+ old_vrf_id);
+ /* start zebra redist to us for new vrf */
+ isis_zebra_vrf_register(isis);
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int isis_vrf_disable(struct vrf *vrf)
+{
+ struct isis *isis;
+ vrf_id_t old_vrf_id = VRF_UNKNOWN;
+
+ if (vrf->vrf_id == VRF_DEFAULT)
+ return 0;
+
+ if (IS_DEBUG_EVENTS)
+ zlog_debug("%s: VRF %s id %d disabled.", __func__, vrf->name,
+ vrf->vrf_id);
+ isis = isis_lookup_by_vrfname(vrf->name);
+ if (isis) {
+ old_vrf_id = isis->vrf_id;
+
+ /* We have instance configured, unlink
+ * from VRF and make it "down".
+ */
+ isis_vrf_unlink(isis, vrf);
+ if (IS_DEBUG_EVENTS)
+ zlog_debug("%s: isis old_vrf_id %d unlinked", __func__,
+ old_vrf_id);
+ }
+
+ return 0;
+}
+
+void isis_vrf_init(void)
+{
+ vrf_init(isis_vrf_new, isis_vrf_enable, isis_vrf_disable,
+ isis_vrf_delete, isis_vrf_enable);
+}
+
void isis_finish(struct isis *isis)
{
struct vrf *vrf = NULL;
@@ -464,7 +587,7 @@ void isis_finish(struct isis *isis)
void isis_terminate()
{
- struct isis *isis = NULL;
+ struct isis *isis;
struct listnode *node, *nnode;
if (listcount(im->isis) == 0)
@@ -643,10 +766,10 @@ int area_clear_net_title(struct vty *vty, const char *net_title)
int show_isis_interface_common(struct vty *vty, const char *ifname, char detail,
const char *vrf_name, bool all_vrf)
{
- struct listnode *anode, *cnode, *mnode, *inode;
+ struct listnode *anode, *cnode, *inode;
struct isis_area *area;
struct isis_circuit *circuit;
- struct isis *isis = NULL;
+ struct isis *isis;
if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
@@ -654,7 +777,7 @@ int show_isis_interface_common(struct vty *vty, const char *ifname, char detail,
}
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, mnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
for (ALL_LIST_ELEMENTS_RO(isis->area_list,
anode, area)) {
vty_out(vty, "Area %s:\n",
@@ -677,7 +800,7 @@ int show_isis_interface_common(struct vty *vty, const char *ifname, char detail,
detail);
}
}
- return 0;
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL) {
@@ -822,10 +945,10 @@ static void isis_neighbor_common(struct vty *vty, const char *id, char detail,
int show_isis_neighbor_common(struct vty *vty, const char *id, char detail,
const char *vrf_name, bool all_vrf)
{
- struct listnode *nnode, *inode;
+ struct listnode *node;
struct isis_dynhn *dynhn;
uint8_t sysid[ISIS_SYS_ID_LEN];
- struct isis *isis = NULL;
+ struct isis *isis;
if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
@@ -846,11 +969,11 @@ int show_isis_neighbor_common(struct vty *vty, const char *id, char detail,
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
isis_neighbor_common(vty, id, detail, isis,
sysid);
}
- return 0;
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL)
@@ -863,7 +986,7 @@ int show_isis_neighbor_common(struct vty *vty, const char *id, char detail,
static void isis_neighbor_common_clear(struct vty *vty, const char *id,
uint8_t *sysid, struct isis *isis)
{
- struct listnode *anode, *cnode, *cnextnode, *node, *nnode;
+ struct listnode *anode, *cnode, *node, *nnode;
struct isis_area *area;
struct isis_circuit *circuit;
struct list *adjdb;
@@ -871,8 +994,7 @@ static void isis_neighbor_common_clear(struct vty *vty, const char *id,
int i;
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
- for (ALL_LIST_ELEMENTS(area->circuit_list, cnode, cnextnode,
- circuit)) {
+ for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit)) {
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
for (i = 0; i < 2; i++) {
adjdb = circuit->u.bc.adjdb[i];
@@ -910,10 +1032,10 @@ static void isis_neighbor_common_clear(struct vty *vty, const char *id,
int clear_isis_neighbor_common(struct vty *vty, const char *id, const char *vrf_name,
bool all_vrf)
{
- struct listnode *nnode, *inode;
+ struct listnode *node;
struct isis_dynhn *dynhn;
uint8_t sysid[ISIS_SYS_ID_LEN];
- struct isis *isis = NULL;
+ struct isis *isis;
if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
@@ -933,11 +1055,10 @@ int clear_isis_neighbor_common(struct vty *vty, const char *id, const char *vrf_
}
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
isis_neighbor_common_clear(vty, id, sysid,
isis);
- }
- return 0;
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL)
@@ -1087,6 +1208,8 @@ void print_debug(struct vty *vty, int flags, int onoff)
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);
+ if (flags & DEBUG_LDP_SYNC)
+ vty_out(vty, "IS-IS ldp-sync debugging is %s\n", onoffs);
}
DEFUN_NOSH (show_debugging,
@@ -1124,6 +1247,8 @@ DEFUN_NOSH (show_debugging,
print_debug(vty, DEBUG_FLOODING, 1);
if (IS_DEBUG_BFD)
print_debug(vty, DEBUG_BFD, 1);
+ if (IS_DEBUG_LDP_SYNC)
+ print_debug(vty, DEBUG_LDP_SYNC, 1);
return CMD_SUCCESS;
}
@@ -1192,6 +1317,10 @@ static int config_write_debug(struct vty *vty)
vty_out(vty, "debug " PROTO_NAME " bfd\n");
write++;
}
+ if (IS_DEBUG_LDP_SYNC) {
+ vty_out(vty, "debug " PROTO_NAME " ldp-sync\n");
+ write++;
+ }
write += spf_backoff_write_config(vty);
return write;
@@ -1548,25 +1677,46 @@ DEFUN (no_debug_isis_bfd,
return CMD_SUCCESS;
}
-DEFUN(show_hostname, show_hostname_cmd,
- "show " PROTO_NAME " [vrf <NAME|all>] hostname",
- SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
- "All VRFs\n"
- "IS-IS Dynamic hostname mapping\n")
+DEFUN(debug_isis_ldp_sync, debug_isis_ldp_sync_cmd,
+ "debug " PROTO_NAME " ldp-sync",
+ DEBUG_STR PROTO_HELP PROTO_NAME " interaction with LDP-Sync\n")
{
- struct listnode *nnode, *inode;
+ debug_ldp_sync |= DEBUG_LDP_SYNC;
+ print_debug(vty, DEBUG_LDP_SYNC, 1);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(no_debug_isis_ldp_sync, no_debug_isis_ldp_sync_cmd,
+ "no debug " PROTO_NAME " ldp-sync",
+ NO_STR UNDEBUG_STR PROTO_HELP PROTO_NAME " interaction with LDP-Sync\n")
+{
+ debug_ldp_sync &= ~DEBUG_LDP_SYNC;
+ print_debug(vty, DEBUG_LDP_SYNC, 0);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (show_hostname,
+ show_hostname_cmd,
+ "show " PROTO_NAME " hostname",
+ SHOW_STR
+ PROTO_HELP
+ "IS-IS Dynamic hostname mapping\n")
+{
+ struct listnode *node;
const char *vrf_name = VRF_DEFAULT_NAME;
bool all_vrf = false;
int idx_vrf = 0;
- struct isis *isis = NULL;
+ struct isis *isis;
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
dynhn_print_all(vty, isis);
- }
- return 0;
+
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL)
@@ -1621,8 +1771,8 @@ DEFUN(show_isis_spf_ietf, show_isis_spf_ietf_cmd,
"All VRFs\n"
"SPF delay IETF information\n")
{
- struct listnode *nnode, *inode;
- struct isis *isis = NULL;
+ struct listnode *node;
+ struct isis *isis;
int idx_vrf = 0;
const char *vrf_name = VRF_DEFAULT_NAME;
bool all_vrf = false;
@@ -1636,10 +1786,10 @@ DEFUN(show_isis_spf_ietf, show_isis_spf_ietf_cmd,
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
isis_spf_ietf_common(vty, isis);
- }
- return 0;
+
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL)
@@ -1755,9 +1905,9 @@ DEFUN(show_isis_summary, show_isis_summary_cmd,
"All VRFs\n"
"summary\n")
{
- struct listnode *inode, *nnode;
+ struct listnode *node;
int idx_vrf = 0;
- struct isis *isis = NULL;
+ struct isis *isis;
const char *vrf_name = VRF_DEFAULT_NAME;
bool all_vrf = false;
@@ -1768,10 +1918,10 @@ DEFUN(show_isis_summary, show_isis_summary_cmd,
}
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
common_isis_summary(vty, isis);
- }
- return 0;
+
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
if (isis != NULL)
@@ -1844,60 +1994,61 @@ struct isis_lsp *lsp_for_arg(struct lspdb_head *head, const char *argv,
return lsp;
}
-static int show_isis_database_common(struct vty *vty, const char *argv,
- int ui_level, struct isis *isis)
+void show_isis_database_lspdb(struct vty *vty, struct isis_area *area,
+ int level, struct lspdb_head *lspdb,
+ const char *argv, int ui_level)
+{
+ struct isis_lsp *lsp;
+ int lsp_count;
+
+ if (lspdb_count(lspdb) > 0) {
+ lsp = lsp_for_arg(lspdb, argv, area->isis);
+
+ if (lsp != NULL || argv == NULL) {
+ vty_out(vty, "IS-IS Level-%d link-state database:\n",
+ level + 1);
+
+ /* print the title in all cases */
+ vty_out(vty,
+ "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n");
+ }
+
+ if (lsp) {
+ if (ui_level == ISIS_UI_LEVEL_DETAIL)
+ lsp_print_detail(lsp, vty, area->dynhostname,
+ area->isis);
+ else
+ lsp_print(lsp, vty, area->dynhostname,
+ area->isis);
+ } else if (argv == NULL) {
+ lsp_count =
+ lsp_print_all(vty, lspdb, ui_level,
+ area->dynhostname, area->isis);
+
+ vty_out(vty, " %u LSPs\n\n", lsp_count);
+ }
+ }
+}
+
+static void show_isis_database_common(struct vty *vty, const char *argv,
+ int ui_level, struct isis *isis)
{
struct listnode *node;
struct isis_area *area;
- struct isis_lsp *lsp;
- int level, lsp_count;
+ int level;
if (isis->area_list->count == 0)
- return CMD_SUCCESS;
+ return;
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 (lspdb_count(&area->lspdb[level]) > 0) {
- lsp = NULL;
- lsp = lsp_for_arg(&area->lspdb[level], argv,
- isis);
-
- if (lsp != NULL || argv == NULL) {
- vty_out(vty,
- "IS-IS Level-%d link-state database:\n",
- level + 1);
-
- /* print the title in all cases */
- vty_out(vty,
- "LSP ID PduLen SeqNumber Chksum Holdtime ATT/P/OL\n");
- }
-
- if (lsp) {
- if (ui_level == ISIS_UI_LEVEL_DETAIL)
- lsp_print_detail(
- lsp, vty,
- area->dynhostname,
- isis);
- else
- lsp_print(lsp, vty,
- area->dynhostname,
- isis);
- } else if (argv == NULL) {
- lsp_count = lsp_print_all(
- vty, &area->lspdb[level],
- ui_level, area->dynhostname,
- isis);
-
- vty_out(vty, " %u LSPs\n\n",
- lsp_count);
- }
- }
- }
+ for (level = 0; level < ISIS_LEVELS; level++)
+ show_isis_database_lspdb(vty, area, level,
+ &area->lspdb[level], argv,
+ ui_level);
}
- return CMD_SUCCESS;
}
/*
* This function supports following display options:
@@ -1918,19 +2069,19 @@ static int show_isis_database_common(struct vty *vty, const char *argv,
static int show_isis_database(struct vty *vty, const char *argv, int ui_level,
const char *vrf_name, bool all_vrf)
{
- struct listnode *inode, *nnode;
- struct isis *isis = NULL;
+ struct listnode *node;
+ struct isis *isis;
if (vrf_name) {
if (all_vrf) {
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
show_isis_database_common(vty, argv, ui_level,
isis);
- }
- return 0;
+
+ return CMD_SUCCESS;
}
isis = isis_lookup_by_vrfname(vrf_name);
- if (isis != NULL)
+ if (isis)
show_isis_database_common(vty, argv, ui_level, isis);
}
@@ -2352,16 +2503,15 @@ static int isis_config_write(struct vty *vty)
{
int write = 0;
struct isis_area *area;
- struct listnode *node, *node2, *inode, *nnode;
- struct isis *isis = NULL;
+ struct listnode *node, *node2, *inode;
+ struct isis *isis;
if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS;
}
- for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
-
+ for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
/* ISIS - Area name */
vty_out(vty, "router " PROTO_NAME " %s\n", area->area_tag);
@@ -2710,6 +2860,8 @@ void isis_init(void)
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(ENABLE_NODE, &debug_isis_ldp_sync_cmd);
+ install_element(ENABLE_NODE, &no_debug_isis_ldp_sync_cmd);
install_element(CONFIG_NODE, &debug_isis_adj_cmd);
install_element(CONFIG_NODE, &no_debug_isis_adj_cmd);
@@ -2737,6 +2889,8 @@ void isis_init(void)
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, &debug_isis_ldp_sync_cmd);
+ install_element(CONFIG_NODE, &no_debug_isis_ldp_sync_cmd);
install_default(ROUTER_NODE);