gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r12890 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r12890 - gnunet/src/dht
Date: Tue, 7 Sep 2010 15:00:57 +0200

Author: nevans
Date: 2010-09-07 15:00:56 +0200 (Tue, 07 Sep 2010)
New Revision: 12890

Modified:
   gnunet/src/dht/dhtlog.h
   gnunet/src/dht/gnunet-dht-driver.c
   gnunet/src/dht/plugin_dhtlog_dummy.c
   gnunet/src/dht/plugin_dhtlog_mysql.c
   gnunet/src/dht/plugin_dhtlog_mysql_dump.c
   gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c
Log:
make insert trial easier to not screw up

Modified: gnunet/src/dht/dhtlog.h
===================================================================
--- gnunet/src/dht/dhtlog.h     2010-09-07 12:53:46 UTC (rev 12889)
+++ gnunet/src/dht/dhtlog.h     2010-09-07 13:00:56 UTC (rev 12890)
@@ -68,6 +68,91 @@
 
 } DHTLOG_MESSAGE_TYPES;
 
+struct GNUNET_DHTLOG_TrialInfo
+{
+  /**
+   * Trialuid, possibly set by insert call.
+   */
+  unsigned long long trialuid;
+
+  /**
+   * Outside of database identifier for the trial.
+   */
+  unsigned int other_identifier;
+
+  /** Number of nodes in the trial */
+  unsigned int num_nodes;
+
+  /** Type of initial topology */
+  unsigned int topology;
+
+  /** Topology to blacklist peers to */
+  unsigned int blacklist_topology;
+
+  /** Initially connect peers in this topology */
+  unsigned int connect_topology;
+
+  /** Option to modify connect topology */
+  unsigned int connect_topology_option;
+
+  /** Modifier for the connect option */
+  float connect_topology_option_modifier;
+
+  /** Percentage parameter used for certain topologies */
+  float topology_percentage;
+
+  /** Probability parameter used for certain topologies */
+  float topology_probability;
+
+  /** Number of puts in the trial */
+  unsigned int puts;
+
+  /** Number of gets in the trial */
+  unsigned int gets;
+
+  /** Concurrent puts/gets in the trial (max allowed) */
+  unsigned int concurrent;
+
+  /** How long between initial connection and issuing puts/gets */
+  unsigned int settle_time;
+
+  /** How many times to do put/get loop */
+  unsigned int num_rounds;
+
+  /** Number of malicious getters */
+  unsigned int malicious_getters;
+
+  /** Number of malicious putters */
+  unsigned int malicious_putters;
+
+  /** Number of malicious droppers */
+  unsigned int malicious_droppers;
+
+  /** Frequency of malicious get requests */
+  unsigned int malicious_get_frequency;
+
+  /** Frequency of malicious put requests */
+  unsigned int malicious_put_frequency;
+
+  /** Stop forwarding put/find_peer requests when peer is closer than others */
+  unsigned int stop_closest;
+
+  /** Stop forwarding get requests when data found */
+  unsigned int stop_found;
+
+  /**
+   * Routing behaves as it would in Kademlia (modified to work recursively,
+   * and with our other GNUnet constraints.
+   */
+  unsigned int strict_kademlia;
+
+  /** Number of gets that were reported successful */
+  unsigned int gets_succeeded;
+
+  /** Message for this trial */
+  char *message;
+};
+
 struct GNUNET_DHTLOG_Handle
 {
 
@@ -94,45 +179,11 @@
   /*
    * Inserts the specified trial into the dhttests.trials table
    *
-   * @param trialuid return the trialuid of the newly inserted trial
-   * @param other_identifier identifier for the trial from another source
-   *        (for joining later)
-   * @param num_nodes how many nodes are in the trial
-   * @param topology integer representing topology for this trial
-   * @param blacklist_topology integer representing blacklist topology for 
this trial
-   * @param connect_topology integer representing connect topology for this 
trial
-   * @param connect_topology_option integer representing connect topology 
option
-   * @param connect_topology_option_modifier float to modify connect option
-   * @param topology_percentage percentage modifier for certain topologies
-   * @param topology_probability probability modifier for certain topologies
-   * @param puts number of puts to perform
-   * @param gets number of gets to perform
-   * @param concurrent number of concurrent requests
-   * @param settle_time time to wait between creating topology and starting 
testing
-   * @param num_rounds number of times to repeat the trial
-   * @param malicious_getters number of malicious GET peers in the trial
-   * @param malicious_putters number of malicious PUT peers in the trial
-   * @param malicious_droppers number of malicious DROP peers in the trial
-   * @param malicious_get_frequency how often malicious gets are sent
-   * @param malicious_put_frequency how often malicious puts are sent
-   * @param stop_closest stop forwarding PUTs if closest node found
-   * @param stop_found stop forwarding GETs if data found
-   * @param strict_kademlia test used kademlia routing algorithm
-   * @param gets_succeeded how many gets did the test driver report success on
-   * @param message string to put into DB for this trial
+   * @param trial_info general information about this trial
    *
    * @return GNUNET_OK on success, GNUNET_SYSERR on failure
    */
-  int (*insert_trial) (unsigned long long *trialuid, unsigned int 
other_identifier, unsigned int num_nodes, unsigned int topology,
-                       unsigned int blacklist_topology, unsigned int 
connect_topology,
-                       unsigned int connect_topology_option, float 
connect_topology_option_modifier,
-                       float topology_percentage, float topology_probability,
-                       unsigned int puts, unsigned int gets, unsigned int 
concurrent, unsigned int settle_time,
-                       unsigned int num_rounds, unsigned int 
malicious_getters, unsigned int malicious_putters,
-                       unsigned int malicious_droppers, unsigned int 
malicious_get_frequency,
-                       unsigned int malicious_put_frequency, unsigned int 
stop_closest, unsigned int stop_found,
-                       unsigned int strict_kademlia, unsigned int 
gets_succeeded,
-                       char *message);
+  int (*insert_trial) (struct GNUNET_DHTLOG_TrialInfo *trial_info);
 
   /*
    * Inserts the specified stats into the dhttests.node_statistics table

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2010-09-07 12:53:46 UTC (rev 12889)
+++ gnunet/src/dht/gnunet-dht-driver.c  2010-09-07 13:00:56 UTC (rev 12890)
@@ -1852,6 +1852,7 @@
      const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct stat frstat;
+  struct GNUNET_DHTLOG_TrialInfo trial_info;
   struct GNUNET_TESTING_Host *hosts;
   struct GNUNET_TESTING_Host *temphost;
   char *topology_str;
@@ -1875,6 +1876,7 @@
 
   sched = s;
   config = cfg;
+  memset(&trial_info, 0, sizeof(struct GNUNET_DHTLOG_TrialInfo));
   /* Get path from configuration file */
   if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string(cfg, "paths", 
"servicehome", &test_directory))
     {
@@ -2221,33 +2223,37 @@
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "dhtlog_handle is NULL!");
 
