* *.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.
This commit is contained in:
hasso 2005-09-04 21:36:36 +00:00
parent c0fb2a5215
commit c89c05dd04
12 changed files with 71 additions and 45 deletions

View File

@ -1,3 +1,11 @@
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> 2005-09-03 Hasso Tepper <hasso at quagga.net>
* isis_lsp.c: Yet another regression introduced by stream cleanup. * isis_lsp.c: Yet another regression introduced by stream cleanup.

View File

@ -404,7 +404,9 @@ isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
} }
else 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)) for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
@ -842,7 +844,8 @@ DEFUN (ip_router_isis,
if (c->ipv6_router == 0) if (c->ipv6_router == 0)
{ {
#endif /* HAVE_IPV6 */ #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; return CMD_WARNING;
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
} }
@ -852,7 +855,8 @@ DEFUN (ip_router_isis,
/* this is here for ciscopability */ /* this is here for ciscopability */
if (!area) 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; return CMD_WARNING;
} }

View File

@ -77,8 +77,8 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
int old_state; int old_state;
old_state = circuit ? circuit->state : C_STATE_NA; old_state = circuit ? circuit->state : C_STATE_NA;
if (isis->debugs & DEBUG_EVENTS)
zlog_debug ("CSM_EVENT: %s", EVENT2STR (event)); zlog_debug ("CSM_EVENT: %s", EVENT2STR (event));
switch (old_state) switch (old_state)
{ {
@ -178,8 +178,9 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
zlog_warn ("Invalid circuit state %d", old_state); zlog_warn ("Invalid circuit state %d", old_state);
} }
zlog_debug ("CSM_STATE_CHANGE: %s -> %s ", STATE2STR (old_state), if (isis->debugs & DEBUG_EVENTS)
circuit ? STATE2STR (circuit->state) : STATE2STR (C_STATE_NA)); zlog_debug ("CSM_STATE_CHANGE: %s -> %s ", STATE2STR (old_state),
circuit ? STATE2STR (circuit->state) : STATE2STR (C_STATE_NA));
return circuit; return circuit;
} }

View File

