stuff
authorChristian Grothoff <christian@grothoff.org>
Thu, 21 Jan 2010 14:31:14 +0000 (14:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 21 Jan 2010 14:31:14 +0000 (14:31 +0000)
src/core/core_api_peer_get_info.c
src/core/gnunet-service-core.c
src/transport/gnunet-service-transport_blacklist.c
src/transport/gnunet-service-transport_blacklist.h
src/transport/transport.h

index 82785980fae14269a3e8ff94e5c22b18fdc05539..d7ecd9cbb22b6249f7da56f370066e702e7dd2d5 100644 (file)
@@ -77,7 +77,7 @@ receive_info (void *cls,
       GNUNET_break (0);
       if (irc->info != NULL)
        irc->info (irc->info_cls, 
-                  NULL, 0, 0, GNUNET_TIME_UNIT_FOREVER_REL, 0, 0);     
+                  NULL, 0, 0, 0, 0);     
       GNUNET_CLIENT_disconnect (irc->client);
       GNUNET_free (irc);
       return;
index 0f4a3c3b9612f427d7df32a904c77ccdbb2c499e..d0fd6893ede4f5c5579918a2976369387a0c79d9 100644 (file)
@@ -524,6 +524,12 @@ struct Neighbour
    */
   uint32_t ping_challenge;
 
+  /**
+   * What was the last distance to this peer as reported by the transports?
+   * (FIXME: actually set this!)
+   */
+  uint32_t last_distance;
+
   /**
    * What is our connection status?
    */
@@ -1005,7 +1011,8 @@ handle_client_init (void *cls,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Sending `%s' message to client.\n", "NOTIFY_CONNECT");
 #endif
-      cnm.reserved = htonl (0);
+      cnm.distance = htonl (n->last_distance);
+      cnm.latency = GNUNET_TIME_relative_hton (n->last_latency);
       cnm.peer = n->peer;
       send_to_client (c, &cnm.header, GNUNET_NO);
       n = n->next;
@@ -1114,7 +1121,6 @@ handle_client_request_info (void *cls,
       cim.reserved_amount = htonl (reserv);
       cim.bpm_in = htonl (n->bpm_in);
       cim.bpm_out = htonl (n->bpm_out);
-      cim.latency = GNUNET_TIME_relative_hton (n->last_latency);
       cim.preference = n->current_preference;
     }
   cim.header.size = htons (sizeof (struct ConfigurationInfoMessage));
@@ -2613,6 +2619,8 @@ handle_pong (struct Neighbour *n, const struct PingMessage *m)
         }      
       cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
       cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
+      cnm.distance = htonl (0); /* FIXME */
+      cnm.latency = GNUNET_TIME_relative_hton (GNUNET_TIME_UNIT_ZERO); /* FIXME */
       cnm.reserved = htonl (0);
       cnm.peer = n->peer;
       send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_CONNECT);
index 623f8c3f26b095f608e6e3c500d53f01bb11edb6..b51f5144260d3429487e0ace4f7b1e3c7c96a6d1 100644 (file)
@@ -25,6 +25,7 @@
  */
 #include "platform.h"
 #include "gnunet_protocols.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_service_lib.h"
 #include "transport.h"
 #include "gnunet-service-transport_blacklist.h"
@@ -183,6 +184,11 @@ GNUNET_TRANSPORT_handle_blacklist_notify (void *cls,
                                          struct GNUNET_SERVER_Client *client,
                                          const struct GNUNET_MessageHeader *message)
 {
+  struct BlacklistNotificationList *bnl;
+
+  bnl = GNUNET_malloc (sizeof (struct BlacklistNotificationList));
+  bnl->next = blacklist_notifiers;
+  blacklist_notifiers = bnl;
   /* FIXME */
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
index cce1013c152985ac283b505d1f312d929182fab0..46a65cb61defc12a6bfb3e2e1b82441775b7ce5d 100644 (file)
  * @brief internal API for blacklisting functionality
  * @author Christian Grothoff
  */
-#include "platform.h"
+#ifndef GNUNET_SERVICE_TRANSPORT_BLACKLIST_H
+#define GNUNET_SERVICE_TRANSPORT_BLACKLIST_H
+
 #include "gnunet_protocols.h"
 #include "gnunet_service_lib.h"
 #include "transport.h"
 
-#ifndef GNUNET_SERVICE_TRANSPORT_BLACKLIST_H
-#define GNUNET_SERVICE_TRANSPORT_BLACKLIST_H
-
 /**
  * Handle a request to blacklist a peer.
  *
index 0970b3648e7cce86702eaa7b85c043ab5e6c1019..603f1bbc1e5d4e9c223175c3f253ba254d981c85 100644 (file)
@@ -23,6 +23,9 @@
  * @brief common internal definitions for transport service
  * @author Christian Grothoff
  */
+#ifndef TRANSPORT_H
+#define TRANSPORT_H
+
 #include "gnunet_crypto_lib.h"
 #include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
@@ -309,3 +312,4 @@ struct BlacklistMessage
 
 
 /* end of transport.h */
+#endif