diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-08 08:35:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-08 08:35:14 +0000 |
commit | 6db5516751484bc331e57c869f16f859a6f87ffd (patch) | |
tree | c0c0709ac284e5e637841308ac17747506ae577d /src/cadet/gnunet-service-cadet_peer.h | |
parent | f820a4b7918625b07d37e63f3ce8791840a9d4ec (diff) | |
download | gnunet-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.h | 46 |
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); | |||
215 | void | 215 | void |
216 | GCP_set_tunnel (struct CadetPeer *peer, struct CadetTunnel *t); | 216 | GCP_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); | |||
225 | int | 226 | int |
226 | GCP_is_neighbor (const struct CadetPeer *peer); | 227 | GCP_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); | |||
235 | void | 237 | void |
236 | GCP_add_tunnel (struct CadetPeer *peer); | 238 | GCP_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 | */ |
250 | int | 251 | void |
251 | GCP_add_connection (struct CadetPeer *peer, struct CadetConnection *c); | 252 | GCP_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 | */ |
265 | struct CadetPeerPath * | 268 | struct CadetPeerPath * |
266 | GCP_add_path (struct CadetPeer *peer, struct CadetPeerPath *p, int trusted); | 269 | GCP_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, | |||
293 | void | 299 | void |
294 | GCP_add_path_to_all (const struct CadetPeerPath *p, int confirmed); | 300 | GCP_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 | */ |
302 | void | 309 | void |
303 | GCP_remove_path (struct CadetPeer *peer, struct CadetPeerPath *path); | 310 | GCP_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 | */ |
313 | int | 320 | void |
314 | GCP_remove_connection (struct CadetPeer *peer, const struct CadetConnection *c); | 321 | GCP_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); | |||
322 | void | 331 | void |
323 | GCP_start_search (struct CadetPeer *peer); | 332 | GCP_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); | |||
331 | void | 341 | void |
332 | GCP_stop_search (struct CadetPeer *peer); | 342 | GCP_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); | |||
341 | const struct GNUNET_PeerIdentity * | 352 | const struct GNUNET_PeerIdentity * |
342 | GCP_get_id (const struct CadetPeer *peer); | 353 | GCP_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); | |||
351 | GNUNET_PEER_Id | 363 | GNUNET_PEER_Id |
352 | GCP_get_short_id (const struct CadetPeer *peer); | 364 | GCP_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); | |||
361 | struct CadetTunnel * | 374 | struct CadetTunnel * |
362 | GCP_get_tunnel (const struct CadetPeer *peer); | 375 | GCP_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 | */ |
370 | void | 384 | void |
371 | GCP_set_hello (struct CadetPeer *peer, const struct GNUNET_HELLO_Message *hello); | 385 | GCP_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); | |||
389 | void | 405 | void |
390 | GCP_try_connect (struct CadetPeer *peer); | 406 | GCP_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, | |||
412 | unsigned int | 430 | unsigned int |
413 | GCP_count_paths (const struct CadetPeer *peer); | 431 | GCP_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); | |||
421 | void | 440 | void |
422 | GCP_iterate_all (GNUNET_CONTAINER_PeerMapIterator iter, void *cls); | 441 | GCP_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); | |||
431 | const char * | 451 | const char * |
432 | GCP_2s (const struct CadetPeer *peer); | 452 | GCP_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 | */ |
439 | void | 460 | void |
440 | GCP_debug (const struct CadetPeer *p, enum GNUNET_ErrorType level); | 461 | GCP_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 */ |