gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (fd30e4bf7 -> 8b8b1d58d)


From: gnunet
Subject: [gnunet] branch master updated (fd30e4bf7 -> 8b8b1d58d)
Date: Tue, 05 Jan 2021 17:40:25 +0100

This is an automated email from the git hooks/post-receive script.

t3sserakt pushed a change to branch master
in repository gnunet.

    from fd30e4bf7 bump changelog
     new 5affc9ad0 - started making tng communicator test code more resilient
     new fac97cea4 Merge branch 'master' of ssh://gnunet.org/gnunet
     new 8b8b1d58d - added configuration to the tng communicator test code

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/transport/gnunet-communicator-tcp.c            | 111 ++++++---
 src/transport/test_communicator_basic.c            | 267 +++++++++++++++------
 .../test_communicator_tcp_basic_peer1.conf         |   2 +-
 .../test_communicator_tcp_basic_peer2.conf         |   2 +-
 .../test_communicator_tcp_rekey_peer2.conf         |   2 +-
 src/transport/transport-testing-communicator.c     |   1 +
 6 files changed, 287 insertions(+), 98 deletions(-)

diff --git a/src/transport/gnunet-communicator-tcp.c 
b/src/transport/gnunet-communicator-tcp.c
index 59f42496a..0c79fc1b4 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -540,6 +540,11 @@ struct Queue
    */
   enum GNUNET_NetworkType nt;
 
+  /**
+   * The connection status of this queue.
+   */
+  enum GNUNET_TRANSPORT_ConnectionStatus cs;
+
   /**
    * Is MQ awaiting a #GNUNET_MQ_impl_send_continue() call?
    */
@@ -828,7 +833,8 @@ int addrs_lens;
 /**
  * Size of data received without KX challenge played back.
  */
-size_t unverified_size;
+// TODO remove?
+// size_t unverified_size;
 
 /**
  * Database for peer's HELLOs.
@@ -1434,6 +1440,9 @@ try_handle_plaintext (struct Queue *queue)
   struct TcpHandshakeAckSignature thas;
   const struct ChallengeNonceP challenge = queue->challenge;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "try handle plaintext!\n");
+
   if ((sizeof(*hdr) > queue->pread_off))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1441,16 +1450,16 @@ try_handle_plaintext (struct Queue *queue)
     return 0; /* not even a header */
   }
 
-  if ((-1 != unverified_size) && (unverified_size > INITIAL_CORE_KX_SIZE))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Already received data of size %lu bigger than KX size %lu!\n",
-                unverified_size,
-                INITIAL_CORE_KX_SIZE);
-    GNUNET_break_op (0);
-    queue_finish (queue);
-    return 0;
-  }
+  /* if ((-1 != unverified_size) && (unverified_size > INITIAL_CORE_KX_SIZE)) 
*/
+  /* { */
+  /*   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, */
+  /*               "Already received data of size %lu bigger than KX size 
%lu!\n", */
+  /*               unverified_size, */
+  /*               INITIAL_CORE_KX_SIZE); */
+  /*   GNUNET_break_op (0); */
+  /*   queue_finish (queue); */
+  /*   return 0; */
+  /* } */
 
   type = ntohs (hdr->type);
   switch (type)
@@ -1513,7 +1522,41 @@ try_handle_plaintext (struct Queue *queue)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Handling plaintext, ack processed!");
 
