gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29748 - gnunet/src/experimentation


From: gnunet
Subject: [GNUnet-SVN] r29748 - gnunet/src/experimentation
Date: Tue, 1 Oct 2013 09:46:18 +0200

Author: grothoff
Date: 2013-10-01 09:46:18 +0200 (Tue, 01 Oct 2013)
New Revision: 29748

Modified:
   gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c
   gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
   gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
Log:
-just indentation

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c      
2013-10-01 07:37:48 UTC (rev 29747)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_experiments.c      
2013-10-01 07:46:18 UTC (rev 29748)
@@ -25,20 +25,18 @@
  * @author Matthias Wachs
  */
 #include "platform.h"
-#include "gnunet_getopt_lib.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_core_service.h"
 #include "gnunet_statistics_service.h"
 #include "gnunet-daemon-experimentation.h"
 
 
-
 /**
  * Struct to store information about an experiment issuer
  */
 struct Issuer
 {
-       struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
+  struct GNUNET_CRYPTO_EccPublicSignKey pubkey;
 };
 
 
@@ -47,14 +45,13 @@
  */
 static struct GNUNET_CONTAINER_MultiHashMap *valid_issuers;
 
-
 /**
  * Hashmap containing valid experiments
  */
 static struct GNUNET_CONTAINER_MultiHashMap *experiments;
 
 
-uint32_t GSE_my_issuer_count;
+static uint32_t GSE_my_issuer_count;
 
 /**
  * Valid experiment issuer for this daemon
@@ -74,23 +71,26 @@
 int
 experiment_verify (struct Issuer *i, struct Experiment *e)
 {
-       GNUNET_assert (NULL != i);
-       GNUNET_assert (NULL != e);
-
-       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Verification: to be 
implemented\n");
-       return GNUNET_OK;
+  GNUNET_assert (NULL != i);
+  GNUNET_assert (NULL != e);
+  
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Verification: to be implemented\n");
+  return GNUNET_OK;
 }
 
-int free_experiment (void *cls,
-                                                                               
 const struct GNUNET_HashCode * key,
-                                                                               
 void *value)
+int 
+free_experiment (void *cls,
+                const struct GNUNET_HashCode * key,
+                void *value)
 {
-       struct Experiment *e = value;
-       GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove (experiments, 
key, value));
-       GNUNET_free_non_null (e->description);
-       GNUNET_free_non_null (e->name);
-       GNUNET_free (e);
-       return GNUNET_OK;
+  struct Experiment *e = value;
+
+  GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove (experiments, key, 
value));
+  GNUNET_free_non_null (e->description);
+  GNUNET_free_non_null (e->name);
+  GNUNET_free (e);
+  return GNUNET_OK;
 }
 
 
@@ -102,27 +102,31 @@
  * @param value the issuer element to free
  * @return GNUNET_OK to continue
  */
-int free_issuer (void *cls,
-                                                                const struct 
GNUNET_HashCode * key,
-                                                                void *value)
+int 
+free_issuer (void *cls,
+            const struct GNUNET_HashCode * key,
+            void *value)
 {
-       struct Issuer *i = value;
-       GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove (valid_issuers, 
key, value));
-       GNUNET_free (i);
-       return GNUNET_OK;
+  struct Issuer *i = value;
+
+  GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove (valid_issuers, key, 
value));
+  GNUNET_free (i);
+  return GNUNET_OK;
 }
 
-int create_issuer (void *cls,
-                                                                const struct 
GNUNET_HashCode * key,
-                                                                void *value)
+
+int
+create_issuer (void *cls,
+              const struct GNUNET_HashCode * key,
+              void *value)
 {
-       static int i = 0;
-       GNUNET_assert (i < GSE_my_issuer_count);
-       GSE_my_issuer[i].issuer_id.hashPubKey = *key;
+  static int i = 0;
 
-       i++;
-       return GNUNET_OK;
-
+  GNUNET_assert (i < GSE_my_issuer_count);
+  GSE_my_issuer[i].issuer_id.hashPubKey = *key;
+  
+  i++;
+  return GNUNET_OK;
 }
 
 
