aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-29 20:03:12 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-29 20:03:12 +0000
commit75bbeaffe2a1467b6f9f4d80bc4d87ed0d9f14a8 (patch)
tree63885d0e8e55d47ecae25cef37181597115c8980 /src/include
parent56c32ea37a52b239494a7f91933e60eb7caf30f3 (diff)
downloadgnunet-75bbeaffe2a1467b6f9f4d80bc4d87ed0d9f14a8.tar.gz
gnunet-75bbeaffe2a1467b6f9f4d80bc4d87ed0d9f14a8.zip
-cleaning up message format and code related to recent transport address stringification code
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_protocols.h7
-rw-r--r--src/include/gnunet_transport_service.h32
2 files changed, 12 insertions, 27 deletions
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index f386d8768..e959a5cf9 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -1083,12 +1083,7 @@ extern "C"
1083#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT 378 1083#define GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_DISCONNECT 378
1084 1084
1085/** 1085/**
1086 * Request to look up addresses of peers. 1086 * Request to monitor addresses used by a peer or all peers.
1087 */
1088#define GNUNET_MESSAGE_TYPE_TRANSPORT_PEER_ADDRESS_LOOKUP 379
1089
1090/**
1091 * Request to iterate over all known addresses.
1092 */ 1087 */
1093#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE 380 1088#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_ITERATE 380
1094 1089
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 830a061f4..24fa124f0 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -99,10 +99,14 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls,
99 99
100 100
101/** 101/**
102 * Function to call with a binary format of an address 102 * Function to call with a textual representation of an address.
103 * This function will be called several times with different possible
104 * textual representations, and a last time with NULL to signal the end
105 * of the iteration.
103 * 106 *
104 * @param cls closure 107 * @param cls closure
105 * @param address NULL on error, otherwise 0-terminated printable UTF-8 string 108 * @param address NULL on error or end of iteration,
109 * otherwise 0-terminated printable UTF-8 string
106 */ 110 */
107typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, 111typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls,
108 const char *address); 112 const char *address);
@@ -112,11 +116,12 @@ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls,
112 * Function to call with a binary format of an address 116 * Function to call with a binary format of an address
113 * 117 *
114 * @param cls closure 118 * @param cls closure
115 * @param address address 119 * @param peer peer this update is about (never NULL)
120 * @param address address, NULL for disconnect notification in monitor mode
116 */ 121 */
117// FIXME: use NULL for address on disconnect IF in monitor mode (one_shot = NO)
118typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls, 122typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (void *cls,
119 const struct GNUNET_HELLO_Address *address); 123 const struct GNUNET_PeerIdentity *peer,
124 const struct GNUNET_HELLO_Address *address);
120 125
121 126
122/** 127/**
@@ -317,7 +322,7 @@ GNUNET_TRANSPORT_address_to_string_cancel (struct
317 * @param cfg configuration to use 322 * @param cfg configuration to use
318 * @param peer peer identity to look up the addresses of, CHANGE: allow NULL for all (connected) peers 323 * @param peer peer identity to look up the addresses of, CHANGE: allow NULL for all (connected) peers
319 * @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL), 324 * @param one_shot GNUNET_YES to return the current state and then end (with NULL+NULL),
320 * GNUNET_NO to monitor the set of addresses used (continuously, must be explicitly cancelled) 325 * GNUNET_NO to monitor the set of addresses used (continuously, must be explicitly canceled, NOT implemented yet!)
321 * @param timeout how long is the lookup allowed to take at most 326 * @param timeout how long is the lookup allowed to take at most
322 * @param peer_address_callback function to call with the results 327 * @param peer_address_callback function to call with the results
323 * @param peer_address_callback_cls closure for peer_address_callback 328 * @param peer_address_callback_cls closure for peer_address_callback
@@ -343,21 +348,6 @@ GNUNET_TRANSPORT_peer_get_active_addresses_cancel (struct
343 348
344 349
345/** 350/**
346 * Return all the known addresses.
347 * @param cfg configuration to use
348 * @param timeout how long is the lookup allowed to take at most
349 * @param peer_address_callback function to call with the results
350 * @param peer_address_callback_cls closure for peer_address_callback
351 */
352void
353GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
354 struct GNUNET_TIME_Relative timeout,
355 GNUNET_TRANSPORT_PeerIterateCallback
356 peer_address_callback,
357 void *peer_address_callback_cls);
358
359
360/**
361 * Handle for blacklisting peers. 351 * Handle for blacklisting peers.
362 */ 352 */
363struct GNUNET_TRANSPORT_Blacklist; 353struct GNUNET_TRANSPORT_Blacklist;