diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-05 12:52:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-05 12:52:20 +0000 |
commit | c55971f17dc99f9833af48e078c8f681be771cb7 (patch) | |
tree | 544fd671b67903506419c98d463d086a696e25a1 /src/ats/gnunet-service-ats_preferences.h | |
parent | 15dd8e6cc1199d611d804853e134882bf13b234a (diff) | |
download | gnunet-c55971f17dc99f9833af48e078c8f681be771cb7.tar.gz gnunet-c55971f17dc99f9833af48e078c8f681be771cb7.zip |
big ATS refactoring, no serious semantic changes should stem from this
Diffstat (limited to 'src/ats/gnunet-service-ats_preferences.h')
-rw-r--r-- | src/ats/gnunet-service-ats_preferences.h | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/src/ats/gnunet-service-ats_preferences.h b/src/ats/gnunet-service-ats_preferences.h new file mode 100644 index 000000000..bab604d21 --- /dev/null +++ b/src/ats/gnunet-service-ats_preferences.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2011-2014 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_preferences.h | ||
23 | * @brief FIXME | ||
24 | * @author Matthias Wachs | ||
25 | * @author Christian Grothoff | ||
26 | */ | ||
27 | #ifndef GNUNET_SERVICE_ATS_PREFERENCES_H | ||
28 | #define GNUNET_SERVICE_ATS_PREFERENCES_H | ||
29 | |||
30 | #include "gnunet_util_lib.h" | ||
31 | #include "gnunet_ats_service.h" | ||
32 | #include "gnunet-service-ats.h" | ||
33 | #include "gnunet_statistics_service.h" | ||
34 | #include "ats.h" | ||
35 | |||
36 | |||
37 | #define DEFAULT_ABS_PREFERENCE 0.0 | ||
38 | |||
39 | #define DEFAULT_REL_PREFERENCE 0.0 | ||
40 | |||
41 | |||
42 | |||
43 | |||
44 | /** | ||
45 | * A preference client disconnected | ||
46 | * | ||
47 | * @param client the client; FIXME: type!? | ||
48 | */ | ||
49 | void | ||
50 | GAS_addresses_preference_client_disconnect (void *client); | ||
51 | |||
52 | |||
53 | |||
54 | |||
55 | /** | ||
56 | * Change the preference for a peer | ||
57 | * | ||
58 | * @param client the client sending this request; FIXME: type!? | ||
59 | * @param peer the peer id | ||
60 | * @param kind the preference kind to change | ||
61 | * @param score_abs the new preference score | ||
62 | */ | ||
63 | void | ||
64 | GAS_addresses_preference_change (void *client, | ||
65 | const struct GNUNET_PeerIdentity *peer, | ||
66 | enum GNUNET_ATS_PreferenceKind kind, | ||
67 | float score_abs); | ||
68 | |||
69 | |||
70 | /** | ||
71 | * Application feedback on how good preference requirements are fulfilled | ||
72 | * for a specific preference in the given time scope [now - scope .. now] | ||
73 | * | ||
74 | * An application notifies ATS if (and only if) it has feedback information | ||
75 | * for a specific property. This value is valid until the feedback score is | ||
76 | * updated by the application. | ||
77 | * | ||
78 | * If the application has no feedback for this preference kind the application | ||
79 | * will not explicitly call. | ||
80 | * | ||
81 | * @param application the application sending this request; FIXME: type? | ||
82 | * @param peer the peer id | ||
83 | * @param scope the time interval this valid for: [now - scope .. now] | ||
84 | * @param kind the preference kind this feedback is intended for | ||
85 | * @param score_abs the new preference score | ||
86 | */ | ||
87 | void | ||
88 | GAS_addresses_preference_feedback (void *application, | ||
89 | const struct GNUNET_PeerIdentity *peer, | ||
90 | const struct GNUNET_TIME_Relative scope, | ||
91 | enum GNUNET_ATS_PreferenceKind kind, | ||
92 | float score_abs); | ||
93 | |||
94 | /** | ||
95 | * Shutdown preferences subsystem. | ||
96 | */ | ||
97 | void | ||
98 | GAS_preference_done (void); | ||
99 | |||
100 | |||
101 | #endif | ||