@@ -135,34 +139,36 @@
 int
 GED_experiments_issuer_accepted (struct GNUNET_PeerIdentity *issuer_ID)
 {
-       if (GNUNET_CONTAINER_multihashmap_contains (valid_issuers, 
&issuer_ID->hashPubKey))
-               return GNUNET_YES;
-       else
-               return GNUNET_NO;
+  if (GNUNET_CONTAINER_multihashmap_contains (valid_issuers, 
&issuer_ID->hashPubKey))
+    return GNUNET_YES;
+  else
+    return GNUNET_NO;
 }
 
+
 struct FindCtx
 {
-       const char *name;
-       struct GNUNET_TIME_Absolute version;
-       struct Experiment *res;
+  const char *name;
+  struct GNUNET_TIME_Absolute version;
+  struct Experiment *res;
 };
 
+
 static int
 find_it (void *cls,
-                               const struct GNUNET_HashCode * key,
-                               void *value)
+        const struct GNUNET_HashCode * key,
+        void *value)
 {
-       struct FindCtx *find_ctx = cls;
-       struct Experiment *e = (struct Experiment *) value;
-
-       if (0 != strcmp(e->name, find_ctx->name))
-               return GNUNET_OK;
-       if (e->version.abs_value_us != find_ctx->version.abs_value_us)
-               return GNUNET_OK;
-
-       find_ctx->res = e;
-       return GNUNET_NO;
+  struct FindCtx *find_ctx = cls;
+  struct Experiment *e = (struct Experiment *) value;
+  
+  if (0 != strcmp(e->name, find_ctx->name))
+    return GNUNET_OK;
+  if (e->version.abs_value_us != find_ctx->version.abs_value_us)
+    return GNUNET_OK;
+  
+  find_ctx->res = e;
+  return GNUNET_NO;
 }
 
 
@@ -176,44 +182,47 @@
  */
 struct Experiment *
 GED_experiments_find (const struct GNUNET_PeerIdentity *issuer,
-                                                                               
        const char *name,
-                                                                               
        const struct GNUNET_TIME_Absolute version)
+                     const char *name,
+                     const struct GNUNET_TIME_Absolute version)
 {
-       struct FindCtx find_ctx;
+  struct FindCtx find_ctx;
+  
+  find_ctx.name = name;
+  find_ctx.version = version;
+  find_ctx.res = NULL;
+  
+  GNUNET_CONTAINER_multihashmap_get_multiple (experiments,
+                                             &issuer->hashPubKey, 
+                                             &find_it, &find_ctx);
+  return find_ctx.res;
+}
 
-       find_ctx.name = name;
-       find_ctx.version = version;
-       find_ctx.res = NULL;
 
-       GNUNET_CONTAINER_multihashmap_get_multiple (experiments,
-                       &issuer->hashPubKey, &find_it, &find_ctx);
-       return find_ctx.res;
-}
-
 struct GetCtx
 {
-       struct Node *n;
-       GNUNET_EXPERIMENTATION_experiments_get_cb get_cb;
+  struct Node *n;
+  GNUNET_EXPERIMENTATION_experiments_get_cb get_cb;
 };
 
 
 static int
 get_it (void *cls,
-                               const struct GNUNET_HashCode * key,
-                               void *value)
+       const struct GNUNET_HashCode * key,
+       void *value)
 {
-       struct GetCtx *get_ctx = cls;
-       struct Experiment *e = value;
+  struct GetCtx *get_ctx = cls;
+  struct Experiment *e = value;
 
-       get_ctx->get_cb (get_ctx->n, e);
-
-       return GNUNET_OK;
+  get_ctx->get_cb (get_ctx->n, e);
+  
+  return GNUNET_OK;
 }
 
+
 void
 GED_experiments_get (struct Node *n,
-                                                                               
 struct GNUNET_PeerIdentity *issuer,
-                                                                               
 GNUNET_EXPERIMENTATION_experiments_get_cb get_cb)
+                    struct GNUNET_PeerIdentity *issuer,
+                    GNUNET_EXPERIMENTATION_experiments_get_cb get_cb)
 {
        struct GetCtx get_ctx;
 
@@ -230,23 +239,26 @@
        get_cb (n, NULL);
 }
 
+
 /**
  * Add a new experiment
  */
