2 This file is part of GNUnet.
3 (C) 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file ats/gnunet-service-ats_performance.c
23 * @brief ats service, interaction with 'performance' API
24 * @author Matthias Wachs
25 * @author Christian Grothoff
28 #include "gnunet-service-ats_performance.h"
32 struct PerformanceClient
34 struct PerformanceClient * next;
36 struct PerformanceClient * prev;
38 struct GNUNET_SERVER_Client *client;
44 * Head of linked list of all clients to this service.
46 static struct PerformanceClient *pc_head;
49 * Tail of linked list of all clients to this service.
51 static struct PerformanceClient *pc_tail;
54 static struct PerformanceClient *
55 find_client (struct GNUNET_SERVER_Client *client)
57 struct PerformanceClient * pc;
59 for (pc = pc_head; pc != NULL; pc = pc->next)
60 if (pc->client == client)
67 GAS_performance_add_client (struct GNUNET_SERVER_Client *client)
69 struct PerformanceClient * pc;
71 GNUNET_break (NULL == find_client (client));
72 pc = GNUNET_malloc (sizeof (struct PerformanceClient));
74 GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, pc);
79 GAS_performance_remove_client (struct GNUNET_SERVER_Client *client)
81 struct PerformanceClient * pc;
83 pc = find_client (client);
86 GNUNET_CONTAINER_DLL_remove (pc_head, pc_tail, pc);
87 GNUNET_SERVER_client_drop (client);
93 GAS_handle_reservation_request (void *cls, struct GNUNET_SERVER_Client *client,
94 const struct GNUNET_MessageHeader *message)
97 // struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) message;
98 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "RESERVATION_REQUEST");
103 GAS_handle_preference_change (void *cls, struct GNUNET_SERVER_Client *client,
104 const struct GNUNET_MessageHeader *message)
107 // struct ChangePreferenceMessage * msg = (struct ChangePreferenceMessage *) message;
108 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "PREFERENCE_CHANGE");
112 /* end of gnunet-service-ats_performance.c */