-  if ((trialmessage != NULL) && (dhtlog_handle != NULL))
-    {
-      dhtlog_handle->insert_trial (&trialuid, (unsigned int)trial_to_run, 
peers_left, topology,
-                                    blacklist_topology, connect_topology,
-                                    connect_topology_option,
-                                    connect_topology_option_modifier, 
topology_percentage,
-                                    topology_probability, num_puts, num_gets,
-                                    max_outstanding_gets, settle_time, 1,
-                                    malicious_getters, malicious_putters,
-                                    malicious_droppers, 
malicious_get_frequency,
-                                    malicious_put_frequency, stop_closest, 
stop_found,
-                                    strict_kademlia, 0, trialmessage);
-    }
-  else if (dhtlog_handle != NULL)
-    {
-      dhtlog_handle->insert_trial (&trialuid, (unsigned int)trial_to_run, 
peers_left, topology,
-                                    blacklist_topology, connect_topology,
-                                    connect_topology_option,
-                                    connect_topology_option_modifier, 
topology_percentage,
-                                    topology_probability, num_puts, num_gets,
-                                    max_outstanding_gets, settle_time, 1,
-                                    malicious_getters, malicious_putters,
-                                    malicious_droppers, 
malicious_get_frequency,
-                                    malicious_put_frequency, stop_closest, 
stop_found,
-                                    strict_kademlia, 0, "");
-    }
+  trial_info.other_identifier = (unsigned int)trial_to_run;
+  trial_info.num_nodes = peers_left;
+  trial_info.topology = topology;
+  trial_info.blacklist_topology = blacklist_topology;
+  trial_info.connect_topology = connect_topology;
+  trial_info.connect_topology_option = connect_topology_option;
+  trial_info.connect_topology_option_modifier = 
connect_topology_option_modifier;
+  trial_info.topology_percentage = topology_percentage;
+  trial_info.topology_probability = topology_probability;
+  trial_info.puts = num_puts;
+  trial_info.gets = num_gets;
+  trial_info.concurrent = max_outstanding_gets;
+  trial_info.settle_time = settle_time;
+  trial_info.num_rounds = 1;
+  trial_info.malicious_getters = malicious_getters;
+  trial_info.malicious_putters = malicious_putters;
+  trial_info.malicious_droppers = malicious_droppers;
+  trial_info.malicious_get_frequency = malicious_get_frequency;
+  trial_info.malicious_put_frequency = malicious_put_frequency;
+  trial_info.stop_closest = stop_closest;
+  trial_info.stop_found = stop_found;
+  trial_info.strict_kademlia = strict_kademlia;
 