-int GNUNET_EXPERIMENTATION_experiments_add (struct Issuer *i,
-                                                                               
                                                                                
                const char *name,
-                                                                               
                                                                                
                struct GNUNET_PeerIdentity issuer_id,
-                                                                               
                                                                                
                struct GNUNET_TIME_Absolute version,
-                                                                               
                                                                                
                char *description,
-                                                                               
                                                                                
                uint32_t required_capabilities,
-                                                                               
                                                                                
                struct GNUNET_TIME_Absolute start,
-                                                                               
                                                                                
                struct GNUNET_TIME_Relative frequency,
-                                                                               
                                                                                
                struct GNUNET_TIME_Relative duration,
-                                                                               
                                                                                
                struct GNUNET_TIME_Absolute stop)
+int
+GNUNET_EXPERIMENTATION_experiments_add (struct Issuer *i,
+                                       const char *name,
+                                       struct GNUNET_PeerIdentity issuer_id,
+                                       struct GNUNET_TIME_Absolute version,
+                                       char *description,
+                                       uint32_t required_capabilities,
+                                       struct GNUNET_TIME_Absolute start,
+                                       struct GNUNET_TIME_Relative frequency,
+                                       struct GNUNET_TIME_Relative duration,
+                                       struct GNUNET_TIME_Absolute stop)
 {
        struct Experiment *e;
-       e = GNUNET_malloc (sizeof (struct Experiment));
 
+       e = GNUNET_new (struct Experiment);
+
        e->name = GNUNET_strdup (name);
        e->issuer = issuer_id;
        e->version = version;
@@ -287,8 +299,9 @@
  * @param cls configuration handle
  * @param name section name
  */
-void exp_file_iterator (void *cls,
-                                                                               
                const char *name)
+void
+exp_file_iterator (void *cls,
+                  const char *name)
 {
        struct GNUNET_CONFIGURATION_Handle *exp = cls;
        struct Issuer *i;

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-10-01 07:37:48 UTC (rev 29747)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_nodes.c    
2013-10-01 07:46:18 UTC (rev 29748)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009 Christian Grothoff (and other contributing authors)
+     (C) 2012-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -32,36 +32,34 @@
 
 
 #define FAST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 
5)
+
 /**
  * Core handle
  */
 static struct GNUNET_CORE_Handle *ch;
 
-
 /**
  * Peer's own identity
  */
 static struct GNUNET_PeerIdentity me;
 
-
 /**
  * Nodes with a pending request
  */
-struct GNUNET_CONTAINER_MultiHashMap *nodes_requested;
+static struct GNUNET_CONTAINER_MultiPeerMap *nodes_requested;
 
-
 /**
  * Active experimentation nodes
  */
-struct GNUNET_CONTAINER_MultiHashMap *nodes_active;
+static struct GNUNET_CONTAINER_MultiPeerMap *nodes_active;
 
-
 /**
  * Inactive experimentation nodes
  * To be excluded from future requests
  */
-struct GNUNET_CONTAINER_MultiHashMap *nodes_inactive;
+static struct GNUNET_CONTAINER_MultiPeerMap *nodes_inactive;
 
+
 struct NodeComCtx
 {
        struct NodeComCtx *prev;
@@ -79,9 +77,10 @@
 /**
  * Update statistics
  *
- * @param m hashmap to update values from
+ * @param m peermap to update values from
  */
-static void update_stats (struct GNUNET_CONTAINER_MultiHashMap *m)
+static void 
+update_stats (struct GNUNET_CONTAINER_MultiPeerMap *m)
 {
        GNUNET_assert (NULL != m);
        GNUNET_assert (NULL != GED_stats);
@@ -89,17 +88,17 @@
        if (m == nodes_active)
        {
                        GNUNET_STATISTICS_set (GED_stats, "# nodes active",
-                                       GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
+                                       GNUNET_CONTAINER_multipeermap_size(m), 
GNUNET_NO);
        }
        else if (m == nodes_inactive)
        {
                        GNUNET_STATISTICS_set (GED_stats, "# nodes inactive",
-                                       GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
+                                       GNUNET_CONTAINER_multipeermap_size(m), 
GNUNET_NO);
        }
        else if (m == nodes_requested)
        {
                        GNUNET_STATISTICS_set (GED_stats, "# nodes requested",
-                                       GNUNET_CONTAINER_multihashmap_size(m), 
GNUNET_NO);
+                                       GNUNET_CONTAINER_multipeermap_size(m), 
GNUNET_NO);
        }
        else
                GNUNET_break (0);
@@ -110,20 +109,20 @@
 /**
  * Clean up node
  *
- * @param cls the hashmap to clean up
+ * @param cls the peermap to clean up
  * @param key key of the current node
  * @param value related node object
- * @return always GNUNET_OK
+ * @return always #GNUNET_OK
  */
 static int
 cleanup_node (void *cls,
-                                                        const struct 
GNUNET_HashCode * key,
-                                                        void *value)
+             const struct GNUNET_PeerIdentity * key,
+             void *value)
 {
        struct Node *n;
        struct NodeComCtx *e_cur;
        struct NodeComCtx *e_next;
-       struct GNUNET_CONTAINER_MultiHashMap *cur = cls;
+       struct GNUNET_CONTAINER_MultiPeerMap *cur = cls;
 
        n = value;
        if (GNUNET_SCHEDULER_NO_TASK != n->timeout_task)
@@ -147,7 +146,7 @@
 
        GNUNET_free_non_null (n->issuer_id);
 
-       GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove (cur, key, 
value));
+       GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_remove (cur, key, 
value));
        GNUNET_free (value);
        return GNUNET_OK;
 }
