paragraph for gnunet devs that don't know how to use the web
[oweals/gnunet.git] / src / ats / gnunet-service-ats_preferences.h
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2011-2014 GNUnet e.V.
4
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your 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  Affero General Public License for more details.
14
15  You should have received a copy of the GNU Affero General Public License
16  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 /**
19  * @file ats/gnunet-service-ats_preferences.h
20  * @brief manage preferences expressed by clients
21  * @author Matthias Wachs
22  * @author Christian Grothoff
23  */
24 #ifndef GNUNET_SERVICE_ATS_PREFERENCES_H
25 #define GNUNET_SERVICE_ATS_PREFERENCES_H
26
27 #include "gnunet_util_lib.h"
28 #include "gnunet_ats_service.h"
29 #include "gnunet-service-ats.h"
30 #include "gnunet_statistics_service.h"
31 #include "ats.h"
32
33 /**
34  * Default preference value we assume if we know nothing.
35  */
36 #define DEFAULT_ABS_PREFERENCE 0.0
37
38 /**
39  * Default relative preference value we assume if we know nothing.
40  */
41 #define DEFAULT_REL_PREFERENCE 0.0
42
43
44 /**
45  * Handle 'preference change' messages from clients.
46  *
47  * @param client the client that sent the request
48  * @param msg the request message
49  */
50 void
51 GAS_handle_preference_change (struct GNUNET_SERVICE_Client *client,
52                               const struct ChangePreferenceMessage *msg);
53
54
55 /**
56  * Initialize preferences subsystem.
57  */
58 void
59 GAS_preference_init (void);
60
61
62 /**
63  * Shutdown preferences subsystem.
64  */
65 void
66 GAS_preference_done (void);
67
68
69 /**
70  * Get the normalized preference values for a specific peer.
71  *
72  * @param cls ignored
73  * @param id the peer
74  * @return pointer to the values, can be indexed
75  *  with `enum GNUNET_ATS_PreferenceKind`, never NULL
76  */
77 const double *
78 GAS_preference_get_by_peer (void *cls,
79                             const struct GNUNET_PeerIdentity *id);
80
81
82 /**
83  * A performance client disconnected
84  *
85  * @param client the disconnecting client
86  */
87 void
88 GAS_preference_client_disconnect (struct GNUNET_SERVICE_Client *client);
89
90
91 #endif