-    unverified_size = -1;
+    // unverified_size = -1;
+
+    /* char *foreign_addr; */
+
+    /* switch (queue->address->sa_family) */
+    /* { */
+    /* case AF_INET: */
+    /*   GNUNET_asprintf (&foreign_addr, */
+    /*                    "%s-%s", */
+    /*                    COMMUNICATOR_ADDRESS_PREFIX, */
+    /*                    GNUNET_a2s (queue->address, queue->address_len)); */
+    /*   break; */
+
+    /* case AF_INET6: */
+    /*   GNUNET_asprintf (&foreign_addr, */
+    /*                    "%s-%s", */
+    /*                    COMMUNICATOR_ADDRESS_PREFIX, */
+    /*                    GNUNET_a2s (queue->address, queue->address_len)); */
+    /*   break; */
+
+    /* default: */
+    /*   GNUNET_assert (0); */
+    /* } */
+
+    /* queue->qh = GNUNET_TRANSPORT_communicator_mq_add (ch, */
+    /*                                                   &queue->target, */
+    /*                                                   foreign_addr, */
+    /*                                                   0 /\* no MTU *\/, */
+    /*                                                   
GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, */
+    /*                                                   0, /\* Priority *\/ */
+    /*                                                   queue->nt, */
+    /*                                                   queue->cs, */
+    /*                                                   queue->mq); */
+
+    /* GNUNET_free (foreign_addr); */
 
     size = ntohs (hdr->size);
     break;
@@ -1590,8 +1633,8 @@ try_handle_plaintext (struct Queue *queue)
     return 0;
   }
   GNUNET_assert (0 != size);
-  if (-1 != unverified_size)
-    unverified_size += size;
+  /* if (-1 != unverified_size) */
+  /*   unverified_size += size; */
   return size;
 }
 
@@ -2139,11 +2182,12 @@ queue_write (void *cls)
     queue->cwrite_off += queue->pwrite_off;
     queue->pwrite_off = 0;
   }
-  if ((-1 != unverified_size)&& ((0 == queue->pwrite_off) &&
-                                 ((0 == queue->rekey_left_bytes) ||
-                                  (0 ==
-                                   GNUNET_TIME_absolute_get_remaining (
-                                     queue->rekey_time).rel_value_us))))
+  // if ((-1 != unverified_size)&& ((0 == queue->pwrite_off) &&
+  if (((0 == queue->pwrite_off) &&
+       ((0 == queue->rekey_left_bytes) ||
+        (0 ==
+         GNUNET_TIME_absolute_get_remaining (
+           queue->rekey_time).rel_value_us))))
   {
     inject_rekey (queue);
   }
@@ -2282,7 +2326,7 @@ mq_error (void *cls, enum GNUNET_MQ_Error error)
  * @param queue queue to boot
  */
 static void
-boot_queue (struct Queue *queue, enum GNUNET_TRANSPORT_ConnectionStatus cs)
+boot_queue (struct Queue *queue)
 {
   queue->nt =
     GNUNET_NT_scanner_get_type (is, queue->address, queue->address_len);
@@ -2333,7 +2377,7 @@ boot_queue (struct Queue *queue, enum 
GNUNET_TRANSPORT_ConnectionStatus cs)
                                                       
GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED,
                                                       0, /* Priority */
                                                       queue->nt,
-                                                      cs,
+                                                      queue->cs,
                                                       queue->mq);
     GNUNET_free (foreign_addr);
   }
@@ -2557,7 +2601,7 @@ free_proto_queue (struct ProtoQueue *pq)
  * @param queue The queue context.
  */
 static void
-send_challenge (struct TCPConfirmation tc, struct Queue *queue)
+send_challenge (struct ChallengeNonceP challenge, struct Queue *queue)
 {
   struct TCPConfirmationAck tca;
   struct TcpHandshakeAckSignature thas;
@@ -2569,7 +2613,7 @@ send_challenge (struct TCPConfirmation tc, struct Queue 
*queue)
   tca.header.type = ntohs (
     GNUNET_MESSAGE_TYPE_COMMUNICATOR_TCP_CONFIRMATION_ACK);
   tca.header.size = ntohs (sizeof(tca));
-  tca.challenge = tc.challenge;
+  tca.challenge = challenge;
   tca.sender = my_identity;
   tca.monotonic_time =
     GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg));
@@ -2665,7 +2709,8 @@ proto_read_kx (void *cls)
               "start kx proto\n");
 
   start_initial_kx_out (queue);
-  boot_queue (queue, GNUNET_TRANSPORT_CS_INBOUND);
+  queue->cs = GNUNET_TRANSPORT_CS_INBOUND;
+  boot_queue (queue);
   queue->read_task =
     GNUNET_SCHEDULER_add_read_net (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
                                    queue->sock,
@@ -2676,7 +2721,8 @@ proto_read_kx (void *cls)
                                     queue->sock,
                                     &queue_write,
                                     queue);
