gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r17466 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r17466 - gnunet/src/ats
Date: Thu, 13 Oct 2011 22:48:27 +0200

Author: grothoff
Date: 2011-10-13 22:48:27 +0200 (Thu, 13 Oct 2011)
New Revision: 17466

Added:
   gnunet/src/ats/gnunet-service-ats_performance.c
   gnunet/src/ats/gnunet-service-ats_performance.h
   gnunet/src/ats/gnunet-service-ats_scheduling.c
   gnunet/src/ats/gnunet-service-ats_scheduling.h
Modified:
   gnunet/src/ats/Makefile.am
   gnunet/src/ats/gnunet-service-ats.c
Log:
merging

Modified: gnunet/src/ats/Makefile.am
===================================================================
--- gnunet/src/ats/Makefile.am  2011-10-13 20:14:22 UTC (rev 17465)
+++ gnunet/src/ats/Makefile.am  2011-10-13 20:48:27 UTC (rev 17466)
@@ -22,7 +22,9 @@
  gnunet-service-ats
 
 gnunet_service_ats_SOURCES = \
- gnunet-service-ats.c         
+ gnunet-service-ats.c \
+ gnunet-service-ats_performance.c gnunet-service-ats_performance.h \
+ gnunet-service-ats_scheduling.c gnunet-service-ats_scheduling.h
 gnunet_service_ats_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_LIBINTL)

Modified: gnunet/src/ats/gnunet-service-ats.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats.c 2011-10-13 20:14:22 UTC (rev 17465)
+++ gnunet/src/ats/gnunet-service-ats.c 2011-10-13 20:48:27 UTC (rev 17466)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009 Christian Grothoff (and other contributing authors)
+     (C) 2011 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
@@ -24,23 +24,13 @@
  * @author Matthias Wachs
  */
 #include "platform.h"
-#include "gnunet_getopt_lib.h"
-#include "gnunet_service_lib.h"
-#include "gnunet_container_lib.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_ats_service.h"
+#include "gnunet-service-ats_performance.h"
+#include "gnunet-service-ats_scheduling.h"
+// #include "gnunet-service-ats_performance.h"
 #include "ats.h"
 
-struct ATS_Clients
-{
-  struct ATS_Clients * next;
-
-  struct ATS_Clients * prev;
-
-  struct GNUNET_SERVER_Client *client;
-
-  uint32_t flags;
-};
-
 struct ATS_Address
 {
   struct GNUNET_PeerIdentity peer;
@@ -58,27 +48,38 @@
   struct GNUNET_TRANSPORT_ATS_Information * ats;
 };
 
-/**
- * Head of linked list of all clients to this service.
- */
-static struct ATS_Clients *ac_head;
+static struct GNUNET_CONTAINER_MultiHashMap * addresses;
 
-/**
- * Tail of linked list of all clients to this service.
- */
-static struct ATS_Clients *ac_tail;
 
-static struct GNUNET_CONTAINER_MultiHashMap * addresses;
 
