aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-28 15:20:50 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-28 15:20:50 +0000
commit68fe3f5587d2e0f134357f06b72583151b36bbdd (patch)
tree9163542a0109688293c13fdd0887c9c280bced0c
parent31d6c6f6241432cebdd3d6c529f7bd2d4a6fb489 (diff)
downloadgnunet-68fe3f5587d2e0f134357f06b72583151b36bbdd.tar.gz
gnunet-68fe3f5587d2e0f134357f06b72583151b36bbdd.zip
-document desired direction of transport API change
-rw-r--r--src/include/gnunet_transport_service.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 2f027656b..1de59d796 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -104,6 +104,7 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls,
104 * @param cls closure 104 * @param cls closure
105 * @param address NULL on error, otherwise 0-terminated printable UTF-8 string 105 * @param address NULL on error, otherwise 0-terminated printable UTF-8 string
106 */ 106 */
107// RENAME: AddressToStringCallback
107typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, 108typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls,
108 const char *address); 109 const char *address);
109 110
@@ -117,6 +118,9 @@ typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls,
117 * @param addr address 118 * @param addr address
118 * @param addrlen address length 119 * @param addrlen address length
119 */ 120 */
121// FIXME: use GNUNET_HELLO_Address (as 2nd arg, replacing others)
122// FIXME: rename: remove "Binary"
123// FIXME: use NULL for address on disconnect IF in monitor mode (one_shot = NO)
120typedef void (*GNUNET_TRANSPORT_AddressLookUpBinaryCallback) (void *cls, 124typedef void (*GNUNET_TRANSPORT_AddressLookUpBinaryCallback) (void *cls,
121 const struct 125 const struct
122 GNUNET_PeerIdentity 126 GNUNET_PeerIdentity
@@ -294,6 +298,7 @@ struct GNUNET_TRANSPORT_AddressLookupContext;
294 * @return handle to cancel the operation, NULL on error 298 * @return handle to cancel the operation, NULL on error
295 */ 299 */
296// FIXME: use 'GNUNET_HELLO_Address' here! 300// FIXME: use 'GNUNET_HELLO_Address' here!
301// => rename: address_to_string
297struct GNUNET_TRANSPORT_AddressLookupContext * 302struct GNUNET_TRANSPORT_AddressLookupContext *
298GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, 303GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
299 const char *address, size_t addressLen, 304 const char *address, size_t addressLen,
@@ -323,18 +328,29 @@ struct GNUNET_TRANSPORT_AddressLookupContext;
323/** 328/**
324 * Return all the known addresses for a peer. FIXME: document better! 329 * Return all the known addresses for a peer. FIXME: document better!
325 * FIXME: use better name! 330 * FIXME: use better name!
331 * CHANGE: Returns the address(es) that we are currently using for this
332 * peer. Upon completion, the 'AddressLookUpCallback' is called one more
333 * time with 'NULL' for the address and the peer. After this, the operation must no
334 * longer be explicitly cancelled.
335 * TODO: change code that uses this API to see if this is fine...
326 * 336 *
327 * @param cfg configuration to use 337 * @param cfg configuration to use
328 * @param peer peer identity to look up the addresses of 338 * @param peer peer identity to look up the addresses of, CHANGE: allow NULL for all (connected) peers
339 * FIXME: @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL),
340 * GNUNET_NO to monitor the set of addresses used (continuously, must be explicitly cancelled)
329 * @param timeout how long is the lookup allowed to take at most 341 * @param timeout how long is the lookup allowed to take at most
330 * @param peer_address_callback function to call with the results 342 * @param peer_address_callback function to call with the results
331 * @param peer_address_callback_cls closure for peer_address_callback 343 * @param peer_address_callback_cls closure for peer_address_callback
332 */ 344 */
345// RENAME: peer_get_active_addresses
333struct GNUNET_TRANSPORT_PeerAddressLookupContext * 346struct GNUNET_TRANSPORT_PeerAddressLookupContext *
334GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle 347GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle
335 *cfg, 348 *cfg,
336 const struct GNUNET_PeerIdentity *peer, 349 const struct GNUNET_PeerIdentity *peer,
350 // FIXME: add argument: one_shot
337 struct GNUNET_TIME_Relative timeout, 351 struct GNUNET_TIME_Relative timeout,
352 // FIXME: change to the 'Binary' lookup callback (which will
353 // be renamed, so the argument type actually won't change)
338 GNUNET_TRANSPORT_AddressLookUpCallback 354 GNUNET_TRANSPORT_AddressLookUpCallback
339 peer_address_callback, 355 peer_address_callback,
340 void *peer_address_callback_cls); 356 void *peer_address_callback_cls);
@@ -353,7 +369,9 @@ GNUNET_TRANSPORT_peer_address_lookup_cancel (struct
353 369
354/** 370/**
355 * Return all the known addresses. FIXME: document better! 371 * Return all the known addresses. FIXME: document better!
356 * FIXME: use better name! FIXME: extend API to allow cancellation! 372 *
373 * FIXME: remove, replace with new 'peer_address_lookup' API
374 *
357 * 375 *
358 * @param cfg configuration to use 376 * @param cfg configuration to use
359 * @param timeout how long is the lookup allowed to take at most 377 * @param timeout how long is the lookup allowed to take at most