-  send_challenge (tc, queue);
+  // TODO To early! Move it somewhere else.
+  // send_challenge (tc, queue);
 
   GNUNET_CONTAINER_DLL_remove (proto_head, proto_tail, pq);
   GNUNET_free (pq);
@@ -2762,7 +2808,9 @@ queue_read_kx (void *cls)
   rcvd = GNUNET_NETWORK_socket_recv (queue->sock,
                                      &queue->cread_buf[queue->cread_off],
                                      BUF_SIZE - queue->cread_off);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %lu bytes for KX\n", rcvd);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received %lu bytes for KX\n",
+              rcvd);
   if (-1 == rcvd)
   {
     if ((EAGAIN != errno) && (EINTR != errno))
@@ -2804,14 +2852,20 @@ queue_read_kx (void *cls)
     queue_destroy (queue);
     return;
   }
-  send_challenge (tc, queue);
+  send_challenge (tc.challenge, queue);
   /* update queue timeout */
   reschedule_queue_timeout (queue);
   /* prepare to continue with regular read task immediately */
   memmove (queue->cread_buf,
            &queue->cread_buf[INITIAL_KX_SIZE],
            queue->cread_off - (INITIAL_KX_SIZE));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "cread_off is %lu bytes before adjusting\n",
+              queue->cread_off);
   queue->cread_off -= INITIAL_KX_SIZE;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "cread_off set to %lu bytes\n",
+              queue->cread_off);
   if (0 < queue->cread_off)
     queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue);
 }
@@ -2893,7 +2947,8 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity 
*peer, const char *address)
   queue->address = in;
   queue->address_len = in_len;
   queue->sock = sock;
-  boot_queue (queue, GNUNET_TRANSPORT_CS_OUTBOUND);
+  queue->cs = GNUNET_TRANSPORT_CS_OUTBOUND;
+  boot_queue (queue);
   // queue->mq_awaits_continue = GNUNET_YES;
   queue->read_task =
     GNUNET_SCHEDULER_add_read_net (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
diff --git a/src/transport/test_communicator_basic.c 
b/src/transport/test_communicator_basic.c
index ea1a7b1fb..55df9a022 100644
--- a/src/transport/test_communicator_basic.c
+++ b/src/transport/test_communicator_basic.c
@@ -61,6 +61,8 @@ static char *cfg_peers_name[NUM_PEERS];
 
 static int ret;
 
+static int bidirect = GNUNET_NO;
+
 static size_t long_message_size;
 
 static struct GNUNET_TIME_Absolute start_short;
@@ -71,16 +73,25 @@ static struct GNUNET_TIME_Absolute timeout;
 
 static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *my_tc;
 
+static struct
+GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tcs[NUM_PEERS];
+
+static char *communicator_name;
+
 static char *test_name;
 
 static struct GNUNET_STATISTICS_GetHandle *box_stats;
 
 static struct GNUNET_STATISTICS_GetHandle *rekey_stats;
 
+#define TEST_SECTION "test-setup"
+
 #define SHORT_MESSAGE_SIZE 128
 
 #define LONG_MESSAGE_SIZE 32000 /* FIXME */
 
+#define ALLOWED_PACKET_LOSS 91
+
 #define BURST_PACKETS 5000
 
 #define TOTAL_ITERATIONS 1
@@ -110,6 +121,27 @@ enum TestPhase
   TP_SIZE_CHECK
 };
 
+static unsigned int phase_short;
+
+static unsigned int phase_long;
+
+static unsigned int phase_size;
+
+static long long unsigned int allowed_packet_loss_short;
+
+static long long unsigned int allowed_packet_loss_long;
+
+static long long unsigned int burst_packets_short;
+
+static long long unsigned int burst_packets_long;
+
+static long long unsigned int delay_long_value;
+
+static long long unsigned int delay_short_value;
+
+static struct GNUNET_TIME_Relative delay_short;
+
+static struct GNUNET_TIME_Relative delay_long;
 
 static size_t num_sent_short = 0;
 
