]> git.puffer.fish Git - mirror/frr.git/commitdiff
* *.c: Try to be less verbose by default (without any debug options
authorhasso <hasso>
Sun, 4 Sep 2005 21:36:36 +0000 (21:36 +0000)
committerhasso <hasso>
Sun, 4 Sep 2005 21:36:36 +0000 (21:36 +0000)
  on).
* isis_lsp.c (lsp_build_nonpseudo): Use stream_reset() instead of
  touching endp directly.
* isis_lsp.c (lsp_build_pseudo): Ditto.

12 files changed:
isisd/ChangeLog
isisd/isis_circuit.c
isisd/isis_csm.c
isisd/isis_dr.c
isisd/isis_events.c
isisd/isis_lsp.c
isisd/isis_main.c
isisd/isis_pdu.c
isisd/isis_spf.c
isisd/isis_zebra.c
isisd/isisd.c
isisd/isisd.h

index d418d63b0bee9093c9e4eeb313acc231f85770be..822d856b16a17fdaccca21ff0435755e46a2deb4 100644 (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>
 
        * isis_lsp.c: Yet another regression introduced by stream cleanup.
index b99fa5daf0af51c5ee03691607fdf3cad0563132..e885a658812e162efd02f57fc7bb320dc532c40b 100644 (file)
@@ -404,7 +404,9 @@ isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
     }
   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))
@@ -842,7 +844,8 @@ DEFUN (ip_router_isis,
       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
        }
@@ -852,7 +855,8 @@ DEFUN (ip_router_isis,
   /* 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;
     }
 
index 58a0b295e40754a5c56dc2dae9e26fece1cbcf77..80d0c9066340c33e1ff2dcfe9970111164e7c470 100644 (file)
@@ -77,8 +77,8 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
   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)
     {
@@ -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_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;
 }
index a5891f945192e4aa873b65d10dccd6b99eed7090..335946c85f8c8e3a029fbeb992f9842ec6dd2d0a 100644 (file)
@@ -307,7 +307,8 @@ isis_dr_commence (struct isis_circuit *circuit, int level)
 {
   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;
index d54036a5fc3dfb2a83e17cc308df70e15ecc1004..a8e60d6d52a1f1161a0ff81a2c14712aa73ed097 100644 (file)
@@ -283,8 +283,9 @@ isis_event_adjacency_state_change (struct isis_adjacency *adj, int newstate)
   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);
@@ -304,8 +305,8 @@ isis_event_dis_status_change (struct thread *thread)
   /* 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);
@@ -316,8 +317,9 @@ isis_event_dis_status_change (struct thread *thread)
 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;
 }
index cb7b93b4cf62459585007d5f4e8944e972632cd6..2a9d1465775a72b91a5001b32ef139002035ef4c 100644 (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);
 
-  /* #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;
 }
@@ -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
    * 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);
 
   /*
@@ -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. */
-  lsp->pdu->endp = 0;
+  stream_reset (lsp->pdu);
   stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
 
   /*
index a4f80582792ba95a8d0a0d11b65b1701a9b5fa3a..2bb22cb68556b38c05e1b5ca0d2dbc396cfd5263 100644 (file)
@@ -325,9 +325,7 @@ main (int argc, char **argv, char **envp)
 
   /* 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);
index e6a1e0382d300297397c093e4df880c5de820bf1..b15d4551cd9900529543df57f95dfe044933956b 100644 (file)
@@ -1121,14 +1121,17 @@ dontcheckadj:
                      && 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],
@@ -1168,10 +1171,11 @@ dontcheckadj:
                           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],
index dc5765a577ec4f94723fef833be20cc2f2a73f16..ba7acbfb0d844d94ce149f35d74c475a14144736 100644 (file)
@@ -781,8 +781,9 @@ isis_spf_preload_tent (struct isis_spftree *spftree,
          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);
index 889c5bfb98deda20f758de8d9ad823dbe628fdd8..a385e6b5c94fd9e74b791fb201ec9daac8a9b216 100644 (file)
 #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"
@@ -43,6 +45,8 @@
 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. */
@@ -66,9 +70,9 @@ isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length)
 
   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);
@@ -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",
               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
@@ -560,7 +565,8 @@ isis_zebra_read_ipv4 (int command, struct zclient *zclient,
 
   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;
index e6679cf3599e4f11413752f806b57ebbde4a4abb..a8d6950ace17c0b4ba5f2adddca566ae1f2f0e2d 100644 (file)
@@ -171,7 +171,8 @@ isis_area_get (struct vty *vty, const char *area_tag)
   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;
@@ -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);
       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
     {
index 77de12ec552f55e8c91195efe7506f63f5d40b91..7a9f764498a966e6916be0db938aec8a9aa4cc4e 100644 (file)
@@ -144,5 +144,6 @@ struct isis_area *isis_area_lookup (const char *);
 #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 */