diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.h')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.h | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 486b696ba..9eab3d9de 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h | |||
@@ -11,12 +11,12 @@ | |||
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 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file fs/gnunet-service-fs_cp.h | 22 | * @file fs/gnunet-service-fs_cp.h |
@@ -60,9 +60,7 @@ | |||
60 | /** | 60 | /** |
61 | * Performance data kept for a peer. | 61 | * Performance data kept for a peer. |
62 | */ | 62 | */ |
63 | struct GSF_PeerPerformanceData | 63 | struct GSF_PeerPerformanceData { |
64 | { | ||
65 | |||
66 | /** | 64 | /** |
67 | * List of the last clients for which this peer successfully | 65 | * List of the last clients for which this peer successfully |
68 | * answered a query. | 66 | * answered a query. |
@@ -128,7 +126,7 @@ struct GSF_PeerPerformanceData | |||
128 | * The peer's identity (pointer). | 126 | * The peer's identity (pointer). |
129 | */ | 127 | */ |
130 | const struct GNUNET_PeerIdentity *peer; | 128 | const struct GNUNET_PeerIdentity *peer; |
131 | 129 | ||
132 | /** | 130 | /** |
133 | * Respect rating for this peer | 131 | * Respect rating for this peer |
134 | */ | 132 | */ |
@@ -143,7 +141,6 @@ struct GSF_PeerPerformanceData | |||
143 | * Number of pending replies (queries are not counted) | 141 | * Number of pending replies (queries are not counted) |
144 | */ | 142 | */ |
145 | unsigned int pending_replies; | 143 | unsigned int pending_replies; |
146 | |||
147 | }; | 144 | }; |
148 | 145 | ||
149 | 146 | ||
@@ -205,9 +202,9 @@ struct GSF_PeerTransmitHandle; | |||
205 | * @return internal handle for the peer | 202 | * @return internal handle for the peer |
206 | */ | 203 | */ |
207 | void * | 204 | void * |
208 | GSF_peer_connect_handler (void *cls, | 205 | GSF_peer_connect_handler(void *cls, |
209 | const struct GNUNET_PeerIdentity *peer, | 206 | const struct GNUNET_PeerIdentity *peer, |
210 | struct GNUNET_MQ_Handle *mq); | 207 | struct GNUNET_MQ_Handle *mq); |
211 | 208 | ||
212 | 209 | ||
213 | /** | 210 | /** |
@@ -217,7 +214,7 @@ GSF_peer_connect_handler (void *cls, | |||
217 | * @return NULL if this peer is not currently connected | 214 | * @return NULL if this peer is not currently connected |
218 | */ | 215 | */ |
219 | struct GSF_ConnectedPeer * | 216 | struct GSF_ConnectedPeer * |
220 | GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); | 217 | GSF_peer_get_(const struct GNUNET_PeerIdentity *peer); |
221 | 218 | ||
222 | 219 | ||
223 | /** | 220 | /** |
@@ -227,8 +224,8 @@ GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); | |||
227 | * @param latency current latency value | 224 | * @param latency current latency value |
228 | */ | 225 | */ |
229 | void | 226 | void |
230 | GSF_update_peer_latency_ (const struct GNUNET_PeerIdentity *id, | 227 | GSF_update_peer_latency_(const struct GNUNET_PeerIdentity *id, |
231 | struct GNUNET_TIME_Relative latency); | 228 | struct GNUNET_TIME_Relative latency); |
232 | 229 | ||
233 | 230 | ||
234 | /** | 231 | /** |
@@ -242,10 +239,10 @@ GSF_update_peer_latency_ (const struct GNUNET_PeerIdentity *id, | |||
242 | * @param env envelope of message to send | 239 | * @param env envelope of message to send |
243 | */ | 240 | */ |
244 | void | 241 | void |
245 | GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | 242 | GSF_peer_transmit_(struct GSF_ConnectedPeer *cp, |
246 | int is_query, | 243 | int is_query, |
247 | uint32_t priority, | 244 | uint32_t priority, |
248 | struct GNUNET_MQ_Envelope *env); | 245 | struct GNUNET_MQ_Envelope *env); |
249 | 246 | ||
250 | 247 | ||
251 | /** | 248 | /** |
@@ -256,9 +253,9 @@ GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | |||
256 | * @param request_priority priority of the original request | 253 | * @param request_priority priority of the original request |
257 | */ | 254 | */ |
258 | void | 255 | void |
259 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | 256 | GSF_peer_update_performance_(struct GSF_ConnectedPeer *cp, |
260 | struct GNUNET_TIME_Absolute request_time, | 257 | struct GNUNET_TIME_Absolute request_time, |
261 | uint32_t request_priority); | 258 | uint32_t request_priority); |
262 | 259 | ||
263 | 260 | ||
264 | /** | 261 | /** |
@@ -269,8 +266,8 @@ GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | |||
269 | * @param initiator_client local client on responsible for query | 266 | * @param initiator_client local client on responsible for query |
270 | */ | 267 | */ |
271 | void | 268 | void |
272 | GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | 269 | GSF_peer_update_responder_client_(struct GSF_ConnectedPeer *cp, |
273 | struct GSF_LocalClient *initiator_client); | 270 | struct GSF_LocalClient *initiator_client); |
274 | 271 | ||
275 | 272 | ||
276 | /** | 273 | /** |
@@ -281,9 +278,9 @@ GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | |||
281 | * @param initiator_peer other peer responsible for query | 278 | * @param initiator_peer other peer responsible for query |
282 | */ | 279 | */ |
283 | void | 280 | void |
284 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | 281 | GSF_peer_update_responder_peer_(struct GSF_ConnectedPeer *cp, |
285 | const struct GSF_ConnectedPeer | 282 | const struct GSF_ConnectedPeer |
286 | *initiator_peer); | 283 | *initiator_peer); |
287 | 284 | ||
288 | 285 | ||
289 | /** | 286 | /** |
@@ -293,8 +290,8 @@ GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | |||
293 | * @param msm the actual message | 290 | * @param msm the actual message |
294 | */ | 291 | */ |
295 | void | 292 | void |
296 | handle_p2p_migration_stop (void *cls, | 293 | handle_p2p_migration_stop(void *cls, |
297 | const struct MigrationStopMessage *message); | 294 | const struct MigrationStopMessage *message); |
298 | 295 | ||
299 | 296 | ||
300 | /** | 297 | /** |
@@ -304,8 +301,8 @@ handle_p2p_migration_stop (void *cls, | |||
304 | * @param gm the actual message | 301 | * @param gm the actual message |
305 | */ | 302 | */ |
306 | void | 303 | void |
307 | handle_p2p_get (void *cls, | 304 | handle_p2p_get(void *cls, |
308 | const struct GetMessage *gm); | 305 | const struct GetMessage *gm); |
309 | 306 | ||
310 | 307 | ||
311 | /** | 308 | /** |
@@ -315,7 +312,7 @@ handle_p2p_get (void *cls, | |||
315 | * @return performance data record for the peer | 312 | * @return performance data record for the peer |
316 | */ | 313 | */ |
317 | struct GSF_PeerPerformanceData * | 314 | struct GSF_PeerPerformanceData * |
318 | GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); | 315 | GSF_get_peer_performance_data_(struct GSF_ConnectedPeer *cp); |
319 | 316 | ||
320 | 317 | ||
321 | /** | 318 | /** |
@@ -326,8 +323,8 @@ GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); | |||
326 | * @param block_time until when to block | 323 | * @param block_time until when to block |
327 | */ | 324 | */ |
328 | void | 325 | void |
329 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | 326 | GSF_block_peer_migration_(struct GSF_ConnectedPeer *cp, |
330 | struct GNUNET_TIME_Absolute block_time); | 327 | struct GNUNET_TIME_Absolute block_time); |
331 | 328 | ||
332 | 329 | ||
333 | /** | 330 | /** |
@@ -339,9 +336,9 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
339 | * @param internal_cls our `struct GSF_ConnectedPeer` for @a peer | 336 | * @param internal_cls our `struct GSF_ConnectedPeer` for @a peer |
340 | */ | 337 | */ |
341 | void | 338 | void |
342 | GSF_peer_disconnect_handler (void *cls, | 339 | GSF_peer_disconnect_handler(void *cls, |
343 | const struct GNUNET_PeerIdentity *peer, | 340 | const struct GNUNET_PeerIdentity *peer, |
344 | void *internal_cls); | 341 | void *internal_cls); |
345 | 342 | ||
346 | 343 | ||
347 | /** | 344 | /** |
@@ -351,7 +348,7 @@ GSF_peer_disconnect_handler (void *cls, | |||
351 | * @param lc handle to the local client (henceforth invalid) | 348 | * @param lc handle to the local client (henceforth invalid) |
352 | */ | 349 | */ |
353 | void | 350 | void |
354 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | 351 | GSF_handle_local_client_disconnect_(const struct GSF_LocalClient *lc); |
355 | 352 | ||
356 | 353 | ||
357 | /** | 354 | /** |
@@ -364,8 +361,8 @@ GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | |||
364 | * @param pref preference change | 361 | * @param pref preference change |
365 | */ | 362 | */ |
366 | void | 363 | void |
367 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | 364 | GSF_connected_peer_change_preference_(struct GSF_ConnectedPeer *cp, |
368 | uint64_t pref); | 365 | uint64_t pref); |
369 | 366 | ||
370 | 367 | ||
371 | /** | 368 | /** |
@@ -375,8 +372,8 @@ GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | |||
375 | * @param id identity to set (written to) | 372 | * @param id identity to set (written to) |
376 | */ | 373 | */ |
377 | void | 374 | void |
378 | GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | 375 | GSF_connected_peer_get_identity_(const struct GSF_ConnectedPeer *cp, |
379 | struct GNUNET_PeerIdentity *id); | 376 | struct GNUNET_PeerIdentity *id); |
380 | 377 | ||
381 | 378 | ||
382 | /** | 379 | /** |
@@ -386,7 +383,7 @@ GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | |||
386 | * @return reference to peer identity, valid until peer disconnects (!) | 383 | * @return reference to peer identity, valid until peer disconnects (!) |
387 | */ | 384 | */ |
388 | const struct GNUNET_PeerIdentity * | 385 | const struct GNUNET_PeerIdentity * |
389 | GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp); | 386 | GSF_connected_peer_get_identity2_(const struct GSF_ConnectedPeer *cp); |
390 | 387 | ||
391 | 388 | ||
392 | 389 | ||
@@ -397,21 +394,21 @@ GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp); | |||
397 | * @param it_cls closure for it | 394 | * @param it_cls closure for it |
398 | */ | 395 | */ |
399 | void | 396 | void |
400 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); | 397 | GSF_iterate_connected_peers_(GSF_ConnectedPeerIterator it, void *it_cls); |
401 | 398 | ||
402 | 399 | ||
403 | /** | 400 | /** |
404 | * Initialize peer management subsystem. | 401 | * Initialize peer management subsystem. |
405 | */ | 402 | */ |
406 | void | 403 | void |
407 | GSF_connected_peer_init_ (void); | 404 | GSF_connected_peer_init_(void); |
408 | 405 | ||
409 | 406 | ||
410 | /** | 407 | /** |
411 | * Shutdown peer management subsystem. | 408 | * Shutdown peer management subsystem. |
412 | */ | 409 | */ |
413 | void | 410 | void |
414 | GSF_connected_peer_done_ (void); | 411 | GSF_connected_peer_done_(void); |
415 | 412 | ||
416 | 413 | ||
417 | #endif | 414 | #endif |