+  if (trialmessage != NULL)
+    trial_info.message = trialmessage;
+  else
+    trial_info.message = "";
+
+  if (dhtlog_handle != NULL)
+    dhtlog_handle->insert_trial(&trial_info);
+
   GNUNET_free_non_null(trialmessage);
 
   hostkey_meter = create_meter(peers_left, "Hostkeys created ", GNUNET_YES);

Modified: gnunet/src/dht/plugin_dhtlog_dummy.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_dummy.c        2010-09-07 12:53:46 UTC (rev 
12889)
+++ gnunet/src/dht/plugin_dhtlog_dummy.c        2010-09-07 13:00:56 UTC (rev 
12890)
@@ -32,50 +32,16 @@
 
 #define DEBUG_DHTLOG GNUNET_NO
 
-  /*
-   * Inserts the specified trial into the dhttests.trials table
-   *
-   * @param trialuid return the trialuid of the newly inserted trial
-   * @param other_identifier identifier for the trial from another source
-   *        (for joining later)
-   * @param num_nodes how many nodes are in the trial
-   * @param topology integer representing topology for this trial
-   * @param blacklist_topology integer representing blacklist topology for 
this trial
-   * @param connect_topology integer representing connect topology for this 
trial
-   * @param connect_topology_option integer representing connect topology 
option
-   * @param connect_topology_option_modifier float to modify connect option
-   * @param topology_percentage percentage modifier for certain topologies
-   * @param topology_probability probability modifier for certain topologies
-   * @param puts number of puts to perform
-   * @param gets number of gets to perform
-   * @param concurrent number of concurrent requests
-   * @param settle_time time to wait between creating topology and starting 
testing
-   * @param num_rounds number of times to repeat the trial
-   * @param malicious_getters number of malicious GET peers in the trial
-   * @param malicious_putters number of malicious PUT peers in the trial
-   * @param malicious_droppers number of malicious DROP peers in the trial
-   * @param malicious_get_frequency how often malicious gets are sent
-   * @param malicious_put_frequency how often malicious puts are sent
-   * @param stop_closest stop forwarding PUTs if closest node found
-   * @param stop_found stop forwarding GETs if data found
-   * @param strict_kademlia test used kademlia routing algorithm
-   * @param gets_succeeded how many gets did the test driver report success on
-   * @param message string to put into DB for this trial
-   *
-   * @return GNUNET_OK on success, GNUNET_SYSERR on failure
-   */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, 
unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float 
connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, 
unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, 
unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int 
malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int 
stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+/*
+ * Inserts the specified trial into the dhttests.trials table
+ *
+ * @param trial_info struct containing the data to insert about this trial
+ *
+ * @return GNUNET_OK on success, GNUNET_SYSERR on failure
+ */
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
-  *trialuid = 42;
+  trial_info->trialuid = 42;
   return GNUNET_OK;
 }
 

Modified: gnunet/src/dht/plugin_dhtlog_mysql.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql.c        2010-09-07 12:53:46 UTC (rev 
12889)
+++ gnunet/src/dht/plugin_dhtlog_mysql.c        2010-09-07 13:00:56 UTC (rev 
12890)
@@ -827,78 +827,44 @@
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this 
trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting 
testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, 
unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float 
connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, 
unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, 
unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int 
malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int 
stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   MYSQL_STMT *stmt;
   int ret;
   unsigned long long m_len;