@ -307,7 +307,8 @@ isis_dr_commence (struct isis_circuit *circuit, int level)
{ {
u_char old_dr[ISIS_SYS_ID_LEN + 2]; 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 */ /* Lets keep a pause in DR election */
circuit->u.bc.run_dr_elect[level - 1] = 0; circuit->u.bc.run_dr_elect[level - 1] = 0;

View File

@ -283,8 +283,9 @@ isis_event_adjacency_state_change (struct isis_adjacency *adj, int newstate)
if (!adj || !adj->circuit || !adj->circuit->area) if (!adj || !adj->circuit || !adj->circuit->area)
return; return;
zlog_debug ("ISIS-Evt (%s) Adjacency State change", if (isis->debugs & DEBUG_EVENTS)
adj->circuit->area->area_tag); zlog_debug ("ISIS-Evt (%s) Adjacency State change",
adj->circuit->area->area_tag);
/* LSP generation again */ /* LSP generation again */
lsp_regenerate_schedule (adj->circuit->area); lsp_regenerate_schedule (adj->circuit->area);
@ -304,8 +305,8 @@ isis_event_dis_status_change (struct thread *thread)
/* invalid arguments */ /* invalid arguments */
if (!circuit || !circuit->area) if (!circuit || !circuit->area)
return 0; return 0;
if (isis->debugs & DEBUG_EVENTS)
zlog_debug ("ISIS-Evt (%s) DIS status change", circuit->area->area_tag); zlog_debug ("ISIS-Evt (%s) DIS status change", circuit->area->area_tag);
/* LSP generation again */ /* LSP generation again */
lsp_regenerate_schedule (circuit->area); lsp_regenerate_schedule (circuit->area);
@ -316,8 +317,9 @@ isis_event_dis_status_change (struct thread *thread)
void void
isis_event_auth_failure (char *area_tag, const char *error_string, u_char *sysid) isis_event_auth_failure (char *area_tag, const char *error_string, u_char *sysid)
{ {
zlog_debug ("ISIS-Evt (%s) Authentication failure %s from %s", if (isis->debugs & DEBUG_EVENTS)
area_tag, error_string, sysid_print (sysid)); zlog_debug ("ISIS-Evt (%s) Authentication failure %s from %s",
area_tag, error_string, sysid_print (sysid));
return; return;
} }

View File

@ -501,13 +501,11 @@ lsp_new (u_char * lsp_id, u_int16_t rem_lifetime, u_int32_t seq_num,
stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN); stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/* #ifdef EXTREME_DEBUG */ if (isis->debugs & DEBUG_EVENTS)
/* logging */ zlog_debug ("New LSP with ID %s-%02x-%02x seqnum %08x",
zlog_debug ("New LSP with ID %s-%02x-%02x seqnum %08x", sysid_print (lsp_id), sysid_print (lsp_id), LSP_PSEUDO_ID (lsp->lsp_header->lsp_id),
LSP_PSEUDO_ID (lsp->lsp_header->lsp_id), LSP_FRAGMENT (lsp->lsp_header->lsp_id),
LSP_FRAGMENT (lsp->lsp_header->lsp_id), ntohl (lsp->lsp_header->seq_num));
ntohl (lsp->lsp_header->seq_num));
/* #endif EXTREME DEBUG */
return lsp; return lsp;
} }
@ -1302,7 +1300,7 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
/* Reset stream endp. Stream is always there and on every LSP refresh only /* 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 * TLV part of it is overwritten. So we must seek past header we will not
* touch. */ * touch. */
lsp->pdu->endp = 0; stream_reset (lsp->pdu);
stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN); stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/* /*
@ -1912,7 +1910,7 @@ lsp_build_pseudo (struct isis_lsp *lsp, struct isis_circuit *circuit,
} }
/* Reset endp of stream to overwrite only TLV part of it. */ /* 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); stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/* /*

View File

@ -325,9 +325,7 @@ main (int argc, char **argv, char **envp)
/* Print banner. */ /* Print banner. */
zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port); zlog_notice ("Quagga-ISISd %s starting: vty@%d", QUAGGA_VERSION, vty_port);
#ifdef HAVE_IPV6
zlog_debug ("IPv6 enabled");
#endif
/* Start finite state machine. */ /* Start finite state machine. */
while (thread_fetch (master, &thread)) while (thread_fetch (master, &thread))
thread_call (&thread); thread_call (&thread);

View File

