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
27 #include "gnunet-service-ats_performance.h"
31 struct PerformanceClient
33 struct PerformanceClient * next;
35 struct PerformanceClient * prev;
37 struct GNUNET_SERVER_Client *client;
43 * Head of linked list of all clients to this service.
45 static struct PerformanceClient *pc_head;
48 * Tail of linked list of all clients to this service.
50 static struct PerformanceClient *pc_tail;
53 static struct PerformanceClient *
54 find_client (struct GNUNET_SERVER_Client *client)
56 struct PerformanceClient * pc;
58 for (pc = pc_head; pc != NULL; pc = pc->next)
59 if (pc->client == client)
66 GAS_add_performance_client (struct GNUNET_SERVER_Client *client)
68 struct PerformanceClient * pc;
70 GNUNET_break (NULL == find_client (client));
71 pc = GNUNET_malloc (sizeof (struct PerformanceClient));
73 GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, pc);
78 GAS_remove_performance_client (struct GNUNET_SERVER_Client *client)
80 struct PerformanceClient * pc;
82 pc = find_client (client);
85 GNUNET_CONTAINER_DLL_remove (pc_head, pc_tail, pc);
86 GNUNET_SERVER_client_drop (client);
92 GAS_handle_reservation_request (void *cls, struct GNUNET_SERVER_Client *client,
93 const struct GNUNET_MessageHeader *message)
96 // struct AddressUpdateMessage * msg = (struct AddressUpdateMessage *) message;
97 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "RESERVATION_REQUEST");
102 GAS_handle_preference_change (void *cls, struct GNUNET_SERVER_Client *client,
103 const struct GNUNET_MessageHeader *message)
106 // struct ChangePreferenceMessage * msg = (struct ChangePreferenceMessage *) message;
107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "PREFERENCE_CHANGE");
111 /* end of gnunet-service-ats_performance.c */