@@ -159,14 +158,16 @@
  * @param id the id to check
  * @return GNUNET_YES or GNUNET_NO
  */
-static int is_me (const struct GNUNET_PeerIdentity *id)
+static int 
+is_me (const struct GNUNET_PeerIdentity *id)
 {
-       if (0 == memcmp (&me, id, sizeof (me)))
-               return GNUNET_YES;
-       else
-               return GNUNET_NO;
+  if (0 == memcmp (&me, id, sizeof (me)))
+    return GNUNET_YES;
+  else
+    return GNUNET_NO;
 }
 
+
 /**
  * Core startup callback
  *
@@ -239,11 +240,11 @@
        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing request for peer %s due 
to timeout\n",
                        GNUNET_i2s (&n->id));
 
-       if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains 
(nodes_requested, &n->id.hashPubKey))
+       if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains 
(nodes_requested, &n->id))
        {
-                       GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove 
(nodes_requested, &n->id.hashPubKey, n));
+                       GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_remove 
(nodes_requested, &n->id, n));
                        update_stats (nodes_requested);
-                       GNUNET_CONTAINER_multihashmap_put (nodes_inactive, 
&n->id.hashPubKey, n,
+                       GNUNET_CONTAINER_multipeermap_put (nodes_inactive, 
&n->id, n,
                                        
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
                        update_stats (nodes_inactive);
        }
@@ -325,8 +326,8 @@
        GNUNET_CONTAINER_DLL_insert_tail(n->e_req_head, n->e_req_tail, e_ctx);
        schedule_transmisson (e_ctx);
 
-       GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put 
(nodes_requested,
-                       &peer->hashPubKey, n, 
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
+       GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_put 
(nodes_requested,
+                       peer, n, 
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
        update_stats (nodes_requested);
 }
 
@@ -389,17 +390,17 @@
 
        res = NULL;
        tmp = NULL;
-       tmp = GNUNET_CONTAINER_multihashmap_get (nodes_active, &id->hashPubKey);
+       tmp = GNUNET_CONTAINER_multipeermap_get (nodes_active, id);
        if (res == NULL)
                res = tmp;
 
-       tmp = GNUNET_CONTAINER_multihashmap_get (nodes_inactive, 
&id->hashPubKey);
+       tmp = GNUNET_CONTAINER_multipeermap_get (nodes_inactive, id);
        if (res == NULL)
                res = tmp;
        else
                GNUNET_break (0); /* Multiple instances */
 
-       tmp = GNUNET_CONTAINER_multihashmap_get (nodes_requested, 
&id->hashPubKey);
+       tmp = GNUNET_CONTAINER_multipeermap_get (nodes_requested, id);
        if (res == NULL)
                res = tmp;
        else
