gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24446 - in gnunet/src: include testbed


From: gnunet
Subject: [GNUnet-SVN] r24446 - in gnunet/src: include testbed
Date: Mon, 22 Oct 2012 13:44:04 +0200

Author: harsha
Date: 2012-10-22 13:44:04 +0200 (Mon, 22 Oct 2012)
New Revision: 24446

Modified:
   gnunet/src/include/gnunet_testbed_service.h
   gnunet/src/testbed/gnunet-testbed-profiler.c
   gnunet/src/testbed/test_testbed_api_topology.c
   gnunet/src/testbed/testbed_api_topology.c
Log:
option for disabling auto retry

Modified: gnunet/src/include/gnunet_testbed_service.h
===================================================================
--- gnunet/src/include/gnunet_testbed_service.h 2012-10-22 11:10:10 UTC (rev 
24445)
+++ gnunet/src/include/gnunet_testbed_service.h 2012-10-22 11:44:04 UTC (rev 
24446)
@@ -908,7 +908,8 @@
 
 
 /**
- * Topologies supported for testbeds.
+ * Topologies and topology options supported for testbeds. Options should 
always
+ * end with GNUNET_TESTBED_TOPOLOGY_OPTION_END
  */
 enum GNUNET_TESTBED_TopologyOption
 {
@@ -940,9 +941,8 @@
   GNUNET_TESTBED_TOPOLOGY_2D_TORUS,
 
   /**
-   * Random graph.  Followed by the link density, that is the
-   * percentage of links present in relation to a clique
-   * (float).
+   * Random graph.  Followed by the number of random links to be established
+   * (unsigned int)
    */
   GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
 
@@ -971,7 +971,23 @@
   /**
    * Read a topology from a given file.  Followed by the name of the file 
(const char *).
    */
-  GNUNET_TESTBED_TOPOLOGY_FROM_FILE
+  GNUNET_TESTBED_TOPOLOGY_FROM_FILE,
+
+  /**
+   * The options should always end with this
+   */
+  GNUNET_TESTBED_TOPOLOGY_OPTION_END,
+
+  /* The following are not topologies but influence how the topology has to be
+     setup. These options should follow the topology specific options (if
+     required by the chosen topology). Note that these should be given before
+     GNUNET_TESTBED_TOPOLOGY_OPTION_END */
+
+  /**
+   * Disable automatic retrying for failed overlay connections. The default is
+   * to always retry failed overlay connections. This parameter takes no 
options.
+   */
+  GNUNET_TESTBED_TOPOLOGY_DISABLE_AUTO_RETRY
 };
 
 

Modified: gnunet/src/testbed/gnunet-testbed-profiler.c
===================================================================
--- gnunet/src/testbed/gnunet-testbed-profiler.c        2012-10-22 11:10:10 UTC 
(rev 24445)
+++ gnunet/src/testbed/gnunet-testbed-profiler.c        2012-10-22 11:44:04 UTC 
(rev 24446)
@@ -334,8 +334,8 @@
     topology_op =
         GNUNET_TESTBED_overlay_configure_topology (NULL, num_peers, peers,
                                                    
GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
-
-                                                   num_links);
+                                                   num_links,
+                                                   
GNUNET_TESTBED_TOPOLOGY_OPTION_END);
   }
 }
 

Modified: gnunet/src/testbed/test_testbed_api_topology.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_topology.c      2012-10-22 11:10:10 UTC 
(rev 24445)
+++ gnunet/src/testbed/test_testbed_api_topology.c      2012-10-22 11:44:04 UTC 
(rev 24446)
@@ -136,7 +136,7 @@
   overlay_connects = 0;
   op = GNUNET_TESTBED_overlay_configure_topology (NULL, NUM_PEERS, peers,
                                                  
GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
-                                                  NUM_PEERS);
+                                                  NUM_PEERS, 
GNUNET_TESTBED_TOPOLOGY_OPTION_END);
   GNUNET_assert (NULL != op);
   shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
                                                 (GNUNET_TIME_UNIT_SECONDS, 
120),

Modified: gnunet/src/testbed/testbed_api_topology.c
===================================================================
--- gnunet/src/testbed/testbed_api_topology.c   2012-10-22 11:10:10 UTC (rev 
24445)
+++ gnunet/src/testbed/testbed_api_topology.c   2012-10-22 11:44:04 UTC (rev 
24446)
@@ -94,7 +94,12 @@
   /**
    * The size of the link array
    */
-  unsigned int link_array_size;    
+  unsigned int link_array_size;
+
+  /**
+   * should the automatic retry be disabled
+   */
+  int disable_retry;
   
 };
 
@@ -117,10 +122,10 @@
 
   GNUNET_assert (op == link->op);
   GNUNET_TESTBED_operation_done (op);
-  link->op = NULL;  
-  if (NULL != emsg)
+  link->op = NULL;
+  tc = link->tc;
+  if ((NULL != emsg) && (GNUNET_NO == tc->disable_retry))
   {
-    tc = link->tc;
     LOG (GNUNET_ERROR_TYPE_WARNING,
         "Error while establishing a link: %s -- Retrying\n", emsg);
     link->op =
@@ -251,6 +256,7 @@
   struct TopologyContext *tc;
   struct GNUNET_TESTBED_Operation *op;
   struct GNUNET_TESTBED_Controller *c;
+  enum GNUNET_TESTBED_TopologyOption secondary_option;
   unsigned int cnt;
 
   if (num_peers < 2)
@@ -296,6 +302,22 @@
     GNUNET_break (0);
     return NULL;
   }
+  do
+  {
+    secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption);
+    switch (secondary_option)
+    {
+    case GNUNET_TESTBED_TOPOLOGY_DISABLE_AUTO_RETRY:
+      tc->disable_retry = GNUNET_YES;
+      break;
+    case GNUNET_TESTBED_TOPOLOGY_OPTION_END:
+      break;
+    default:
+      GNUNET_break (0);         /* Should not use any other option apart from
+                                   the ones handled here */
+      return NULL;
+    }
+  } while (GNUNET_TESTBED_TOPOLOGY_OPTION_END != secondary_option);
   op = GNUNET_TESTBED_operation_create_ (tc,
                                         &opstart_overlay_configure_topology,
                                         &oprelease_overlay_configure_topology);
@@ -328,6 +350,7 @@
   struct GNUNET_TESTBED_Operation *op;
   va_list vargs;
 
+  GNUNET_assert (topo < GNUNET_TESTBED_TOPOLOGY_OPTION_END);
   va_start (vargs, topo);
   op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers,
                                                     topo, vargs);




reply via email to

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