@@ -296,10 +328,6 @@ latency_timeout (void *cls)
   GNUNET_SCHEDULER_shutdown ();
 }
 
-
-/*static void
-  size_test (void *cls);*/
-
 static void
 size_test (void *cls)
 {
@@ -345,15 +373,14 @@ long_test_cb (void *cls)
        (unsigned int) num_received_long);
   payload = make_payload (long_message_size);
   num_sent_long++;
-  GNUNET_TRANSPORT_TESTING_transport_communicator_send (
-    my_tc,
-    ((BURST_PACKETS * 0.91 == num_received_long) ||
-     (BURST_PACKETS == num_sent_long))
-    ? NULL
-    : &long_test,
-    NULL,
-    payload,
-    long_message_size);
+  GNUNET_TRANSPORT_TESTING_transport_communicator_send (my_tc,
+                                                        (burst_packets_long ==
+                                                         num_sent_long)
+                                                        ? NULL
+                                                        : &long_test,
+                                                        NULL,
+                                                        payload,
+                                                        long_message_size);
   GNUNET_free (payload);
   timeout = GNUNET_TIME_relative_to_absolute (
     GNUNET_TIME_relative_multiply (
@@ -365,10 +392,7 @@ long_test_cb (void *cls)
 static void
 long_test (void *cls)
 {
-  /*LOG (GNUNET_ERROR_TYPE_DEBUG,
-       "long_test %u\n",
-       num_sent_long);*/
-  GNUNET_SCHEDULER_add_delayed (DELAY,
+  GNUNET_SCHEDULER_add_delayed (delay_long,
                                 &long_test_cb,
                                 NULL);
 }
@@ -389,15 +413,14 @@ short_test_cb (void *cls)
        (unsigned int) num_received_short);
   payload = make_payload (SHORT_MESSAGE_SIZE);
   num_sent_short++;
-  GNUNET_TRANSPORT_TESTING_transport_communicator_send (
-    my_tc,
-    ( (BURST_PACKETS * 0.91 == num_received_short) ||
-      (BURST_PACKETS == num_sent_short) )
-    ? NULL
-    : &short_test,
-    NULL,
-    payload,
-    SHORT_MESSAGE_SIZE);
+  GNUNET_TRANSPORT_TESTING_transport_communicator_send (my_tc,
+                                                        (burst_packets_short ==
+                                                         num_sent_short)
+                                                        ? NULL
+                                                        : &short_test,
+                                                        NULL,
+                                                        payload,
+                                                        SHORT_MESSAGE_SIZE);
   GNUNET_free (payload);
   timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (
                                                 GNUNET_TIME_UNIT_SECONDS,
@@ -408,40 +431,61 @@ short_test_cb (void *cls)
 static void
 short_test (void *cls)
 {
-  GNUNET_SCHEDULER_add_delayed (DELAY,
+  GNUNET_SCHEDULER_add_delayed (delay_short,
                                 &short_test_cb,
                                 NULL);
 }
 
 
-static int test_prepared = GNUNET_NO;
+/* static int test_prepared = GNUNET_NO; */
+
+/* This helps establishing the backchannel */
+/* static void */
+/* prepare_test (void *cls) */
+/* { */
+/*   char *payload; */
+
+/*   if (GNUNET_YES == test_prepared) */
+/*   { */
+/*     GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, */
+/*                                   &short_test, */
+/*                                   NULL); */
+/*     return; */
+/*   } */
+/*   test_prepared = GNUNET_YES; */
+/*   payload = make_payload (SHORT_MESSAGE_SIZE); */
+/*   GNUNET_TRANSPORT_TESTING_transport_communicator_send (my_tc, */
+/*                                                         &prepare_test, */
+/*                                                         NULL, */
+/*                                                         payload, */
+/*                                                         
SHORT_MESSAGE_SIZE); */
+/*   GNUNET_free (payload); */
+/* } */
 
-/**
- * This helps establishing the backchannel
- */
 static void
-prepare_test (void *cls)
+choose_phase ()
 {
-  char *payload;
-
-  if (GNUNET_YES == test_prepared)
+  if (phase_short)
   {
-    GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
-                                  &short_test,
-                                  NULL);
-    return;
+    phase =  TP_BURST_SHORT;
+    start_short = GNUNET_TIME_absolute_get ();
+    short_test (NULL);
   }
-  test_prepared = GNUNET_YES;
-  payload = make_payload (SHORT_MESSAGE_SIZE);
-  GNUNET_TRANSPORT_TESTING_transport_communicator_send (my_tc,
-                                                        &prepare_test,
-                                                        NULL,
-                                                        payload,
-                                                        SHORT_MESSAGE_SIZE);
-  GNUNET_free (payload);
+  else if (phase_long)
+  {
+    phase =  TP_BURST_LONG;
+    start_long = GNUNET_TIME_absolute_get ();
+    long_test (NULL);
+  }
+  else if (phase_size)
+  {
+    phase =  TP_SIZE_CHECK;
+    size_test (NULL);
+  }
+  else
+    GNUNET_assert (0);
 }
 
-
 /**
  * @brief Handle opening of queue
  *
@@ -466,14 +510,14 @@ add_queue_cb (void *cls,
     return; // TODO?
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Queue established, starting test...\n");
-  start_short = GNUNET_TIME_absolute_get ();
+  // start_short = GNUNET_TIME_absolute_get ();
   my_tc = tc_h;
   if (0 != mtu) /* Message header overhead */
     long_message_size = mtu - sizeof(struct GNUNET_TRANSPORT_SendMessageTo)
                         - sizeof(struct GNUNET_MessageHeader);
   else
     long_message_size = LONG_MESSAGE_SIZE;
-  phase = TP_BURST_SHORT;
+  // phase = TP_BURST_SHORT;
   timeout = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (
                                                 GNUNET_TIME_UNIT_SECONDS,
                                                 TIMEOUT_MULTIPLIER));
@@ -484,7 +528,8 @@ add_queue_cb (void *cls,
                                           &latency_timeout,
                                           NULL);
   // prepare_test (NULL);
-  short_test (NULL);
+  // short_test (NULL);
+  choose_phase ();
 }
 
 
@@ -600,6 +645,30 @@ process_statistics (void *cls,
   return GNUNET_OK;
 }
 
+static void
+load_phase_config ()
+{
+
+  phase_short =  GNUNET_CONFIGURATION_get_value_yesno (cfg_peers[0],
+                                                       TEST_SECTION,
+                                                       "PHASE_SHORT");
+  if (GNUNET_SYSERR == phase_short)
+    phase_short = GNUNET_YES;
+
+  phase_long =  GNUNET_CONFIGURATION_get_value_yesno (cfg_peers[0],
+                                                      TEST_SECTION,
+                                                      "PHASE_LONG");
+
+  if (GNUNET_SYSERR == phase_long)
+    phase_long = GNUNET_YES;
+
+  phase_size =   GNUNET_CONFIGURATION_get_value_yesno (cfg_peers[0],
+                                                       TEST_SECTION,
+                                                       "PHASE_SIZE");
+
+  if (GNUNET_SYSERR == phase_size)
+    phase_size = GNUNET_YES;
+}
 
 /**
  * @brief Handle an incoming message
@@ -639,7 +708,10 @@ incoming_message_cb (
       num_received_short++;
       duration = GNUNET_TIME_absolute_get_duration (start_short);
       update_avg_latency (payload);
-      if (num_received_short == BURST_PACKETS * 0.91)
+      if ((num_sent_short == burst_packets_short) && (num_received_short >
+                                                      burst_packets_short / 100
+                                                      *
+                                                      
allowed_packet_loss_short) )
       {
         LOG (GNUNET_ERROR_TYPE_MESSAGE,
              "Short size packet test done.\n");
@@ -654,12 +726,14 @@ incoming_message_cb (
              goodput,
              (unsigned long long) avg_latency);
         GNUNET_free (goodput);
-        start_long = GNUNET_TIME_absolute_get ();
-        phase = TP_BURST_LONG;
+        // start_long = GNUNET_TIME_absolute_get ();
+        // phase = TP_BURST_LONG;
         // num_sent_short = 0;
         avg_latency = 0;
         // num_received = 0;
-        long_test (NULL);
+        phase_short = GNUNET_NO;
+        choose_phase ();
+        // long_test (NULL);
       }
       break;
     }
@@ -674,7 +748,10 @@ incoming_message_cb (
       num_received_long++;
       duration = GNUNET_TIME_absolute_get_duration (start_long);
       update_avg_latency (payload);
-      if (num_received_long == BURST_PACKETS * 0.91)
+      if ((num_sent_long == burst_packets_long) && (num_received_long >
+                                                    burst_packets_long
+                                                    / 100
+                                                    * 
allowed_packet_loss_short) )
       {
         LOG (GNUNET_ERROR_TYPE_MESSAGE,
              "Long size packet test done.\n");
@@ -692,11 +769,13 @@ incoming_message_cb (
              (unsigned long long) avg_latency);
         GNUNET_free (goodput);
         ack = 0;
-        phase = TP_SIZE_CHECK;
+        // phase = TP_SIZE_CHECK;
         // num_received = 0;
         // num_sent_long = 0;
         avg_latency = 0;
-        size_test (NULL);
+        // size_test (NULL);
+        phase_long = GNUNET_NO;
+        choose_phase ();
       }
       break;
     }
@@ -724,17 +803,22 @@ incoming_message_cb (
         iterations_left--;
         if (0 != iterations_left)
         {
-          start_short = GNUNET_TIME_absolute_get ();
-          phase = TP_BURST_SHORT;
+          // start_short = GNUNET_TIME_absolute_get ();
+          // phase = TP_BURST_SHORT;
           num_sent_short = 0;
           num_sent_long = 0;
           num_received_short = 0;
           num_received_long = 0;
-          short_test (NULL);
+          // short_test (NULL);
+          load_phase_config ();
+          choose_phase ();
           break;
         }
-        if ( (0 == strcmp ("rekey", test_name)) ||
-             (0 == strcmp ("backchannel", test_name)) )
+        if ((0 == strcmp ("udp", communicator_name)) && ((0 == strcmp ("rekey",
+                                                                       
test_name))
+                                                         ||(0 == strcmp (
+                                                              "backchannel",
+                                                              test_name))) )
         {
           if (NULL != box_stats)
             GNUNET_STATISTICS_get_cancel (box_stats);
@@ -795,6 +879,7 @@ do_shutdown (void *cls)
 }
 
 
+
 /**
  * @brief Main function called by the scheduler
  *
@@ -821,24 +906,29 @@ run (void *cls)
       &handle_backchannel_cb,
       cfg_peers_name[i]);   /* cls */
 
-    if ((0 == strcmp ("rekey", test_name)) || (0 == strcmp ("backchannel",
-                                                            test_name)) )
+    if ((0 == strcmp ("udp", communicator_name)) && ((0 == strcmp ("rekey",
+                                                                   
test_name))||
+                                                     (0 == strcmp (
+                                                        "backchannel",
+                                                        test_name))) )
     {
       stats[i] = GNUNET_STATISTICS_create ("C-UDP",
                                            cfg_peers[i]);
     }
+    else if ((0 == strcmp ("bidirect", test_name)))
+    {
+      bidirect = GNUNET_YES;
+    }
   }
   GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
                                  NULL);
 }
 
