gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8832 - GNUnet/src/applications/dhtlog_mysql


From: gnunet
Subject: [GNUnet-SVN] r8832 - GNUnet/src/applications/dhtlog_mysql
Date: Mon, 17 Aug 2009 17:37:12 -0600

Author: nevans
Date: 2009-08-17 17:37:12 -0600 (Mon, 17 Aug 2009)
New Revision: 8832

Modified:
   GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c
Log:
handle malicious logging, extra trial info, etc

Modified: GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c
===================================================================
--- GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c 2009-08-17 23:36:12 UTC 
(rev 8831)
+++ GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c 2009-08-17 23:37:12 UTC 
(rev 8832)
@@ -61,8 +61,8 @@
                           "VALUES (?, ?, ?)"
 static struct GNUNET_MysqlStatementHandle *insert_node;
 
-#define INSERT_TRIALS_STMT "INSERT INTO trials (starttime, numnodes, topology, 
puts, gets, concurrent, settle_time, num_rounds, message) "\
-                          "VALUES (NOW(), ?, ?, ?, ?, ?, ?, ?, ?)"
+#define INSERT_TRIALS_STMT "INSERT INTO trials (starttime, numnodes, topology, 
puts, gets, concurrent, settle_time, num_rounds, malicious_getters, 
malicious_putters, malicious_droppers, message) "\
+                          "VALUES (NOW(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
 static struct GNUNET_MysqlStatementHandle *insert_trial;
 
 #define INSERT_DHTKEY_STMT "INSERT INTO dhtkeys (dhtkey, trialuid, keybits) "\
@@ -84,23 +84,7 @@
 #define GET_NODEUID_STMT "SELECT nodeuid FROM nodes where trialuid = ? and 
nodeid = ?"
 static struct GNUNET_MysqlStatementHandle *get_nodeuid;
 
-#define DEL_QUERIES_STMT "DELETE FROM queries where trialuid = ?"
-static struct GNUNET_MysqlStatementHandle *del_queries;
 
-#define DEL_NODES_STMT "DELETE FROM nodes where trialuid = ?"
-static struct GNUNET_MysqlStatementHandle *del_nodes;
-
-#define DEL_TRIALS_STMT "DELETE FROM trials where trialuid = ?"
-static struct GNUNET_MysqlStatementHandle *del_trials;
-
-#define DEL_ROUTES_STMT "DELETE FROM routes where trialuid = ?"
-static struct GNUNET_MysqlStatementHandle *del_routes;
-
-#define DEL_DHTKEYS_STMT "DELETE FROM dhtkeys where trialuid = ?"
-static struct GNUNET_MysqlStatementHandle *del_dhtkeys;
-
-
-
 /*
  * Creates tables if they don't already exist for dht logging
  */
@@ -167,6 +151,10 @@
              "`endtime` datetime NOT NULL,"
              "`settle_time` int(10) unsigned NOT NULL,"
              "`num_rounds` int(10) unsigned NOT NULL,"
+             "`malicious_getters` int(10) unsigned NOT NULL,"
+             "`malicious_putters` int(10) unsigned NOT NULL,"
+             "`malicious_droppers` int(10) unsigned NOT NULL,"
+             "`message` text NOT NULL,"
              "PRIMARY KEY  (`trialuid`),"
              "UNIQUE KEY `trialuid` (`trialuid`)"
              ") ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1"))
@@ -249,7 +237,8 @@
 int
 add_trial (unsigned long long *trialuid, int num_nodes, int topology,
            int puts, int gets, int concurrent, int settle_time,
-           int num_rounds, char *message)
+           int num_rounds, int malicious_getters, int malicious_putters,
+           int malicious_droppers, char *message)
 {
   int ret;
   unsigned long long m_len;
@@ -278,6 +267,15 @@
                                                   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_BLOB,
                                                   message,
                                                   max_varchar_len +
@@ -541,6 +539,10 @@
     {
 
     }
+  else if (key->bits[(512 / 8 / sizeof (unsigned int)) - 1] == 42)      /* 
Malicious marker */
+    {
+      key_uid = 0;
+    }
   else
     {
       return GNUNET_SYSERR;





reply via email to

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