summaryrefslogtreecommitdiff
path: root/src/include/gnunet_ats_plugin_new.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_ats_plugin_new.h')
-rw-r--r--src/include/gnunet_ats_plugin_new.h76
1 files changed, 34 insertions, 42 deletions
diff --git a/src/include/gnunet_ats_plugin_new.h b/src/include/gnunet_ats_plugin_new.h
index 633343272..f9005ee73 100644
--- a/src/include/gnunet_ats_plugin_new.h
+++ b/src/include/gnunet_ats_plugin_new.h
@@ -1,19 +1,19 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2009-2015, 2018 GNUnet e.V. 3 Copyright (C) 2009-2015, 2018 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 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 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, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 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/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19 */ 19 */
@@ -47,7 +47,6 @@
47 * Preference being expressed by an application client. 47 * Preference being expressed by an application client.
48 */ 48 */
49struct GNUNET_ATS_Preference { 49struct GNUNET_ATS_Preference {
50
51 /** 50 /**
52 * Peer to get address suggestions for. 51 * Peer to get address suggestions for.
53 */ 52 */
@@ -74,7 +73,6 @@ struct GNUNET_ATS_Session;
74 * Plugin-relevant information about a session. 73 * Plugin-relevant information about a session.
75 */ 74 */
76struct GNUNET_ATS_SessionData { 75struct GNUNET_ATS_SessionData {
77
78 /** 76 /**
79 * Peer the session is with. 77 * Peer the session is with.
80 */ 78 */
@@ -89,12 +87,11 @@ struct GNUNET_ATS_SessionData {
89 * Handle to the session that has the given properties. 87 * Handle to the session that has the given properties.
90 */ 88 */
91 struct GNUNET_ATS_Session *session; 89 struct GNUNET_ATS_Session *session;
92 90
93 /** 91 /**
94 * Is the session inbound only? 92 * Is the session inbound only?
95 */ 93 */
96 int inbound_only; 94 int inbound_only;
97
98}; 95};
99 96
100/** 97/**
@@ -116,9 +113,7 @@ struct GNUNET_ATS_SessionHandle;
116 * Each solver is required to set up and return an instance 113 * Each solver is required to set up and return an instance
117 * of this struct during initialization. 114 * of this struct during initialization.
118 */ 115 */
119struct GNUNET_ATS_SolverFunctions 116struct GNUNET_ATS_SolverFunctions {
120{
121
122 /** 117 /**
123 * Closure to pass to all solver functions in this struct. 118 * Closure to pass to all solver functions in this struct.
124 */ 119 */
@@ -133,20 +128,20 @@ struct GNUNET_ATS_SolverFunctions
133 */ 128 */
134 struct GNUNET_ATS_PreferenceHandle * 129 struct GNUNET_ATS_PreferenceHandle *
135 (*preference_add)(void *cls, 130 (*preference_add)(void *cls,
136 const struct GNUNET_ATS_Preference *pref); 131 const struct GNUNET_ATS_Preference *pref);
137 132
138 /** 133 /**
139 * The plugin should end respecting a preference. 134 * The plugin should end respecting a preference.
140 * 135 *
141 * @param cls the closure 136 * @param cls the closure
142 * @param ph whatever @e preference_add returned 137 * @param ph whatever @e preference_add returned
143 * @param pref the preference to delete 138 * @param pref the preference to delete
144 * @return plugin's internal representation, or NULL 139 * @return plugin's internal representation, or NULL
145 */ 140 */
146 void 141 void
147 (*preference_del)(void *cls, 142 (*preference_del)(void *cls,
148 struct GNUNET_ATS_PreferenceHandle *ph, 143 struct GNUNET_ATS_PreferenceHandle *ph,
149 const struct GNUNET_ATS_Preference *pref); 144 const struct GNUNET_ATS_Preference *pref);
150 145
151 /** 146 /**
152 * Transport established a new session with performance 147 * Transport established a new session with performance
@@ -159,8 +154,8 @@ struct GNUNET_ATS_SolverFunctions
159 */ 154 */
160 struct GNUNET_ATS_SessionHandle * 155 struct GNUNET_ATS_SessionHandle *
161 (*session_add)(void *cls, 156 (*session_add)(void *cls,
162 const struct GNUNET_ATS_SessionData *data, 157 const struct GNUNET_ATS_SessionData *data,
163 const char *address); 158 const char *address);
164 159
165 /** 160 /**
166 * @a data changed for a given @a sh, solver should consider 161 * @a data changed for a given @a sh, solver should consider
@@ -172,8 +167,8 @@ struct GNUNET_ATS_SolverFunctions
172 */ 167 */
173 void 168 void
174 (*session_update)(void *cls, 169 (*session_update)(void *cls,
175 struct GNUNET_ATS_SessionHandle *sh, 170 struct GNUNET_ATS_SessionHandle *sh,
176 const struct GNUNET_ATS_SessionData *data); 171 const struct GNUNET_ATS_SessionData *data);
177 172
178 /** 173 /**
179 * A session went away. Solver should update accordingly. 174 * A session went away. Solver should update accordingly.
@@ -184,9 +179,8 @@ struct GNUNET_ATS_SolverFunctions
184 */ 179 */
185 void 180 void
186 (*session_del)(void *cls, 181 (*session_del)(void *cls,
187 struct GNUNET_ATS_SessionHandle *sh, 182 struct GNUNET_ATS_SessionHandle *sh,
188 const struct GNUNET_ATS_SessionData *data); 183 const struct GNUNET_ATS_SessionData *data);
189
190}; 184};
191 185
192 186
@@ -195,8 +189,7 @@ struct GNUNET_ATS_SolverFunctions
195 * of this type as to the initialization function 189 * of this type as to the initialization function
196 * of the ATS plugins. 190 * of the ATS plugins.
197 */ 191 */
198struct GNUNET_ATS_PluginEnvironment 192struct GNUNET_ATS_PluginEnvironment {
199{
200 /** 193 /**
201 * Configuration handle to be used by the solver 194 * Configuration handle to be used by the solver
202 */ 195 */
@@ -222,11 +215,11 @@ struct GNUNET_ATS_PluginEnvironment
222 */ 215 */
223 void 216 void
224 (*suggest_cb) (void *cls, 217 (*suggest_cb) (void *cls,
225 const struct GNUNET_PeerIdentity *pid, 218 const struct GNUNET_PeerIdentity *pid,
226 const char *address); 219 const char *address);
227 220
228 /** 221 /**
229 * Tell the transport that it should allocate the given 222 * Tell the transport that it should allocate the given
230 * bandwidth to the specified session. 223 * bandwidth to the specified session.
231 * 224 *
232 * @param cls closure, NULL 225 * @param cls closure, NULL
@@ -237,15 +230,14 @@ struct GNUNET_ATS_PluginEnvironment
237 */ 230 */
238 void 231 void
239 (*allocate_cb) (void *cls, 232 (*allocate_cb) (void *cls,
240 struct GNUNET_ATS_Session *session, 233 struct GNUNET_ATS_Session *session,
241 const struct GNUNET_PeerIdentity *peer, 234 const struct GNUNET_PeerIdentity *peer,
242 struct GNUNET_BANDWIDTH_Value32NBO bw_in, 235 struct GNUNET_BANDWIDTH_Value32NBO bw_in,
243 struct GNUNET_BANDWIDTH_Value32NBO bw_out); 236 struct GNUNET_BANDWIDTH_Value32NBO bw_out);
244
245}; 237};
246 238
247 239
248 240
249#endif 241#endif
250 242
251/** @} */ /* end of group */ 243/** @} */ /* end of group */