docu
[oweals/gnunet.git] / src / ats / gnunet-service-ats_addresses_simplistic.c
1 /*
2      This file is part of GNUnet.
3      (C) 2011 Christian Grothoff (and other contributing authors)
4
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.
9
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.
14
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.
19 */
20
21 /**
22  * @file ats/gnunet-service-ats_addresses_simplistic.h
23  * @brief ats simplistic ressource assignment
24  * @author Matthias Wachs
25  * @author Christian Grothoff
26  */
27 #include "platform.h"
28 #include "gnunet_util_lib.h"
29 #include "gnunet-service-ats_addresses.h"
30 #include "gnunet_statistics_service.h"
31
32
33 /**
34  * A handle for the simplistic solver
35  */
36 struct GAS_SIMPLISTIC_Handle
37 {
38
39 };
40
41
42 /**
43  * Init the simplistic problem solving component
44  *
45  * @param cfg configuration handle
46  * @param stats the GNUNET_STATISTICS handle
47  * @return handle for the solver on success, NULL on fail
48  */
49 void *
50 GAS_simplistic_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
51                      const struct GNUNET_STATISTICS_Handle *stats)
52 {
53   struct GAS_SIMPLISTIC_Handle *solver = GNUNET_malloc (sizeof (struct GAS_SIMPLISTIC_Handle));
54   return solver;
55 }
56
57
58 /**
59  * Shutdown the simplistic problem solving component
60  *
61  * @param solver the respective handle to shutdown
62  */
63 void
64 GAS_simplistic_done (void *solver)
65 {
66   GNUNET_assert (solver != NULL);
67   GNUNET_free (solver);
68 }
69
70 /**
71  * Updates a single address in the solve
72  *
73  * @param solver the solver Handle
74  * @param addresses the address hashmap containing all addresses
75  * @param address the update address
76  */
77 void
78 GAS_simplistic_address_update (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address)
79 {
80
81 }
82
83
84 /**
85  * Remove an address from the solver
86  *
87  * @param solver the solver handle
88  * @param addresses the address hashmap containing all addresses
89  * @param address the address to remove
90  */
91 void
92 GAS_simplistic_address_delete (void *solver, struct GNUNET_CONTAINER_MultiHashMap * addresses, struct ATS_Address *address)
93 {
94
95 }
96
97
98 /**
99  * Get the prefered address for a specific peer
100  *
101  * @param solver the solver handle
102  * @param addresses the address hashmap containing all addresses
103  * @param peer the identity of the peer
104  */
105 struct ATS_PreferedAddress *
106 GAS_simplistic_get_preferred_address (void *solver,
107                                struct GNUNET_CONTAINER_MultiHashMap * addresses,
108                                const struct GNUNET_PeerIdentity *peer)
109 {
110   return NULL;
111 }
112
113
114 /**
115  * Changes the preferences for a peer in the problem
116  *
117  * @param solver the solver handle
118  * @param peer the peer to change the preference for
119  * @param kind the kind to change the preference
120  * @param score the score
121  */
122 void
123 GAS_simplistic_address_change_preference (void *solver,
124                                    const struct GNUNET_PeerIdentity *peer,
125                                    enum GNUNET_ATS_PreferenceKind kind,
126                                    float score)
127 {
128
129 }
130
131 /* end of gnunet-service-ats_addresses_simplistic.c */