aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_peer.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-08 08:35:14 +0000
committerChristian Grothoff <christian@grothoff.org>2015-06-08 08:35:14 +0000
commit6db5516751484bc331e57c869f16f859a6f87ffd (patch)
treec0c0709ac284e5e637841308ac17747506ae577d /src/cadet/gnunet-service-cadet_peer.h
parentf820a4b7918625b07d37e63f3ce8791840a9d4ec (diff)
downloadgnunet-6db5516751484bc331e57c869f16f859a6f87ffd.tar.gz
gnunet-6db5516751484bc331e57c869f16f859a6f87ffd.zip
-indentation, doxygen, be a bit pickier about return values to eliminate possible causes of #3794
Diffstat (limited to 'src/cadet/gnunet-service-cadet_peer.h')
-rw-r--r--src/cadet/gnunet-service-cadet_peer.h46
1 files changed, 34 insertions, 12 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h
index a0211328b..af937007a 100644
--- a/src/cadet/gnunet-service-cadet_peer.h
+++ b/src/cadet/gnunet-service-cadet_peer.h
@@ -215,6 +215,7 @@ GCP_queue_unlock (struct CadetPeer *peer, struct CadetConnection *c);
215void 215void
216GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t); 216GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t);
217 217
218
218/** 219/**
219 * Check whether there is a direct (core level) connection to peer. 220 * Check whether there is a direct (core level) connection to peer.
220 * 221 *
@@ -225,6 +226,7 @@ GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t);
225int 226int
226GCP_is_neighbor (const struct CadetPeer *peer); 227GCP_is_neighbor (const struct CadetPeer *peer);
227 228
229
228/** 230/**
229 * Create and initialize a new tunnel towards a peer, in case it has none. 231 * Create and initialize a new tunnel towards a peer, in case it has none.
230 * 232 *
@@ -235,6 +237,7 @@ GCP_is_neighbor (const struct CadetPeer *peer);
235void 237void
236GCP_add_tunnel (struct CadetPeer *peer); 238GCP_add_tunnel (struct CadetPeer *peer);
237 239
240
238/** 241/**
239 * Add a connection to a neighboring peer. 242 * Add a connection to a neighboring peer.
240 * 243 *
@@ -244,11 +247,11 @@ GCP_add_tunnel (struct CadetPeer *peer);
244 * 247 *
245 * @param peer Peer to add connection to. 248 * @param peer Peer to add connection to.
246 * @param c Connection to add. 249 * @param c Connection to add.
247 *
248 * @return GNUNET_OK on success.
249 */ 250 */
250int 251void
251GCP_add_connection (struct CadetPeer *peer, struct CadetConnection *c); 252GCP_add_connection (struct CadetPeer *peer,
253 struct CadetConnection *c);
254
252 255
253/** 256/**
254 * Add the path to the peer and update the path used to reach it in case this 257 * Add the path to the peer and update the path used to reach it in case this
@@ -263,7 +266,10 @@ GCP_add_connection (struct CadetPeer *peer, struct CadetConnection *c);
263 * NULL on error. 266 * NULL on error.
264 */ 267 */
265struct CadetPeerPath * 268struct CadetPeerPath *
266GCP_add_path (struct CadetPeer *peer, struct CadetPeerPath *p, int trusted); 269GCP_add_path (struct CadetPeer *peer,
270 struct CadetPeerPath *p,
271 int trusted);
272
267 273
268/** 274/**
269 * Add the path to the origin peer and update the path used to reach it in case 275 * Add the path to the origin peer and update the path used to reach it in case
@@ -293,6 +299,7 @@ GCP_add_path_to_origin (struct CadetPeer *peer,
293void 299void
294GCP_add_path_to_all (const struct CadetPeerPath *p, int confirmed); 300GCP_add_path_to_all (const struct CadetPeerPath *p, int confirmed);
295 301
302
296/** 303/**
297 * Remove any path to the peer that has the extact same peers as the one given. 304 * Remove any path to the peer that has the extact same peers as the one given.
298 * 305 *
@@ -300,18 +307,20 @@ GCP_add_path_to_all (const struct CadetPeerPath *p, int confirmed);
300 * @param path Path to remove. Is always destroyed . 307 * @param path Path to remove. Is always destroyed .
301 */ 308 */
302void 309void
303GCP_remove_path (struct CadetPeer *peer, struct CadetPeerPath *path); 310GCP_remove_path (struct CadetPeer *peer,
311 struct CadetPeerPath *path);
312
304 313
305/** 314/**
306 * Remove a connection from a neighboring peer. 315 * Remove a connection from a neighboring peer.
307 * 316 *
308 * @param peer Peer to remove connection from. 317 * @param peer Peer to remove connection from.
309 * @param c Connection to remove. 318 * @param c Connection to remove.
310 *
311 * @return GNUNET_OK on success.
312 */ 319 */
313int 320void
314GCP_remove_connection (struct CadetPeer *peer, const struct CadetConnection *c); 321GCP_remove_connection (struct CadetPeer *peer,
322 const struct CadetConnection *c);
323
315 324
316/** 325/**
317 * Start the DHT search for new paths towards the peer: we don't have 326 * Start the DHT search for new paths towards the peer: we don't have
@@ -322,6 +331,7 @@ GCP_remove_connection (struct CadetPeer *peer, const struct CadetConnection *c);
322void 331void
323GCP_start_search (struct CadetPeer *peer); 332GCP_start_search (struct CadetPeer *peer);
324 333
334
325/** 335/**
326 * Stop the DHT search for new paths towards the peer: we already have 336 * Stop the DHT search for new paths towards the peer: we already have
327 * enough good connections. 337 * enough good connections.
@@ -331,6 +341,7 @@ GCP_start_search (struct CadetPeer *peer);
331void 341void
332GCP_stop_search (struct CadetPeer *peer); 342GCP_stop_search (struct CadetPeer *peer);
333 343
344
334/** 345/**
335 * Get the Full ID of a peer. 346 * Get the Full ID of a peer.
336 * 347 *
@@ -341,6 +352,7 @@ GCP_stop_search (struct CadetPeer *peer);
341const struct GNUNET_PeerIdentity * 352const struct GNUNET_PeerIdentity *
342GCP_get_id (const struct CadetPeer *peer); 353GCP_get_id (const struct CadetPeer *peer);
343 354
355
344/** 356/**
345 * Get the Short ID of a peer. 357 * Get the Short ID of a peer.
346 * 358 *
@@ -351,6 +363,7 @@ GCP_get_id (const struct CadetPeer *peer);
351GNUNET_PEER_Id 363GNUNET_PEER_Id
352GCP_get_short_id (const struct CadetPeer *peer); 364GCP_get_short_id (const struct CadetPeer *peer);
353 365
366
354/** 367/**
355 * Get the tunnel towards a peer. 368 * Get the tunnel towards a peer.
356 * 369 *
@@ -361,6 +374,7 @@ GCP_get_short_id (const struct CadetPeer *peer);
361struct CadetTunnel * 374struct CadetTunnel *
362GCP_get_tunnel (const struct CadetPeer *peer); 375GCP_get_tunnel (const struct CadetPeer *peer);
363 376
377
364/** 378/**
365 * Set the hello message. 379 * Set the hello message.
366 * 380 *
@@ -368,7 +382,9 @@ GCP_get_tunnel (const struct CadetPeer *peer);
368 * @param hello Hello message. 382 * @param hello Hello message.
369 */ 383 */
370void 384void
371GCP_set_hello (struct CadetPeer *peer, const struct GNUNET_HELLO_Message *hello); 385GCP_set_hello (struct CadetPeer *peer,
386 const struct GNUNET_HELLO_Message *hello);
387
372 388
373/** 389/**
374 * Get the hello message. 390 * Get the hello message.
@@ -389,6 +405,7 @@ GCP_get_hello (struct CadetPeer *peer);
389void 405void
390GCP_try_connect (struct CadetPeer *peer); 406GCP_try_connect (struct CadetPeer *peer);
391 407
408
392/** 409/**
393 * Notify a peer that a link between two other peers is broken. If any path 410 * Notify a peer that a link between two other peers is broken. If any path
394 * used that link, eliminate it. 411 * used that link, eliminate it.
@@ -402,6 +419,7 @@ GCP_notify_broken_link (struct CadetPeer *peer,
402 struct GNUNET_PeerIdentity *peer1, 419 struct GNUNET_PeerIdentity *peer1,
403 struct GNUNET_PeerIdentity *peer2); 420 struct GNUNET_PeerIdentity *peer2);
404 421
422
405/** 423/**
406 * Count the number of known paths toward the peer. 424 * Count the number of known paths toward the peer.
407 * 425 *
@@ -412,6 +430,7 @@ GCP_notify_broken_link (struct CadetPeer *peer,
412unsigned int 430unsigned int
413GCP_count_paths (const struct CadetPeer *peer); 431GCP_count_paths (const struct CadetPeer *peer);
414 432
433
415/** 434/**
416 * Iterate all known peers. 435 * Iterate all known peers.
417 * 436 *
@@ -421,6 +440,7 @@ GCP_count_paths (const struct CadetPeer *peer);
421void 440void
422GCP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls); 441GCP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls);
423 442
443
424/** 444/**
425 * Get the static string for a peer ID. 445 * Get the static string for a peer ID.
426 * 446 *
@@ -431,13 +451,15 @@ GCP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls);
431const char * 451const char *
432GCP_2s (const struct CadetPeer *peer); 452GCP_2s (const struct CadetPeer *peer);
433 453
454
434/** 455/**
435 * Log all kinds of info about a peer. 456 * Log all kinds of info about a peer.
436 * 457 *
437 * @param peer Peer. 458 * @param peer Peer.
438 */ 459 */
439void 460void
440GCP_debug (const struct CadetPeer *p, enum GNUNET_ErrorType level); 461GCP_debug (const struct CadetPeer *p,
462 enum GNUNET_ErrorType level);
441 463
442 464
443#if 0 /* keep Emacsens' auto-indent happy */ 465#if 0 /* keep Emacsens' auto-indent happy */