-
 int
 main (int argc,
       char *const *argv)
 {
   struct GNUNET_CRYPTO_EddsaPrivateKey *private_key;
-  char *communicator_name;
   char *test_mode;
   char *cfg_peer;
 
@@ -911,6 +1001,49 @@ main (int argc,
          i,
          GNUNET_i2s_full (&peer_id[i]));
   }
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "ALLOWED_PACKET_LOSS_SHORT",
+                                             &allowed_packet_loss_short))
+    allowed_packet_loss_short = ALLOWED_PACKET_LOSS;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "ALLOWED_PACKET_LOSS_LONG",
+                                             &allowed_packet_loss_long))
+    allowed_packet_loss_long = ALLOWED_PACKET_LOSS;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "BURST_PACKETS_SHORT",
+                                             &burst_packets_short))
+    burst_packets_short = BURST_PACKETS;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "BURST_├ťACKETS_LONG",
+                                             &burst_packets_long))
+    burst_packets_long = BURST_PACKETS;
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "DELAY_SHORT",
+                                             &delay_short_value))
+    delay_short = DELAY;
+  else
+    GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,
+                                   delay_short_value);
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg_peers[0],
+                                             TEST_SECTION,
+                                             "DELAY_SHORT",
+                                             &delay_long_value))
+    delay_long = DELAY;
+  else
+    GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MICROSECONDS,
+                                   delay_long_value);
+  load_phase_config ();
   LOG (GNUNET_ERROR_TYPE_MESSAGE, "Starting test...\n");
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "argv[0]: %s\n",
diff --git a/src/transport/test_communicator_tcp_basic_peer1.conf 
b/src/transport/test_communicator_tcp_basic_peer1.conf
index 2411f485b..b32aa1c17 100644
--- a/src/transport/test_communicator_tcp_basic_peer1.conf
+++ b/src/transport/test_communicator_tcp_basic_peer1.conf
@@ -33,7 +33,7 @@ UNIXPATH = 
$GNUNET_RUNTIME_DIR/test_gnunet-communicator-unix_1.sock
 #PREFIX = xterm -geometry 100x85 -T peer1 -e gdb --args
 #PREFIX = valgrind --leak-check=full --track-origins=yes
 BINDTO = 60002
