aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2014-12-24 15:11:38 +0000
committerJulius Bünger <buenger@mytum.de>2014-12-24 15:11:38 +0000
commit23fa03199548424901516bfea8f9568ef492833a (patch)
treede1538d3cc27ac6eec1da899f5890ddf4ef8bf30 /src
parent8fc3f747a85b4367b863a57ae9ea96b5b58f2f65 (diff)
downloadgnunet-23fa03199548424901516bfea8f9568ef492833a.tar.gz
gnunet-23fa03199548424901516bfea8f9568ef492833a.zip
Added documenting comments
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_rps_service.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/include/gnunet_rps_service.h b/src/include/gnunet_rps_service.h
index 3a3b2cbad..2b0d136cb 100644
--- a/src/include/gnunet_rps_service.h
+++ b/src/include/gnunet_rps_service.h
@@ -39,13 +39,36 @@ extern "C"
39 */ 39 */
40#define GNUNET_RPS_VERSION 0x00000000 40#define GNUNET_RPS_VERSION 0x00000000
41 41
42/**
43 * Handle for the random peer sampling service
44 */
45struct GNUNET_RPS_Handle;
46
47/**
48 * Handle for one request to the rps service
49 */
50struct GNUNET_RPS_Request_Handle;
51
52/**
53 * Callback called when requested random peers are available.
54 *
55 * @param cls the closure given with the request
56 * @param num_peers the number of peers returned
57 * @param peers array with num_peers PeerIDs
58 */
42typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, uint64_t num_peers, struct GNUNET_PeerIdentity *peers); 59typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, uint64_t num_peers, struct GNUNET_PeerIdentity *peers);
43 60
44/** 61/**
45 * Request n random peers. 62 * Request n random peers.
46 * 63 *
47 * This is a wrapper function that makes it useless to have to 64 * This is a wrapper function that makes it unnecessary to have to
48 * (dis)connect from/to the service. 65 * (dis)connect from/to the service.
66 *
67 * @param cfg the configuration to use
68 * @param n number of peers to be returned
69 * @param ready_cb the callback to be called when the PeerIDs are available
70 * @param cls closure given to the callback
71 * @return handle to this request
49 */ 72 */
50 struct GNUNET_RPS_Request_Handle * 73 struct GNUNET_RPS_Request_Handle *
51GNUNET_RPS_request_peers_single_call (const struct GNUNET_CONFIGURATION_Handle *cfg, 74GNUNET_RPS_request_peers_single_call (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -55,6 +78,9 @@ GNUNET_RPS_request_peers_single_call (const struct GNUNET_CONFIGURATION_Handle *
55 78
56/** 79/**
57 * Connect to the rps service 80 * Connect to the rps service
81 *
82 * @param cfg configuration to use
83 * @return handle to the rps service
58 */ 84 */
59 struct GNUNET_RPS_Handle * 85 struct GNUNET_RPS_Handle *
60GNUNET_RPS_connect( const struct GNUNET_CONFIGURATION_Handle *cfg ); 86GNUNET_RPS_connect( const struct GNUNET_CONFIGURATION_Handle *cfg );
@@ -66,6 +92,12 @@ GNUNET_RPS_connect( const struct GNUNET_CONFIGURATION_Handle *cfg );
66 * but needs a GNUNET_RPS_Handle. 92 * but needs a GNUNET_RPS_Handle.
67 * This exists only for other parts of GNUnet that expect having to 93 * This exists only for other parts of GNUnet that expect having to
68 * (dis)connect from/to a service. 94 * (dis)connect from/to a service.
95 *
96 * @param h handle to the rps service
97 * @param n number of random peers to return
98 * @param ready_cb the callback to be called when the peers are available
99 * @param cls a closure that will be given to the callback
100 * @return handle to this request
69 */ 101 */
70 struct GNUNET_RPS_Request_Handle * 102 struct GNUNET_RPS_Request_Handle *
71GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint64_t n, 103GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint64_t n,
@@ -74,12 +106,16 @@ GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint64_t n,
74 106
75/** 107/**
76 * Cancle an issued request. 108 * Cancle an issued request.
109 *
110 * @param rh handle of the pending request to be canceled
77 */ 111 */
78 void 112 void
79GNUNET_RPS_request_cancel ( struct GNUNET_RPS_Request_Handle *rh ); 113GNUNET_RPS_request_cancel ( struct GNUNET_RPS_Request_Handle *rh );
80 114
81/** 115/**
82 * Disconnect from the rps service 116 * Disconnect from the rps service
117 *
118 * @param h the handle to the rps service
83 */ 119 */
84 void 120 void
85GNUNET_RPS_disconnect ( struct GNUNET_RPS_Handle *h ); 121GNUNET_RPS_disconnect ( struct GNUNET_RPS_Handle *h );