dummy for address in use
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 8 Nov 2011 14:54:43 +0000 (14:54 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 8 Nov 2011 14:54:43 +0000 (14:54 +0000)
first I have to find the bugs in scheduling api, then I can add the logic here

src/ats/gnunet-service-ats_addresses.c
src/ats/gnunet-service-ats_addresses.h
src/ats/gnunet-service-ats_scheduling.c
src/ats/gnunet-service-ats_scheduling.h

index 22304aa6dd9a871e184c7627f888042c5fdcfa9b..d5c0b0915ebfa0a94f39cd1cceee9989c5dbca6d 100644 (file)
@@ -379,6 +379,18 @@ find_address_it (void *cls, const GNUNET_HashCode * key, void *value)
 }
 
 
+void
+GAS_addresses_in_use (const struct GNUNET_PeerIdentity *peer,
+                      const char *plugin_name, const void *plugin_addr,
+                      size_t plugin_addr_len, uint32_t session_id,
+                      int in_use)
+{
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message for peer `%s': %i\n",
+              "ADDRESS_IN_USE",
+              GNUNET_i2s (peer), in_use);
+}
+
 void
 GAS_addresses_request_address (const struct GNUNET_PeerIdentity *peer)
 {
index 7fde42d969ee2753ff08afc744e9decb103ff964..95f267bf998c8205c0dd3d7e7eac56094928dedc 100644 (file)
@@ -46,6 +46,15 @@ void
 GAS_addresses_done (void);
 
 
+/**
+ * This address is now used or not used anymore
+ */
+void
+GAS_addresses_in_use (const struct GNUNET_PeerIdentity *peer,
+                      const char *plugin_name, const void *plugin_addr,
+                      size_t plugin_addr_len, uint32_t session_id,
+                      int in_use);
+
 void
 GAS_addresses_update (const struct GNUNET_PeerIdentity *peer,
                       const char *plugin_name, const void *plugin_addr,
index 4af44e29bd4567598f6f09470c2c075168ea8414..fb404041793a8123f69d38570ef96b4b06487ac3 100644 (file)
@@ -246,9 +246,8 @@ GAS_handle_address_in_use (void *cls, struct GNUNET_SERVER_Client *client,
   uint16_t plugin_name_length;
 
   uint16_t size;
+  uint16_t in_use;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n",
-              "ADDRESS_IN_USE");
   size = ntohs (message->size);
   if (size < sizeof (struct AddressUseMessage))
   {
@@ -276,16 +275,14 @@ GAS_handle_address_in_use (void *cls, struct GNUNET_SERVER_Client *client,
     return;
   }
 
-
-/*
-  GAS_addresses_update (&m->peer,
+  in_use = ntohs (m->in_use);
+  GAS_addresses_in_use (&m->peer,
                         plugin_name,
                         address,
                         address_length,
                         ntohl (m->session_id),
-                        atsi,
-                        ats_count);
-*/
+                        in_use);
+
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
 }
 
index 44ac705e31010ccb3f3920702fc8eac6a96bf40f..b97430b62eb3a63f80552d6742d5ad4e8e6d3c1d 100644 (file)
@@ -114,6 +114,7 @@ void
 GAS_handle_address_in_use (void *cls, struct GNUNET_SERVER_Client *client,
                            const struct GNUNET_MessageHeader *message);
 
+
 /**
  * Handle 'address destroyed' messages from clients.
  *