2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2003-12-23 09:09:43 +01:00
|
|
|
/*
|
|
|
|
* IS-IS Rout(e)ing protocol - isisd.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001,2002 Sampo Saaristo
|
|
|
|
* Tampere University of Technology
|
|
|
|
* Institute of Communications Engineering
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
2022-02-28 16:40:31 +01:00
|
|
|
#include "event.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "vty.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "memory.h"
|
2012-03-24 16:35:20 +01:00
|
|
|
#include "time.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "linklist.h"
|
|
|
|
#include "if.h"
|
|
|
|
#include "hash.h"
|
2020-11-07 01:15:39 +01:00
|
|
|
#include "filter.h"
|
2020-11-26 03:39:09 +01:00
|
|
|
#include "plist.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "stream.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "table.h"
|
2016-04-05 23:54:53 +02:00
|
|
|
#include "qobj.h"
|
2020-08-18 09:26:51 +02:00
|
|
|
#include "zclient.h"
|
2020-07-13 14:37:59 +02:00
|
|
|
#include "vrf.h"
|
2017-02-21 23:52:29 +01:00
|
|
|
#include "spf_backoff.h"
|
2018-11-13 17:19:10 +01:00
|
|
|
#include "lib/northbound_cli.h"
|
2021-05-06 13:44:05 +02:00
|
|
|
#include "bfd.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
#include "isisd/isis_constants.h"
|
|
|
|
#include "isisd/isis_common.h"
|
|
|
|
#include "isisd/isis_flags.h"
|
2012-03-24 16:35:20 +01:00
|
|
|
#include "isisd/isis_circuit.h"
|
|
|
|
#include "isisd/isis_csm.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "isisd/isisd.h"
|
|
|
|
#include "isisd/isis_dynhn.h"
|
|
|
|
#include "isisd/isis_adjacency.h"
|
|
|
|
#include "isisd/isis_pdu.h"
|
|
|
|
#include "isisd/isis_misc.h"
|
|
|
|
#include "isisd/isis_constants.h"
|
|
|
|
#include "isisd/isis_lsp.h"
|
|
|
|
#include "isisd/isis_spf.h"
|
|
|
|
#include "isisd/isis_route.h"
|
|
|
|
#include "isisd/isis_zebra.h"
|
|
|
|
#include "isisd/isis_events.h"
|
2016-04-19 19:03:05 +02:00
|
|
|
#include "isisd/isis_te.h"
|
2017-04-27 13:56:35 +02:00
|
|
|
#include "isisd/isis_mt.h"
|
2019-08-04 03:02:37 +02:00
|
|
|
#include "isisd/isis_sr.h"
|
fabricd: adjacency formation optimization as per section 2.4
OpenFabric changes IS-IS's initial database synchronization. While
regular IS-IS will simultaneuously exchange LSPs with all neighboring
routers during startup, this is considered too much churn for a densely
connected fabric.
To mitigate this, OpenFabric prescribes that a router should only
bring up an adjacency with a single neighbor and perform a full
synchronization with that neighbor, before bringing up further
adjacencies.
This is implemented by having a field `initial_sync_state` in the
fabricd datastructure which tracks whether an initial sync is still
pending, currently in progress, or complete.
When an initial sync is pending, the state will transition to the
in-progress state when the first IIH is received.
During this state, all IIHs from other routers are ignored. Any
IIHs transmitted on any link other than the one to the router with
which we are performing the initial sync will always report the far
end as DOWN in their threeway handshake state, avoiding the formation of
additional adjacencies.
The state will be left if all the SRM and SSN flags on the
initial-sync circuit are cleared (meaning that initial sync has
completed). This is checked in `lsp_tick`. When this condition occurrs,
we progress to the initial-sync-complete state, allowing other
adjacencies to form.
The state can also be left if the initial synchronization is taking too
long to succeed, for whatever reason. In that case, we fall back to the
initial-sync-pending state and will reattempt initial synchronization
with a different neighbor.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-04-02 17:55:26 +02:00
|
|
|
#include "isisd/fabricd.h"
|
2019-10-17 20:33:53 +02:00
|
|
|
#include "isisd/isis_nb.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2020-06-19 21:04:33 +02:00
|
|
|
/* For debug statement. */
|
|
|
|
unsigned long debug_adj_pkt;
|
|
|
|
unsigned long debug_snp_pkt;
|
|
|
|
unsigned long debug_update_pkt;
|
|
|
|
unsigned long debug_spf_events;
|
|
|
|
unsigned long debug_rte_events;
|
|
|
|
unsigned long debug_events;
|
|
|
|
unsigned long debug_pkt_dump;
|
|
|
|
unsigned long debug_lsp_gen;
|
|
|
|
unsigned long debug_lsp_sched;
|
|
|
|
unsigned long debug_flooding;
|
|
|
|
unsigned long debug_bfd;
|
|
|
|
unsigned long debug_tx_queue;
|
|
|
|
unsigned long debug_sr;
|
2020-07-22 20:32:35 +02:00
|
|
|
unsigned long debug_ldp_sync;
|
2020-11-20 22:59:35 +01:00
|
|
|
unsigned long debug_lfa;
|
2021-06-22 19:59:02 +02:00
|
|
|
unsigned long debug_te;
|
2020-06-19 21:04:33 +02:00
|
|
|
|
2021-03-22 18:27:58 +01:00
|
|
|
DEFINE_MGROUP(ISISD, "isisd");
|
|
|
|
|
|
|
|
DEFINE_MTYPE_STATIC(ISISD, ISIS, "ISIS process");
|
|
|
|
DEFINE_MTYPE_STATIC(ISISD, ISIS_NAME, "ISIS process name");
|
|
|
|
DEFINE_MTYPE_STATIC(ISISD, ISIS_AREA, "ISIS area");
|
|
|
|
DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address");
|
|
|
|
DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name");
|
2022-09-19 18:34:18 +02:00
|
|
|
DEFINE_MTYPE(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");
|
2021-03-22 18:27:58 +01:00
|
|
|
|
2016-04-05 23:54:53 +02:00
|
|
|
DEFINE_QOBJ_TYPE(isis_area);
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
/* ISIS process wide configuration. */
|
|
|
|
static struct isis_master isis_master;
|
|
|
|
|
|
|
|
/* ISIS process wide configuration pointer to export. */
|
|
|
|
struct isis_master *im;
|
|
|
|
|
2023-02-16 00:42:09 +01:00
|
|
|
/* ISIS config processing thread */
|
2022-03-01 22:18:12 +01:00
|
|
|
struct event *t_isis_cfg;
|
2023-02-16 00:42:09 +01:00
|
|
|
|
2020-09-15 22:46:15 +02:00
|
|
|
#ifndef FABRICD
|
|
|
|
DEFINE_HOOK(isis_hook_db_overload, (const struct isis_area *area), (area));
|
|
|
|
#endif /* ifndef FABRICD */
|
|
|
|
|
2006-12-08 02:09:50 +01:00
|
|
|
/*
|
|
|
|
* Prototypes.
|
|
|
|
*/
|
|
|
|
int isis_area_get(struct vty *, const char *);
|
2012-03-24 16:35:20 +01:00
|
|
|
int area_net_title(struct vty *, const char *);
|
|
|
|
int area_clear_net_title(struct vty *, const char *);
|
2022-02-23 16:51:07 +01:00
|
|
|
int show_isis_interface_common(struct vty *, struct json_object *json,
|
|
|
|
const char *ifname, char, const char *vrf_name,
|
2020-07-13 14:37:59 +02:00
|
|
|
bool all_vrf);
|
2022-02-23 16:51:07 +01:00
|
|
|
int show_isis_interface_common_vty(struct vty *, const char *ifname, char,
|
|
|
|
const char *vrf_name, bool all_vrf);
|
|
|
|
int show_isis_interface_common_json(struct json_object *json,
|
|
|
|
const char *ifname, char,
|
|
|
|
const char *vrf_name, bool all_vrf);
|
2022-02-24 09:33:53 +01:00
|
|
|
int show_isis_neighbor_common(struct vty *, struct json_object *json,
|
|
|
|
const char *id, char, const char *vrf_name,
|
|
|
|
bool all_vrf);
|
|
|
|
int clear_isis_neighbor_common(struct vty *, const char *id,
|
|
|
|
const char *vrf_name, bool all_vrf);
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
/* Link ISIS instance to VRF. */
|
|
|
|
void isis_vrf_link(struct isis *isis, struct vrf *vrf)
|
|
|
|
{
|
|
|
|
isis->vrf_id = vrf->vrf_id;
|
|
|
|
if (vrf->info != (void *)isis)
|
|
|
|
vrf->info = (void *)isis;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unlink ISIS instance to VRF. */
|
|
|
|
void isis_vrf_unlink(struct isis *isis, struct vrf *vrf)
|
|
|
|
{
|
|
|
|
if (vrf->info == (void *)isis)
|
|
|
|
vrf->info = NULL;
|
|
|
|
isis->vrf_id = VRF_UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct isis *isis_lookup_by_vrfid(vrf_id_t vrf_id)
|
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
|
|
|
struct listnode *node;
|
2006-12-08 02:09:50 +01:00
|
|
|
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2020-07-13 14:37:59 +02:00
|
|
|
if (isis->vrf_id == vrf_id)
|
|
|
|
return isis;
|
2020-08-21 02:44:27 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct isis *isis_lookup_by_vrfname(const char *vrfname)
|
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
|
|
|
struct listnode *node;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2020-07-13 14:37:59 +02:00
|
|
|
if (isis->name && vrfname && strcmp(isis->name, vrfname) == 0)
|
|
|
|
return isis;
|
2020-08-21 02:44:27 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis_lookup_by_sysid(const uint8_t *sysid)
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
|
|
|
struct listnode *node;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2020-07-13 14:37:59 +02:00
|
|
|
if (!memcmp(isis->sysid, sysid, ISIS_SYS_ID_LEN))
|
|
|
|
return isis;
|
2020-08-21 02:44:27 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-03-07 20:14:41 +01:00
|
|
|
void isis_master_init(struct event_loop *master)
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2022-05-11 12:16:44 +02:00
|
|
|
memset(&isis_master, 0, sizeof(isis_master));
|
2020-07-13 14:37:59 +02:00
|
|
|
im = &isis_master;
|
|
|
|
im->isis = list_new();
|
|
|
|
im->master = master;
|
|
|
|
}
|
2006-12-08 02:09:50 +01:00
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
struct isis *isis_new(const char *vrf_name)
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct vrf *vrf;
|
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2005-09-01 19:52:33 +02:00
|
|
|
isis = XCALLOC(MTYPE_ISIS, sizeof(struct isis));
|
2021-04-28 00:57:21 +02:00
|
|
|
|
|
|
|
isis->name = XSTRDUP(MTYPE_ISIS_NAME, vrf_name);
|
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
vrf = vrf_lookup_by_name(vrf_name);
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
if (vrf)
|
2020-07-13 14:37:59 +02:00
|
|
|
isis_vrf_link(isis, vrf);
|
2021-04-28 00:57:21 +02:00
|
|
|
else
|
2020-08-18 09:26:51 +02:00
|
|
|
isis->vrf_id = VRF_UNKNOWN;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2021-05-04 23:10:31 +02:00
|
|
|
isis_zebra_vrf_register(isis);
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (IS_DEBUG_EVENTS)
|
|
|
|
zlog_debug(
|
|
|
|
"%s: Create new isis instance with vrf_name %s vrf_id %u",
|
|
|
|
__func__, isis->name, isis->vrf_id);
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/*
|
2003-12-23 09:09:43 +01:00
|
|
|
* Default values
|
2017-07-17 14:03:14 +02:00
|
|
|
*/
|
2022-02-24 11:31:18 +01:00
|
|
|
isis->max_area_addrs = ISIS_DEFAULT_MAX_AREA_ADDRESSES;
|
2020-07-13 14:37:59 +02:00
|
|
|
isis->process_id = getpid();
|
2012-03-24 16:35:20 +01:00
|
|
|
isis->router_id = 0;
|
2003-12-23 09:09:43 +01:00
|
|
|
isis->area_list = list_new();
|
|
|
|
isis->uptime = time(NULL);
|
2020-09-15 22:46:15 +02:00
|
|
|
isis->snmp_notifications = 1;
|
2020-07-13 14:37:59 +02:00
|
|
|
dyn_cache_init(isis);
|
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
listnode_add(im->isis, isis);
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
return isis;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
void isis_finish(struct isis *isis)
|
|
|
|
{
|
2022-08-05 16:00:48 +02:00
|
|
|
struct isis_area *area;
|
|
|
|
struct listnode *node, *nnode;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS(isis->area_list, node, nnode, area))
|
|
|
|
isis_area_destroy(area);
|
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
struct vrf *vrf = NULL;
|
|
|
|
|
|
|
|
listnode_delete(im->isis, isis);
|
|
|
|
|
2021-05-04 23:10:31 +02:00
|
|
|
isis_zebra_vrf_deregister(isis);
|
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
vrf = vrf_lookup_by_name(isis->name);
|
|
|
|
if (vrf)
|
|
|
|
isis_vrf_unlink(isis, vrf);
|
|
|
|
XFREE(MTYPE_ISIS_NAME, isis->name);
|
|
|
|
|
|
|
|
isis_redist_free(isis);
|
|
|
|
list_delete(&isis->area_list);
|
2021-06-11 17:27:46 +02:00
|
|
|
dyn_cache_finish(isis);
|
2021-04-28 00:57:21 +02:00
|
|
|
XFREE(MTYPE_ISIS, isis);
|
|
|
|
}
|
|
|
|
|
|
|
|
void isis_area_add_circuit(struct isis_area *area, struct isis_circuit *circuit)
|
|
|
|
{
|
|
|
|
isis_csm_state_change(ISIS_ENABLE, circuit, area);
|
|
|
|
|
|
|
|
area->ip_circuits += circuit->ip_router;
|
|
|
|
area->ipv6_circuits += circuit->ipv6_router;
|
|
|
|
|
|
|
|
area->lfa_protected_links[0] += circuit->lfa_protection[0];
|
|
|
|
area->rlfa_protected_links[0] += circuit->rlfa_protection[0];
|
|
|
|
area->tilfa_protected_links[0] += circuit->tilfa_protection[0];
|
|
|
|
|
|
|
|
area->lfa_protected_links[1] += circuit->lfa_protection[1];
|
|
|
|
area->rlfa_protected_links[1] += circuit->rlfa_protection[1];
|
|
|
|
area->tilfa_protected_links[1] += circuit->tilfa_protection[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
void isis_area_del_circuit(struct isis_area *area, struct isis_circuit *circuit)
|
|
|
|
{
|
|
|
|
area->ip_circuits -= circuit->ip_router;
|
|
|
|
area->ipv6_circuits -= circuit->ipv6_router;
|
|
|
|
|
|
|
|
area->lfa_protected_links[0] -= circuit->lfa_protection[0];
|
|
|
|
area->rlfa_protected_links[0] -= circuit->rlfa_protection[0];
|
|
|
|
area->tilfa_protected_links[0] -= circuit->tilfa_protection[0];
|
|
|
|
|
|
|
|
area->lfa_protected_links[1] -= circuit->lfa_protection[1];
|
|
|
|
area->rlfa_protected_links[1] -= circuit->rlfa_protection[1];
|
|
|
|
area->tilfa_protected_links[1] -= circuit->tilfa_protection[1];
|
|
|
|
|
|
|
|
isis_csm_state_change(ISIS_DISABLE, circuit, area);
|
|
|
|
}
|
|
|
|
|
2022-08-05 16:00:48 +02:00
|
|
|
static void delete_area_addr(void *arg)
|
|
|
|
{
|
|
|
|
struct area_addr *addr = (struct area_addr *)arg;
|
|
|
|
|
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addr);
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
struct isis_area *isis_area_create(const char *area_tag, const char *vrf_name)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2003-12-23 09:09:43 +01:00
|
|
|
struct isis_area *area;
|
2020-07-13 14:37:59 +02:00
|
|
|
struct isis *isis = NULL;
|
|
|
|
struct vrf *vrf = NULL;
|
2021-04-28 00:57:21 +02:00
|
|
|
struct interface *ifp;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
|
2005-09-01 19:52:33 +02:00
|
|
|
area = XCALLOC(MTYPE_ISIS_AREA, sizeof(struct isis_area));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
if (!vrf_name)
|
|
|
|
vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
|
|
|
|
vrf = vrf_lookup_by_name(vrf_name);
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
|
|
|
|
if (isis == NULL)
|
|
|
|
isis = isis_new(vrf_name);
|
2020-08-23 05:22:32 +02:00
|
|
|
|
|
|
|
listnode_add(isis->area_list, area);
|
|
|
|
area->isis = isis;
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/*
|
2018-03-22 14:58:53 +01:00
|
|
|
* Fabricd runs only as level-2.
|
2019-12-17 16:54:29 +01:00
|
|
|
* For IS-IS, the default is level-1-2
|
2017-07-17 14:03:14 +02:00
|
|
|
*/
|
2019-12-17 16:54:29 +01:00
|
|
|
if (fabricd)
|
2018-03-22 14:58:53 +01:00
|
|
|
area->is_type = IS_LEVEL_2;
|
2018-12-10 14:30:40 +01:00
|
|
|
else
|
|
|
|
area->is_type = yang_get_default_enum(
|
|
|
|
"/frr-isisd:isis/instance/is-type");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
|
|
|
/*
|
2003-12-23 09:09:43 +01:00
|
|
|
* intialize the databases
|
2017-07-17 14:03:14 +02:00
|
|
|
*/
|
2019-02-04 01:22:03 +01:00
|
|
|
if (area->is_type & IS_LEVEL_1)
|
|
|
|
lsp_db_init(&area->lspdb[0]);
|
|
|
|
if (area->is_type & IS_LEVEL_2)
|
|
|
|
lsp_db_init(&area->lspdb[1]);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
spftree_area_init(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
area->circuit_list = list_new();
|
2020-08-11 04:09:12 +02:00
|
|
|
area->adjacency_list = list_new();
|
2003-12-23 09:09:43 +01:00
|
|
|
area->area_addrs = list_new();
|
2022-08-05 16:00:48 +02:00
|
|
|
area->area_addrs->del = delete_area_addr;
|
|
|
|
|
2020-08-24 19:46:36 +02:00
|
|
|
if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
|
2022-05-20 20:19:08 +02:00
|
|
|
event_add_timer(master, lsp_tick, area, 1, &area->t_tick);
|
2008-01-29 20:29:44 +01:00
|
|
|
flags_initialize(&area->flags);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-08-04 03:02:37 +02:00
|
|
|
isis_sr_area_init(area);
|
|
|
|
|
2017-07-17 14:03:14 +02:00
|
|
|
/*
|
2003-12-23 09:09:43 +01:00
|
|
|
* Default values
|
2017-07-17 14:03:14 +02:00
|
|
|
*/
|
2018-12-10 14:30:40 +01:00
|
|
|
#ifndef FABRICD
|
|
|
|
enum isis_metric_style default_style;
|
|
|
|
|
|
|
|
area->max_lsp_lifetime[0] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->max_lsp_lifetime[1] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-2/maximum-lifetime");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->lsp_refresh[0] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-1/refresh-interval");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->lsp_refresh[1] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-2/refresh-interval");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->lsp_gen_interval[0] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-1/generation-interval");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->lsp_gen_interval[1] = yang_get_default_uint16(
|
isisd, yang: unified lsp-timers command
Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.
As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-04-06 17:05:41 +02:00
|
|
|
"/frr-isisd:isis/instance/lsp/timers/level-2/generation-interval");
|
2018-12-10 14:30:40 +01:00
|
|
|
area->min_spf_interval[0] = yang_get_default_uint16(
|
|
|
|
"/frr-isisd:isis/instance/spf/minimum-interval/level-1");
|
|
|
|
area->min_spf_interval[1] = yang_get_default_uint16(
|
|
|
|
"/frr-isisd:isis/instance/spf/minimum-interval/level-1");
|
|
|
|
area->dynhostname = yang_get_default_bool(
|
|
|
|
"/frr-isisd:isis/instance/dynamic-hostname");
|
|
|
|
default_style =
|
|
|
|
yang_get_default_enum("/frr-isisd:isis/instance/metric-style");
|
|
|
|
area->oldmetric = default_style == ISIS_WIDE_METRIC ? 0 : 1;
|
|
|
|
area->newmetric = default_style == ISIS_NARROW_METRIC ? 0 : 1;
|
|
|
|
area->lsp_frag_threshold = 90; /* not currently configurable */
|
|
|
|
area->lsp_mtu =
|
|
|
|
yang_get_default_uint16("/frr-isisd:isis/instance/lsp/mtu");
|
2020-11-07 01:15:39 +01:00
|
|
|
area->lfa_load_sharing[0] = yang_get_default_bool(
|
|
|
|
"/frr-isisd:isis/instance/fast-reroute/level-1/lfa/load-sharing");
|
|
|
|
area->lfa_load_sharing[1] = yang_get_default_bool(
|
|
|
|
"/frr-isisd:isis/instance/fast-reroute/level-2/lfa/load-sharing");
|
2020-12-24 19:29:42 +01:00
|
|
|
area->attached_bit_send =
|
|
|
|
yang_get_default_bool("/frr-isisd:isis/instance/attach-send");
|
|
|
|
area->attached_bit_rcv_ignore = yang_get_default_bool(
|
|
|
|
"/frr-isisd:isis/instance/attach-receive-ignore");
|
|
|
|
|
2018-12-10 14:30:40 +01:00
|
|
|
#else
|
2012-03-24 16:35:20 +01:00
|
|
|
area->max_lsp_lifetime[0] = DEFAULT_LSP_LIFETIME; /* 1200 */
|
|
|
|
area->max_lsp_lifetime[1] = DEFAULT_LSP_LIFETIME; /* 1200 */
|
|
|
|
area->lsp_refresh[0] = DEFAULT_MAX_LSP_GEN_INTERVAL; /* 900 */
|
|
|
|
area->lsp_refresh[1] = DEFAULT_MAX_LSP_GEN_INTERVAL; /* 900 */
|
|
|
|
area->lsp_gen_interval[0] = DEFAULT_MIN_LSP_GEN_INTERVAL;
|
|
|
|
area->lsp_gen_interval[1] = DEFAULT_MIN_LSP_GEN_INTERVAL;
|
2003-12-23 09:09:43 +01:00
|
|
|
area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
|
|
|
|
area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
|
|
|
|
area->dynhostname = 1;
|
2012-03-24 16:35:20 +01:00
|
|
|
area->oldmetric = 0;
|
|
|
|
area->newmetric = 1;
|
2003-12-23 09:09:43 +01:00
|
|
|
area->lsp_frag_threshold = 90;
|
2015-11-10 18:43:31 +01:00
|
|
|
area->lsp_mtu = DEFAULT_LSP_MTU;
|
2020-11-07 01:15:39 +01:00
|
|
|
area->lfa_load_sharing[0] = true;
|
|
|
|
area->lfa_load_sharing[1] = true;
|
2020-12-24 19:29:42 +01:00
|
|
|
area->attached_bit_send = true;
|
|
|
|
area->attached_bit_rcv_ignore = false;
|
2018-12-10 14:30:40 +01:00
|
|
|
#endif /* ifndef FABRICD */
|
2020-11-07 01:15:39 +01:00
|
|
|
area->lfa_priority_limit[0] = SPF_PREFIX_PRIO_LOW;
|
|
|
|
area->lfa_priority_limit[1] = SPF_PREFIX_PRIO_LOW;
|
|
|
|
isis_lfa_tiebreakers_init(area, ISIS_LEVEL1);
|
|
|
|
isis_lfa_tiebreakers_init(area, ISIS_LEVEL2);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
area_mt_init(area);
|
2006-12-08 02:09:50 +01:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
area->area_tag = strdup(area_tag);
|
2020-07-13 14:37:59 +02:00
|
|
|
|
fabricd: adjacency formation optimization as per section 2.4
OpenFabric changes IS-IS's initial database synchronization. While
regular IS-IS will simultaneuously exchange LSPs with all neighboring
routers during startup, this is considered too much churn for a densely
connected fabric.
To mitigate this, OpenFabric prescribes that a router should only
bring up an adjacency with a single neighbor and perform a full
synchronization with that neighbor, before bringing up further
adjacencies.
This is implemented by having a field `initial_sync_state` in the
fabricd datastructure which tracks whether an initial sync is still
pending, currently in progress, or complete.
When an initial sync is pending, the state will transition to the
in-progress state when the first IIH is received.
During this state, all IIHs from other routers are ignored. Any
IIHs transmitted on any link other than the one to the router with
which we are performing the initial sync will always report the far
end as DOWN in their threeway handshake state, avoiding the formation of
additional adjacencies.
The state will be left if all the SRM and SSN flags on the
initial-sync circuit are cleared (meaning that initial sync has
completed). This is checked in `lsp_tick`. When this condition occurrs,
we progress to the initial-sync-complete state, allowing other
adjacencies to form.
The state can also be left if the initial synchronization is taking too
long to succeed, for whatever reason. In that case, we fall back to the
initial-sync-pending state and will reattempt initial synchronization
with a different neighbor.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-04-02 17:55:26 +02:00
|
|
|
if (fabricd)
|
2018-04-02 18:39:46 +02:00
|
|
|
area->fabricd = fabricd_new(area);
|
2018-10-24 06:27:17 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-05-19 13:52:04 +02:00
|
|
|
area->bfd_signalled_down = false;
|
|
|
|
area->bfd_force_spf_refresh = false;
|
|
|
|
|
2005-09-01 19:52:33 +02:00
|
|
|
QOBJ_REG(area, isis_area);
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2021-04-28 00:57:21 +02:00
|
|
|
if (vrf) {
|
|
|
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
|
|
|
if (ifp->ifindex == IFINDEX_INTERNAL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
circuit = ifp->info;
|
2021-06-16 14:52:14 +02:00
|
|
|
if (circuit && strmatch(circuit->tag, area->area_tag))
|
2021-04-28 00:57:21 +02:00
|
|
|
isis_area_add_circuit(area, circuit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return area;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
struct isis_area *isis_area_lookup(const char *area_tag, vrf_id_t vrf_id)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
|
|
|
struct isis_area *area;
|
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist,
and some basic auditing of usage.
* configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES
* HACKING: Add notes about deprecating interfaces and commands.
* lib/linklist.h: Add usage comments.
Rename getdata macro to listgetdata.
Rename nextnode to listnextnode and fix its odd behaviour to be
less dangerous.
Make listgetdata macro assert node is not null, NULL list entries
should be bug condition.
ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use
with for loop, Suggested by Jim Carlson of Sun.
Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the
"safety" of previous macro.
LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to
distinguish from the similarly named functions, and reflect their
effect better.
Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section
with the old defines which were modified above,
for backwards compatibility - guarded to prevent Quagga using it..
* lib/linklist.c: fix up for linklist.h changes.
* ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single
scan of the area list, rather than scanning all areas first for
INTER_ROUTER and then again for INTER_NETWORK. According to
16.2, the scan should be area specific anyway, and further
ospf6d does not seem to implement 16.3 anyway.
2005-04-07 09:30:20 +02:00
|
|
|
struct listnode *node;
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
isis = isis_lookup_by_vrfid(vrf_id);
|
|
|
|
if (isis == NULL)
|
|
|
|
return NULL;
|
2012-03-24 16:35:20 +01:00
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
|
|
|
|
if ((area->area_tag == NULL && area_tag == NULL)
|
|
|
|
|| (area->area_tag && area_tag
|
|
|
|
&& strcmp(area->area_tag, area_tag) == 0))
|
|
|
|
return area;
|
|
|
|
|
|
|
|
return NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2017-02-20 10:51:47 +01:00
|
|
|
int isis_area_get(struct vty *vty, const char *area_tag)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2017-02-20 10:51:47 +01:00
|
|
|
struct isis_area *area;
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
area = isis_area_lookup(area_tag, VRF_DEFAULT);
|
2017-02-21 23:52:29 +01:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area) {
|
2018-03-22 15:01:08 +01:00
|
|
|
VTY_PUSH_CONTEXT(ROUTER_NODE, area);
|
2004-09-10 22:48:21 +02:00
|
|
|
return CMD_SUCCESS;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
area = isis_area_create(area_tag, VRF_DEFAULT_NAME);
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_EVENTS)
|
2012-03-24 16:35:20 +01:00
|
|
|
zlog_debug("New IS-IS area instance %s", area->area_tag);
|
|
|
|
|
2018-03-22 15:01:08 +01:00
|
|
|
VTY_PUSH_CONTEXT(ROUTER_NODE, area);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2004-09-10 22:48:21 +02:00
|
|
|
return CMD_SUCCESS;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-08-10 17:23:14 +02:00
|
|
|
void isis_area_destroy(struct isis_area *area)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2005-09-28 20:45:54 +02:00
|
|
|
struct listnode *node, *nnode;
|
2003-12-23 09:09:43 +01:00
|
|
|
struct isis_circuit *circuit;
|
|
|
|
|
2016-04-05 23:54:53 +02:00
|
|
|
QOBJ_UNREG(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-04-02 18:39:46 +02:00
|
|
|
if (fabricd)
|
|
|
|
fabricd_finish(area->fabricd);
|
|
|
|
|
2004-09-10 22:48:21 +02:00
|
|
|
if (area->circuit_list) {
|
2003-12-23 09:09:43 +01:00
|
|
|
for (ALL_LIST_ELEMENTS(area->circuit_list, node, nnode,
|
2021-04-28 00:57:21 +02:00
|
|
|
circuit))
|
|
|
|
isis_area_del_circuit(area, circuit);
|
|
|
|
|
2018-10-02 11:39:51 +02:00
|
|
|
list_delete(&area->circuit_list);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2022-08-05 16:00:48 +02:00
|
|
|
if (area->flags.free_idcs)
|
|
|
|
list_delete(&area->flags.free_idcs);
|
|
|
|
|
2020-08-11 04:09:12 +02:00
|
|
|
list_delete(&area->adjacency_list);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp_db_fini(&area->lspdb[0]);
|
|
|
|
lsp_db_fini(&area->lspdb[1]);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-07-24 17:40:24 +02:00
|
|
|
/* invalidate and verify to delete all routes from zebra */
|
2019-05-28 16:46:06 +02:00
|
|
|
isis_area_invalidate_routes(area, area->is_type);
|
2018-07-24 17:40:24 +02:00
|
|
|
isis_area_verify_routes(area);
|
|
|
|
|
2019-08-04 03:02:37 +02:00
|
|
|
isis_sr_area_term(area);
|
|
|
|
|
2022-08-05 16:00:48 +02:00
|
|
|
isis_mpls_te_term(area);
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
spftree_area_del(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-11-14 23:32:01 +01:00
|
|
|
if (area->spf_timer[0])
|
2022-12-25 16:26:52 +01:00
|
|
|
isis_spf_timer_free(EVENT_ARG(area->spf_timer[0]));
|
|
|
|
EVENT_OFF(area->spf_timer[0]);
|
2020-11-14 23:32:01 +01:00
|
|
|
if (area->spf_timer[1])
|
2022-12-25 16:26:52 +01:00
|
|
|
isis_spf_timer_free(EVENT_ARG(area->spf_timer[1]));
|
|
|
|
EVENT_OFF(area->spf_timer[1]);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
spf_backoff_free(area->spf_delay_ietf[0]);
|
2017-02-21 23:52:29 +01:00
|
|
|
spf_backoff_free(area->spf_delay_ietf[1]);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-24 19:46:36 +02:00
|
|
|
if (!CHECK_FLAG(im->options, F_ISIS_UNIT_TEST))
|
|
|
|
isis_redist_area_finish(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-08-05 16:00:48 +02:00
|
|
|
list_delete(&area->area_addrs);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-11-07 01:15:39 +01:00
|
|
|
for (int i = SPF_PREFIX_PRIO_CRITICAL; i <= SPF_PREFIX_PRIO_MEDIUM;
|
|
|
|
i++) {
|
|
|
|
struct spf_prefix_priority_acl *ppa;
|
|
|
|
|
|
|
|
ppa = &area->spf_prefix_priorities[i];
|
|
|
|
XFREE(MTYPE_ISIS_ACL_NAME, ppa->name);
|
|
|
|
}
|
|
|
|
isis_lfa_tiebreakers_clear(area, ISIS_LEVEL1);
|
|
|
|
isis_lfa_tiebreakers_clear(area, ISIS_LEVEL2);
|
|
|
|
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF(area->t_tick);
|
|
|
|
EVENT_OFF(area->t_lsp_refresh[0]);
|
|
|
|
EVENT_OFF(area->t_lsp_refresh[1]);
|
|
|
|
EVENT_OFF(area->t_rlfa_rib_update);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-12-10 15:08:37 +01:00
|
|
|
event_cancel_event(master, area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
listnode_delete(area->isis->area_list, area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
free(area->area_tag);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
area_mt_finish(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-09-19 18:34:18 +02:00
|
|
|
if (area->rlfa_plist_name[0])
|
|
|
|
XFREE(MTYPE_ISIS_PLIST_NAME, area->rlfa_plist_name[0]);
|
|
|
|
if (area->rlfa_plist_name[1])
|
|
|
|
XFREE(MTYPE_ISIS_PLIST_NAME, area->rlfa_plist_name[1]);
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
XFREE(MTYPE_ISIS_AREA, area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
|
2021-05-04 23:10:31 +02:00
|
|
|
static void isis_set_redist_vrf_bitmaps(struct isis *isis, bool set)
|
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct isis_area *area;
|
|
|
|
int type;
|
|
|
|
int level;
|
|
|
|
int protocol;
|
|
|
|
|
|
|
|
char do_subscribe[REDIST_PROTOCOL_COUNT][ZEBRA_ROUTE_MAX + 1];
|
|
|
|
|
|
|
|
memset(do_subscribe, 0, sizeof(do_subscribe));
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area))
|
|
|
|
for (protocol = 0; protocol < REDIST_PROTOCOL_COUNT; protocol++)
|
|
|
|
for (type = 0; type < ZEBRA_ROUTE_MAX + 1; type++)
|
|
|
|
for (level = 0; level < ISIS_LEVELS; level++)
|
|
|
|
if (area->redist_settings[protocol]
|
|
|
|
[type][level]
|
|
|
|
.redist
|
|
|
|
== 1)
|
|
|
|
do_subscribe[protocol][type] =
|
|
|
|
1;
|
|
|
|
|
|
|
|
for (protocol = 0; protocol < REDIST_PROTOCOL_COUNT; protocol++)
|
|
|
|
for (type = 0; type < ZEBRA_ROUTE_MAX + 1; type++) {
|
|
|
|
/* This field is actually controlling transmission of
|
|
|
|
* the IS-IS
|
|
|
|
* routes to Zebra and has nothing to do with
|
|
|
|
* redistribution,
|
|
|
|
* so skip it. */
|
|
|
|
if (type == PROTO_TYPE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!do_subscribe[protocol][type])
|
|
|
|
continue;
|
|
|
|
|
|
|
|
afi_t afi = afi_for_redist_protocol(protocol);
|
|
|
|
|
|
|
|
if (type == DEFAULT_ROUTE) {
|
|
|
|
if (set)
|
|
|
|
vrf_bitmap_set(
|
|
|
|
zclient->default_information
|
|
|
|
[afi],
|
|
|
|
isis->vrf_id);
|
|
|
|
else
|
|
|
|
vrf_bitmap_unset(
|
|
|
|
zclient->default_information
|
|
|
|
[afi],
|
|
|
|
isis->vrf_id);
|
|
|
|
} else {
|
|
|
|
if (set)
|
|
|
|
vrf_bitmap_set(
|
|
|
|
zclient->redist[afi][type],
|
|
|
|
isis->vrf_id);
|
|
|
|
else
|
|
|
|
vrf_bitmap_unset(
|
|
|
|
zclient->redist[afi][type],
|
|
|
|
isis->vrf_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
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);
|
isisd: make isis work with default vrf name different than 'default'
The problem is related to startup configuration, which is not operational
on default vrf name.
To reproduce the issue, run the two daemons:
zebra -o vrf0 &
isisd -f /tmp/isisd.conf
router isis 1
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The obtained show running-config looks like below:
router isis 1 vrf default
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The default vrf name is obtained by zebra daemon. While isis is not
connected to zebra, i.e. at startup, when loading a startup configuration,
the macro VRF_DEFAULT_NAME is used and returns 'default'.
But because zebra connected and forces to a new default vrf name, the
configuration is not seen as the default one, and further attempts to
configure the isis instance via 'router isis 1' will trigger creation
of an other instance.
To handle this situation, at vrf_enable() event, which is called for
each default vrf name change, the associated isis instance is updated
with th new vrf name. The same is done for NB yang path.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-10-27 14:56:37 +02:00
|
|
|
if (isis && isis->vrf_id != vrf->vrf_id) {
|
2020-08-18 09:26:51 +02:00
|
|
|
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);
|
isisd: make isis work with default vrf name different than 'default'
The problem is related to startup configuration, which is not operational
on default vrf name.
To reproduce the issue, run the two daemons:
zebra -o vrf0 &
isisd -f /tmp/isisd.conf
router isis 1
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The obtained show running-config looks like below:
router isis 1 vrf default
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The default vrf name is obtained by zebra daemon. While isis is not
connected to zebra, i.e. at startup, when loading a startup configuration,
the macro VRF_DEFAULT_NAME is used and returns 'default'.
But because zebra connected and forces to a new default vrf name, the
configuration is not seen as the default one, and further attempts to
configure the isis instance via 'router isis 1' will trigger creation
of an other instance.
To handle this situation, at vrf_enable() event, which is called for
each default vrf name change, the associated isis instance is updated
with th new vrf name. The same is done for NB yang path.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-10-27 14:56:37 +02:00
|
|
|
/* start zebra redist to us for new vrf */
|
|
|
|
isis_set_redist_vrf_bitmaps(isis, true);
|
2021-05-04 23:10:31 +02:00
|
|
|
|
isisd: make isis work with default vrf name different than 'default'
The problem is related to startup configuration, which is not operational
on default vrf name.
To reproduce the issue, run the two daemons:
zebra -o vrf0 &
isisd -f /tmp/isisd.conf
router isis 1
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The obtained show running-config looks like below:
router isis 1 vrf default
lsp-gen-interval 2
net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
metric-style wide
redistribute ipv4 connected level-2
redistribute ipv6 connected level-2
The default vrf name is obtained by zebra daemon. While isis is not
connected to zebra, i.e. at startup, when loading a startup configuration,
the macro VRF_DEFAULT_NAME is used and returns 'default'.
But because zebra connected and forces to a new default vrf name, the
configuration is not seen as the default one, and further attempts to
configure the isis instance via 'router isis 1' will trigger creation
of an other instance.
To handle this situation, at vrf_enable() event, which is called for
each default vrf name change, the associated isis instance is updated
with th new vrf name. The same is done for NB yang path.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-10-27 14:56:37 +02:00
|
|
|
isis_zebra_vrf_register(isis);
|
2020-08-18 09:26:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2021-05-04 20:58:23 +02:00
|
|
|
isis_zebra_vrf_deregister(isis);
|
|
|
|
|
2021-05-04 23:10:31 +02:00
|
|
|
isis_set_redist_vrf_bitmaps(isis, false);
|
|
|
|
|
2020-08-18 09:26:51 +02:00
|
|
|
/* 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,
|
*: rework renaming the default VRF
Currently, it is possible to rename the default VRF either by passing
`-o` option to zebra or by creating a file in `/var/run/netns` and
binding it to `/proc/self/ns/net`.
In both cases, only zebra knows about the rename and other daemons learn
about it only after they connect to zebra. This is a problem, because
daemons may read their config before they connect to zebra. To handle
this rename after the config is read, we have some special code in every
single daemon, which is not very bad but not desirable in my opinion.
But things are getting worse when we need to handle this in northbound
layer as we have to manually rewrite the config nodes. This approach is
already hacky, but still works as every daemon handles its own NB
structures. But it is completely incompatible with the central
management daemon architecture we are aiming for, as mgmtd doesn't even
have a connection with zebra to learn from it. And it shouldn't have it,
because operational state changes should never affect configuration.
To solve the problem and simplify the code, I propose to expand the `-o`
option to all daemons. By using the startup option, we let daemons know
about the rename before they read their configs so we don't need any
special code to deal with it. There's an easy way to pass the option to
all daemons by using `frr_global_options` variable.
Unfortunately, the second way of renaming by creating a file in
`/var/run/netns` is incompatible with the new mgmtd architecture.
Theoretically, we could force daemons to read their configs only after
they connect to zebra, but it means adding even more code to handle a
very specific use-case. And anyway this won't work for mgmtd as it
doesn't have a connection with zebra. So I had to remove this option.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-03 23:22:55 +01:00
|
|
|
isis_vrf_delete);
|
2021-06-21 17:04:46 +02:00
|
|
|
|
2021-08-25 18:29:42 +02:00
|
|
|
vrf_cmd_init(NULL);
|
2020-08-18 09:26:51 +02:00
|
|
|
}
|
|
|
|
|
2022-10-26 02:06:49 +02:00
|
|
|
void isis_terminate(void)
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
struct listnode *node, *nnode;
|
|
|
|
|
2021-05-06 13:44:05 +02:00
|
|
|
bfd_protocol_integration_set_shutdown(true);
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (listcount(im->isis) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS(im->isis, node, nnode, isis))
|
|
|
|
isis_finish(isis);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2020-11-07 01:15:39 +01:00
|
|
|
void isis_filter_update(struct access_list *access)
|
|
|
|
{
|
|
|
|
struct isis *isis;
|
|
|
|
struct isis_area *area;
|
|
|
|
struct listnode *node, *anode;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
|
|
|
|
for (int i = SPF_PREFIX_PRIO_CRITICAL;
|
|
|
|
i <= SPF_PREFIX_PRIO_MEDIUM; i++) {
|
|
|
|
struct spf_prefix_priority_acl *ppa;
|
|
|
|
|
|
|
|
ppa = &area->spf_prefix_priorities[i];
|
|
|
|
ppa->list_v4 =
|
|
|
|
access_list_lookup(AFI_IP, ppa->name);
|
|
|
|
ppa->list_v6 =
|
|
|
|
access_list_lookup(AFI_IP6, ppa->name);
|
|
|
|
}
|
|
|
|
lsp_regenerate_schedule(area, area->is_type, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-26 03:39:09 +01:00
|
|
|
void isis_prefix_list_update(struct prefix_list *plist)
|
|
|
|
{
|
|
|
|
struct isis *isis;
|
|
|
|
struct isis_area *area;
|
|
|
|
struct listnode *node, *anode;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
|
|
|
|
for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS;
|
|
|
|
level++) {
|
|
|
|
const char *plist_name =
|
|
|
|
prefix_list_name(plist);
|
|
|
|
|
|
|
|
if (!area->rlfa_plist_name[level - 1])
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!strmatch(area->rlfa_plist_name[level - 1],
|
|
|
|
plist_name))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
area->rlfa_plist[level - 1] =
|
|
|
|
prefix_list_lookup(AFI_IP, plist_name);
|
|
|
|
lsp_regenerate_schedule(area, area->is_type, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-14 12:34:02 +01:00
|
|
|
#ifdef FABRICD
|
2003-12-23 09:09:43 +01:00
|
|
|
static void area_set_mt_enabled(struct isis_area *area, uint16_t mtid,
|
|
|
|
bool enabled)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2017-04-27 13:56:35 +02:00
|
|
|
struct isis_area_mt_setting *setting;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
setting = area_get_mt_setting(area, mtid);
|
|
|
|
if (setting->enabled != enabled) {
|
|
|
|
setting->enabled = enabled;
|
2016-07-28 17:23:26 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 0);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
static void area_set_mt_overload(struct isis_area *area, uint16_t mtid,
|
|
|
|
bool overload)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2017-04-27 13:56:35 +02:00
|
|
|
struct isis_area_mt_setting *setting;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
setting = area_get_mt_setting(area, mtid);
|
|
|
|
if (setting->overload != overload) {
|
|
|
|
setting->overload = overload;
|
|
|
|
if (setting->enabled)
|
2016-07-28 17:23:26 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2,
|
2017-07-17 14:03:14 +02:00
|
|
|
0);
|
|
|
|
}
|
|
|
|
}
|
2018-11-14 12:34:02 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
int area_net_title(struct vty *vty, const char *net_title)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2016-09-26 18:36:13 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
2012-03-24 16:35:20 +01:00
|
|
|
struct area_addr *addr;
|
2003-12-23 09:09:43 +01:00
|
|
|
struct area_addr *addrp;
|
2005-09-28 20:45:54 +02:00
|
|
|
struct listnode *node;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t buff[255];
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
/* We check that we are not over the maximal number of addresses */
|
2020-07-13 14:37:59 +02:00
|
|
|
if (listcount(area->area_addrs) >= area->isis->max_area_addrs) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Maximum of area addresses (%d) already reached \n",
|
2020-07-13 14:37:59 +02:00
|
|
|
area->isis->max_area_addrs);
|
2012-03-24 16:35:20 +01:00
|
|
|
return CMD_ERR_NOTHING_TODO;
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
addr = XMALLOC(MTYPE_ISIS_AREA_ADDR, sizeof(struct area_addr));
|
|
|
|
addr->addr_len = dotformat2buff(buff, net_title);
|
|
|
|
memcpy(addr->area_addr, buff, addr->addr_len);
|
|
|
|
#ifdef EXTREME_DEBUG
|
2004-12-24 01:14:50 +01:00
|
|
|
zlog_debug("added area address %s for area %s (address length %d)",
|
2003-12-23 09:09:43 +01:00
|
|
|
net_title, area->area_tag, addr->addr_len);
|
|
|
|
#endif /* EXTREME_DEBUG */
|
2004-09-10 22:48:21 +02:00
|
|
|
if (addr->addr_len < 8 || addr->addr_len > 20) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"area address must be at least 8..20 octets long (%d)\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
addr->addr_len);
|
2012-03-24 16:35:20 +01:00
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addr);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (addr->area_addr[addr->addr_len - 1] != 0) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"nsel byte (last byte) in area address must be 0\n");
|
2003-12-23 09:09:43 +01:00
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addr);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (area->isis->sysid_set == 0) {
|
2004-09-10 22:48:21 +02:00
|
|
|
/*
|
|
|
|
* First area address - get the SystemID for this router
|
|
|
|
*/
|
2020-07-13 14:37:59 +02:00
|
|
|
memcpy(area->isis->sysid, GETSYSID(addr), ISIS_SYS_ID_LEN);
|
|
|
|
area->isis->sysid_set = 1;
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_EVENTS)
|
2005-09-04 23:36:36 +02:00
|
|
|
zlog_debug("Router has SystemID %s",
|
2020-07-13 14:37:59 +02:00
|
|
|
sysid_print(area->isis->sysid));
|
2004-09-10 22:48:21 +02:00
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* Check that the SystemID portions match
|
|
|
|
*/
|
2020-07-13 14:37:59 +02:00
|
|
|
if (memcmp(area->isis->sysid, GETSYSID(addr),
|
|
|
|
ISIS_SYS_ID_LEN)) {
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"System ID must not change when defining additional area addresses\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addr);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-10 22:48:21 +02:00
|
|
|
/* now we see that we don't already have this address */
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node, addrp)) {
|
2012-03-24 16:35:20 +01:00
|
|
|
if ((addrp->addr_len + ISIS_SYS_ID_LEN + ISIS_NSEL_LEN)
|
|
|
|
!= (addr->addr_len))
|
2005-09-28 20:45:54 +02:00
|
|
|
continue;
|
|
|
|
if (!memcmp(addrp->area_addr, addr->area_addr,
|
|
|
|
addr->addr_len)) {
|
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addr);
|
|
|
|
return CMD_SUCCESS; /* silent fail */
|
|
|
|
}
|
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
/*
|
|
|
|
* Forget the systemID part of the address
|
|
|
|
*/
|
2012-03-24 16:35:20 +01:00
|
|
|
addr->addr_len -= (ISIS_SYS_ID_LEN + ISIS_NSEL_LEN);
|
2003-12-23 09:09:43 +01:00
|
|
|
listnode_add(area->area_addrs, addr);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
/* only now we can safely generate our LSPs for this area */
|
2004-09-10 22:48:21 +02:00
|
|
|
if (listcount(area->area_addrs) > 0) {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->is_type & IS_LEVEL_1)
|
|
|
|
lsp_generate(area, IS_LEVEL_1);
|
|
|
|
if (area->is_type & IS_LEVEL_2)
|
|
|
|
lsp_generate(area, IS_LEVEL_2);
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
int area_clear_net_title(struct vty *vty, const char *net_title)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-09-26 18:36:13 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
2004-09-10 22:48:21 +02:00
|
|
|
struct area_addr addr, *addrp = NULL;
|
2005-09-28 20:45:54 +02:00
|
|
|
struct listnode *node;
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t buff[255];
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
addr.addr_len = dotformat2buff(buff, net_title);
|
2004-09-10 22:48:21 +02:00
|
|
|
if (addr.addr_len < 8 || addr.addr_len > 20) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Unsupported area address length %d, should be 8...20 \n",
|
2017-06-21 05:10:57 +02:00
|
|
|
addr.addr_len);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-10 22:48:21 +02:00
|
|
|
memcpy(addr.area_addr, buff, (int)addr.addr_len);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node, addrp))
|
2012-03-24 16:35:20 +01:00
|
|
|
if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == addr.addr_len
|
2003-12-23 09:09:43 +01:00
|
|
|
&& !memcmp(addrp->area_addr, addr.area_addr, addr.addr_len))
|
2004-09-10 22:48:21 +02:00
|
|
|
break;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-10 22:48:21 +02:00
|
|
|
if (!addrp) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "No area address %s for area %s \n", net_title,
|
2017-06-21 05:10:57 +02:00
|
|
|
area->area_tag);
|
2012-03-24 16:35:20 +01:00
|
|
|
return CMD_ERR_NO_MATCH;
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
listnode_delete(area->area_addrs, addrp);
|
2012-03-24 16:35:20 +01:00
|
|
|
XFREE(MTYPE_ISIS_AREA_ADDR, addrp);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
/*
|
|
|
|
* Last area address - reset the SystemID for this router
|
|
|
|
*/
|
|
|
|
if (listcount(area->area_addrs) == 0) {
|
2020-07-13 14:37:59 +02:00
|
|
|
memset(area->isis->sysid, 0, ISIS_SYS_ID_LEN);
|
|
|
|
area->isis->sysid_set = 0;
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_EVENTS)
|
2012-03-24 16:35:20 +01:00
|
|
|
zlog_debug("Router has no SystemID");
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2012-03-24 16:35:20 +01:00
|
|
|
* 'show isis interface' command
|
2003-12-23 09:09:43 +01:00
|
|
|
*/
|
2022-02-23 16:51:07 +01:00
|
|
|
int show_isis_interface_common(struct vty *vty, struct json_object *json,
|
|
|
|
const char *ifname, char detail,
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name, bool all_vrf)
|
2022-02-23 16:51:07 +01:00
|
|
|
{
|
|
|
|
if (json) {
|
|
|
|
return show_isis_interface_common_json(json, ifname, detail,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
} else {
|
|
|
|
return show_isis_interface_common_vty(vty, ifname, detail,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int show_isis_interface_common_json(struct json_object *json,
|
|
|
|
const char *ifname, char detail,
|
|
|
|
const char *vrf_name, bool all_vrf)
|
|
|
|
{
|
|
|
|
struct listnode *anode, *cnode, *inode;
|
|
|
|
struct isis_area *area;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
struct isis *isis;
|
|
|
|
struct json_object *areas_json, *area_json;
|
2022-02-24 09:33:53 +01:00
|
|
|
struct json_object *circuits_json, *circuit_json;
|
2022-02-23 16:51:07 +01:00
|
|
|
if (!im) {
|
|
|
|
// IS-IS Routing Process not enabled
|
|
|
|
json_object_string_add(json, "is-is-routing-process-enabled",
|
|
|
|
"no");
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
|
|
|
|
areas_json = json_object_new_array();
|
|
|
|
json_object_object_add(json, "areas",
|
|
|
|
areas_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list,
|
|
|
|
anode, area)) {
|
|
|
|
area_json = json_object_new_object();
|
|
|
|
json_object_string_add(
|
|
|
|
area_json, "area",
|
|
|
|
area->area_tag ? area->area_tag
|
|
|
|
: "null");
|
2022-02-24 09:33:53 +01:00
|
|
|
circuits_json = json_object_new_array();
|
|
|
|
json_object_object_add(area_json,
|
|
|
|
"circuits",
|
|
|
|
circuits_json);
|
2022-02-23 16:51:07 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(
|
|
|
|
area->circuit_list, cnode,
|
2022-02-24 09:33:53 +01:00
|
|
|
circuit)) {
|
|
|
|
circuit_json =
|
|
|
|
json_object_new_object();
|
|
|
|
json_object_int_add(
|
|
|
|
circuit_json, "circuit",
|
|
|
|
circuit->circuit_id);
|
2022-02-23 16:51:07 +01:00
|
|
|
if (!ifname)
|
|
|
|
isis_circuit_print_json(
|
|
|
|
circuit,
|
2022-02-24 09:33:53 +01:00
|
|
|
circuit_json,
|
2022-02-23 16:51:07 +01:00
|
|
|
detail);
|
|
|
|
else if (strcmp(circuit->interface->name, ifname) == 0)
|
|
|
|
isis_circuit_print_json(
|
|
|
|
circuit,
|
2022-02-24 09:33:53 +01:00
|
|
|
circuit_json,
|
2022-02-23 16:51:07 +01:00
|
|
|
detail);
|
2022-02-24 09:33:53 +01:00
|
|
|
json_object_array_add(
|
|
|
|
circuits_json,
|
|
|
|
circuit_json);
|
|
|
|
}
|
2022-02-23 16:51:07 +01:00
|
|
|
json_object_array_add(areas_json,
|
|
|
|
area_json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
if (isis != NULL) {
|
|
|
|
areas_json = json_object_new_array();
|
|
|
|
json_object_object_add(json, "areas", areas_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode,
|
|
|
|
area)) {
|
|
|
|
area_json = json_object_new_object();
|
|
|
|
json_object_string_add(area_json, "area",
|
|
|
|
area->area_tag
|
|
|
|
? area->area_tag
|
|
|
|
: "null");
|
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
circuits_json = json_object_new_array();
|
|
|
|
json_object_object_add(area_json, "circuits",
|
|
|
|
circuits_json);
|
2022-02-23 16:51:07 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list,
|
2022-02-24 09:33:53 +01:00
|
|
|
cnode, circuit)) {
|
|
|
|
circuit_json = json_object_new_object();
|
|
|
|
json_object_int_add(
|
|
|
|
circuit_json, "circuit",
|
|
|
|
circuit->circuit_id);
|
2022-02-23 16:51:07 +01:00
|
|
|
if (!ifname)
|
|
|
|
isis_circuit_print_json(
|
2022-02-24 09:33:53 +01:00
|
|
|
circuit, circuit_json,
|
2022-02-23 16:51:07 +01:00
|
|
|
detail);
|
|
|
|
else if (
|
|
|
|
strcmp(circuit->interface->name,
|
|
|
|
ifname) == 0)
|
|
|
|
isis_circuit_print_json(
|
2022-02-24 09:33:53 +01:00
|
|
|
circuit, circuit_json,
|
2022-02-23 16:51:07 +01:00
|
|
|
detail);
|
2022-02-24 09:33:53 +01:00
|
|
|
json_object_array_add(circuits_json,
|
|
|
|
circuit_json);
|
|
|
|
}
|
2022-02-23 16:51:07 +01:00
|
|
|
json_object_array_add(areas_json, area_json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
int show_isis_interface_common_vty(struct vty *vty, const char *ifname,
|
|
|
|
char detail, const char *vrf_name,
|
|
|
|
bool all_vrf)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *anode, *cnode, *inode;
|
2003-12-23 09:09:43 +01:00
|
|
|
struct isis_area *area;
|
|
|
|
struct isis_circuit *circuit;
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (!im) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
|
2020-07-13 14:37:59 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list,
|
|
|
|
anode, area)) {
|
|
|
|
vty_out(vty, "Area %s:\n",
|
|
|
|
area->area_tag);
|
|
|
|
|
|
|
|
if (detail == ISIS_UI_LEVEL_BRIEF)
|
|
|
|
vty_out(vty,
|
|
|
|
" Interface CircId State Type Level\n");
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(
|
|
|
|
area->circuit_list, cnode,
|
|
|
|
circuit))
|
|
|
|
if (!ifname)
|
|
|
|
isis_circuit_print_vty(
|
|
|
|
circuit, vty,
|
|
|
|
detail);
|
|
|
|
else if (strcmp(circuit->interface->name, ifname) == 0)
|
|
|
|
isis_circuit_print_vty(
|
|
|
|
circuit, vty,
|
|
|
|
detail);
|
|
|
|
}
|
|
|
|
}
|
2020-08-21 02:44:27 +02:00
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
if (isis != NULL) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode,
|
|
|
|
area)) {
|
|
|
|
vty_out(vty, "Area %s:\n", area->area_tag);
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (detail == ISIS_UI_LEVEL_BRIEF)
|
|
|
|
vty_out(vty,
|
|
|
|
" Interface CircId State Type Level\n");
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list,
|
|
|
|
cnode, circuit))
|
|
|
|
if (!ifname)
|
|
|
|
isis_circuit_print_vty(
|
|
|
|
circuit, vty, detail);
|
|
|
|
else if (
|
|
|
|
strcmp(circuit->interface->name,
|
2022-02-23 16:51:07 +01:00
|
|
|
ifname) == 0)
|
2020-07-13 14:37:59 +02:00
|
|
|
isis_circuit_print_vty(
|
|
|
|
circuit, vty, detail);
|
|
|
|
}
|
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_isis_interface,
|
|
|
|
show_isis_interface_cmd,
|
2022-02-23 16:51:07 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] interface [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
2022-02-23 16:51:07 +01:00
|
|
|
"json output\n"
|
2020-07-13 14:37:59 +02:00
|
|
|
"IS-IS interface\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2022-02-23 16:51:07 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-23 16:51:07 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-23 16:51:07 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
res = show_isis_interface_common(vty, json, NULL, ISIS_UI_LEVEL_BRIEF,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_isis_interface_detail,
|
|
|
|
show_isis_interface_detail_cmd,
|
2022-02-23 16:51:07 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] interface detail [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
|
|
|
"IS-IS interface\n"
|
2022-02-23 16:51:07 +01:00
|
|
|
"show detailed information\n"
|
|
|
|
"json output\n")
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2022-02-23 16:51:07 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-23 16:51:07 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-23 16:51:07 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
res = show_isis_interface_common(vty, json, NULL, ISIS_UI_LEVEL_DETAIL,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_isis_interface_arg,
|
|
|
|
show_isis_interface_arg_cmd,
|
2022-02-23 16:51:07 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] interface WORD [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
|
|
|
"IS-IS interface\n"
|
2022-02-23 16:51:07 +01:00
|
|
|
"IS-IS interface name\n"
|
|
|
|
"json output\n")
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2022-02-23 16:51:07 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
int idx_word = 0;
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-23 16:51:07 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-23 16:51:07 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
char *ifname = argv_find(argv, argc, "WORD", &idx_word)
|
|
|
|
? argv[idx_word]->arg
|
|
|
|
: NULL;
|
2022-02-23 16:51:07 +01:00
|
|
|
res = show_isis_interface_common(
|
|
|
|
vty, json, ifname, ISIS_UI_LEVEL_DETAIL, vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2021-06-11 17:27:46 +02:00
|
|
|
static int id_to_sysid(struct isis *isis, const char *id, uint8_t *sysid)
|
|
|
|
{
|
|
|
|
struct isis_dynhn *dynhn;
|
|
|
|
|
|
|
|
memset(sysid, 0, ISIS_SYS_ID_LEN);
|
|
|
|
if (id) {
|
|
|
|
if (sysid2buff(sysid, id) == 0) {
|
|
|
|
dynhn = dynhn_find_by_name(isis, id);
|
|
|
|
if (dynhn == NULL)
|
|
|
|
return -1;
|
|
|
|
memcpy(sysid, dynhn->id, ISIS_SYS_ID_LEN);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
static void isis_neighbor_common_json(struct json_object *json, const char *id,
|
|
|
|
char detail, struct isis *isis,
|
|
|
|
uint8_t *sysid)
|
|
|
|
{
|
|
|
|
struct listnode *anode, *cnode, *node;
|
|
|
|
struct isis_area *area;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
struct list *adjdb;
|
|
|
|
struct isis_adjacency *adj;
|
|
|
|
struct json_object *areas_json, *area_json;
|
|
|
|
struct json_object *circuits_json, *circuit_json;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
areas_json = json_object_new_array();
|
|
|
|
json_object_object_add(json, "areas", areas_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
|
|
|
|
area_json = json_object_new_object();
|
|
|
|
json_object_string_add(area_json, "area",
|
|
|
|
area->area_tag ? area->area_tag
|
|
|
|
: "null");
|
|
|
|
circuits_json = json_object_new_array();
|
|
|
|
json_object_object_add(area_json, "circuits", circuits_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit)) {
|
|
|
|
circuit_json = json_object_new_object();
|
|
|
|
json_object_int_add(circuit_json, "circuit",
|
|
|
|
circuit->circuit_id);
|
|
|
|
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
adjdb = circuit->u.bc.adjdb[i];
|
|
|
|
if (adjdb && adjdb->count) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(
|
|
|
|
adjdb, node, adj))
|
|
|
|
if (!id ||
|
|
|
|
!memcmp(adj->sysid,
|
|
|
|
sysid,
|
|
|
|
ISIS_SYS_ID_LEN))
|
|
|
|
isis_adj_print_json(
|
|
|
|
adj,
|
|
|
|
circuit_json,
|
|
|
|
detail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (circuit->circ_type == CIRCUIT_T_P2P &&
|
|
|
|
circuit->u.p2p.neighbor) {
|
|
|
|
adj = circuit->u.p2p.neighbor;
|
|
|
|
if (!id ||
|
|
|
|
!memcmp(adj->sysid, sysid, ISIS_SYS_ID_LEN))
|
|
|
|
isis_adj_print_json(adj, circuit_json,
|
|
|
|
detail);
|
|
|
|
}
|
|
|
|
json_object_array_add(circuits_json, circuit_json);
|
|
|
|
}
|
|
|
|
json_object_array_add(areas_json, area_json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void isis_neighbor_common_vty(struct vty *vty, const char *id,
|
|
|
|
char detail, struct isis *isis,
|
|
|
|
uint8_t *sysid)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
|
|
|
struct listnode *anode, *cnode, *node;
|
|
|
|
struct isis_area *area;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
struct list *adjdb;
|
|
|
|
struct isis_adjacency *adj;
|
|
|
|
int i;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Area %s:\n", area->area_tag);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (detail == ISIS_UI_LEVEL_BRIEF)
|
2017-07-13 18:50:29 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" System Id Interface L State Holdtime SNPA\n");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
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];
|
|
|
|
if (adjdb && adjdb->count) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(
|
|
|
|
adjdb, node, adj))
|
2022-02-24 09:33:53 +01:00
|
|
|
if (!id ||
|
|
|
|
!memcmp(adj->sysid,
|
2020-07-13 14:37:59 +02:00
|
|
|
sysid,
|
|
|
|
ISIS_SYS_ID_LEN))
|
2012-03-24 16:35:20 +01:00
|
|
|
isis_adj_print_vty(
|
|
|
|
adj,
|
|
|
|
vty,
|
|
|
|
detail);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2022-02-24 09:33:53 +01:00
|
|
|
} else if (circuit->circ_type == CIRCUIT_T_P2P &&
|
|
|
|
circuit->u.p2p.neighbor) {
|
2012-03-24 16:35:20 +01:00
|
|
|
adj = circuit->u.p2p.neighbor;
|
2022-02-24 09:33:53 +01:00
|
|
|
if (!id ||
|
|
|
|
!memcmp(adj->sysid, sysid, ISIS_SYS_ID_LEN))
|
2012-03-24 16:35:20 +01:00
|
|
|
isis_adj_print_vty(adj, vty, detail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-02-24 09:33:53 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
static void isis_neighbor_common(struct vty *vty, struct json_object *json,
|
|
|
|
const char *id, char detail, struct isis *isis,
|
|
|
|
uint8_t *sysid)
|
|
|
|
{
|
|
|
|
if (json) {
|
|
|
|
isis_neighbor_common_json(json, id, detail,isis,sysid);
|
|
|
|
} else {
|
|
|
|
isis_neighbor_common_vty(vty, id, detail,isis,sysid);
|
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2022-02-24 09:33:53 +01:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
/*
|
2020-07-13 14:37:59 +02:00
|
|
|
* 'show isis neighbor' command
|
2012-03-24 16:35:20 +01:00
|
|
|
*/
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
int show_isis_neighbor_common(struct vty *vty, struct json_object *json,
|
|
|
|
const char *id, char detail, const char *vrf_name,
|
|
|
|
bool all_vrf)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t sysid[ISIS_SYS_ID_LEN];
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (!im) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
|
2021-06-11 17:27:46 +02:00
|
|
|
if (id_to_sysid(isis, id, sysid)) {
|
|
|
|
vty_out(vty, "Invalid system id %s\n",
|
|
|
|
id);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2022-02-24 09:33:53 +01:00
|
|
|
isis_neighbor_common(vty, json, id, detail,
|
|
|
|
isis, sysid);
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
2020-08-21 02:44:27 +02:00
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
2021-06-11 17:27:46 +02:00
|
|
|
if (isis != NULL) {
|
|
|
|
if (id_to_sysid(isis, id, sysid)) {
|
|
|
|
vty_out(vty, "Invalid system id %s\n", id);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2022-02-24 09:33:53 +01:00
|
|
|
isis_neighbor_common(vty, json, id, detail, isis,
|
|
|
|
sysid);
|
2021-06-11 17:27:46 +02:00
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void isis_neighbor_common_clear(struct vty *vty, const char *id,
|
|
|
|
uint8_t *sysid, struct isis *isis)
|
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *anode, *cnode, *node, *nnode;
|
2020-07-13 14:37:59 +02:00
|
|
|
struct isis_area *area;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
struct list *adjdb;
|
|
|
|
struct isis_adjacency *adj;
|
|
|
|
int i;
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit)) {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
adjdb = circuit->u.bc.adjdb[i];
|
|
|
|
if (adjdb && adjdb->count) {
|
|
|
|
for (ALL_LIST_ELEMENTS(
|
|
|
|
adjdb, node, nnode,
|
|
|
|
adj))
|
|
|
|
if (!id
|
2020-07-13 14:37:59 +02:00
|
|
|
|| !memcmp(
|
|
|
|
adj->sysid,
|
|
|
|
sysid,
|
|
|
|
ISIS_SYS_ID_LEN))
|
2012-03-24 16:35:20 +01:00
|
|
|
isis_adj_state_change(
|
2020-04-18 02:06:07 +02:00
|
|
|
&adj,
|
2012-03-24 16:35:20 +01:00
|
|
|
ISIS_ADJ_DOWN,
|
|
|
|
"clear user request");
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
} else if (circuit->circ_type == CIRCUIT_T_P2P
|
|
|
|
&& circuit->u.p2p.neighbor) {
|
|
|
|
adj = circuit->u.p2p.neighbor;
|
|
|
|
if (!id
|
|
|
|
|| !memcmp(adj->sysid, sysid,
|
|
|
|
ISIS_SYS_ID_LEN))
|
|
|
|
isis_adj_state_change(
|
2020-04-18 02:06:07 +02:00
|
|
|
&adj, ISIS_ADJ_DOWN,
|
2012-03-24 16:35:20 +01:00
|
|
|
"clear user request");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
/*
|
|
|
|
* 'clear isis neighbor' command
|
|
|
|
*/
|
|
|
|
int clear_isis_neighbor_common(struct vty *vty, const char *id, const char *vrf_name,
|
|
|
|
bool all_vrf)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
2020-07-13 14:37:59 +02:00
|
|
|
uint8_t sysid[ISIS_SYS_ID_LEN];
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (!im) {
|
|
|
|
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2021-06-11 17:27:46 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis)) {
|
|
|
|
if (id_to_sysid(isis, id, sysid)) {
|
|
|
|
vty_out(vty, "Invalid system id %s\n",
|
|
|
|
id);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
isis_neighbor_common_clear(vty, id, sysid,
|
|
|
|
isis);
|
2021-06-11 17:27:46 +02:00
|
|
|
}
|
2020-08-21 02:44:27 +02:00
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
2021-06-11 17:27:46 +02:00
|
|
|
if (isis != NULL) {
|
|
|
|
if (id_to_sysid(isis, id, sysid)) {
|
|
|
|
vty_out(vty, "Invalid system id %s\n", id);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
isis_neighbor_common_clear(vty, id, sysid, isis);
|
2021-06-11 17:27:46 +02:00
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
return CMD_SUCCESS;
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_isis_neighbor,
|
|
|
|
show_isis_neighbor_cmd,
|
2022-02-24 09:33:53 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] neighbor [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All vrfs\n"
|
2022-02-24 09:33:53 +01:00
|
|
|
"IS-IS neighbor adjacencies\n"
|
|
|
|
"json output\n")
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2022-02-24 09:33:53 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-24 09:33:53 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-24 09:33:53 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
res = show_isis_neighbor_common(vty, json, NULL, ISIS_UI_LEVEL_BRIEF,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(show_isis_neighbor_detail,
|
|
|
|
show_isis_neighbor_detail_cmd,
|
2022-02-24 09:33:53 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] neighbor detail [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"all vrfs\n"
|
|
|
|
"IS-IS neighbor adjacencies\n"
|
2022-02-24 09:33:53 +01:00
|
|
|
"show detailed information\n"
|
|
|
|
"json output\n")
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2022-02-24 09:33:53 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-24 09:33:53 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-24 09:33:53 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
2020-07-13 14:37:59 +02:00
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
res = show_isis_neighbor_common(vty, json, NULL, ISIS_UI_LEVEL_DETAIL,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(show_isis_neighbor_arg,
|
|
|
|
show_isis_neighbor_arg_cmd,
|
2022-02-24 09:33:53 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] neighbor WORD [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All vrfs\n"
|
|
|
|
"IS-IS neighbor adjacencies\n"
|
2022-02-24 09:33:53 +01:00
|
|
|
"System id\n"
|
|
|
|
"json output\n")
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2022-02-24 09:33:53 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
int idx_word = 0;
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2022-02-24 09:33:53 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-24 09:33:53 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
2020-07-13 14:37:59 +02:00
|
|
|
char *id = argv_find(argv, argc, "WORD", &idx_word)
|
|
|
|
? argv[idx_word]->arg
|
|
|
|
: NULL;
|
|
|
|
|
2022-02-24 09:33:53 +01:00
|
|
|
res = show_isis_neighbor_common(vty, json, id, ISIS_UI_LEVEL_DETAIL,
|
|
|
|
vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(clear_isis_neighbor,
|
|
|
|
clear_isis_neighbor_cmd,
|
|
|
|
"clear " PROTO_NAME " [vrf <NAME|all>] neighbor",
|
|
|
|
CLEAR_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All vrfs\n"
|
|
|
|
"IS-IS neighbor adjacencies\n")
|
|
|
|
{
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
|
|
|
return clear_isis_neighbor_common(vty, NULL, vrf_name, all_vrf);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(clear_isis_neighbor_arg,
|
|
|
|
clear_isis_neighbor_arg_cmd,
|
|
|
|
"clear " PROTO_NAME " [vrf <NAME|all>] neighbor WORD",
|
|
|
|
CLEAR_STR
|
|
|
|
PROTO_HELP
|
|
|
|
VRF_CMD_HELP_STR
|
|
|
|
"All vrfs\n"
|
|
|
|
"IS-IS neighbor adjacencies\n"
|
|
|
|
"System id\n")
|
|
|
|
{
|
|
|
|
int idx_word = 0;
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
|
|
|
|
|
|
|
char *id = argv_find(argv, argc, "WORD", &idx_word)
|
|
|
|
? argv[idx_word]->arg
|
|
|
|
: NULL;
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
|
|
|
return clear_isis_neighbor_common(vty, id, vrf_name, all_vrf);
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
/*
|
|
|
|
* 'isis debug', 'show debugging'
|
|
|
|
*/
|
|
|
|
void print_debug(struct vty *vty, int flags, int onoff)
|
|
|
|
{
|
2019-05-29 14:44:07 +02:00
|
|
|
const char *onoffs = onoff ? "on" : "off";
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_ADJ_PACKETS)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"IS-IS Adjacency related packets debugging is %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
onoffs);
|
2018-11-16 16:05:54 +01:00
|
|
|
if (flags & DEBUG_TX_QUEUE)
|
|
|
|
vty_out(vty, "IS-IS TX queue debugging is %s\n",
|
|
|
|
onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_SNP_PACKETS)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS CSNP/PSNP packets debugging is %s\n",
|
|
|
|
onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_SPF_EVENTS)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS SPF events debugging is %s\n", onoffs);
|
2019-08-04 03:02:37 +02:00
|
|
|
if (flags & DEBUG_SR)
|
|
|
|
vty_out(vty, "IS-IS Segment Routing events debugging is %s\n",
|
|
|
|
onoffs);
|
2021-06-22 19:59:02 +02:00
|
|
|
if (flags & DEBUG_TE)
|
|
|
|
vty_out(vty,
|
|
|
|
"IS-IS Traffic Engineering events debugging is %s\n",
|
|
|
|
onoffs);
|
2020-11-20 22:59:35 +01:00
|
|
|
if (flags & DEBUG_LFA)
|
|
|
|
vty_out(vty, "IS-IS LFA events debugging is %s\n", onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_UPDATE_PACKETS)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS Update related packet debugging is %s\n",
|
|
|
|
onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_RTE_EVENTS)
|
2022-03-31 11:19:26 +02:00
|
|
|
vty_out(vty, "IS-IS Route related debugging is %s\n", onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
if (flags & DEBUG_EVENTS)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS Event debugging is %s\n", onoffs);
|
2012-03-24 16:35:20 +01:00
|
|
|
if (flags & DEBUG_PACKET_DUMP)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS Packet dump debugging is %s\n", onoffs);
|
2015-11-12 14:21:47 +01:00
|
|
|
if (flags & DEBUG_LSP_GEN)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS LSP generation debugging is %s\n", onoffs);
|
2015-11-10 18:43:34 +01:00
|
|
|
if (flags & DEBUG_LSP_SCHED)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "IS-IS LSP scheduling debugging is %s\n", onoffs);
|
2018-11-16 16:31:37 +01:00
|
|
|
if (flags & DEBUG_FLOODING)
|
|
|
|
vty_out(vty, "IS-IS Flooding debugging is %s\n", onoffs);
|
2018-09-28 19:35:10 +02:00
|
|
|
if (flags & DEBUG_BFD)
|
|
|
|
vty_out(vty, "IS-IS BFD debugging is %s\n", onoffs);
|
2020-07-22 20:32:35 +02:00
|
|
|
if (flags & DEBUG_LDP_SYNC)
|
|
|
|
vty_out(vty, "IS-IS ldp-sync debugging is %s\n", onoffs);
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2017-08-18 18:50:13 +02:00
|
|
|
DEFUN_NOSH (show_debugging,
|
|
|
|
show_debugging_isis_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"show debugging [" PROTO_NAME "]",
|
2017-08-18 18:50:13 +02:00
|
|
|
SHOW_STR
|
|
|
|
"State of each debugging option\n"
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, PROTO_NAME " debugging status:\n");
|
2017-08-18 18:50:13 +02:00
|
|
|
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_ADJ_PACKETS)
|
|
|
|
print_debug(vty, DEBUG_ADJ_PACKETS, 1);
|
|
|
|
if (IS_DEBUG_TX_QUEUE)
|
|
|
|
print_debug(vty, DEBUG_TX_QUEUE, 1);
|
|
|
|
if (IS_DEBUG_SNP_PACKETS)
|
|
|
|
print_debug(vty, DEBUG_SNP_PACKETS, 1);
|
|
|
|
if (IS_DEBUG_SPF_EVENTS)
|
|
|
|
print_debug(vty, DEBUG_SPF_EVENTS, 1);
|
|
|
|
if (IS_DEBUG_SR)
|
|
|
|
print_debug(vty, DEBUG_SR, 1);
|
2021-06-22 19:59:02 +02:00
|
|
|
if (IS_DEBUG_TE)
|
|
|
|
print_debug(vty, DEBUG_TE, 1);
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_UPDATE_PACKETS)
|
|
|
|
print_debug(vty, DEBUG_UPDATE_PACKETS, 1);
|
|
|
|
if (IS_DEBUG_RTE_EVENTS)
|
|
|
|
print_debug(vty, DEBUG_RTE_EVENTS, 1);
|
|
|
|
if (IS_DEBUG_EVENTS)
|
|
|
|
print_debug(vty, DEBUG_EVENTS, 1);
|
|
|
|
if (IS_DEBUG_PACKET_DUMP)
|
|
|
|
print_debug(vty, DEBUG_PACKET_DUMP, 1);
|
|
|
|
if (IS_DEBUG_LSP_GEN)
|
|
|
|
print_debug(vty, DEBUG_LSP_GEN, 1);
|
|
|
|
if (IS_DEBUG_LSP_SCHED)
|
|
|
|
print_debug(vty, DEBUG_LSP_SCHED, 1);
|
|
|
|
if (IS_DEBUG_FLOODING)
|
|
|
|
print_debug(vty, DEBUG_FLOODING, 1);
|
|
|
|
if (IS_DEBUG_BFD)
|
|
|
|
print_debug(vty, DEBUG_BFD, 1);
|
2020-07-22 20:32:35 +02:00
|
|
|
if (IS_DEBUG_LDP_SYNC)
|
|
|
|
print_debug(vty, DEBUG_LDP_SYNC, 1);
|
2021-04-28 11:16:51 +02:00
|
|
|
if (IS_DEBUG_LFA)
|
|
|
|
print_debug(vty, DEBUG_LFA, 1);
|
|
|
|
|
2022-10-07 13:51:17 +02:00
|
|
|
cmd_show_lib_debugs(vty);
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2018-09-08 22:31:43 +02:00
|
|
|
static int config_write_debug(struct vty *vty);
|
2003-12-23 09:56:18 +01:00
|
|
|
/* Debug node. */
|
2018-09-08 21:46:23 +02:00
|
|
|
static struct cmd_node debug_node = {
|
2018-09-09 00:15:50 +02:00
|
|
|
.name = "debug",
|
2018-09-08 21:46:23 +02:00
|
|
|
.node = DEBUG_NODE,
|
|
|
|
.prompt = "",
|
2018-09-08 22:31:43 +02:00
|
|
|
.config_write = config_write_debug,
|
2018-09-08 21:46:23 +02:00
|
|
|
};
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:56:18 +01:00
|
|
|
static int config_write_debug(struct vty *vty)
|
|
|
|
{
|
|
|
|
int write = 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_ADJ_PACKETS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " adj-packets\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_TX_QUEUE) {
|
2018-11-16 16:05:54 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " tx-queue\n");
|
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_SNP_PACKETS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " snp-packets\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_SPF_EVENTS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " spf-events\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_SR) {
|
2019-08-04 03:02:37 +02:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " sr-events\n");
|
|
|
|
write++;
|
|
|
|
}
|
2021-06-22 19:59:02 +02:00
|
|
|
if (IS_DEBUG_TE) {
|
|
|
|
vty_out(vty, "debug " PROTO_NAME " te-events\n");
|
|
|
|
write++;
|
|
|
|
}
|
2020-11-20 22:59:35 +01:00
|
|
|
if (IS_DEBUG_LFA) {
|
|
|
|
vty_out(vty, "debug " PROTO_NAME " lfa\n");
|
2020-08-21 00:55:42 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_UPDATE_PACKETS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " update-packets\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_RTE_EVENTS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " route-events\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_EVENTS) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " events\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_PACKET_DUMP) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " packet-dump\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_LSP_GEN) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " lsp-gen\n");
|
2015-11-12 14:21:47 +01:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_LSP_SCHED) {
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " lsp-sched\n");
|
2015-11-10 18:43:34 +01:00
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_FLOODING) {
|
2018-07-25 11:01:59 +02:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " flooding\n");
|
|
|
|
write++;
|
|
|
|
}
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_BFD) {
|
2018-09-28 19:35:10 +02:00
|
|
|
vty_out(vty, "debug " PROTO_NAME " bfd\n");
|
|
|
|
write++;
|
|
|
|
}
|
2020-07-22 20:32:35 +02:00
|
|
|
if (IS_DEBUG_LDP_SYNC) {
|
|
|
|
vty_out(vty, "debug " PROTO_NAME " ldp-sync\n");
|
|
|
|
write++;
|
|
|
|
}
|
2017-02-21 23:52:29 +01:00
|
|
|
write += spf_backoff_write_config(vty);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:56:18 +01:00
|
|
|
return write;
|
|
|
|
}
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
DEFUN (debug_isis_adj,
|
|
|
|
debug_isis_adj_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " adj-packets",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Adjacency related packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_adj_pkt |= DEBUG_ADJ_PACKETS;
|
2004-09-10 22:48:21 +02:00
|
|
|
print_debug(vty, DEBUG_ADJ_PACKETS, 1);
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_adj,
|
|
|
|
no_debug_isis_adj_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " adj-packets",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Adjacency related packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_adj_pkt &= ~DEBUG_ADJ_PACKETS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_ADJ_PACKETS, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2018-11-16 16:05:54 +01:00
|
|
|
DEFUN (debug_isis_tx_queue,
|
|
|
|
debug_isis_tx_queue_cmd,
|
|
|
|
"debug " PROTO_NAME " tx-queue",
|
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"IS-IS TX queues\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_tx_queue |= DEBUG_TX_QUEUE;
|
2018-11-16 16:05:54 +01:00
|
|
|
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")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_tx_queue &= ~DEBUG_TX_QUEUE;
|
2018-11-16 16:05:54 +01:00
|
|
|
print_debug(vty, DEBUG_TX_QUEUE, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2018-11-16 16:31:37 +01:00
|
|
|
DEFUN (debug_isis_flooding,
|
|
|
|
debug_isis_flooding_cmd,
|
|
|
|
"debug " PROTO_NAME " flooding",
|
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"Flooding algorithm\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_flooding |= DEBUG_FLOODING;
|
2018-11-16 16:31:37 +01:00
|
|
|
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")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_flooding &= ~DEBUG_FLOODING;
|
2018-11-16 16:31:37 +01:00
|
|
|
print_debug(vty, DEBUG_FLOODING, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
DEFUN (debug_isis_snp,
|
|
|
|
debug_isis_snp_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " snp-packets",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS CSNP/PSNP packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_snp_pkt |= DEBUG_SNP_PACKETS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_SNP_PACKETS, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_snp,
|
|
|
|
no_debug_isis_snp_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " snp-packets",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS CSNP/PSNP packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_snp_pkt &= ~DEBUG_SNP_PACKETS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_SNP_PACKETS, 0);
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (debug_isis_upd,
|
|
|
|
debug_isis_upd_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " update-packets",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Update related packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_update_pkt |= DEBUG_UPDATE_PACKETS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_UPDATE_PACKETS, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_upd,
|
|
|
|
no_debug_isis_upd_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " update-packets",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Update related packets\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_update_pkt &= ~DEBUG_UPDATE_PACKETS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_UPDATE_PACKETS, 0);
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (debug_isis_spfevents,
|
|
|
|
debug_isis_spfevents_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " spf-events",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Shortest Path First Events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_spf_events |= DEBUG_SPF_EVENTS;
|
2004-09-10 22:48:21 +02:00
|
|
|
print_debug(vty, DEBUG_SPF_EVENTS, 1);
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_spfevents,
|
|
|
|
no_debug_isis_spfevents_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " spf-events",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Shortest Path First Events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_spf_events &= ~DEBUG_SPF_EVENTS;
|
2004-09-10 22:48:21 +02:00
|
|
|
print_debug(vty, DEBUG_SPF_EVENTS, 0);
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-08-04 03:02:37 +02:00
|
|
|
DEFUN (debug_isis_srevents,
|
|
|
|
debug_isis_srevents_cmd,
|
|
|
|
"debug " PROTO_NAME " sr-events",
|
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"IS-IS Segment Routing Events\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_sr |= DEBUG_SR;
|
2019-08-04 03:02:37 +02:00
|
|
|
print_debug(vty, DEBUG_SR, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_srevents,
|
|
|
|
no_debug_isis_srevents_cmd,
|
|
|
|
"no debug " PROTO_NAME " sr-events",
|
|
|
|
NO_STR
|
|
|
|
UNDEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"IS-IS Segment Routing Events\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_sr &= ~DEBUG_SR;
|
2019-08-04 03:02:37 +02:00
|
|
|
print_debug(vty, DEBUG_SR, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-06-22 19:59:02 +02:00
|
|
|
DEFUN (debug_isis_teevents,
|
|
|
|
debug_isis_teevents_cmd,
|
|
|
|
"debug " PROTO_NAME " te-events",
|
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"IS-IS Traffic Engineering Events\n")
|
|
|
|
{
|
|
|
|
debug_te |= DEBUG_TE;
|
|
|
|
print_debug(vty, DEBUG_TE, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_teevents,
|
|
|
|
no_debug_isis_teevents_cmd,
|
|
|
|
"no debug " PROTO_NAME " te-events",
|
|
|
|
NO_STR
|
|
|
|
UNDEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"IS-IS Traffic Engineering Events\n")
|
|
|
|
{
|
|
|
|
debug_te &= ~DEBUG_TE;
|
|
|
|
print_debug(vty, DEBUG_TE, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-11-20 22:59:35 +01:00
|
|
|
DEFUN (debug_isis_lfa,
|
|
|
|
debug_isis_lfa_cmd,
|
|
|
|
"debug " PROTO_NAME " lfa",
|
2020-08-21 00:55:42 +02:00
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
2020-11-20 22:59:35 +01:00
|
|
|
"IS-IS LFA Events\n")
|
2020-08-21 00:55:42 +02:00
|
|
|
{
|
2020-11-20 22:59:35 +01:00
|
|
|
debug_lfa |= DEBUG_LFA;
|
|
|
|
print_debug(vty, DEBUG_LFA, 1);
|
2020-08-21 00:55:42 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-11-20 22:59:35 +01:00
|
|
|
DEFUN (no_debug_isis_lfa,
|
|
|
|
no_debug_isis_lfa_cmd,
|
|
|
|
"no debug " PROTO_NAME " lfa",
|
2020-08-21 00:55:42 +02:00
|
|
|
NO_STR
|
|
|
|
UNDEBUG_STR
|
|
|
|
PROTO_HELP
|
2020-11-20 22:59:35 +01:00
|
|
|
"IS-IS LFA Events\n")
|
2020-08-21 00:55:42 +02:00
|
|
|
{
|
2020-11-20 22:59:35 +01:00
|
|
|
debug_lfa &= ~DEBUG_LFA;
|
|
|
|
print_debug(vty, DEBUG_LFA, 0);
|
2020-08-21 00:55:42 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
DEFUN (debug_isis_rtevents,
|
|
|
|
debug_isis_rtevents_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " route-events",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Route related events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_rte_events |= DEBUG_RTE_EVENTS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_RTE_EVENTS, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_rtevents,
|
|
|
|
no_debug_isis_rtevents_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " route-events",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Route related events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_rte_events &= ~DEBUG_RTE_EVENTS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_RTE_EVENTS, 0);
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (debug_isis_events,
|
|
|
|
debug_isis_events_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " events",
|
2003-12-23 09:09:43 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2005-09-19 06:23:34 +02:00
|
|
|
"IS-IS Events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_events |= DEBUG_EVENTS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_EVENTS, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_events,
|
|
|
|
no_debug_isis_events_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " events",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2003-12-23 09:09:43 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2004-09-10 22:48:21 +02:00
|
|
|
"IS-IS Events\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_events &= ~DEBUG_EVENTS;
|
2003-12-23 09:09:43 +01:00
|
|
|
print_debug(vty, DEBUG_EVENTS, 0);
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
DEFUN (debug_isis_packet_dump,
|
|
|
|
debug_isis_packet_dump_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " packet-dump",
|
2012-03-24 16:35:20 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2012-03-24 16:35:20 +01:00
|
|
|
"IS-IS packet dump\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_pkt_dump |= DEBUG_PACKET_DUMP;
|
2012-03-24 16:35:20 +01:00
|
|
|
print_debug(vty, DEBUG_PACKET_DUMP, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_packet_dump,
|
|
|
|
no_debug_isis_packet_dump_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " packet-dump",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2012-03-24 16:35:20 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2012-03-24 16:35:20 +01:00
|
|
|
"IS-IS packet dump\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_pkt_dump &= ~DEBUG_PACKET_DUMP;
|
2012-03-24 16:35:20 +01:00
|
|
|
print_debug(vty, DEBUG_PACKET_DUMP, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-11-12 14:21:47 +01:00
|
|
|
DEFUN (debug_isis_lsp_gen,
|
|
|
|
debug_isis_lsp_gen_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " lsp-gen",
|
2015-11-12 14:21:47 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2015-11-12 14:21:47 +01:00
|
|
|
"IS-IS generation of own LSPs\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_lsp_gen |= DEBUG_LSP_GEN;
|
2015-11-12 14:21:47 +01:00
|
|
|
print_debug(vty, DEBUG_LSP_GEN, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_debug_isis_lsp_gen,
|
|
|
|
no_debug_isis_lsp_gen_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " lsp-gen",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2015-11-12 14:21:47 +01:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2015-11-12 14:21:47 +01:00
|
|
|
"IS-IS generation of own LSPs\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_lsp_gen &= ~DEBUG_LSP_GEN;
|
2015-11-12 14:21:47 +01:00
|
|
|
print_debug(vty, DEBUG_LSP_GEN, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2015-11-10 18:43:34 +01:00
|
|
|
DEFUN (debug_isis_lsp_sched,
|
|
|
|
debug_isis_lsp_sched_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"debug " PROTO_NAME " lsp-sched",
|
2015-11-10 18:43:34 +01:00
|
|
|
DEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2015-11-10 18:43:34 +01:00
|
|
|
"IS-IS scheduling of LSP generation\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_lsp_sched |= DEBUG_LSP_SCHED;
|
2015-11-10 18:43:34 +01:00
|
|
|
print_debug(vty, DEBUG_LSP_SCHED, 1);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2016-09-17 13:25:35 +02:00
|
|
|
DEFUN (no_debug_isis_lsp_sched,
|
|
|
|
no_debug_isis_lsp_sched_cmd,
|
2018-03-22 15:01:08 +01:00
|
|
|
"no debug " PROTO_NAME " lsp-sched",
|
2016-11-05 00:03:03 +01:00
|
|
|
NO_STR
|
2016-09-17 13:25:35 +02:00
|
|
|
UNDEBUG_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2016-09-17 13:25:35 +02:00
|
|
|
"IS-IS scheduling of LSP generation\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_lsp_sched &= ~DEBUG_LSP_SCHED;
|
2016-09-17 13:25:35 +02:00
|
|
|
print_debug(vty, DEBUG_LSP_SCHED, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2018-09-28 19:35:10 +02:00
|
|
|
DEFUN (debug_isis_bfd,
|
|
|
|
debug_isis_bfd_cmd,
|
|
|
|
"debug " PROTO_NAME " bfd",
|
|
|
|
DEBUG_STR
|
|
|
|
PROTO_HELP
|
|
|
|
PROTO_NAME " interaction with BFD\n")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_bfd |= DEBUG_BFD;
|
2022-04-07 11:13:34 +02:00
|
|
|
bfd_protocol_integration_set_debug(true);
|
2018-09-28 19:35:10 +02:00
|
|
|
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")
|
|
|
|
{
|
2020-06-19 21:04:33 +02:00
|
|
|
debug_bfd &= ~DEBUG_BFD;
|
2022-04-07 11:13:34 +02:00
|
|
|
bfd_protocol_integration_set_debug(false);
|
2018-09-28 19:35:10 +02:00
|
|
|
print_debug(vty, DEBUG_BFD, 0);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-07-22 20:32:35 +02:00
|
|
|
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")
|
|
|
|
{
|
|
|
|
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,
|
2021-05-21 19:13:51 +02:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] hostname",
|
|
|
|
SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
2020-07-22 20:32:35 +02:00
|
|
|
"IS-IS Dynamic hostname mapping\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
int idx_vrf = 0;
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2020-07-13 14:37:59 +02:00
|
|
|
dynhn_print_all(vty, isis);
|
2020-08-21 02:44:27 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
if (isis != NULL)
|
|
|
|
dynhn_print_all(vty, isis);
|
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
static void isis_spf_ietf_common(struct vty *vty, struct isis *isis)
|
2017-02-21 23:52:29 +01:00
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct isis_area *area;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
vty_out(vty, "vrf : %s\n", isis->name);
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Area %s:\n",
|
|
|
|
area->area_tag ? area->area_tag : "null");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) {
|
|
|
|
if ((area->is_type & level) == 0)
|
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Level-%d:\n", level);
|
2017-02-21 23:52:29 +01:00
|
|
|
vty_out(vty, " SPF delay status: ");
|
|
|
|
if (area->spf_timer[level - 1]) {
|
2022-12-11 14:19:00 +01:00
|
|
|
struct timeval remain = event_timer_remain(
|
2017-02-21 23:52:29 +01:00
|
|
|
area->spf_timer[level - 1]);
|
2017-08-26 01:14:25 +02:00
|
|
|
vty_out(vty, "Pending, due in %lld msec\n",
|
|
|
|
(long long)remain.tv_sec * 1000
|
2017-06-21 05:10:57 +02:00
|
|
|
+ remain.tv_usec / 1000);
|
2017-02-21 23:52:29 +01:00
|
|
|
} else {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Not scheduled\n");
|
2017-02-21 23:52:29 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
if (area->spf_delay_ietf[level - 1]) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" Using draft-ietf-rtgwg-backoff-algo-04\n");
|
2017-02-21 23:52:29 +01:00
|
|
|
spf_backoff_show(
|
|
|
|
area->spf_delay_ietf[level - 1], vty,
|
|
|
|
" ");
|
|
|
|
} else {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Using legacy backoff algo\n");
|
2017-02-21 23:52:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(show_isis_spf_ietf, show_isis_spf_ietf_cmd,
|
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] spf-delay-ietf",
|
|
|
|
SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
|
|
|
"SPF delay IETF information\n")
|
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
int idx_vrf = 0;
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf)
|
|
|
|
|
|
|
|
if (!im) {
|
|
|
|
vty_out(vty, "ISIS is not running\n");
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2020-07-13 14:37:59 +02:00
|
|
|
isis_spf_ietf_common(vty, isis);
|
2020-08-21 02:44:27 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
if (isis != NULL)
|
|
|
|
isis_spf_ietf_common(vty, isis);
|
|
|
|
}
|
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2022-02-23 12:41:04 +01:00
|
|
|
|
|
|
|
static const char *pdu_counter_index_to_name_json(enum pdu_counter_index index)
|
|
|
|
{
|
|
|
|
switch (index) {
|
|
|
|
case L1_LAN_HELLO_INDEX:
|
|
|
|
return "l1-iih";
|
|
|
|
case L2_LAN_HELLO_INDEX:
|
|
|
|
return "l2-iih";
|
|
|
|
case P2P_HELLO_INDEX:
|
|
|
|
return "p2p-iih";
|
|
|
|
case L1_LINK_STATE_INDEX:
|
|
|
|
return "l1-lsp";
|
|
|
|
case L2_LINK_STATE_INDEX:
|
|
|
|
return "l2-lsp";
|
|
|
|
case FS_LINK_STATE_INDEX:
|
|
|
|
return "fs-lsp";
|
|
|
|
case L1_COMPLETE_SEQ_NUM_INDEX:
|
|
|
|
return "l1-csnp";
|
|
|
|
case L2_COMPLETE_SEQ_NUM_INDEX:
|
|
|
|
return "l2-csnp";
|
|
|
|
case L1_PARTIAL_SEQ_NUM_INDEX:
|
|
|
|
return "l1-psnp";
|
|
|
|
case L2_PARTIAL_SEQ_NUM_INDEX:
|
|
|
|
return "l2-psnp";
|
2023-01-30 16:08:47 +01:00
|
|
|
case PDU_COUNTER_SIZE:
|
2022-02-23 12:41:04 +01:00
|
|
|
return "???????";
|
|
|
|
}
|
2023-01-30 16:08:47 +01:00
|
|
|
|
|
|
|
assert(!"Reached end of function where we are not expecting to");
|
2022-02-23 12:41:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void common_isis_summary_json(struct json_object *json,
|
|
|
|
struct isis *isis)
|
|
|
|
{
|
|
|
|
int level;
|
|
|
|
json_object *areas_json, *area_json, *tx_pdu_json, *rx_pdu_json,
|
|
|
|
*levels_json, *level_json;
|
|
|
|
struct listnode *node, *node2;
|
|
|
|
struct isis_area *area;
|
|
|
|
time_t cur;
|
|
|
|
char uptime[MONOTIME_STRLEN];
|
|
|
|
char stier[5];
|
|
|
|
json_object_string_add(json, "vrf", isis->name);
|
|
|
|
json_object_int_add(json, "process-id", isis->process_id);
|
|
|
|
if (isis->sysid_set)
|
|
|
|
json_object_string_add(json, "system-id",
|
|
|
|
sysid_print(isis->sysid));
|
|
|
|
|
|
|
|
cur = time(NULL);
|
|
|
|
cur -= isis->uptime;
|
|
|
|
frrtime_to_interval(cur, uptime, sizeof(uptime));
|
|
|
|
json_object_string_add(json, "up-time", uptime);
|
|
|
|
if (isis->area_list)
|
|
|
|
json_object_int_add(json, "number-areas",
|
|
|
|
isis->area_list->count);
|
|
|
|
areas_json = json_object_new_array();
|
|
|
|
json_object_object_add(json, "areas", areas_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
|
|
|
area_json = json_object_new_object();
|
|
|
|
json_object_string_add(area_json, "area",
|
|
|
|
area->area_tag ? area->area_tag
|
|
|
|
: "null");
|
|
|
|
|
|
|
|
|
|
|
|
if (fabricd) {
|
|
|
|
uint8_t tier = fabricd_tier(area);
|
|
|
|
snprintfrr(stier, sizeof(stier), "%s", &tier);
|
|
|
|
json_object_string_add(area_json, "tier",
|
|
|
|
tier == ISIS_TIER_UNDEFINED
|
|
|
|
? "undefined"
|
|
|
|
: stier);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listcount(area->area_addrs) > 0) {
|
|
|
|
struct area_addr *area_addr;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node2,
|
|
|
|
area_addr)) {
|
|
|
|
json_object_string_add(
|
|
|
|
area_json, "net",
|
|
|
|
isonet_print(area_addr->area_addr,
|
|
|
|
area_addr->addr_len +
|
|
|
|
ISIS_SYS_ID_LEN +
|
|
|
|
1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tx_pdu_json = json_object_new_object();
|
|
|
|
json_object_object_add(area_json, "tx-pdu-type", tx_pdu_json);
|
|
|
|
for (int i = 0; i < PDU_COUNTER_SIZE; i++) {
|
|
|
|
if (!area->pdu_tx_counters[i])
|
|
|
|
continue;
|
|
|
|
json_object_int_add(tx_pdu_json,
|
|
|
|
pdu_counter_index_to_name_json(i),
|
|
|
|
area->pdu_tx_counters[i]);
|
|
|
|
}
|
|
|
|
json_object_int_add(tx_pdu_json, "lsp-rxmt",
|
|
|
|
area->lsp_rxmt_count);
|
|
|
|
|
|
|
|
rx_pdu_json = json_object_new_object();
|
|
|
|
json_object_object_add(area_json, "rx-pdu-type", rx_pdu_json);
|
|
|
|
for (int i = 0; i < PDU_COUNTER_SIZE; i++) {
|
|
|
|
if (!area->pdu_rx_counters[i])
|
|
|
|
continue;
|
|
|
|
json_object_int_add(rx_pdu_json,
|
|
|
|
pdu_counter_index_to_name_json(i),
|
|
|
|
area->pdu_rx_counters[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
levels_json = json_object_new_array();
|
|
|
|
json_object_object_add(area_json, "levels", levels_json);
|
|
|
|
for (level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) {
|
|
|
|
if ((area->is_type & level) == 0)
|
|
|
|
continue;
|
|
|
|
level_json = json_object_new_object();
|
|
|
|
json_object_int_add(level_json, "id", level);
|
|
|
|
json_object_int_add(level_json, "lsp0-regenerated",
|
|
|
|
area->lsp_gen_count[level - 1]);
|
|
|
|
json_object_int_add(level_json, "lsp-purged",
|
|
|
|
area->lsp_purge_count[level - 1]);
|
|
|
|
if (area->spf_timer[level - 1])
|
|
|
|
json_object_string_add(level_json, "spf",
|
|
|
|
"pending");
|
|
|
|
else
|
|
|
|
json_object_string_add(level_json, "spf",
|
|
|
|
"no pending");
|
|
|
|
json_object_int_add(level_json, "minimum-interval",
|
|
|
|
area->min_spf_interval[level - 1]);
|
|
|
|
if (area->spf_delay_ietf[level - 1])
|
|
|
|
json_object_string_add(
|
|
|
|
level_json, "ietf-spf-delay-activated",
|
|
|
|
"not used");
|
|
|
|
if (area->ip_circuits) {
|
|
|
|
isis_spf_print_json(
|
|
|
|
area->spftree[SPFTREE_IPV4][level - 1],
|
|
|
|
level_json);
|
|
|
|
}
|
|
|
|
if (area->ipv6_circuits) {
|
|
|
|
isis_spf_print_json(
|
|
|
|
area->spftree[SPFTREE_IPV6][level - 1],
|
|
|
|
level_json);
|
|
|
|
}
|
|
|
|
json_object_array_add(levels_json, level_json);
|
|
|
|
}
|
|
|
|
json_object_array_add(areas_json, area_json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void common_isis_summary_vty(struct vty *vty, struct isis *isis)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
|
|
|
struct listnode *node, *node2;
|
2003-12-23 09:09:43 +01:00
|
|
|
struct isis_area *area;
|
2012-03-24 16:35:20 +01:00
|
|
|
int level;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
vty_out(vty, "vrf : %s\n", isis->name);
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Process Id : %ld\n", isis->process_id);
|
2012-03-24 16:35:20 +01:00
|
|
|
if (isis->sysid_set)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "System Id : %s\n",
|
|
|
|
sysid_print(isis->sysid));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
vty_out(vty, "Up time : ");
|
|
|
|
vty_out_timestr(vty, isis->uptime);
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (isis->area_list)
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Number of areas : %d\n", isis->area_list->count);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Area %s:\n",
|
|
|
|
area->area_tag ? area->area_tag : "null");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-05-10 19:05:40 +02:00
|
|
|
if (fabricd) {
|
|
|
|
uint8_t tier = fabricd_tier(area);
|
|
|
|
if (tier == ISIS_TIER_UNDEFINED)
|
|
|
|
vty_out(vty, " Tier: undefined\n");
|
|
|
|
else
|
2020-03-27 12:51:47 +01:00
|
|
|
vty_out(vty, " Tier: %hhu\n", tier);
|
2018-05-10 19:05:40 +02:00
|
|
|
}
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (listcount(area->area_addrs) > 0) {
|
|
|
|
struct area_addr *area_addr;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->area_addrs, node2,
|
|
|
|
area_addr)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Net: %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
isonet_print(area_addr->area_addr,
|
|
|
|
area_addr->addr_len
|
|
|
|
+ ISIS_SYS_ID_LEN
|
|
|
|
+ 1));
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2018-11-23 17:50:33 +01:00
|
|
|
vty_out(vty, " TX counters per PDU type:\n");
|
|
|
|
pdu_counter_print(vty, " ", area->pdu_tx_counters);
|
2018-11-23 21:32:18 +01:00
|
|
|
vty_out(vty, " LSP RXMT: %" PRIu64 "\n",
|
|
|
|
area->lsp_rxmt_count);
|
2018-11-23 17:50:33 +01:00
|
|
|
vty_out(vty, " RX counters per PDU type:\n");
|
|
|
|
pdu_counter_print(vty, " ", area->pdu_rx_counters);
|
|
|
|
|
2023-01-06 19:06:23 +01:00
|
|
|
vty_out(vty, " Advertise high metrics: %s\n",
|
|
|
|
area->advertise_high_metrics ? "Enabled" : "Disabled");
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
for (level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) {
|
|
|
|
if ((area->is_type & level) == 0)
|
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " Level-%d:\n", level);
|
2018-11-23 21:36:26 +01:00
|
|
|
|
|
|
|
vty_out(vty, " LSP0 regenerated: %" PRIu64 "\n",
|
|
|
|
area->lsp_gen_count[level - 1]);
|
|
|
|
|
2018-11-24 00:36:37 +01:00
|
|
|
vty_out(vty, " LSPs purged: %" PRIu64 "\n",
|
|
|
|
area->lsp_purge_count[level - 1]);
|
|
|
|
|
2017-02-20 10:51:47 +01:00
|
|
|
if (area->spf_timer[level - 1])
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " SPF: (pending)\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
else
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " SPF:\n");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-20 10:51:47 +01:00
|
|
|
vty_out(vty, " minimum interval : %d",
|
|
|
|
area->min_spf_interval[level - 1]);
|
2017-02-21 23:52:29 +01:00
|
|
|
if (area->spf_delay_ietf[level - 1])
|
|
|
|
vty_out(vty,
|
|
|
|
" (not used, IETF SPF delay activated)");
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-10 18:11:19 +02:00
|
|
|
if (area->ip_circuits) {
|
|
|
|
vty_out(vty, " IPv4 route computation:\n");
|
|
|
|
isis_spf_print(
|
|
|
|
area->spftree[SPFTREE_IPV4][level - 1],
|
|
|
|
vty);
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-10 18:11:19 +02:00
|
|
|
if (area->ipv6_circuits) {
|
|
|
|
vty_out(vty, " IPv6 route computation:\n");
|
|
|
|
isis_spf_print(
|
|
|
|
area->spftree[SPFTREE_IPV6][level - 1],
|
|
|
|
vty);
|
|
|
|
}
|
2018-07-26 22:53:08 +02:00
|
|
|
|
2020-08-10 18:11:19 +02:00
|
|
|
if (area->ipv6_circuits
|
|
|
|
&& isis_area_ipv6_dstsrc_enabled(area)) {
|
|
|
|
vty_out(vty,
|
|
|
|
" IPv6 dst-src route computation:\n");
|
|
|
|
isis_spf_print(area->spftree[SPFTREE_DSTSRC]
|
|
|
|
[level - 1],
|
|
|
|
vty);
|
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
2022-02-23 12:41:04 +01:00
|
|
|
static void common_isis_summary(struct vty *vty, struct json_object *json,
|
|
|
|
struct isis *isis)
|
|
|
|
{
|
|
|
|
if (json) {
|
|
|
|
common_isis_summary_json(json, isis);
|
|
|
|
} else {
|
|
|
|
common_isis_summary_vty(vty, isis);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_isis_summary, show_isis_summary_cmd,
|
2022-02-23 12:41:04 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] summary [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
2022-02-23 12:41:04 +01:00
|
|
|
"json output\n"
|
2020-07-13 14:37:59 +02:00
|
|
|
"summary\n")
|
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
2020-07-13 14:37:59 +02:00
|
|
|
int idx_vrf = 0;
|
2020-08-21 02:44:27 +02:00
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
2022-02-23 12:41:04 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf)
|
|
|
|
if (!im) {
|
|
|
|
vty_out(vty, PROTO_NAME " is not running\n");
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2022-02-23 12:41:04 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
2020-07-13 14:37:59 +02:00
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2022-02-23 12:41:04 +01:00
|
|
|
common_isis_summary(vty, json, isis);
|
2020-08-21 02:44:27 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
|
|
|
if (isis != NULL)
|
2022-02-23 12:41:04 +01:00
|
|
|
common_isis_summary(vty, json, isis);
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
|
2022-02-23 12:41:04 +01:00
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2021-06-22 18:44:24 +02:00
|
|
|
struct isis_lsp *lsp_for_sysid(struct lspdb_head *head, const char *sysid_str,
|
|
|
|
struct isis *isis)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2018-11-23 01:38:24 +01:00
|
|
|
char sysid[255] = {0};
|
2021-06-22 16:53:26 +02:00
|
|
|
uint8_t number[3] = {0};
|
2018-11-23 01:38:24 +01:00
|
|
|
const char *pos;
|
|
|
|
uint8_t lspid[ISIS_SYS_ID_LEN + 2] = {0};
|
|
|
|
struct isis_dynhn *dynhn;
|
|
|
|
struct isis_lsp *lsp = NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-06-22 18:44:24 +02:00
|
|
|
if (!sysid_str)
|
2018-11-23 01:38:24 +01:00
|
|
|
return NULL;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
/*
|
2021-06-22 18:44:24 +02:00
|
|
|
* extract fragment and pseudo id from the string sysid_str
|
2012-03-24 16:35:20 +01:00
|
|
|
* in the forms:
|
|
|
|
* (a) <systemid/hostname>.<pseudo-id>-<framenent> or
|
|
|
|
* (b) <systemid/hostname>.<pseudo-id> or
|
|
|
|
* (c) <systemid/hostname> or
|
|
|
|
* Where systemid is in the form:
|
|
|
|
* xxxx.xxxx.xxxx
|
|
|
|
*/
|
2021-06-22 18:44:24 +02:00
|
|
|
strlcpy(sysid, sysid_str, sizeof(sysid));
|
2021-06-22 18:36:16 +02:00
|
|
|
|
2021-06-22 18:44:24 +02:00
|
|
|
if (strlen(sysid_str) > 3) {
|
|
|
|
pos = sysid_str + strlen(sysid_str) - 3;
|
2012-03-24 16:35:20 +01:00
|
|
|
if (strncmp(pos, "-", 1) == 0) {
|
|
|
|
memcpy(number, ++pos, 2);
|
|
|
|
lspid[ISIS_SYS_ID_LEN + 1] =
|
2018-03-27 21:13:34 +02:00
|
|
|
(uint8_t)strtol((char *)number, NULL, 16);
|
2012-03-24 16:35:20 +01:00
|
|
|
pos -= 4;
|
|
|
|
if (strncmp(pos, ".", 1) != 0)
|
2018-11-23 01:38:24 +01:00
|
|
|
return NULL;
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
if (strncmp(pos, ".", 1) == 0) {
|
|
|
|
memcpy(number, ++pos, 2);
|
|
|
|
lspid[ISIS_SYS_ID_LEN] =
|
2018-03-27 21:13:34 +02:00
|
|
|
(uint8_t)strtol((char *)number, NULL, 16);
|
2021-06-22 18:44:24 +02:00
|
|
|
sysid[pos - sysid_str - 1] = '\0';
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-11-23 01:38:24 +01:00
|
|
|
/*
|
2021-06-22 18:44:24 +02:00
|
|
|
* Try to find the lsp-id if the sysid_str
|
|
|
|
* is in the form
|
2018-11-23 01:38:24 +01:00
|
|
|
* hostname.<pseudo-id>-<fragment>
|
|
|
|
*/
|
|
|
|
if (sysid2buff(lspid, sysid)) {
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp = lsp_search(head, lspid);
|
2021-06-11 17:27:46 +02:00
|
|
|
} else if ((dynhn = dynhn_find_by_name(isis, sysid))) {
|
2018-11-23 01:38:24 +01:00
|
|
|
memcpy(lspid, dynhn->id, ISIS_SYS_ID_LEN);
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp = lsp_search(head, lspid);
|
2018-11-23 01:38:24 +01:00
|
|
|
} else if (strncmp(cmd_hostname_get(), sysid, 15) == 0) {
|
|
|
|
memcpy(lspid, isis->sysid, ISIS_SYS_ID_LEN);
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp = lsp_search(head, lspid);
|
2018-11-23 01:38:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return lsp;
|
|
|
|
}
|
|
|
|
|
2022-02-24 11:31:18 +01:00
|
|
|
void show_isis_database_lspdb_json(struct json_object *json,
|
|
|
|
struct isis_area *area, int level,
|
|
|
|
struct lspdb_head *lspdb,
|
|
|
|
const char *sysid_str, int ui_level)
|
|
|
|
{
|
|
|
|
struct isis_lsp *lsp;
|
|
|
|
int lsp_count;
|
|
|
|
|
|
|
|
if (lspdb_count(lspdb) > 0) {
|
|
|
|
lsp = lsp_for_sysid(lspdb, sysid_str, area->isis);
|
|
|
|
|
|
|
|
if (lsp != NULL || sysid_str == NULL) {
|
|
|
|
json_object_int_add(json, "id", level + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lsp) {
|
|
|
|
if (ui_level == ISIS_UI_LEVEL_DETAIL)
|
|
|
|
lsp_print_detail(lsp, NULL, json,
|
|
|
|
area->dynhostname, area->isis);
|
|
|
|
else
|
|
|
|
lsp_print_json(lsp, json, area->dynhostname,
|
|
|
|
area->isis);
|
|
|
|
} else if (sysid_str == NULL) {
|
|
|
|
lsp_count =
|
|
|
|
lsp_print_all(NULL, json, lspdb, ui_level,
|
|
|
|
area->dynhostname, area->isis);
|
|
|
|
|
|
|
|
json_object_int_add(json, "count", lsp_count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void show_isis_database_lspdb_vty(struct vty *vty, struct isis_area *area,
|
|
|
|
int level, struct lspdb_head *lspdb,
|
|
|
|
const char *sysid_str, int ui_level)
|
2020-08-24 19:46:36 +02:00
|
|
|
{
|
|
|
|
struct isis_lsp *lsp;
|
|
|
|
int lsp_count;
|
|
|
|
|
|
|
|
if (lspdb_count(lspdb) > 0) {
|
2021-06-22 18:44:24 +02:00
|
|
|
lsp = lsp_for_sysid(lspdb, sysid_str, area->isis);
|
2020-08-24 19:46:36 +02:00
|
|
|
|
2021-06-22 18:44:24 +02:00
|
|
|
if (lsp != NULL || sysid_str == NULL) {
|
2020-08-24 19:46:36 +02:00
|
|
|
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)
|
2022-02-24 11:31:18 +01:00
|
|
|
lsp_print_detail(lsp, vty, NULL,
|
|
|
|
area->dynhostname, area->isis);
|
2020-08-24 19:46:36 +02:00
|
|
|
else
|
2022-02-24 11:31:18 +01:00
|
|
|
lsp_print_vty(lsp, vty, area->dynhostname,
|
|
|
|
area->isis);
|
2021-06-22 18:44:24 +02:00
|
|
|
} else if (sysid_str == NULL) {
|
2020-08-24 19:46:36 +02:00
|
|
|
lsp_count =
|
2022-02-24 11:31:18 +01:00
|
|
|
lsp_print_all(vty, NULL, lspdb, ui_level,
|
2020-08-24 19:46:36 +02:00
|
|
|
area->dynhostname, area->isis);
|
|
|
|
|
|
|
|
vty_out(vty, " %u LSPs\n\n", lsp_count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-24 11:31:18 +01:00
|
|
|
static void show_isis_database_json(struct json_object *json, const char *sysid_str,
|
|
|
|
int ui_level, struct isis *isis)
|
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct isis_area *area;
|
|
|
|
int level;
|
|
|
|
struct json_object *tag_area_json,*area_json, *lsp_json, *area_arr_json, *arr_json;
|
|
|
|
|
|
|
|
if (isis->area_list->count == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
area_arr_json = json_object_new_array();
|
|
|
|
json_object_object_add(json, "areas", area_arr_json);
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
|
|
|
area_json = json_object_new_object();
|
|
|
|
tag_area_json = json_object_new_object();
|
|
|
|
json_object_string_add(tag_area_json, "name",
|
|
|
|
area->area_tag ? area->area_tag
|
|
|
|
: "null");
|
|
|
|
|
|
|
|
arr_json = json_object_new_array();
|
|
|
|
json_object_object_add(area_json,"area",tag_area_json);
|
|
|
|
json_object_object_add(area_json,"levels",arr_json);
|
|
|
|
for (level = 0; level < ISIS_LEVELS; level++) {
|
|
|
|
lsp_json = json_object_new_object();
|
|
|
|
show_isis_database_lspdb_json(lsp_json, area, level,
|
|
|
|
&area->lspdb[level],
|
|
|
|
sysid_str, ui_level);
|
|
|
|
json_object_array_add(arr_json, lsp_json);
|
|
|
|
}
|
|
|
|
json_object_array_add(area_arr_json, area_json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void show_isis_database_vty(struct vty *vty, const char *sysid_str,
|
2020-08-24 19:46:36 +02:00
|
|
|
int ui_level, struct isis *isis)
|
2018-11-23 01:38:24 +01:00
|
|
|
{
|
|
|
|
struct listnode *node;
|
|
|
|
struct isis_area *area;
|
2020-08-24 19:46:36 +02:00
|
|
|
int level;
|
2018-11-23 01:38:24 +01:00
|
|
|
|
|
|
|
if (isis->area_list->count == 0)
|
2020-08-24 19:46:36 +02:00
|
|
|
return;
|
2018-11-23 01:38:24 +01:00
|
|
|
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Area %s:\n",
|
|
|
|
area->area_tag ? area->area_tag : "null");
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-24 19:46:36 +02:00
|
|
|
for (level = 0; level < ISIS_LEVELS; level++)
|
2022-02-24 11:31:18 +01:00
|
|
|
show_isis_database_lspdb_vty(vty, area, level,
|
2021-06-22 18:44:24 +02:00
|
|
|
&area->lspdb[level], sysid_str,
|
2020-08-24 19:46:36 +02:00
|
|
|
ui_level);
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
2022-02-24 11:31:18 +01:00
|
|
|
|
|
|
|
static void show_isis_database_common(struct vty *vty, struct json_object *json, const char *sysid_str,
|
|
|
|
int ui_level, struct isis *isis)
|
|
|
|
{
|
|
|
|
if (json) {
|
|
|
|
show_isis_database_json(json, sysid_str, ui_level, isis);
|
|
|
|
} else {
|
|
|
|
show_isis_database_vty(vty, sysid_str, ui_level, isis);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
/*
|
|
|
|
* 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> ]
|
|
|
|
*/
|
2022-02-24 11:31:18 +01:00
|
|
|
static int show_isis_database(struct vty *vty, struct json_object *json, const char *sysid_str,
|
2021-06-22 18:44:24 +02:00
|
|
|
int ui_level, const char *vrf_name, bool all_vrf)
|
2020-07-13 14:37:59 +02:00
|
|
|
{
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node;
|
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
if (vrf_name) {
|
|
|
|
if (all_vrf) {
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, node, isis))
|
2022-02-24 11:31:18 +01:00
|
|
|
show_isis_database_common(vty, json, sysid_str,
|
2021-06-22 18:44:24 +02:00
|
|
|
ui_level, isis);
|
2020-08-21 02:44:27 +02:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
|
|
|
isis = isis_lookup_by_vrfname(vrf_name);
|
2020-08-21 02:44:27 +02:00
|
|
|
if (isis)
|
2022-02-24 11:31:18 +01:00
|
|
|
show_isis_database_common(vty, json, sysid_str,
|
|
|
|
ui_level, isis);
|
2020-07-13 14:37:59 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
DEFUN(show_database, show_database_cmd,
|
2022-02-24 11:31:18 +01:00
|
|
|
"show " PROTO_NAME " [vrf <NAME|all>] database [detail] [WORD] [json]",
|
2020-07-13 14:37:59 +02:00
|
|
|
SHOW_STR PROTO_HELP VRF_CMD_HELP_STR
|
|
|
|
"All VRFs\n"
|
|
|
|
"Link state database\n"
|
|
|
|
"Detailed information\n"
|
2022-02-24 11:31:18 +01:00
|
|
|
"LSP ID\n"
|
|
|
|
"json output\n")
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2022-02-24 11:31:18 +01:00
|
|
|
int res = CMD_SUCCESS;
|
2016-11-30 00:07:11 +01:00
|
|
|
int idx = 0;
|
2020-07-13 14:37:59 +02:00
|
|
|
int idx_vrf = 0;
|
|
|
|
const char *vrf_name = VRF_DEFAULT_NAME;
|
|
|
|
bool all_vrf = false;
|
2016-11-30 00:07:11 +01:00
|
|
|
int uilevel = argv_find(argv, argc, "detail", &idx)
|
|
|
|
? ISIS_UI_LEVEL_DETAIL
|
|
|
|
: ISIS_UI_LEVEL_BRIEF;
|
|
|
|
char *id = argv_find(argv, argc, "WORD", &idx) ? argv[idx]->arg : NULL;
|
2022-02-24 11:31:18 +01:00
|
|
|
bool uj = use_json(argc, argv);
|
|
|
|
json_object *json = NULL;
|
|
|
|
|
2020-07-13 14:37:59 +02:00
|
|
|
ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
|
2022-02-24 11:31:18 +01:00
|
|
|
if (uj)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
|
|
|
res = show_isis_database(vty, json, id, uilevel, vrf_name, all_vrf);
|
|
|
|
if (uj)
|
|
|
|
vty_json(vty, json);
|
|
|
|
return res;
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2018-11-13 17:19:10 +01:00
|
|
|
#ifdef FABRICD
|
2012-03-24 16:35:20 +01:00
|
|
|
/*
|
2018-11-13 17:19:10 +01:00
|
|
|
* 'router openfabric' command
|
2012-03-24 16:35:20 +01:00
|
|
|
*/
|
2018-11-13 17:19:10 +01:00
|
|
|
DEFUN_NOSH (router_openfabric,
|
|
|
|
router_openfabric_cmd,
|
|
|
|
"router openfabric WORD",
|
2012-03-24 16:35:20 +01:00
|
|
|
ROUTER_STR
|
2018-03-22 15:01:08 +01:00
|
|
|
PROTO_HELP
|
2017-10-21 02:16:57 +02:00
|
|
|
"ISO Routing area tag\n")
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2016-09-23 21:50:58 +02:00
|
|
|
int idx_word = 2;
|
|
|
|
return isis_area_get(vty, argv[idx_word]->arg);
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2018-11-13 17:19:10 +01:00
|
|
|
*'no router openfabric' command
|
2012-03-24 16:35:20 +01:00
|
|
|
*/
|
2018-11-13 17:19:10 +01:00
|
|
|
DEFUN (no_router_openfabric,
|
|
|
|
no_router_openfabric_cmd,
|
|
|
|
"no router openfabric WORD",
|
2018-03-22 15:01:08 +01:00
|
|
|
NO_STR
|
|
|
|
ROUTER_STR
|
|
|
|
PROTO_HELP
|
|
|
|
"ISO Routing area tag\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2020-08-10 17:23:14 +02:00
|
|
|
struct isis_area *area;
|
|
|
|
const char *area_tag;
|
2016-09-23 21:50:58 +02:00
|
|
|
int idx_word = 3;
|
2020-08-10 17:23:14 +02:00
|
|
|
|
|
|
|
area_tag = argv[idx_word]->arg;
|
2020-07-13 14:37:59 +02:00
|
|
|
area = isis_area_lookup(area_tag, VRF_DEFAULT);
|
2020-08-10 17:23:14 +02:00
|
|
|
if (area == NULL) {
|
|
|
|
zlog_warn("%s: could not find area with area-tag %s",
|
|
|
|
__func__, area_tag);
|
|
|
|
return CMD_ERR_NO_MATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
isis_area_destroy(area);
|
|
|
|
return CMD_SUCCESS;
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2018-11-13 17:19:10 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2018-11-13 17:33:49 +01:00
|
|
|
#ifdef FABRICD
|
2003-12-23 09:09:43 +01:00
|
|
|
/*
|
|
|
|
* 'net' command
|
|
|
|
*/
|
|
|
|
DEFUN (net,
|
|
|
|
net_cmd,
|
|
|
|
"net WORD",
|
|
|
|
"A Network Entity Title for this process (OSI only)\n"
|
2004-09-10 22:48:21 +02:00
|
|
|
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-09-23 21:50:58 +02:00
|
|
|
int idx_word = 1;
|
|
|
|
return area_net_title(vty, argv[idx_word]->arg);
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 'no net' command
|
|
|
|
*/
|
|
|
|
DEFUN (no_net,
|
|
|
|
no_net_cmd,
|
|
|
|
"no net WORD",
|
|
|
|
NO_STR
|
|
|
|
"A Network Entity Title for this process (OSI only)\n"
|
2004-09-10 22:48:21 +02:00
|
|
|
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-09-23 21:50:58 +02:00
|
|
|
int idx_word = 2;
|
|
|
|
return area_clear_net_title(vty, argv[idx_word]->arg);
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2018-11-13 17:33:49 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2018-11-14 12:34:02 +01:00
|
|
|
#ifdef FABRICD
|
2017-04-27 13:56:35 +02:00
|
|
|
DEFUN (isis_topology,
|
|
|
|
isis_topology_cmd,
|
|
|
|
"topology " ISIS_MT_NAMES " [overload]",
|
|
|
|
"Configure IS-IS topologies\n"
|
|
|
|
ISIS_MT_DESCRIPTIONS
|
|
|
|
"Set overload bit for topology\n")
|
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
|
|
|
|
|
|
|
const char *arg = argv[1]->arg;
|
|
|
|
uint16_t mtid = isis_str2mtid(arg);
|
2017-05-06 15:50:41 +02:00
|
|
|
|
|
|
|
if (area->oldmetric) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Multi topology IS-IS can only be used with wide metrics\n");
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-05-06 15:50:41 +02:00
|
|
|
}
|
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
if (mtid == (uint16_t)-1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Don't know topology '%s'\n", arg);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-04-27 13:56:35 +02:00
|
|
|
}
|
|
|
|
if (mtid == ISIS_MT_IPV4_UNICAST) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Cannot configure IPv4 unicast topology\n");
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-04-27 13:56:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
area_set_mt_enabled(area, mtid, true);
|
|
|
|
area_set_mt_overload(area, mtid, (argc == 3));
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN (no_isis_topology,
|
|
|
|
no_isis_topology_cmd,
|
|
|
|
"no topology " ISIS_MT_NAMES " [overload]",
|
|
|
|
NO_STR
|
|
|
|
"Configure IS-IS topologies\n"
|
|
|
|
ISIS_MT_DESCRIPTIONS
|
|
|
|
"Set overload bit for topology\n")
|
|
|
|
{
|
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
|
|
|
|
|
|
|
const char *arg = argv[2]->arg;
|
|
|
|
uint16_t mtid = isis_str2mtid(arg);
|
2017-05-06 15:50:41 +02:00
|
|
|
|
|
|
|
if (area->oldmetric) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
"Multi topology IS-IS can only be used with wide metrics\n");
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-05-06 15:50:41 +02:00
|
|
|
}
|
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
if (mtid == (uint16_t)-1) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Don't know topology '%s'\n", arg);
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-04-27 13:56:35 +02:00
|
|
|
}
|
|
|
|
if (mtid == ISIS_MT_IPV4_UNICAST) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "Cannot configure IPv4 unicast topology\n");
|
2017-08-22 16:18:10 +02:00
|
|
|
return CMD_WARNING_CONFIG_FAILED;
|
2017-04-27 13:56:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
area_set_mt_enabled(area, mtid, false);
|
|
|
|
area_set_mt_overload(area, mtid, false);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2018-11-14 12:34:02 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2017-04-27 13:56:35 +02:00
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
void isis_area_lsp_mtu_set(struct isis_area *area, unsigned int lsp_mtu)
|
2015-11-10 18:43:31 +01:00
|
|
|
{
|
|
|
|
area->lsp_mtu = lsp_mtu;
|
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1_AND_2, 1);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
static int isis_area_passwd_set(struct isis_area *area, int level,
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t passwd_type, const char *passwd,
|
|
|
|
uint8_t snp_auth)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2016-07-28 17:23:31 +02:00
|
|
|
struct isis_passwd *dest;
|
|
|
|
struct isis_passwd modified;
|
2017-07-17 14:03:14 +02:00
|
|
|
int len;
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2));
|
|
|
|
dest = (level == IS_LEVEL_1) ? &area->area_passwd
|
|
|
|
: &area->domain_passwd;
|
|
|
|
memset(&modified, 0, sizeof(modified));
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
if (passwd_type != ISIS_PASSWD_TYPE_UNUSED) {
|
|
|
|
if (!passwd)
|
|
|
|
return -1;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
len = strlen(passwd);
|
|
|
|
if (len > 254)
|
|
|
|
return -1;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
modified.len = len;
|
2019-02-26 20:48:12 +01:00
|
|
|
strlcpy((char *)modified.passwd, passwd,
|
|
|
|
sizeof(modified.passwd));
|
2016-07-28 17:23:31 +02:00
|
|
|
modified.type = passwd_type;
|
|
|
|
modified.snp_auth = snp_auth;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
if (memcmp(&modified, dest, sizeof(modified))) {
|
|
|
|
memcpy(dest, &modified, sizeof(modified));
|
2016-07-28 17:23:26 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
return 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
int isis_area_passwd_unset(struct isis_area *area, int level)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2016-07-28 17:23:31 +02:00
|
|
|
return isis_area_passwd_set(area, level, ISIS_PASSWD_TYPE_UNUSED, NULL,
|
2017-07-17 14:03:14 +02:00
|
|
|
0);
|
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
int isis_area_passwd_cleartext_set(struct isis_area *area, int level,
|
2018-03-27 21:13:34 +02:00
|
|
|
const char *passwd, uint8_t snp_auth)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2016-07-28 17:23:31 +02:00
|
|
|
return isis_area_passwd_set(area, level, ISIS_PASSWD_TYPE_CLEARTXT,
|
|
|
|
passwd, snp_auth);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level,
|
2018-03-27 21:13:34 +02:00
|
|
|
const char *passwd, uint8_t snp_auth)
|
2017-07-17 14:03:14 +02:00
|
|
|
{
|
2016-07-28 17:23:31 +02:00
|
|
|
return isis_area_passwd_set(area, level, ISIS_PASSWD_TYPE_HMAC_MD5,
|
|
|
|
passwd, snp_auth);
|
2015-11-10 18:43:31 +01:00
|
|
|
}
|
|
|
|
|
2018-07-24 17:40:24 +02:00
|
|
|
void isis_area_invalidate_routes(struct isis_area *area, int levels)
|
|
|
|
{
|
|
|
|
for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
|
|
|
|
if (!(level & levels))
|
|
|
|
continue;
|
2018-07-26 12:57:38 +02:00
|
|
|
for (int tree = SPFTREE_IPV4; tree < SPFTREE_COUNT; tree++) {
|
|
|
|
isis_spf_invalidate_routes(
|
|
|
|
area->spftree[tree][level - 1]);
|
|
|
|
}
|
2018-07-24 17:40:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void isis_area_verify_routes(struct isis_area *area)
|
|
|
|
{
|
2018-07-26 12:57:38 +02:00
|
|
|
for (int tree = SPFTREE_IPV4; tree < SPFTREE_COUNT; tree++)
|
|
|
|
isis_spf_verify_routes(area, area->spftree[tree]);
|
2018-07-24 17:40:24 +02:00
|
|
|
}
|
|
|
|
|
2022-03-21 17:59:27 +01:00
|
|
|
void isis_area_switchover_routes(struct isis_area *area, int family,
|
|
|
|
union g_addr *nexthop_ip, ifindex_t ifindex,
|
|
|
|
int level)
|
|
|
|
{
|
|
|
|
int tree;
|
|
|
|
|
|
|
|
/* TODO SPFTREE_DSTSRC */
|
|
|
|
if (family == AF_INET)
|
|
|
|
tree = SPFTREE_IPV4;
|
|
|
|
else if (family == AF_INET6)
|
|
|
|
tree = SPFTREE_IPV6;
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
|
|
|
|
isis_spf_switchover_routes(area, area->spftree[tree], family,
|
|
|
|
nexthop_ip, ifindex, level);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
static void area_resign_level(struct isis_area *area, int level)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2018-07-24 17:40:24 +02:00
|
|
|
isis_area_invalidate_routes(area, level);
|
|
|
|
isis_area_verify_routes(area);
|
|
|
|
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp_db_fini(&area->lspdb[level - 1]);
|
2018-07-26 12:57:38 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2018-07-26 12:57:38 +02:00
|
|
|
|
2020-11-14 23:32:01 +01:00
|
|
|
if (area->spf_timer[level - 1])
|
2022-12-25 16:26:52 +01:00
|
|
|
isis_spf_timer_free(EVENT_ARG(area->spf_timer[level - 1]));
|
2020-11-14 23:32:01 +01:00
|
|
|
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF(area->spf_timer[level - 1]);
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
sched_debug(
|
|
|
|
"ISIS (%s): Resigned from L%d - canceling LSP regeneration timer.",
|
|
|
|
area->area_tag, level);
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF(area->t_lsp_refresh[level - 1]);
|
2016-07-28 17:23:31 +02:00
|
|
|
area->lsp_regenerate_pending[level - 1] = 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
void isis_area_is_type_set(struct isis_area *area, int is_type)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2016-07-28 17:23:31 +02:00
|
|
|
struct listnode *node;
|
2016-07-28 17:23:29 +02:00
|
|
|
struct isis_circuit *circuit;
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2020-06-19 21:04:33 +02:00
|
|
|
if (IS_DEBUG_EVENTS)
|
2016-07-28 17:23:31 +02:00
|
|
|
zlog_debug("ISIS-Evt (%s) system type change %s -> %s",
|
|
|
|
area->area_tag, circuit_t2string(area->is_type),
|
|
|
|
circuit_t2string(is_type));
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
if (area->is_type == is_type)
|
|
|
|
return; /* No change */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
switch (area->is_type) {
|
|
|
|
case IS_LEVEL_1:
|
|
|
|
if (is_type == IS_LEVEL_2)
|
|
|
|
area_resign_level(area, IS_LEVEL_1);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp_db_init(&area->lspdb[1]);
|
2016-07-28 17:23:31 +02:00
|
|
|
break;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:31 +02:00
|
|
|
case IS_LEVEL_1_AND_2:
|
|
|
|
if (is_type == IS_LEVEL_1)
|
2016-07-28 17:23:29 +02:00
|
|
|
area_resign_level(area, IS_LEVEL_2);
|
|
|
|
else
|
|
|
|
area_resign_level(area, IS_LEVEL_1);
|
|
|
|
break;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-20 10:51:47 +01:00
|
|
|
case IS_LEVEL_2:
|
2016-07-28 17:23:29 +02:00
|
|
|
if (is_type == IS_LEVEL_1)
|
|
|
|
area_resign_level(area, IS_LEVEL_2);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-02-04 01:22:03 +01:00
|
|
|
lsp_db_init(&area->lspdb[0]);
|
2016-07-28 17:23:29 +02:00
|
|
|
break;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
default:
|
|
|
|
break;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
area->is_type = is_type;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-10-30 02:15:24 +02:00
|
|
|
/*
|
|
|
|
* If area's IS type is strict Level-1 or Level-2, override circuit's
|
|
|
|
* IS type. Otherwise use circuit's configured IS type.
|
|
|
|
*/
|
2016-07-28 17:23:29 +02:00
|
|
|
if (area->is_type != IS_LEVEL_1_AND_2) {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit))
|
|
|
|
isis_circuit_is_type_set(circuit, is_type);
|
2021-10-30 02:15:24 +02:00
|
|
|
} else {
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit))
|
|
|
|
isis_circuit_is_type_set(circuit, circuit->is_type_config);
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
spftree_area_init(area);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
if (listcount(area->area_addrs) > 0) {
|
|
|
|
if (is_type & IS_LEVEL_1)
|
2017-01-05 20:22:31 +01:00
|
|
|
lsp_generate(area, IS_LEVEL_1);
|
|
|
|
if (is_type & IS_LEVEL_2)
|
|
|
|
lsp_generate(area, IS_LEVEL_2);
|
|
|
|
}
|
2016-07-28 17:23:29 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-28 17:23:29 +02:00
|
|
|
return;
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:26 +02:00
|
|
|
void isis_area_metricstyle_set(struct isis_area *area, bool old_metric,
|
|
|
|
bool new_metric)
|
2012-03-28 08:48:05 +02:00
|
|
|
{
|
2018-11-13 18:05:00 +01:00
|
|
|
area->oldmetric = old_metric;
|
|
|
|
area->newmetric = new_metric;
|
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
2012-03-28 08:48:05 +02:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:26 +02:00
|
|
|
void isis_area_overload_bit_set(struct isis_area *area, bool overload_bit)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-07-28 17:23:26 +02:00
|
|
|
char new_overload_bit = overload_bit ? LSPBIT_OL : 0;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2016-07-28 17:23:26 +02:00
|
|
|
if (new_overload_bit != area->overload_bit) {
|
|
|
|
area->overload_bit = new_overload_bit;
|
2022-10-12 19:52:27 +02:00
|
|
|
if (new_overload_bit) {
|
2020-09-15 22:46:15 +02:00
|
|
|
area->overload_counter++;
|
2022-10-12 19:52:27 +02:00
|
|
|
} else {
|
|
|
|
/* Cancel overload on startup timer if it's running */
|
|
|
|
if (area->t_overload_on_startup_timer) {
|
2022-12-25 16:26:52 +01:00
|
|
|
EVENT_OFF(area->t_overload_on_startup_timer);
|
2022-10-12 19:52:27 +02:00
|
|
|
area->t_overload_on_startup_timer = NULL;
|
|
|
|
}
|
|
|
|
}
|
2020-09-15 22:46:15 +02:00
|
|
|
|
|
|
|
#ifndef FABRICD
|
|
|
|
hook_call(isis_hook_db_overload, area);
|
|
|
|
#endif /* ifndef FABRICD */
|
|
|
|
|
2016-07-28 17:23:26 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
2005-09-26 18:49:07 +02:00
|
|
|
}
|
2018-11-14 14:55:48 +01:00
|
|
|
#ifndef FABRICD
|
|
|
|
isis_notif_db_overload(area, overload_bit);
|
|
|
|
#endif /* ifndef FABRICD */
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2022-09-15 20:50:27 +02:00
|
|
|
void isis_area_overload_on_startup_set(struct isis_area *area,
|
|
|
|
uint32_t startup_time)
|
|
|
|
{
|
2022-10-13 01:03:29 +02:00
|
|
|
if (area->overload_on_startup_time != startup_time) {
|
2022-09-15 20:50:27 +02:00
|
|
|
area->overload_on_startup_time = startup_time;
|
2022-10-13 01:03:29 +02:00
|
|
|
isis_restart_write_overload_time(area, startup_time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-16 00:42:09 +01:00
|
|
|
void config_end_lsp_generate(struct isis_area *area)
|
|
|
|
{
|
|
|
|
if (listcount(area->area_addrs) > 0) {
|
|
|
|
if (CHECK_FLAG(area->is_type, IS_LEVEL_1))
|
|
|
|
lsp_generate(area, IS_LEVEL_1);
|
|
|
|
if (CHECK_FLAG(area->is_type, IS_LEVEL_2))
|
|
|
|
lsp_generate(area, IS_LEVEL_2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-06 19:06:23 +01:00
|
|
|
void isis_area_advertise_high_metrics_set(struct isis_area *area,
|
|
|
|
bool advertise_high_metrics)
|
|
|
|
{
|
2023-01-11 02:58:29 +01:00
|
|
|
struct listnode *node;
|
|
|
|
struct isis_circuit *circuit;
|
|
|
|
int max_metric;
|
|
|
|
char xpath[XPATH_MAXLEN];
|
|
|
|
struct lyd_node *dnode;
|
|
|
|
int configured_metric_l1;
|
|
|
|
int configured_metric_l2;
|
|
|
|
|
|
|
|
if (area->advertise_high_metrics == advertise_high_metrics)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (advertise_high_metrics) {
|
|
|
|
if (area->oldmetric && area->newmetric)
|
|
|
|
max_metric = ISIS_NARROW_METRIC_INFINITY;
|
|
|
|
else if (area->newmetric)
|
|
|
|
max_metric = MAX_WIDE_LINK_METRIC;
|
|
|
|
else
|
|
|
|
max_metric = MAX_NARROW_LINK_METRIC;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
|
|
|
|
isis_circuit_metric_set(circuit, IS_LEVEL_1,
|
|
|
|
max_metric);
|
|
|
|
isis_circuit_metric_set(circuit, IS_LEVEL_2,
|
|
|
|
max_metric);
|
|
|
|
}
|
|
|
|
|
|
|
|
area->advertise_high_metrics = true;
|
|
|
|
} else {
|
|
|
|
area->advertise_high_metrics = false;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit)) {
|
|
|
|
/* Get configured metric */
|
|
|
|
snprintf(xpath, XPATH_MAXLEN,
|
|
|
|
"/frr-interface:lib/interface[name='%s']",
|
|
|
|
circuit->interface->name);
|
|
|
|
dnode = yang_dnode_get(running_config->dnode, xpath);
|
|
|
|
|
|
|
|
configured_metric_l1 = yang_dnode_get_uint32(
|
|
|
|
dnode, "./frr-isisd:isis/metric/level-1");
|
|
|
|
configured_metric_l2 = yang_dnode_get_uint32(
|
|
|
|
dnode, "./frr-isisd:isis/metric/level-2");
|
|
|
|
|
|
|
|
isis_circuit_metric_set(circuit, IS_LEVEL_1,
|
|
|
|
configured_metric_l1);
|
|
|
|
isis_circuit_metric_set(circuit, IS_LEVEL_2,
|
|
|
|
configured_metric_l2);
|
|
|
|
}
|
|
|
|
}
|
2023-01-06 19:06:23 +01:00
|
|
|
}
|
|
|
|
|
2022-10-13 01:03:29 +02:00
|
|
|
/*
|
|
|
|
* Returns the path of the file (non-volatile memory) that contains restart
|
|
|
|
* information.
|
|
|
|
*/
|
2022-10-26 02:06:49 +02:00
|
|
|
char *isis_restart_filepath(void)
|
2022-10-13 01:03:29 +02:00
|
|
|
{
|
|
|
|
static char filepath[MAXPATHLEN];
|
|
|
|
snprintf(filepath, sizeof(filepath), ISISD_RESTART, "");
|
|
|
|
return filepath;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Record in non-volatile memory the overload on startup time.
|
|
|
|
*/
|
|
|
|
void isis_restart_write_overload_time(struct isis_area *isis_area,
|
|
|
|
uint32_t overload_time)
|
|
|
|
{
|
|
|
|
char *filepath;
|
|
|
|
const char *area_name;
|
|
|
|
json_object *json;
|
|
|
|
json_object *json_areas;
|
|
|
|
json_object *json_area;
|
|
|
|
|
|
|
|
filepath = isis_restart_filepath();
|
|
|
|
area_name = isis_area->area_tag;
|
|
|
|
|
|
|
|
json = json_object_from_file(filepath);
|
|
|
|
if (json == NULL)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
|
|
|
json_object_object_get_ex(json, "areas", &json_areas);
|
|
|
|
if (!json_areas) {
|
|
|
|
json_areas = json_object_new_object();
|
|
|
|
json_object_object_add(json, "areas", json_areas);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_object_get_ex(json_areas, area_name, &json_area);
|
|
|
|
if (!json_area) {
|
|
|
|
json_area = json_object_new_object();
|
|
|
|
json_object_object_add(json_areas, area_name, json_area);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_int_add(json_area, "overload_time",
|
|
|
|
isis_area->overload_on_startup_time);
|
|
|
|
json_object_to_file_ext(filepath, json, JSON_C_TO_STRING_PRETTY);
|
|
|
|
json_object_free(json);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fetch from non-volatile memory the overload on startup time.
|
|
|
|
*/
|
|
|
|
uint32_t isis_restart_read_overload_time(struct isis_area *isis_area)
|
|
|
|
{
|
|
|
|
char *filepath;
|
|
|
|
const char *area_name;
|
|
|
|
json_object *json;
|
|
|
|
json_object *json_areas;
|
|
|
|
json_object *json_area;
|
|
|
|
json_object *json_overload_time;
|
|
|
|
uint32_t overload_time = 0;
|
|
|
|
|
|
|
|
filepath = isis_restart_filepath();
|
|
|
|
area_name = isis_area->area_tag;
|
|
|
|
|
|
|
|
json = json_object_from_file(filepath);
|
|
|
|
if (json == NULL)
|
|
|
|
json = json_object_new_object();
|
|
|
|
|
|
|
|
json_object_object_get_ex(json, "areas", &json_areas);
|
|
|
|
if (!json_areas) {
|
|
|
|
json_areas = json_object_new_object();
|
|
|
|
json_object_object_add(json, "areas", json_areas);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_object_get_ex(json_areas, area_name, &json_area);
|
|
|
|
if (!json_area) {
|
|
|
|
json_area = json_object_new_object();
|
|
|
|
json_object_object_add(json_areas, area_name, json_area);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_object_get_ex(json_area, "overload_time",
|
|
|
|
&json_overload_time);
|
|
|
|
if (json_overload_time) {
|
|
|
|
overload_time = json_object_get_int(json_overload_time);
|
|
|
|
}
|
|
|
|
|
|
|
|
json_object_object_del(json_areas, area_name);
|
|
|
|
|
|
|
|
json_object_to_file_ext(filepath, json, JSON_C_TO_STRING_PRETTY);
|
|
|
|
json_object_free(json);
|
|
|
|
|
|
|
|
return overload_time;
|
2022-09-15 20:50:27 +02:00
|
|
|
}
|
|
|
|
|
2020-12-24 19:29:42 +01:00
|
|
|
void isis_area_attached_bit_send_set(struct isis_area *area, bool attached_bit)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (attached_bit != area->attached_bit_send) {
|
|
|
|
area->attached_bit_send = attached_bit;
|
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void isis_area_attached_bit_receive_set(struct isis_area *area,
|
|
|
|
bool attached_bit)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
|
|
|
|
2020-12-24 19:29:42 +01:00
|
|
|
if (attached_bit != area->attached_bit_rcv_ignore) {
|
|
|
|
area->attached_bit_rcv_ignore = attached_bit;
|
2016-07-28 17:23:26 +02:00
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:26 +02:00
|
|
|
void isis_area_dynhostname_set(struct isis_area *area, bool dynhostname)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-07-28 17:23:26 +02:00
|
|
|
if (area->dynhostname != dynhostname) {
|
|
|
|
area->dynhostname = dynhostname;
|
|
|
|
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 0);
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
void isis_area_max_lsp_lifetime_set(struct isis_area *area, int level,
|
|
|
|
uint16_t max_lsp_lifetime)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-07-28 17:23:30 +02:00
|
|
|
assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2));
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
if (area->max_lsp_lifetime[level - 1] == max_lsp_lifetime)
|
|
|
|
return;
|
2012-03-24 16:35:20 +01:00
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
area->max_lsp_lifetime[level - 1] = max_lsp_lifetime;
|
|
|
|
lsp_regenerate_schedule(area, level, 1);
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
void isis_area_lsp_refresh_set(struct isis_area *area, int level,
|
|
|
|
uint16_t lsp_refresh)
|
2012-03-24 16:35:20 +01:00
|
|
|
{
|
2016-07-28 17:23:30 +02:00
|
|
|
assert((level == IS_LEVEL_1) || (level == IS_LEVEL_2));
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
if (area->lsp_refresh[level - 1] == lsp_refresh)
|
|
|
|
return;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2016-07-28 17:23:30 +02:00
|
|
|
area->lsp_refresh[level - 1] = lsp_refresh;
|
|
|
|
lsp_regenerate_schedule(area, level, 1);
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
|
|
|
|
2018-11-14 14:44:07 +01:00
|
|
|
#ifdef FABRICD
|
2012-03-24 16:35:20 +01:00
|
|
|
DEFUN (log_adj_changes,
|
|
|
|
log_adj_changes_cmd,
|
|
|
|
"log-adjacency-changes",
|
|
|
|
"Log changes in adjacency state\n")
|
|
|
|
{
|
2016-09-26 18:36:13 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
area->log_adj_changes = 1;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
DEFUN (no_log_adj_changes,
|
|
|
|
no_log_adj_changes_cmd,
|
|
|
|
"no log-adjacency-changes",
|
2016-11-08 02:46:04 +01:00
|
|
|
NO_STR
|
2012-03-24 16:35:20 +01:00
|
|
|
"Stop logging changes in adjacency state\n")
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2016-09-26 18:36:13 +02:00
|
|
|
VTY_DECLVAR_CONTEXT(isis_area, area);
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
area->log_adj_changes = 0;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2018-11-14 14:44:07 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2018-11-14 14:50:53 +01:00
|
|
|
#ifdef FABRICD
|
2003-12-23 09:09:43 +01:00
|
|
|
/* IS-IS configuration write function */
|
2018-09-08 22:31:43 +02:00
|
|
|
static int isis_config_write(struct vty *vty)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
|
|
|
int write = 0;
|
2020-07-13 14:37:59 +02:00
|
|
|
struct isis_area *area;
|
2020-08-21 02:44:27 +02:00
|
|
|
struct listnode *node, *node2, *inode;
|
|
|
|
struct isis *isis;
|
2020-07-13 14:37:59 +02:00
|
|
|
|
|
|
|
if (!im) {
|
|
|
|
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-08-21 02:44:27 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(im->isis, inode, isis)) {
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
|
2004-09-10 22:48:21 +02:00
|
|
|
/* ISIS - Area name */
|
2018-03-22 15:01:08 +01:00
|
|
|
vty_out(vty, "router " PROTO_NAME " %s\n", area->area_tag);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
/* ISIS - Net */
|
|
|
|
if (listcount(area->area_addrs) > 0) {
|
|
|
|
struct area_addr *area_addr;
|
2005-09-28 20:45:54 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(area->area_addrs,
|
|
|
|
node2, area_addr)) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " net %s\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
isonet_print(
|
|
|
|
area_addr->area_addr,
|
|
|
|
area_addr->addr_len
|
|
|
|
+ ISIS_SYS_ID_LEN
|
|
|
|
+ 1));
|
2005-09-28 20:45:54 +02:00
|
|
|
write++;
|
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2005-09-28 20:45:54 +02:00
|
|
|
/* ISIS - Dynamic hostname - Defaults to true so only
|
|
|
|
* display if
|
|
|
|
* false. */
|
2004-09-10 22:48:21 +02:00
|
|
|
if (!area->dynhostname) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " no hostname dynamic\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2012-03-28 08:48:05 +02:00
|
|
|
/* ISIS - Metric-Style - when true displays wide */
|
2018-03-22 14:58:53 +01:00
|
|
|
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++;
|
|
|
|
}
|
2012-11-27 02:10:28 +01:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
/* ISIS - overload-bit */
|
|
|
|
if (area->overload_bit) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " set-overload-bit\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
/* ISIS - Area is-type (level-1-2 is default) */
|
2018-03-22 14:58:53 +01:00
|
|
|
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++;
|
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2015-11-12 14:24:22 +01:00
|
|
|
write += isis_redist_config_write(vty, area, AF_INET);
|
|
|
|
write += isis_redist_config_write(vty, area, AF_INET6);
|
2004-09-10 22:48:21 +02:00
|
|
|
/* ISIS - Lsp generation interval */
|
|
|
|
if (area->lsp_gen_interval[0]
|
|
|
|
== area->lsp_gen_interval[1]) {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->lsp_gen_interval[0]
|
|
|
|
!= DEFAULT_MIN_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " lsp-gen-interval %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_gen_interval[0]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
} else {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->lsp_gen_interval[0]
|
|
|
|
!= DEFAULT_MIN_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" lsp-gen-interval level-1 %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_gen_interval[0]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->lsp_gen_interval[1]
|
|
|
|
!= DEFAULT_MIN_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" lsp-gen-interval level-2 %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_gen_interval[1]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
|
|
|
/* ISIS - LSP lifetime */
|
|
|
|
if (area->max_lsp_lifetime[0]
|
|
|
|
== area->max_lsp_lifetime[1]) {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->max_lsp_lifetime[0]
|
|
|
|
!= DEFAULT_LSP_LIFETIME) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " max-lsp-lifetime %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->max_lsp_lifetime[0]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
} else {
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->max_lsp_lifetime[0]
|
|
|
|
!= DEFAULT_LSP_LIFETIME) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" max-lsp-lifetime level-1 %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->max_lsp_lifetime[0]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->max_lsp_lifetime[1]
|
|
|
|
!= DEFAULT_LSP_LIFETIME) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" max-lsp-lifetime level-2 %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->max_lsp_lifetime[1]);
|
2004-09-10 22:48:21 +02:00
|
|
|
write++;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
/* ISIS - LSP refresh interval */
|
|
|
|
if (area->lsp_refresh[0] == area->lsp_refresh[1]) {
|
|
|
|
if (area->lsp_refresh[0]
|
|
|
|
!= DEFAULT_MAX_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" lsp-refresh-interval %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_refresh[0]);
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (area->lsp_refresh[0]
|
|
|
|
!= DEFAULT_MAX_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" lsp-refresh-interval level-1 %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_refresh[0]);
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
if (area->lsp_refresh[1]
|
|
|
|
!= DEFAULT_MAX_LSP_GEN_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" lsp-refresh-interval level-2 %u\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->lsp_refresh[1]);
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2012-03-24 16:35:20 +01:00
|
|
|
}
|
2015-11-10 18:43:31 +01:00
|
|
|
if (area->lsp_mtu != DEFAULT_LSP_MTU) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " lsp-mtu %u\n", area->lsp_mtu);
|
2015-11-10 18:43:31 +01:00
|
|
|
write++;
|
|
|
|
}
|
2018-05-31 15:14:26 +02:00
|
|
|
if (area->purge_originator) {
|
|
|
|
vty_out(vty, " purge-originator\n");
|
|
|
|
write++;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2005-10-01 08:03:04 +02:00
|
|
|
/* Minimum SPF interval. */
|
|
|
|
if (area->min_spf_interval[0]
|
|
|
|
== area->min_spf_interval[1]) {
|
|
|
|
if (area->min_spf_interval[0]
|
|
|
|
!= MINIMUM_SPF_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " spf-interval %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->min_spf_interval[0]);
|
2005-10-01 08:03:04 +02:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (area->min_spf_interval[0]
|
|
|
|
!= MINIMUM_SPF_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" spf-interval level-1 %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->min_spf_interval[0]);
|
2005-10-01 08:03:04 +02:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
if (area->min_spf_interval[1]
|
|
|
|
!= MINIMUM_SPF_INTERVAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" spf-interval level-2 %d\n",
|
2017-06-21 05:10:57 +02:00
|
|
|
area->min_spf_interval[1]);
|
2005-10-01 08:03:04 +02:00
|
|
|
write++;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2005-10-01 08:03:04 +02:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
/* IETF SPF interval */
|
|
|
|
if (area->spf_delay_ietf[0]) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" spf-delay-ietf init-delay %ld short-delay %ld long-delay %ld holddown %ld time-to-learn %ld\n",
|
2017-02-21 23:52:29 +01:00
|
|
|
spf_backoff_init_delay(
|
|
|
|
area->spf_delay_ietf[0]),
|
|
|
|
spf_backoff_short_delay(
|
|
|
|
area->spf_delay_ietf[0]),
|
|
|
|
spf_backoff_long_delay(
|
|
|
|
area->spf_delay_ietf[0]),
|
|
|
|
spf_backoff_holddown(
|
|
|
|
area->spf_delay_ietf[0]),
|
2017-06-21 05:10:57 +02:00
|
|
|
spf_backoff_timetolearn(
|
|
|
|
area->spf_delay_ietf[0]));
|
2017-02-21 23:52:29 +01:00
|
|
|
write++;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2004-09-15 18:21:59 +02:00
|
|
|
/* Authentication passwords. */
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->area_passwd.type
|
|
|
|
== ISIS_PASSWD_TYPE_HMAC_MD5) {
|
|
|
|
vty_out(vty, " area-password md5 %s",
|
|
|
|
area->area_passwd.passwd);
|
2005-01-01 11:29:51 +01:00
|
|
|
if (CHECK_FLAG(area->area_passwd.snp_auth,
|
|
|
|
SNP_AUTH_SEND)) {
|
|
|
|
vty_out(vty, " authenticate snp ");
|
|
|
|
if (CHECK_FLAG(
|
|
|
|
area->area_passwd.snp_auth,
|
|
|
|
SNP_AUTH_RECV))
|
|
|
|
vty_out(vty, "validate");
|
|
|
|
else
|
|
|
|
vty_out(vty, "send-only");
|
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2004-09-15 18:21:59 +02:00
|
|
|
write++;
|
2012-03-24 16:35:20 +01:00
|
|
|
} else if (area->area_passwd.type
|
|
|
|
== ISIS_PASSWD_TYPE_CLEARTXT) {
|
|
|
|
vty_out(vty, " area-password clear %s",
|
|
|
|
area->area_passwd.passwd);
|
|
|
|
if (CHECK_FLAG(area->area_passwd.snp_auth,
|
|
|
|
SNP_AUTH_SEND)) {
|
|
|
|
vty_out(vty, " authenticate snp ");
|
|
|
|
if (CHECK_FLAG(
|
|
|
|
area->area_passwd.snp_auth,
|
|
|
|
SNP_AUTH_RECV))
|
|
|
|
vty_out(vty, "validate");
|
|
|
|
else
|
|
|
|
vty_out(vty, "send-only");
|
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
|
|
|
if (area->domain_passwd.type
|
|
|
|
== ISIS_PASSWD_TYPE_HMAC_MD5) {
|
|
|
|
vty_out(vty, " domain-password md5 %s",
|
|
|
|
area->domain_passwd.passwd);
|
|
|
|
if (CHECK_FLAG(area->domain_passwd.snp_auth,
|
|
|
|
SNP_AUTH_SEND)) {
|
|
|
|
vty_out(vty, " authenticate snp ");
|
|
|
|
if (CHECK_FLAG(area->domain_passwd
|
|
|
|
.snp_auth,
|
|
|
|
SNP_AUTH_RECV))
|
|
|
|
vty_out(vty, "validate");
|
|
|
|
else
|
|
|
|
vty_out(vty, "send-only");
|
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
} else if (area->domain_passwd.type
|
|
|
|
== ISIS_PASSWD_TYPE_CLEARTXT) {
|
|
|
|
vty_out(vty, " domain-password clear %s",
|
|
|
|
area->domain_passwd.passwd);
|
2005-01-01 11:29:51 +01:00
|
|
|
if (CHECK_FLAG(area->domain_passwd.snp_auth,
|
|
|
|
SNP_AUTH_SEND)) {
|
|
|
|
vty_out(vty, " authenticate snp ");
|
|
|
|
if (CHECK_FLAG(area->domain_passwd
|
|
|
|
.snp_auth,
|
|
|
|
SNP_AUTH_RECV))
|
|
|
|
vty_out(vty, "validate");
|
|
|
|
else
|
|
|
|
vty_out(vty, "send-only");
|
|
|
|
}
|
2017-07-13 19:04:25 +02:00
|
|
|
vty_out(vty, "\n");
|
2004-09-15 18:21:59 +02:00
|
|
|
write++;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
if (area->log_adj_changes) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, " log-adjacency-changes\n");
|
2012-03-24 16:35:20 +01:00
|
|
|
write++;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-04-27 13:56:35 +02:00
|
|
|
write += area_write_mt_settings(area, vty);
|
2018-05-10 19:05:40 +02:00
|
|
|
write += fabricd_write_settings(area, vty);
|
2021-08-08 21:38:50 +02:00
|
|
|
|
|
|
|
vty_out(vty, "exit\n");
|
2004-09-10 22:48:21 +02:00
|
|
|
}
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
return write;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-09-09 00:15:50 +02:00
|
|
|
struct cmd_node router_node = {
|
|
|
|
.name = "openfabric",
|
|
|
|
.node = OPENFABRIC_NODE,
|
|
|
|
.parent_node = CONFIG_NODE,
|
|
|
|
.prompt = "%s(config-router)# ",
|
|
|
|
.config_write = isis_config_write,
|
|
|
|
};
|
2018-11-14 14:50:53 +01:00
|
|
|
#else
|
|
|
|
/* IS-IS configuration write function */
|
2018-09-08 22:31:43 +02:00
|
|
|
static int isis_config_write(struct vty *vty)
|
2018-11-14 14:50:53 +01:00
|
|
|
{
|
|
|
|
int write = 0;
|
|
|
|
struct lyd_node *dnode;
|
|
|
|
|
|
|
|
dnode = yang_dnode_get(running_config->dnode, "/frr-isisd:isis");
|
2018-12-10 14:30:40 +01:00
|
|
|
if (dnode) {
|
2018-11-14 14:50:53 +01:00
|
|
|
nb_cli_show_dnode_cmds(vty, dnode, false);
|
2018-12-10 14:30:40 +01:00
|
|
|
write++;
|
|
|
|
}
|
2018-11-14 14:50:53 +01:00
|
|
|
|
|
|
|
return write;
|
|
|
|
}
|
|
|
|
|
2018-09-08 21:46:23 +02:00
|
|
|
struct cmd_node router_node = {
|
2018-09-09 00:15:50 +02:00
|
|
|
.name = "isis",
|
|
|
|
.node = ISIS_NODE,
|
2018-09-08 23:15:09 +02:00
|
|
|
.parent_node = CONFIG_NODE,
|
2018-09-08 21:46:23 +02:00
|
|
|
.prompt = "%s(config-router)# ",
|
2018-09-08 22:31:43 +02:00
|
|
|
.config_write = isis_config_write,
|
2018-09-08 21:46:23 +02:00
|
|
|
};
|
2018-09-09 00:15:50 +02:00
|
|
|
#endif /* ifdef FABRICD */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2019-01-24 10:12:36 +01:00
|
|
|
void isis_init(void)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
|
|
|
/* Install IS-IS top node */
|
2018-09-08 22:31:43 +02:00
|
|
|
install_node(&router_node);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
install_element(VIEW_NODE, &show_isis_summary_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
install_element(VIEW_NODE, &show_isis_spf_ietf_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
install_element(VIEW_NODE, &show_isis_interface_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_isis_interface_detail_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_isis_interface_arg_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2012-03-24 16:35:20 +01:00
|
|
|
install_element(VIEW_NODE, &show_isis_neighbor_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_isis_neighbor_detail_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_isis_neighbor_arg_cmd);
|
2020-10-01 16:11:35 +02:00
|
|
|
install_element(ENABLE_NODE, &clear_isis_neighbor_cmd);
|
|
|
|
install_element(ENABLE_NODE, &clear_isis_neighbor_arg_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
install_element(VIEW_NODE, &show_hostname_cmd);
|
|
|
|
install_element(VIEW_NODE, &show_database_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-04-19 19:03:05 +02:00
|
|
|
install_element(ENABLE_NODE, &show_debugging_isis_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-09-08 22:31:43 +02:00
|
|
|
install_node(&debug_node);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_adj_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_adj_cmd);
|
2018-11-16 16:05:54 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_tx_queue_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_tx_queue_cmd);
|
2018-11-16 16:31:37 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_flooding_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_flooding_cmd);
|
2003-12-23 09:09:43 +01:00
|
|
|
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);
|
2019-08-04 03:02:37 +02:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_srevents_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_srevents_cmd);
|
2021-06-22 19:59:02 +02:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_teevents_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_teevents_cmd);
|
2020-11-20 22:59:35 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_lfa_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_lfa_cmd);
|
2003-12-23 09:09:43 +01:00
|
|
|
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_events_cmd);
|
2012-03-24 16:35:20 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_packet_dump_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_packet_dump_cmd);
|
2015-11-12 14:21:47 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_lsp_gen_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_lsp_gen_cmd);
|
2015-11-10 18:43:34 +01:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_lsp_sched_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_lsp_sched_cmd);
|
2018-09-28 19:35:10 +02:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_bfd_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_bfd_cmd);
|
2020-07-22 20:32:35 +02:00
|
|
|
install_element(ENABLE_NODE, &debug_isis_ldp_sync_cmd);
|
|
|
|
install_element(ENABLE_NODE, &no_debug_isis_ldp_sync_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2003-12-23 09:56:18 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_adj_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_adj_cmd);
|
2018-11-16 16:05:54 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_tx_queue_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_tx_queue_cmd);
|
2018-11-16 16:31:37 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_flooding_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_flooding_cmd);
|
2003-12-23 09:56:18 +01:00
|
|
|
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);
|
2019-08-04 03:02:37 +02:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_srevents_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_srevents_cmd);
|
2021-06-22 19:59:02 +02:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_teevents_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_teevents_cmd);
|
2020-11-20 22:59:35 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_lfa_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_lfa_cmd);
|
2003-12-23 09:56:18 +01:00
|
|
|
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_events_cmd);
|
2012-03-24 16:35:20 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_packet_dump_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_packet_dump_cmd);
|
2015-11-12 14:21:47 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_lsp_gen_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_lsp_gen_cmd);
|
2015-11-10 18:43:34 +01:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_lsp_sched_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_lsp_sched_cmd);
|
2018-09-28 19:35:10 +02:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_bfd_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_bfd_cmd);
|
2020-07-22 20:32:35 +02:00
|
|
|
install_element(CONFIG_NODE, &debug_isis_ldp_sync_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_debug_isis_ldp_sync_cmd);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-03-22 15:01:08 +01:00
|
|
|
install_default(ROUTER_NODE);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-11-13 17:19:10 +01:00
|
|
|
#ifdef FABRICD
|
|
|
|
install_element(CONFIG_NODE, &router_openfabric_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_router_openfabric_cmd);
|
2018-11-14 14:44:07 +01:00
|
|
|
|
2018-03-22 15:01:08 +01:00
|
|
|
install_element(ROUTER_NODE, &net_cmd);
|
|
|
|
install_element(ROUTER_NODE, &no_net_cmd);
|
2018-11-14 14:44:07 +01:00
|
|
|
|
2018-03-22 15:01:08 +01:00
|
|
|
install_element(ROUTER_NODE, &isis_topology_cmd);
|
|
|
|
install_element(ROUTER_NODE, &no_isis_topology_cmd);
|
2018-11-14 14:44:07 +01:00
|
|
|
|
2018-03-22 15:01:08 +01:00
|
|
|
install_element(ROUTER_NODE, &log_adj_changes_cmd);
|
|
|
|
install_element(ROUTER_NODE, &no_log_adj_changes_cmd);
|
2018-11-14 14:44:07 +01:00
|
|
|
#endif /* ifdef FABRICD */
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-02-21 23:52:29 +01:00
|
|
|
spf_backoff_cmd_init();
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|