@@ -417,8 +418,8 @@
 static void node_make_active (struct Node *n)
 {
        int c1;
-  GNUNET_CONTAINER_multihashmap_put (nodes_active,
-                       &n->id.hashPubKey, n, 
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
+  GNUNET_CONTAINER_multipeermap_put (nodes_active,
+                       &n->id, n, 
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
        update_stats (nodes_active);
        GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Added peer `%s' as active 
node\n"),
                        GNUNET_i2s (&n->id));
@@ -463,13 +464,13 @@
        }
 
        make_active = GNUNET_NO;
-       if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_active, 
&peer->hashPubKey)))
+       if (NULL != (n = GNUNET_CONTAINER_multipeermap_get (nodes_active, 
peer)))
        {
                        /* Nothing to do */
        }
-       else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get 
(nodes_requested, &peer->hashPubKey)))
+       else if (NULL != (n = GNUNET_CONTAINER_multipeermap_get 
(nodes_requested, peer)))
        {
-                       GNUNET_CONTAINER_multihashmap_remove (nodes_requested, 
&peer->hashPubKey, n);
+                       GNUNET_CONTAINER_multipeermap_remove (nodes_requested, 
peer, n);
                        if (GNUNET_SCHEDULER_NO_TASK != n->timeout_task)
                        {
                                GNUNET_SCHEDULER_cancel (n->timeout_task);
@@ -478,9 +479,9 @@
                        update_stats (nodes_requested);
                        make_active = GNUNET_YES;
        }
-       else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get 
(nodes_inactive, &peer->hashPubKey)))
+       else if (NULL != (n = GNUNET_CONTAINER_multipeermap_get 
(nodes_inactive, peer)))
        {
-                 GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove 
(nodes_inactive, &peer->hashPubKey, n));
+                 GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_remove 
(nodes_inactive, peer, n));
                        update_stats (nodes_inactive);
                        make_active = GNUNET_YES;
        }
@@ -565,16 +566,16 @@
        }
 
        make_active = GNUNET_NO;
-       if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_active, 
&peer->hashPubKey)))
+       if (NULL != (n = GNUNET_CONTAINER_multipeermap_get (nodes_active, 
peer)))
        {
                        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from 
%s peer `%s'\n",
                                        "RESPONSE", "active", GNUNET_i2s 
(peer));
        }
-       else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get 
(nodes_requested, &peer->hashPubKey)))
+       else if (NULL != (n = GNUNET_CONTAINER_multipeermap_get 
(nodes_requested, peer)))
        {
                        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from 
%s peer `%s'\n",
                                        "RESPONSE", "requested", GNUNET_i2s 
(peer));
-                       GNUNET_CONTAINER_multihashmap_remove (nodes_requested, 
&peer->hashPubKey, n);
+                       GNUNET_CONTAINER_multipeermap_remove (nodes_requested, 
peer, n);
                        if (GNUNET_SCHEDULER_NO_TASK != n->timeout_task)
                        {
                                GNUNET_SCHEDULER_cancel (n->timeout_task);
@@ -583,11 +584,11 @@
                        update_stats (nodes_requested);
                        make_active = GNUNET_YES;
        }
-       else if (NULL != (n = GNUNET_CONTAINER_multihashmap_get 
(nodes_inactive, &peer->hashPubKey)))
+       else if (NULL != (n = GNUNET_CONTAINER_multipeermap_get 
(nodes_inactive, peer)))
        {
                        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %s from 
peer `%s'\n",
                                        "RESPONSE", "inactive", GNUNET_i2s 
(peer));
-                       GNUNET_break (0 == GNUNET_CONTAINER_multihashmap_remove 
(nodes_inactive, &peer->hashPubKey, n));
+                       GNUNET_break (0 == GNUNET_CONTAINER_multipeermap_remove 
(nodes_inactive, peer, n));
                        update_stats (nodes_inactive);
                        make_active = GNUNET_YES;
        }
@@ -850,13 +851,13 @@
        GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Connected to peer %s\n"),
                        GNUNET_i2s (peer));
 
