summaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_cp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.h')
-rw-r--r--src/fs/gnunet-service-fs_cp.h85
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 */
63struct GSF_PeerPerformanceData 63struct 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 */
207void * 204void *
208GSF_peer_connect_handler (void *cls, 205GSF_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 */
219struct GSF_ConnectedPeer * 216struct GSF_ConnectedPeer *
220GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); 217GSF_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 */
229void 226void
230GSF_update_peer_latency_ (const struct GNUNET_PeerIdentity *id, 227GSF_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 */
244void 241void
245GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, 242GSF_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 */
258void 255void
259GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, 256GSF_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 */
271void 268void
272GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, 269GSF_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 */
283void 280void
284GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, 281GSF_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 */
295void 292void
296handle_p2p_migration_stop (void *cls, 293handle_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 */
306void 303void
307handle_p2p_get (void *cls, 304handle_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 */
317struct GSF_PeerPerformanceData * 314struct GSF_PeerPerformanceData *
318GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); 315GSF_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 */
328void 325void
329GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, 326GSF_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 */
341void 338void
342GSF_peer_disconnect_handler (void *cls, 339GSF_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 */
353void 350void
354GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); 351GSF_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 */
366void 363void
367GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, 364GSF_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 */
377void 374void
378GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, 375GSF_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 */
388const struct GNUNET_PeerIdentity * 385const struct GNUNET_PeerIdentity *
389GSF_connected_peer_get_identity2_ (const struct GSF_ConnectedPeer *cp); 386GSF_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 */
399void 396void
400GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); 397GSF_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 */
406void 403void
407GSF_connected_peer_init_ (void); 404GSF_connected_peer_init_(void);
408 405
409 406
410/** 407/**
411 * Shutdown peer management subsystem. 408 * Shutdown peer management subsystem.
412 */ 409 */
413void 410void
414GSF_connected_peer_done_ (void); 411GSF_connected_peer_done_(void);
415 412
416 413
417#endif 414#endif