-  m_len = strlen (message);
+  m_len = strlen (trial_info->message);
 
   stmt = mysql_stmt_init(conn);
   if (GNUNET_OK !=
-      (ret = prepared_statement_run (insert_trial, trialuid,
-                                     MYSQL_TYPE_LONG, &other_identifier, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &num_nodes, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &topology, GNUNET_YES,
-                                     MYSQL_TYPE_FLOAT, &topology_percentage,
-                                     MYSQL_TYPE_FLOAT, &topology_probability,
-                                     MYSQL_TYPE_LONG, &blacklist_topology, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &connect_topology, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, 
&connect_topology_option, GNUNET_YES,
-                                     MYSQL_TYPE_FLOAT, 
&connect_topology_option_modifier,
-                                     MYSQL_TYPE_LONG, &puts, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &gets, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &concurrent, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &settle_time, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &num_rounds, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_getters, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_putters, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &malicious_droppers, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, 
&malicious_get_frequency, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, 
&malicious_put_frequency, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &stop_closest, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &stop_found, GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &strict_kademlia, 
GNUNET_YES,
-                                     MYSQL_TYPE_LONG, &gets_succeeded, 
GNUNET_YES,
-                                     MYSQL_TYPE_BLOB, message, max_varchar_len 
+
+      (ret = prepared_statement_run (insert_trial, &trial_info->trialuid,
+                                     MYSQL_TYPE_LONG, 
&trial_info->other_identifier, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->num_nodes, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->topology, 
GNUNET_YES,
+                                     MYSQL_TYPE_FLOAT, 
&trial_info->topology_percentage,
+                                     MYSQL_TYPE_FLOAT, 
&trial_info->topology_probability,
+                                     MYSQL_TYPE_LONG, 
&trial_info->blacklist_topology, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->connect_topology, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->connect_topology_option, GNUNET_YES,
+                                     MYSQL_TYPE_FLOAT, 
&trial_info->connect_topology_option_modifier,
+                                     MYSQL_TYPE_LONG, &trial_info->puts, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->gets, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->concurrent, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->settle_time, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->num_rounds, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->malicious_getters, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->malicious_putters, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->malicious_droppers, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->malicious_get_frequency, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->malicious_put_frequency, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->stop_closest, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, &trial_info->stop_found, 
GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->strict_kademlia, GNUNET_YES,
+                                     MYSQL_TYPE_LONG, 
&trial_info->gets_succeeded, GNUNET_YES,
+                                     MYSQL_TYPE_BLOB, trial_info->message, 
max_varchar_len +
                                      max_varchar_len, &m_len,
                                       -1)))
     {

Modified: gnunet/src/dht/plugin_dhtlog_mysql_dump.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql_dump.c   2010-09-07 12:53:46 UTC (rev 
12889)
+++ gnunet/src/dht/plugin_dhtlog_mysql_dump.c   2010-09-07 13:00:56 UTC (rev 
12890)
@@ -256,49 +256,14 @@
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this 
trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting 
testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, 
unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float 
connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, 
unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, 
unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int 
malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int 
stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   int ret;
-  if (trialuid != NULL)
-    *trialuid = 0;
+  trial_info->trialuid = 0;
   if (outfile == NULL)
     return GNUNET_SYSERR;
 
@@ -309,14 +274,14 @@
                    "@m_gets = %u, @m_puts = %u, @m_drops = %u, "
                    "@m_g_f = %u, @m_p_f = %u, @s_c = %u, @s_f = %u,"
                    "@s_k = %u, @g_s = %u, @message = \"%s\";\n",
-                   get_sql_time(), other_identifier, num_nodes, topology,
-                   blacklist_topology, connect_topology,
-                   connect_topology_option, connect_topology_option_modifier,
-                   topology_percentage, topology_probability,
-                   puts, gets, concurrent, settle_time,
-                   num_rounds, malicious_getters, malicious_putters,
-                   malicious_droppers, malicious_get_frequency, 
malicious_put_frequency,
-                   stop_closest, stop_found, strict_kademlia, gets_succeeded, 
message);
+                   get_sql_time(), trial_info->other_identifier, 
trial_info->num_nodes, trial_info->topology,
+                   trial_info->blacklist_topology, 
trial_info->connect_topology,
+                   trial_info->connect_topology_option, 
trial_info->connect_topology_option_modifier,
+                   trial_info->topology_percentage, 
trial_info->topology_probability,
+                   trial_info->puts, trial_info->gets, trial_info->concurrent, 
trial_info->settle_time,
+                   trial_info->num_rounds, trial_info->malicious_getters, 
trial_info->malicious_putters,
+                   trial_info->malicious_droppers, 
trial_info->malicious_get_frequency, trial_info->malicious_put_frequency,
+                   trial_info->stop_closest, trial_info->stop_found, 
trial_info->strict_kademlia, trial_info->gets_succeeded, trial_info->message);
 
   if (ret < 0)
     return GNUNET_SYSERR;

Modified: gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c
===================================================================
--- gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c      2010-09-07 12:53:46 UTC 
(rev 12889)
+++ gnunet/src/dht/plugin_dhtlog_mysql_dump_load.c      2010-09-07 13:00:56 UTC 
(rev 12890)
@@ -138,49 +138,14 @@
 /*
  * Inserts the specified trial into the dhttests.trials table
  *
- * @param trialuid return the trialuid of the newly inserted trial
- * @param other_identifier identifier for the trial from another source
- *        (for joining later)
- * @param num_nodes how many nodes are in the trial
- * @param topology integer representing topology for this trial
- * @param blacklist_topology integer representing blacklist topology for this 
trial
- * @param connect_topology integer representing connect topology for this trial
- * @param connect_topology_option integer representing connect topology option
- * @param connect_topology_option_modifier float to modify connect option
- * @param topology_percentage percentage modifier for certain topologies
- * @param topology_probability probability modifier for certain topologies
- * @param puts number of puts to perform
- * @param gets number of gets to perform
- * @param concurrent number of concurrent requests
- * @param settle_time time to wait between creating topology and starting 
testing
- * @param num_rounds number of times to repeat the trial
- * @param malicious_getters number of malicious GET peers in the trial
- * @param malicious_putters number of malicious PUT peers in the trial
- * @param malicious_droppers number of malicious DROP peers in the trial
- * @param malicious_get_frequency how often malicious gets are sent
- * @param malicious_put_frequency how often malicious puts are sent
- * @param stop_closest stop forwarding PUTs if closest node found
- * @param stop_found stop forwarding GETs if data found
- * @param strict_kademlia test used kademlia routing algorithm
- * @param gets_succeeded how many gets did the test driver report success on
- * @param message string to put into DB for this trial
+ * @param trial_info struct containing the data to insert about this trial
  *
  * @return GNUNET_OK on success, GNUNET_SYSERR on failure
  */
-int add_trial (unsigned long long *trialuid, unsigned int other_identifier, 
unsigned int num_nodes, unsigned int topology,
-               unsigned int blacklist_topology, unsigned int connect_topology,
-               unsigned int connect_topology_option, float 
connect_topology_option_modifier,
-               float topology_percentage, float topology_probability,
-               unsigned int puts, unsigned int gets, unsigned int concurrent, 
unsigned int settle_time,
-               unsigned int num_rounds, unsigned int malicious_getters, 
unsigned int malicious_putters,
-               unsigned int malicious_droppers, unsigned int 
malicious_get_frequency,
-               unsigned int malicious_put_frequency, unsigned int 
stop_closest, unsigned int stop_found,
-               unsigned int strict_kademlia, unsigned int gets_succeeded,
-               char *message)
+int add_trial (struct GNUNET_DHTLOG_TrialInfo *trial_info)
 {
   int ret;
-  if (trialuid != NULL)
-    *trialuid = 0;
+  trial_info->trialuid = 0;
   if (outfile == NULL)
     return GNUNET_SYSERR;
 
@@ -194,14 +159,14 @@
                            "malicious_put_frequency, stop_closest, stop_found, 
strict_kademlia, "
                            "gets_succeeded, message) "
                            "VALUES (\"%s\", %u, %u, %u, %u, %u, %u, %f, %f, 
%f, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, \"%s\");\n",
-                           get_sql_time(), other_identifier, num_nodes, 
topology,
-                           blacklist_topology, connect_topology,
-                           connect_topology_option, 
connect_topology_option_modifier,
-                           topology_percentage, topology_probability,
-                           puts, gets, concurrent, settle_time,
-                           num_rounds, malicious_getters, malicious_putters,
-                           malicious_droppers, malicious_get_frequency, 
malicious_put_frequency,
-                           stop_closest, stop_found, strict_kademlia, 
gets_succeeded, message);
+                           get_sql_time(), trial_info->other_identifier, 
trial_info->num_nodes, trial_info->topology,
+                           trial_info->blacklist_topology, 
trial_info->connect_topology,
+                           trial_info->connect_topology_option, 
trial_info->connect_topology_option_modifier,
+                           trial_info->topology_percentage, 
trial_info->topology_probability,
+                           trial_info->puts, trial_info->gets, 
trial_info->concurrent, trial_info->settle_time,
+                           trial_info->num_rounds, 
trial_info->malicious_getters, trial_info->malicious_putters,
+                           trial_info->malicious_droppers, 
trial_info->malicious_get_frequency, trial_info->malicious_put_frequency,
+                           trial_info->stop_closest, trial_info->stop_found, 
trial_info->strict_kademlia, trial_info->gets_succeeded, trial_info->message);
 
   if (ret < 0)
     return GNUNET_SYSERR;




reply via email to

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