-       if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains 
(nodes_requested, &peer->hashPubKey))
+       if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains 
(nodes_requested, peer))
                return; /* We already sent a request */
 
-       if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (nodes_active, 
&peer->hashPubKey))
+       if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains (nodes_active, 
peer))
                return; /* This peer is known as active  */
 
-       if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains 
(nodes_inactive, &peer->hashPubKey))
+       if (GNUNET_YES == GNUNET_CONTAINER_multipeermap_contains 
(nodes_inactive, peer))
                return; /* This peer is known as inactive  */
 
        send_experimentation_request (peer);
@@ -879,14 +880,14 @@
        GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Disconnected from peer %s\n"),
                        GNUNET_i2s (peer));
 
-       if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_requested, 
&peer->hashPubKey)))
-               cleanup_node (nodes_requested, &peer->hashPubKey, n);
+       if (NULL != (n = GNUNET_CONTAINER_multipeermap_get (nodes_requested, 
peer)))
+               cleanup_node (nodes_requested, peer, n);
 
-       if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_active, 
&peer->hashPubKey)))
-               cleanup_node (nodes_active, &peer->hashPubKey, n);
+       if (NULL != (n = GNUNET_CONTAINER_multipeermap_get (nodes_active, 
peer)))
+               cleanup_node (nodes_active, peer, n);
 
-       if (NULL != (n = GNUNET_CONTAINER_multihashmap_get (nodes_inactive, 
&peer->hashPubKey)))
-               cleanup_node (nodes_inactive, &peer->hashPubKey, n);
+       if (NULL != (n = GNUNET_CONTAINER_multipeermap_get (nodes_inactive, 
peer)))
+               cleanup_node (nodes_inactive, peer, n);
 }
 
 
@@ -1060,9 +1061,9 @@
                        return;
        }
 
-       nodes_requested = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
-       nodes_active = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
-       nodes_inactive = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
+       nodes_requested = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
+       nodes_active = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
+       nodes_inactive = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
 }
 
 
@@ -1080,31 +1081,31 @@
 
   if (NULL != nodes_requested)
   {
-               GNUNET_CONTAINER_multihashmap_iterate (nodes_requested,
+               GNUNET_CONTAINER_multipeermap_iterate (nodes_requested,
                                                                                
                                                                                
         &cleanup_node,
                                                                                
                                                                                
         nodes_requested);
                update_stats (nodes_requested);
-               GNUNET_CONTAINER_multihashmap_destroy (nodes_requested);
+               GNUNET_CONTAINER_multipeermap_destroy (nodes_requested);
                nodes_requested = NULL;
   }
 
   if (NULL != nodes_active)
   {
-               GNUNET_CONTAINER_multihashmap_iterate (nodes_active,
+               GNUNET_CONTAINER_multipeermap_iterate (nodes_active,
                                                                                
                                                                                
         &cleanup_node,
                                                                                
                                                                                
         nodes_active);
                update_stats (nodes_active);
-               GNUNET_CONTAINER_multihashmap_destroy (nodes_active);
+               GNUNET_CONTAINER_multipeermap_destroy (nodes_active);
                nodes_active = NULL;
   }
 
   if (NULL != nodes_inactive)
   {
-               GNUNET_CONTAINER_multihashmap_iterate (nodes_inactive,
+               GNUNET_CONTAINER_multipeermap_iterate (nodes_inactive,
                                                                                
                                                                                
         &cleanup_node,
                                                                                
                                                                                
         nodes_inactive);
                update_stats (nodes_inactive);
-               GNUNET_CONTAINER_multihashmap_destroy (nodes_inactive);
+               GNUNET_CONTAINER_multipeermap_destroy (nodes_inactive);
                nodes_inactive = NULL;
   }
 }

Modified: gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c
===================================================================
--- gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c        
2013-10-01 07:37:48 UTC (rev 29747)
+++ gnunet/src/experimentation/gnunet-daemon-experimentation_scheduler.c        
2013-10-01 07:46:18 UTC (rev 29748)
@@ -25,7 +25,6 @@
  * @author Matthias Wachs
  */
 #include "platform.h"
-#include "gnunet_getopt_lib.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_core_service.h"
 #include "gnunet_statistics_service.h"




reply via email to

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