diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-10 11:50:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-10 11:50:42 +0000 |
commit | 648a6cd5055798507a011b1e9c0d612371ce7a8d (patch) | |
tree | e851a861d26fd9aa02e24ef0ddf9d076258e2cac /src/include | |
parent | 2ac8943f5d703fcf886b16fbf2eb6be3fedb746f (diff) | |
download | gnunet-648a6cd5055798507a011b1e9c0d612371ce7a8d.tar.gz gnunet-648a6cd5055798507a011b1e9c0d612371ce7a8d.zip |
doku
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_core_service.h | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 24083f1a1..a7c5ba45c 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -211,40 +211,6 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | |||
211 | 211 | ||
212 | 212 | ||
213 | /** | 213 | /** |
214 | * Iterate over all connected peers. Calls peer_cb with each | ||
215 | * connected peer, and then once with NULL to indicate that all peers | ||
216 | * have been handled. | ||
217 | * | ||
218 | * @param cfg configuration handle | ||
219 | * @param peer_cb function to call with the peer information | ||
220 | * @param cb_cls closure for peer_cb | ||
221 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | ||
222 | */ | ||
223 | int | ||
224 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
225 | GNUNET_CORE_ConnectEventHandler peer_cb, | ||
226 | void *cb_cls); | ||
227 | |||
228 | |||
229 | /** | ||
230 | * Check if the given peer is currently connected and return information | ||
231 | * about the session if so. | ||
232 | * | ||
233 | * @param cfg configuration to use | ||
234 | * @param peer the specific peer to check for | ||
235 | * @param peer_cb function to call with the peer information | ||
236 | * @param cb_cls closure for peer_cb | ||
237 | * | ||
238 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | ||
239 | */ | ||
240 | int | ||
241 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
242 | struct GNUNET_PeerIdentity *peer, | ||
243 | GNUNET_CORE_ConnectEventHandler peer_cb, | ||
244 | void *cb_cls); | ||
245 | |||
246 | |||
247 | /** | ||
248 | * Handle for a transmission request. | 214 | * Handle for a transmission request. |
249 | */ | 215 | */ |
250 | struct GNUNET_CORE_TransmitHandle; | 216 | struct GNUNET_CORE_TransmitHandle; |
@@ -298,6 +264,56 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | |||
298 | *th); | 264 | *th); |
299 | 265 | ||
300 | 266 | ||
267 | |||
268 | |||
269 | |||
270 | /** | ||
271 | * Iterate over all connected peers. Calls peer_cb with each | ||
272 | * connected peer, and then once with NULL to indicate that all peers | ||
273 | * have been handled. Normal users of the CORE API are not expected | ||
274 | * to use this function. It is different in that it truly lists | ||
275 | * all connections, not just those relevant to the application. This | ||
276 | * function is used by special applications for diagnostics. This | ||
277 | * function is NOT part of the 'versioned', 'official' API. | ||
278 | * | ||
279 | * FIXME: we should probably make it possible to 'cancel' the | ||
280 | * operation... | ||
281 | * | ||
282 | * @param cfg configuration handle | ||
283 | * @param peer_cb function to call with the peer information | ||
284 | * @param cb_cls closure for peer_cb | ||
285 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | ||
286 | */ | ||
287 | int | ||
288 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
289 | GNUNET_CORE_ConnectEventHandler peer_cb, | ||
290 | void *cb_cls); | ||
291 | |||
292 | |||
293 | /** | ||
294 | * Check if the given peer is currently connected and return information | ||
295 | * about the session if so. This function is for special cirumstances | ||
296 | * (GNUNET_TESTING uses it), normal users of the CORE API are | ||
297 | * expected to track which peers are connected based on the | ||
298 | * connect/disconnect callbacks from GNUNET_CORE_connect. This | ||
299 | * function is NOT part of the 'versioned', 'official' API. | ||
300 | * | ||
301 | * FIXME: we should probably make it possible to 'cancel' the | ||
302 | * operation... | ||
303 | * | ||
304 | * @param cfg configuration to use | ||
305 | * @param peer the specific peer to check for | ||
306 | * @param peer_cb function to call with the peer information | ||
307 | * @param cb_cls closure for peer_cb | ||
308 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | ||
309 | */ | ||
310 | int | ||
311 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
312 | struct GNUNET_PeerIdentity *peer, | ||
313 | GNUNET_CORE_ConnectEventHandler peer_cb, | ||
314 | void *cb_cls); | ||
315 | |||
316 | |||
301 | #if 0 /* keep Emacsens' auto-indent happy */ | 317 | #if 0 /* keep Emacsens' auto-indent happy */ |
302 | { | 318 | { |
303 | #endif | 319 | #endif |