on).
* isis_lsp.c (lsp_build_nonpseudo): Use stream_reset() instead of
touching endp directly.
* isis_lsp.c (lsp_build_pseudo): Ditto.
+2005-09-05 Hasso Tepper <hasso at quagga.net>
+
+ * *.c: Try to be less verbose by default (without any debug options
+ on).
+ * isis_lsp.c (lsp_build_nonpseudo): Use stream_reset() instead of
+ touching endp directly.
+ * isis_lsp.c (lsp_build_pseudo): Ditto.
+
2005-09-03 Hasso Tepper <hasso at quagga.net>
* isis_lsp.c: Yet another regression introduced by stream cleanup.
}
else
{
- zlog_warn ("isis_circuit_if_add: unsupported media");
+ /* It's normal in case of loopback etc. */
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("isis_circuit_if_add: unsupported media");
}
for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
if (c->ipv6_router == 0)
{
#endif /* HAVE_IPV6 */
- vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
+ /* FIXME: Find the way to warn only vty users. */
+ /* vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); */
return CMD_WARNING;
#ifdef HAVE_IPV6
}
/* this is here for ciscopability */
if (!area)
{
- vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
+ /* FIXME: Find the way to warn only vty users. */
+ /* vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); */
return CMD_WARNING;
}
int old_state;
old_state = circuit ? circuit->state : C_STATE_NA;
-
- zlog_debug ("CSM_EVENT: %s", EVENT2STR (event));
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("CSM_EVENT: %s", EVENT2STR (event));
switch (old_state)
{
zlog_warn ("Invalid circuit state %d", old_state);
}
- zlog_debug ("CSM_STATE_CHANGE: %s -> %s ", STATE2STR (old_state),
- circuit ? STATE2STR (circuit->state) : STATE2STR (C_STATE_NA));
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("CSM_STATE_CHANGE: %s -> %s ", STATE2STR (old_state),
+ circuit ? STATE2STR (circuit->state) : STATE2STR (C_STATE_NA));
return circuit;
}
{
u_char old_dr[ISIS_SYS_ID_LEN + 2];
- zlog_debug ("isis_dr_commence l%d", level);
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("isis_dr_commence l%d", level);
/* Lets keep a pause in DR election */
circuit->u.bc.run_dr_elect[level - 1] = 0;
if (!adj || !adj->circuit || !adj->circuit->area)
return;
- zlog_debug ("ISIS-Evt (%s) Adjacency State change",
- adj->circuit->area->area_tag);
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("ISIS-Evt (%s) Adjacency State change",
+ adj->circuit->area->area_tag);
/* LSP generation again */
lsp_regenerate_schedule (adj->circuit->area);
/* invalid arguments */
if (!circuit || !circuit->area)
return 0;
-
- zlog_debug ("ISIS-Evt (%s) DIS status change", circuit->area->area_tag);
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("ISIS-Evt (%s) DIS status change", circuit->area->area_tag);
/* LSP generation again */
lsp_regenerate_schedule (circuit->area);
void
isis_event_auth_failure (char *area_tag, const char *error_string, u_char *sysid)
{
- zlog_debug ("ISIS-Evt (%s) Authentication failure %s from %s",
- area_tag, error_string, sysid_print (sysid));
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("ISIS-Evt (%s) Authentication failure %s from %s",
+ area_tag, error_string, sysid_print (sysid));
return;
}
stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
- /* #ifdef EXTREME_DEBUG */
- /* logging */
- zlog_debug ("New LSP with ID %s-%02x-%02x seqnum %08x", sysid_print (lsp_id),
- LSP_PSEUDO_ID (lsp->lsp_header->lsp_id),
- LSP_FRAGMENT (lsp->lsp_header->lsp_id),
- ntohl (lsp->lsp_header->seq_num));
- /* #endif EXTREME DEBUG */
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("New LSP with ID %s-%02x-%02x seqnum %08x",
+ sysid_print (lsp_id), LSP_PSEUDO_ID (lsp->lsp_header->lsp_id),
+ LSP_FRAGMENT (lsp->lsp_header->lsp_id),
+ ntohl (lsp->lsp_header->seq_num));
return lsp;
}
/* Reset stream endp. Stream is always there and on every LSP refresh only
* TLV part of it is overwritten. So we must seek past header we will not
* touch. */
- lsp->pdu->endp = 0;
+ stream_reset (lsp->pdu);
stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/*
}
/* Reset endp of stream to overwrite only TLV part of it. */
- lsp->pdu->endp = 0;
+ stream_reset (lsp->pdu);
stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/*
/* Print banner. */
zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port);
-#ifdef HAVE_IPV6
- zlog_debug ("IPv6 enabled");
-#endif
+
/* Start finite state machine. */
while (thread_fetch (master, &thread))
thread_call (&thread);
&& circuit->u.bc.is_dr[level - 1] == 1))
{
lsp->lsp_header->seq_num = htonl (ntohl (hdr->seq_num) + 1);
- zlog_debug ("LSP LEN: %d", ntohs (lsp->lsp_header->pdu_len));
+ if (isis->debugs & DEBUG_UPDATE_PACKETS)
+ zlog_debug ("LSP LEN: %d",
+ ntohs (lsp->lsp_header->pdu_len));
iso_csum_create (STREAM_DATA (lsp->pdu) + 12,
ntohs (lsp->lsp_header->pdu_len) - 12, 12);
ISIS_FLAGS_SET_ALL (lsp->SRMflags);
- zlog_debug
- ("ISIS-Upd (%s): (1) re-originating LSP %s new seq 0x%08x",
- circuit->area->area_tag, rawlspid_print (hdr->lsp_id),
- ntohl (lsp->lsp_header->seq_num));
+ if (isis->debugs & DEBUG_UPDATE_PACKETS)
+ zlog_debug ("ISIS-Upd (%s): (1) re-originating LSP %s new "
+ "seq 0x%08x", circuit->area->area_tag,
+ rawlspid_print (hdr->lsp_id),
+ ntohl (lsp->lsp_header->seq_num));
lsp->lsp_header->rem_lifetime =
htons (isis_jitter
(circuit->area->max_lsp_lifetime[level - 1],
ntohs (lsp->lsp_header->pdu_len) - 12, 12);
ISIS_FLAGS_SET_ALL (lsp->SRMflags);
- zlog_debug
- ("ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08x",
- circuit->area->area_tag, rawlspid_print (hdr->lsp_id),
- ntohl (lsp->lsp_header->seq_num));
+ if (isis->debugs & DEBUG_UPDATE_PACKETS)
+ zlog_debug ("ISIS-Upd (%s): (2) re-originating LSP %s new seq "
+ "0x%08x", circuit->area->area_tag,
+ rawlspid_print (hdr->lsp_id),
+ ntohl (lsp->lsp_header->seq_num));
lsp->lsp_header->rem_lifetime =
htons (isis_jitter
(circuit->area->max_lsp_lifetime[level - 1],
if (listcount (adj_list) == 0)
{
list_delete (adj_list);
- zlog_warn ("ISIS-Spf: no L%d adjacencies on circuit %s",
- level, circuit->interface->name);
+ if (isis->debugs & DEBUG_SPF_EVENTS)
+ zlog_debug ("ISIS-Spf: no L%d adjacencies on circuit %s",
+ level, circuit->interface->name);
continue;
}
anode = listhead (adj_list);
#include "stream.h"
#include "linklist.h"
+#include "isisd/dict.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
+#include "isisd/isisd.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_csm.h"
#include "isisd/isis_route.h"
struct zclient *zclient = NULL;
extern struct thread_master *master;
+extern struct isis *isis;
+
struct in_addr router_id_zebra;
/* Router-id update message from zebra. */
ifp = zebra_interface_add_read (zclient->ibuf);
-
- zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ if (isis->debugs & DEBUG_ZEBRA)
+ zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
+ ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
if (if_is_operative (ifp))
isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
zlog_warn ("Zebra: got delete of %s, but interface is still up",
ifp->name);
- zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ if (isis->debugs & DEBUG_ZEBRA)
+ zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d",
+ ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
/* Cannot call if_delete because we should retain the pseudo interface
if (command == ZEBRA_IPV4_ROUTE_ADD)
{
- zlog_debug ("IPv4 Route add from Z");
+ if (isis->debugs & DEBUG_ZEBRA)
+ zlog_debug ("IPv4 Route add from Z");
}
return 0;
area->area_tag = strdup (area_tag);
listnode_add (isis->area_list, area);
- zlog_debug ("new IS-IS area instance %s", area->area_tag);
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("New IS-IS area instance %s", area->area_tag);
vty->node = ISIS_NODE;
vty->index = area;
*/
memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
isis->sysid_set = 1;
- zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
+ if (isis->debugs & DEBUG_EVENTS)
+ zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid));
}
else
{
#define DEBUG_SPF_TRIGGERS (1<<8)
#define DEBUG_RTE_EVENTS (1<<9)
#define DEBUG_EVENTS (1<<10)
+#define DEBUG_ZEBRA (1<<11)
#endif /* ISISD_H */