-int free_address_it (void *cls,
-               const GNUNET_HashCode * key,
-               void *value)
+static void
+handle_ats_start (void *cls, struct GNUNET_SERVER_Client *client,
+                 const struct GNUNET_MessageHeader *message)
 {
-  struct ATS_Address * aa = cls;
-  GNUNET_free (aa);
-  return GNUNET_OK;
+  const struct ClientStartMessage * msg = (const struct ClientStartMessage *) 
message;
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Received `%s' message\n",
+             "ATS_START");
+  switch (ntohl (msg->start_flag))
+  {
+  case START_FLAG_SCHEDULING:
+    GAS_add_scheduling_client (client);
+    break;
+  case START_FLAG_PERFORMANCE_WITH_PIC:
+    GAS_add_performance_client (client);
+    break;
+  case START_FLAG_PERFORMANCE_NO_PIC:
+    break;
+  default:
+    GNUNET_break (0);
+    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    return;
+  }
+  GNUNET_SERVER_receive_done (client, GNUNET_OK);    
 }
 
+
 struct CompareAddressContext
 {
   struct ATS_Address * search;
@@ -101,6 +102,21 @@
   return GNUNET_YES;
 }
 
+
+static int 
+free_address_it (void *cls,
+                const GNUNET_HashCode * key,
+                void *value)
+{
+  struct ATS_Address * aa = cls;
+  GNUNET_free (aa);
+  return GNUNET_OK;
+}
+
+
+
+
+
 /**
  * Task run during shutdown.
  *
@@ -110,147 +126,11 @@
 static void
 cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct ATS_Clients * t;
-
-  while (ac_head != NULL)
-  {
-    t = ac_head;
-    GNUNET_CONTAINER_DLL_remove(ac_head,ac_tail, t);
-    GNUNET_free (t);
-  }
-
-  GNUNET_CONTAINER_multihashmap_iterate (addresses, free_address_it, NULL);
-
+  GNUNET_CONTAINER_multihashmap_iterate (addresses, &free_address_it, NULL);
   GNUNET_CONTAINER_multihashmap_destroy (addresses);
 }
 
-static struct ATS_Clients * find_client (struct GNUNET_SERVER_Client *client)
-{
-  struct ATS_Clients * ac = ac_head;
-  while (ac != NULL)
-  {
-  if (ac->client == client)
-    break;
-  ac = ac->next;
-  }
-  return ac;
-}
 
-static void
-handle_ats_start (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  struct ClientStartMessage * msg = (struct ClientStartMessage *) message;
-  struct ATS_Clients * ac = NULL;
-
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "ATS_START");
-
-  GNUNET_assert (find_client(client) == NULL);
-
-  ac = GNUNET_malloc (sizeof (struct ATS_Clients));
-  ac->client = client;
-  ac->flags = ntohl (msg->start_flag);
-
-  GNUNET_CONTAINER_DLL_insert(ac_head, ac_tail, ac);
-}
-
-static void
-handle_request_address (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  // struct RequestAddressMessage * msg = (struct RequestAddressMessage *) 
message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"REQUEST_ADDRESS");
-
-}
-
-static void
-handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"ADDRESS_UPDATE");
-
-  struct GNUNET_TRANSPORT_ATS_Information *am;
-  char *pm;
-
-  size_t size = ntohs (msg->header.size);
-  if ((size <= sizeof (struct AddressUpdateMessage)) || (size >= 
GNUNET_SERVER_MAX_MESSAGE_SIZE))
-  {
-    GNUNET_break (0);
-    return;
-  }
-
-  size_t ats_count = ntohs (msg->ats_count);
-  size_t addr_len = ntohs (msg->address_length);
-  size_t plugin_len = ntohs (msg->plugin_name_length) + 1 ;
-
-  if (
-       (plugin_len  >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
-       (addr_len  >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
-       (addr_len >= GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct 
GNUNET_TRANSPORT_ATS_Information)) )
-  {
-    GNUNET_break (0);
-    return;
-  }
-
-  struct ATS_Address * aa = GNUNET_malloc (sizeof (struct ATS_Address) +
-                                           ats_count * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information) +
-                                           addr_len +
-                                           plugin_len);
-
-
-
-  memcpy (&aa->peer, &msg->peer, sizeof (struct GNUNET_PeerIdentity));
-  aa->addr_len = addr_len;
-  aa->ats_count = ats_count;
-  aa->ats = (struct GNUNET_TRANSPORT_ATS_Information *) &aa[1];
-
-  am = (struct GNUNET_TRANSPORT_ATS_Information*) &msg[1];
-  memcpy (&aa->ats, am, ats_count * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information));
-  pm = (char *) &am[ats_count];
-  memcpy (aa->addr, pm, addr_len);
-  memcpy (aa->plugin, &pm[plugin_len], plugin_len);
-  aa->session_id = ntohl(msg->session_id);
-
-  GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(addresses, 
&aa->peer.hashPubKey, aa, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
-}
-
-static void
-handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  // struct AddressDestroyedMessage * msg = (struct AddressDestroyedMessage *) 
message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"ADDRESS_DESTROYED");
-/*
-  struct GNUNET_PeerIdentity *peer = &msg->peer;
-  struct ATS_Address * aa = find_address_by_addr (peer);
-  GNUNET_CONTAINER_multihashmap_remove(addresses, peer, aa);
-  GNUNET_free (aa);*/
-}
-
-static void
-handle_reservation_request (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  // struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) 
message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"RESERVATION_REQUEST");
-}
-
-static void
-handle_preference_change (void *cls, struct GNUNET_SERVER_Client *client,
-                      const struct GNUNET_MessageHeader *message)
-
-{
-  // struct ChangePreferenceMessage * msg = (struct ChangePreferenceMessage *) 
message;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"PREFERENCE_CHANGE");
-}
-
 /**
  * Process template requests.
  *
@@ -263,17 +143,21 @@
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   static const struct GNUNET_SERVER_MessageHandler handlers[] = {
-      {&handle_ats_start, NULL, GNUNET_MESSAGE_TYPE_ATS_START, sizeof (struct 
ClientStartMessage)},
-      {&handle_request_address, NULL, GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS, 
sizeof (struct RequestAddressMessage)},
-      {&handle_address_update, NULL, GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE, 
0},
-      {&handle_address_destroyed, NULL, 
GNUNET_MESSAGE_TYPE_ATS_ADDRESS_DESTROYED, 0},
-      {&handle_reservation_request, NULL, 
GNUNET_MESSAGE_TYPE_ATS_RESERVATION_REQUEST, sizeof (struct 
ReservationRequestMessage)},
-      {&handle_preference_change, NULL, 
GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
+    { &handle_ats_start, NULL, 
+      GNUNET_MESSAGE_TYPE_ATS_START, sizeof (struct ClientStartMessage)},
+    { &GAS_handle_request_address, NULL,
+      GNUNET_MESSAGE_TYPE_ATS_REQUEST_ADDRESS, sizeof (struct 
RequestAddressMessage)},
+    { &GAS_handle_address_update, NULL, 
+      GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE, 0},
+    { &GAS_handle_address_destroyed, NULL, 
+      GNUNET_MESSAGE_TYPE_ATS_ADDRESS_DESTROYED, 0},
+    { &GAS_handle_reservation_request, NULL, 
+      GNUNET_MESSAGE_TYPE_ATS_RESERVATION_REQUEST, sizeof (struct 
ReservationRequestMessage)},
+    { &GAS_handle_preference_change, NULL, 
+      GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE, 0},
     {NULL, NULL, 0, 0}
   };
-
-  addresses = GNUNET_CONTAINER_multihashmap_create(100);
-
+  addresses = GNUNET_CONTAINER_multihashmap_create(128);
   GNUNET_SERVER_add_handlers (server, handlers);
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
                                 NULL);

Added: gnunet/src/ats/gnunet-service-ats_performance.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_performance.c                             
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_performance.c     2011-10-13 20:48:27 UTC 
(rev 17466)
@@ -0,0 +1,90 @@
+/*
+     This file is part of GNUnet.
+     (C) 2011 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
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file ats/gnunet-service-ats_performance.c
+ * @brief ats service, interaction with 'performance' API
+ * @author Matthias Wachs
+ */
+#include "platform.h"
+#include "gnunet-service-ats_performance.h"
+#include "ats.h"
+
+
+struct PerformanceClient
+{
+  struct PerformanceClient * next;
+
+  struct PerformanceClient * prev;
+
+  struct GNUNET_SERVER_Client *client;
+
+};
+
+
+/**
+ * Head of linked list of all clients to this service.
+ */
+static struct PerformanceClient *pc_head;
+
+/**
+ * Tail of linked list of all clients to this service.
+ */
+static struct PerformanceClient *pc_tail;
+
+
+void
+GAS_add_performance_client (struct GNUNET_SERVER_Client *client)
+{
+  struct PerformanceClient * pc;
+
+  pc = GNUNET_malloc (sizeof (struct PerformanceClient));
+  pc->client = client;
+  GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, pc);
+}
+
+
+void
+GAS_remove_performance_client (struct GNUNET_SERVER_Client *client)
+{
+}
+
+
+void
+GAS_handle_reservation_request (void *cls, struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *message)
+
+{
+  // struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) 
message;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"RESERVATION_REQUEST");
+}
+
+
+void
+GAS_handle_preference_change (void *cls, struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *message)
+
+{
+  // struct ChangePreferenceMessage * msg = (struct ChangePreferenceMessage *) 
message;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"PREFERENCE_CHANGE");
+}
+
+
+/* end of gnunet-service-ats_performance.c */

Added: gnunet/src/ats/gnunet-service-ats_performance.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_performance.h                             
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_performance.h     2011-10-13 20:48:27 UTC 
(rev 17466)
@@ -0,0 +1,50 @@
+/*
+     This file is part of GNUnet.
+     (C) 2011 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
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file ats/gnunet-service-ats_performance.h
+ * @brief ats service, interaction with 'performance' API
+ * @author Matthias Wachs
+ */
+#ifndef GNUNET_SERVICE_ATS_PERFORMANCE_H
+#define GNUNET_SERVICE_ATS_PERFORMANCE_H
+
+#include "gnunet_util_lib.h"
+
+void
+GAS_add_performance_client (struct GNUNET_SERVER_Client *client);
+
+
+void
+GAS_remove_performance_client (struct GNUNET_SERVER_Client *client);
+
+
+void
+GAS_handle_reservation_request (void *cls, struct GNUNET_SERVER_Client *client,
+                               const struct GNUNET_MessageHeader *message);
+
+
+void
+GAS_handle_preference_change (void *cls, struct GNUNET_SERVER_Client *client,
+                             const struct GNUNET_MessageHeader *message);
+
+
+#endif
+/* end of gnunet-service-ats_performance.h */

Added: gnunet/src/ats/gnunet-service-ats_scheduling.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_scheduling.c                              
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_scheduling.c      2011-10-13 20:48:27 UTC 
(rev 17466)
@@ -0,0 +1,154 @@
+/*
+     This file is part of GNUnet.
+     (C) 2011 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
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file ats/gnunet-service-ats_scheduling.c
+ * @brief ats service, interaction with 'scheduling' API
+ * @author Matthias Wachs
+ */
+#include "platform.h"
+#include "gnunet-service-ats_scheduling.h"
+#include "ats.h"
+
+
+struct SchedulingClient
+{
+  struct SchedulingClient * next;
+
+  struct SchedulingClient * prev;
+
+  struct GNUNET_SERVER_Client *client;
+
+};
+
+
+/**
+ * Head of linked list of all clients to this service.
+ */
+static struct SchedulingClient *ac_head;
+
+/**
+ * Tail of linked list of all clients to this service.
+ */
+static struct SchedulingClient *ac_tail;
+
+
+void
+GAS_add_scheduling_client (struct GNUNET_SERVER_Client *client)
+{
+  struct SchedulingClient *ac;
+
+  ac = GNUNET_malloc (sizeof (struct SchedulingClient));
+  ac->client = client;
+  GNUNET_SERVER_client_keep (client);
+  GNUNET_CONTAINER_DLL_insert(ac_head, ac_tail, ac);
+}
+
+
+void
+GAS_remove_scheduling_client (struct GNUNET_SERVER_Client *client)
+{
+}
+
+
+void
+GAS_handle_request_address (void *cls, struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *message)
+
+{
+  // struct RequestAddressMessage * msg = (struct RequestAddressMessage *) 
message;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"REQUEST_ADDRESS");
+
+}
+
+
+void
+GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *message)
+
+{
+#if 0
+  struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) message;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"ADDRESS_UPDATE");
+
+  struct GNUNET_TRANSPORT_ATS_Information *am;
+  char *pm;
+
+  size_t size = ntohs (msg->header.size);
+  if ((size <= sizeof (struct AddressUpdateMessage)) || (size >= 
GNUNET_SERVER_MAX_MESSAGE_SIZE))
+  {
+    GNUNET_break (0);
+    return;
+  }
+
+  size_t ats_count = ntohs (msg->ats_count);
+  size_t addr_len = ntohs (msg->address_length);
+  size_t plugin_len = ntohs (msg->plugin_name_length) + 1 ;
+
+  if (
+       (plugin_len  >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
+       (addr_len  >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
+       (addr_len >= GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct 
GNUNET_TRANSPORT_ATS_Information)) )
+  {
+    GNUNET_break (0);
+    return;
+  }
+
+  struct ATS_Address * aa = GNUNET_malloc (sizeof (struct ATS_Address) +
+                                           ats_count * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information) +
+                                           addr_len +
+                                           plugin_len);
+
+
+
+  memcpy (&aa->peer, &msg->peer, sizeof (struct GNUNET_PeerIdentity));
+  aa->addr_len = addr_len;
+  aa->ats_count = ats_count;
+  aa->ats = (struct GNUNET_TRANSPORT_ATS_Information *) &aa[1];
+
+  am = (struct GNUNET_TRANSPORT_ATS_Information*) &msg[1];
+  memcpy (&aa->ats, am, ats_count * sizeof (struct 
GNUNET_TRANSPORT_ATS_Information));
+  pm = (char *) &am[ats_count];
+  memcpy (aa->addr, pm, addr_len);
+  memcpy (aa->plugin, &pm[plugin_len], plugin_len);
+  aa->session_id = ntohl(msg->session_id);
+
+  GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(addresses, 
&aa->peer.hashPubKey, aa, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
+#endif
+}
+
+
+void
+GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
+                      const struct GNUNET_MessageHeader *message)
+
+{
+#if 0
+  // struct AddressDestroyedMessage * msg = (struct AddressDestroyedMessage *) 
message;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", 
"ADDRESS_DESTROYED");
+/*
+  struct GNUNET_PeerIdentity *peer = &msg->peer;
+  struct ATS_Address * aa = find_address_by_addr (peer);
+  GNUNET_CONTAINER_multihashmap_remove(addresses, peer, aa);
+  GNUNET_free (aa);*/
+#endif
+}
+
+/* end of gnunet-service-ats_scheduling.c */

Added: gnunet/src/ats/gnunet-service-ats_scheduling.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_scheduling.h                              
(rev 0)
+++ gnunet/src/ats/gnunet-service-ats_scheduling.h      2011-10-13 20:48:27 UTC 
(rev 17466)
@@ -0,0 +1,55 @@
+/*
+     This file is part of GNUnet.
+     (C) 2011 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
+     by the Free Software Foundation; either version 3, or (at your
+     option) any later version.
+
+     GNUnet is distributed in the hope that it will be useful, but
+     WITHOUT ANY WARRANTY; without even the implied warranty of
+     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+     General Public License for more details.
+
+     You should have received a copy of the GNU General Public License
+     along with GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file ats/gnunet-service-ats_scheduling.h
+ * @brief ats service, interaction with 'scheduling' API
+ * @author Matthias Wachs
+ */
+#ifndef GNUNET_SERVICE_ATS_SCHEDULING_H
+#define GNUNET_SERVICE_ATS_SCHEDULING_H
+
+#include "gnunet_util_lib.h"
+
+void
+GAS_add_scheduling_client (struct GNUNET_SERVER_Client *client);
+
+
+void
+GAS_remove_scheduling_client (struct GNUNET_SERVER_Client *client);
+
+
+void
+GAS_handle_request_address (void *cls, struct GNUNET_SERVER_Client *client,
+                           const struct GNUNET_MessageHeader *message);
+
+
+void
+GAS_handle_address_update (void *cls, struct GNUNET_SERVER_Client *client,
+                          const struct GNUNET_MessageHeader *message);
+
+
+void
+GAS_handle_address_destroyed (void *cls, struct GNUNET_SERVER_Client *client,
+                             const struct GNUNET_MessageHeader *message);
+
+
+#endif
+/* end of gnunet-service-ats_scheduling.h */




reply via email to

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