-DISABLE_V6 = NO
+DISABLE_V6 = YES
 
 [communicator-udp]
 BINDTO = 60002
diff --git a/src/transport/test_communicator_tcp_basic_peer2.conf 
b/src/transport/test_communicator_tcp_basic_peer2.conf
index 8005718bf..b73157f0d 100644
--- a/src/transport/test_communicator_tcp_basic_peer2.conf
+++ b/src/transport/test_communicator_tcp_basic_peer2.conf
@@ -34,7 +34,7 @@ UNIXPATH = 
$GNUNET_RUNTIME_DIR/test_gnunet-communicator-unix_2.sock
 #PREFIX = xterm -geometry 100x85 -T peer2 -e gdb --args
 #PREFIX = valgrind --leak-check=full --track-origins=yes 
 BINDTO = 60003
-DISABLE_V6 = NO
+DISABLE_V6 = YES
 
 [communicator-udp]
 BINDTO = 60003
diff --git a/src/transport/test_communicator_tcp_rekey_peer2.conf 
b/src/transport/test_communicator_tcp_rekey_peer2.conf
index 1036039c4..086a996ae 100644
--- a/src/transport/test_communicator_tcp_rekey_peer2.conf
+++ b/src/transport/test_communicator_tcp_rekey_peer2.conf
@@ -38,7 +38,7 @@ UNIXPATH = 
$GNUNET_RUNTIME_DIR/test_gnunet-communicator-unix_2.sock
 #PREFIX = xterm -geometry 100x85 -T peer2 -e gdb --args
 #PREFIX = valgrind --leak-check=full --track-origins=yes
 BINDTO = 60003
-DISABLE_V6 = NO
+DISABLE_V6 = YES
 REKEY_INTERVAL = 100ms
 
 [communicator-udp]
diff --git a/src/transport/transport-testing-communicator.c 
b/src/transport/transport-testing-communicator.c
index 56240864c..de356fb9c 100644
--- a/src/transport/transport-testing-communicator.c
+++ b/src/transport/transport-testing-communicator.c
@@ -317,6 +317,7 @@ handle_add_address (void *cls,
     client->tc;
   uint16_t size;
   size = ntohs (msg->header.size) - sizeof(*msg);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "received add address cb %u\n", size);
   if (0 == size)
     return; /* receive-only communicator */
   LOG (GNUNET_ERROR_TYPE_DEBUG, "received add address cb %u\n", size);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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