@ -1121,14 +1121,17 @@ dontcheckadj:
&& circuit->u.bc.is_dr[level - 1] == 1)) && circuit->u.bc.is_dr[level - 1] == 1))
{ {
lsp->lsp_header->seq_num = htonl (ntohl (hdr->seq_num) + 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, iso_csum_create (STREAM_DATA (lsp->pdu) + 12,
ntohs (lsp->lsp_header->pdu_len) - 12, 12); ntohs (lsp->lsp_header->pdu_len) - 12, 12);
ISIS_FLAGS_SET_ALL (lsp->SRMflags); ISIS_FLAGS_SET_ALL (lsp->SRMflags);
zlog_debug if (isis->debugs & DEBUG_UPDATE_PACKETS)
("ISIS-Upd (%s): (1) re-originating LSP %s new seq 0x%08x", zlog_debug ("ISIS-Upd (%s): (1) re-originating LSP %s new "
circuit->area->area_tag, rawlspid_print (hdr->lsp_id), "seq 0x%08x", circuit->area->area_tag,
ntohl (lsp->lsp_header->seq_num)); rawlspid_print (hdr->lsp_id),
ntohl (lsp->lsp_header->seq_num));
lsp->lsp_header->rem_lifetime = lsp->lsp_header->rem_lifetime =
htons (isis_jitter htons (isis_jitter
(circuit->area->max_lsp_lifetime[level - 1], (circuit->area->max_lsp_lifetime[level - 1],
@ -1168,10 +1171,11 @@ dontcheckadj:
ntohs (lsp->lsp_header->pdu_len) - 12, 12); ntohs (lsp->lsp_header->pdu_len) - 12, 12);
ISIS_FLAGS_SET_ALL (lsp->SRMflags); ISIS_FLAGS_SET_ALL (lsp->SRMflags);
zlog_debug if (isis->debugs & DEBUG_UPDATE_PACKETS)
("ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08x", zlog_debug ("ISIS-Upd (%s): (2) re-originating LSP %s new seq "
circuit->area->area_tag, rawlspid_print (hdr->lsp_id), "0x%08x", circuit->area->area_tag,
ntohl (lsp->lsp_header->seq_num)); rawlspid_print (hdr->lsp_id),
ntohl (lsp->lsp_header->seq_num));
lsp->lsp_header->rem_lifetime = lsp->lsp_header->rem_lifetime =
htons (isis_jitter htons (isis_jitter
(circuit->area->max_lsp_lifetime[level - 1], (circuit->area->max_lsp_lifetime[level - 1],

View File

@ -781,8 +781,9 @@ isis_spf_preload_tent (struct isis_spftree *spftree,
if (listcount (adj_list) == 0) if (listcount (adj_list) == 0)
{ {
list_delete (adj_list); list_delete (adj_list);
zlog_warn ("ISIS-Spf: no L%d adjacencies on circuit %s", if (isis->debugs & DEBUG_SPF_EVENTS)
level, circuit->interface->name); zlog_debug ("ISIS-Spf: no L%d adjacencies on circuit %s",
level, circuit->interface->name);
continue; continue;
} }
anode = listhead (adj_list); anode = listhead (adj_list);

View File

@ -33,8 +33,10 @@
#include "stream.h" #include "stream.h"
#include "linklist.h" #include "linklist.h"
#include "isisd/dict.h"
#include "isisd/isis_constants.h" #include "isisd/isis_constants.h"
#include "isisd/isis_common.h" #include "isisd/isis_common.h"
#include "isisd/isisd.h"
#include "isisd/isis_circuit.h" #include "isisd/isis_circuit.h"
#include "isisd/isis_csm.h" #include "isisd/isis_csm.h"
#include "isisd/isis_route.h" #include "isisd/isis_route.h"
@ -43,6 +45,8 @@
struct zclient *zclient = NULL; struct zclient *zclient = NULL;
extern struct thread_master *master; extern struct thread_master *master;
extern struct isis *isis;
struct in_addr router_id_zebra; struct in_addr router_id_zebra;
/* Router-id update message from zebra. */ /* Router-id update message from zebra. */
@ -66,9 +70,9 @@ isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length)
ifp = zebra_interface_add_read (zclient->ibuf); ifp = zebra_interface_add_read (zclient->ibuf);
if (isis->debugs & DEBUG_ZEBRA)
zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d", 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); ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
if (if_is_operative (ifp)) if (if_is_operative (ifp))
isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
@ -92,8 +96,9 @@ isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length)
zlog_warn ("Zebra: got delete of %s, but interface is still up", zlog_warn ("Zebra: got delete of %s, but interface is still up",
ifp->name); ifp->name);
zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d", if (isis->debugs & DEBUG_ZEBRA)
ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); 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 /* Cannot call if_delete because we should retain the pseudo interface
@ -560,7 +565,8 @@ isis_zebra_read_ipv4 (int command, struct zclient *zclient,
if (command == ZEBRA_IPV4_ROUTE_ADD) 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; return 0;

View File

@ -171,7 +171,8 @@ isis_area_get (struct vty *vty, const char *area_tag)
area->area_tag = strdup (area_tag); area->area_tag = strdup (area_tag);
listnode_add (isis->area_list, area); 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->node = ISIS_NODE;
vty->index = area; vty->index = area;
@ -260,7 +261,8 @@ area_net_title (struct vty *vty, u_char *net_title)
*/ */
memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN); memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN);
isis->sysid_set = 1; 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 else
{ {

View File

@ -144,5 +144,6 @@ struct isis_area *isis_area_lookup (const char *);
#define DEBUG_SPF_TRIGGERS (1<<8) #define DEBUG_SPF_TRIGGERS (1<<8)
#define DEBUG_RTE_EVENTS (1<<9) #define DEBUG_RTE_EVENTS (1<<9)
#define DEBUG_EVENTS (1<<10) #define DEBUG_EVENTS (1<<10)
#define DEBUG_ZEBRA (1<<11)
#endif /* ISISD_H */ #endif /* ISISD_H */