glitch in the license text detected by hyazinthe, thank you!
[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 /**
16  * @file ats/gnunet-service-ats_preferences.h
17  * @brief manage preferences expressed by clients
18  * @author Matthias Wachs
19  * @author Christian Grothoff
20  */
21 #ifndef GNUNET_SERVICE_ATS_PREFERENCES_H
22 #define GNUNET_SERVICE_ATS_PREFERENCES_H
23
24 #include "gnunet_util_lib.h"
25 #include "gnunet_ats_service.h"
26 #include "gnunet-service-ats.h"
27 #include "gnunet_statistics_service.h"
28 #include "ats.h"
29
30 /**
31  * Default preference value we assume if we know nothing.
32  */
33 #define DEFAULT_ABS_PREFERENCE 0.0
34
35 /**
36  * Default relative preference value we assume if we know nothing.
37  */
38 #define DEFAULT_REL_PREFERENCE 0.0
39
40
41 /**
42  * Handle 'preference change' messages from clients.
43  *
44  * @param client the client that sent the request
45  * @param msg the request message
46  */
47 void
48 GAS_handle_preference_change (struct GNUNET_SERVICE_Client *client,
49                               const struct ChangePreferenceMessage *msg);
50
51
52 /**
53  * Initialize preferences subsystem.
54  */
55 void
56 GAS_preference_init (void);
57
58
59 /**
60  * Shutdown preferences subsystem.
61  */
62 void
63 GAS_preference_done (void);
64
65
66 /**
67  * Get the normalized preference values for a specific peer.
68  *
69  * @param cls ignored
70  * @param id the peer
71  * @return pointer to the values, can be indexed
72  *  with `enum GNUNET_ATS_PreferenceKind`, never NULL
73  */
74 const double *
75 GAS_preference_get_by_peer (void *cls,
76                             const struct GNUNET_PeerIdentity *id);
77
78
79 /**
80  * A performance client disconnected
81  *
82  * @param client the disconnecting client
83  */
84 void
85 GAS_preference_client_disconnect (struct GNUNET_SERVICE_Client *client);
86
87
88 #endif