gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r36080 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r36080 - gnunet/src/cadet
Date: Wed, 15 Jul 2015 13:45:15 +0200

Author: bartpolot
Date: 2015-07-15 13:45:15 +0200 (Wed, 15 Jul 2015)
New Revision: 36080

Modified:
   gnunet/src/cadet/gnunet-service-cadet_connection.c
   gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
Detailed statistics

Modified: gnunet/src/cadet/gnunet-service-cadet_connection.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_connection.c  2015-07-15 11:45:14 UTC 
(rev 36079)
+++ gnunet/src/cadet/gnunet-service-cadet_connection.c  2015-07-15 11:45:15 UTC 
(rev 36080)
@@ -2470,7 +2470,7 @@
   /* Is this message for us? */
   if (GCC_is_terminal (c, fwd))
   {
-    GNUNET_STATISTICS_update (stats, "# messages received", 1, GNUNET_NO);
+    GNUNET_STATISTICS_update (stats, "# received encrypted", 1, GNUNET_NO);
 
     if (NULL == c->t)
     {
@@ -2546,7 +2546,7 @@
   if (GCC_is_terminal (c, fwd))
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  message for us!\n");
-    GNUNET_STATISTICS_update (stats, "# messages received", 1, GNUNET_NO);
+    GNUNET_STATISTICS_update (stats, "# received KX", 1, GNUNET_NO);
     if (NULL == c->t)
     {
       GNUNET_break (0);

Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-07-15 11:45:14 UTC 
(rev 36079)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2015-07-15 11:45:15 UTC 
(rev 36080)
@@ -2476,7 +2476,9 @@
              int fwd)
 {
   struct CadetChannel *ch;
+  char buf[128];
   size_t size;
+  uint16_t type;
 
   /* Check size */
   size = ntohs (msg->header.size);
@@ -2487,9 +2489,12 @@
     GNUNET_break (0);
     return;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n",
-              GC_m2s (ntohs (msg[1].header.type)));
+  type = ntohs (msg[1].header.type);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, " payload of type %s\n", GC_m2s (type));
+  sprintf (buf, "# received payload of type %hu", type);
+  GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO);
 
+
   /* Check channel */
   ch = GCT_get_channel (t, ntohl (msg->chid));
   if (NULL == ch)
@@ -3005,10 +3010,14 @@
                   int fwd)
 {
   uint16_t type;
+  char buf[256];
 
   type = ntohs (msgh->type);
   LOG (GNUNET_ERROR_TYPE_INFO, "<=== %s on %s\n", GC_m2s (type), GCT_2s (t));
+  sprintf (buf, "# received encrypted of type %hu (%s)", type, GC_m2s (type));
+  GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO);
 
+
   switch (type)
   {
     case GNUNET_MESSAGE_TYPE_CADET_KEEPALIVE:
@@ -3080,6 +3089,7 @@
     {
       const struct GNUNET_CADET_Encrypted *emsg;
 
+      GNUNET_STATISTICS_update (stats, "# received OTR", 1, GNUNET_NO);
       emsg = (const struct GNUNET_CADET_Encrypted *) msg;
       payload_size = size - sizeof (struct GNUNET_CADET_Encrypted);
       decrypted_size = t_decrypt_and_validate (t, cbuf, &emsg[1], payload_size,
@@ -3090,6 +3100,7 @@
     {
       const struct GNUNET_CADET_AX *emsg;
 
+      GNUNET_STATISTICS_update (stats, "# received Axolotl", 1, GNUNET_NO);
       emsg = (const struct GNUNET_CADET_AX *) msg;
       decrypted_size = t_ax_decrypt_and_validate (t, cbuf, emsg, size);
     }
@@ -3102,6 +3113,7 @@
   if (-1 == decrypted_size)
   {
     GNUNET_break_op (0);
+    GNUNET_STATISTICS_update (stats, "# unable to decrypt", 1, GNUNET_NO);
     LOG (GNUNET_ERROR_TYPE_WARNING, "Wrong crypto on tunnel %s\n", GCT_2s (t));
     GCT_debug (t, GNUNET_ERROR_TYPE_WARNING);
     return;
@@ -3140,9 +3152,12 @@
                const struct GNUNET_MessageHeader *message)
 {
   uint16_t type;
+  char buf[256];
 
   type = ntohs (message->type);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "kx message received: %s\n", GC_m2s (type));
+  sprintf (buf, "# received KX of type %hu (%s)", type, GC_m2s (type));
+  GNUNET_STATISTICS_update (stats, buf, 1, GNUNET_NO);
   switch (type)
   {
     case GNUNET_MESSAGE_TYPE_CADET_KX_EPHEMERAL:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]