aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-11-29 09:37:54 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-11-29 09:37:54 +0000
commit623df97886da9ee06724b7860a1a2463737b750e (patch)
treea7638265a42b7b276d10403078411e4f4d8973d8 /src/include
parent51b7d6d6e0d50e77a3fc948af68ae02f325684ac (diff)
downloadgnunet-623df97886da9ee06724b7860a1a2463737b750e.tar.gz
gnunet-623df97886da9ee06724b7860a1a2463737b750e.zip
first steps to transport_api cleanup
compiles but no guarante to work!
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_hello_lib.h8
-rw-r--r--src/include/gnunet_transport_service.h53
2 files changed, 24 insertions, 37 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index 886a41093..09f5f1c7d 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -111,6 +111,14 @@ GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
111 const struct GNUNET_HELLO_Address *a2); 111 const struct GNUNET_HELLO_Address *a2);
112 112
113 113
114/**
115 * Get the size of an address struct.
116 *
117 * @param address address
118 * @return the size
119 */
120size_t
121GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
114 122
115/** 123/**
116 * Free an address. 124 * Free an address.
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 1de59d796..b0d9e34b0 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -104,8 +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_AddressToStringCallback) (void *cls,
108typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls,
109 const char *address); 108 const char *address);
110 109
111 110
@@ -119,16 +118,9 @@ typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls,
119 * @param addrlen address length 118 * @param addrlen address length
120 */ 119 */
121// FIXME: use GNUNET_HELLO_Address (as 2nd arg, replacing others) 120// 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) 121// FIXME: use NULL for address on disconnect IF in monitor mode (one_shot = NO)
124typedef void (*GNUNET_TRANSPORT_AddressLookUpBinaryCallback) (void *cls, 122typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls,
125 const struct 123 const struct GNUNET_HELLO_Address *address);
126 GNUNET_PeerIdentity
127 * peer,
128 const char
129 *transport,
130 const void *addr,
131 size_t addrlen);
132 124
133 125
134/** 126/**
@@ -280,7 +272,7 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
280/** 272/**
281 * Handle to cancel a pending address lookup. 273 * Handle to cancel a pending address lookup.
282 */ 274 */
283struct GNUNET_TRANSPORT_AddressLookupContext; 275struct GNUNET_TRANSPORT_AddressToStringContext;
284 276
285 277
286/** 278/**
@@ -297,14 +289,12 @@ struct GNUNET_TRANSPORT_AddressLookupContext;
297 * @param aluc_cls closure for aluc 289 * @param aluc_cls closure for aluc
298 * @return handle to cancel the operation, NULL on error 290 * @return handle to cancel the operation, NULL on error
299 */ 291 */
300// FIXME: use 'GNUNET_HELLO_Address' here! 292struct GNUNET_TRANSPORT_AddressToStringContext *
301// => rename: address_to_string 293GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cfg,
302struct GNUNET_TRANSPORT_AddressLookupContext * 294 const struct GNUNET_HELLO_Address *address,
303GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, 295 int numeric,
304 const char *address, size_t addressLen,
305 int numeric, const char *nameTrans,
306 struct GNUNET_TIME_Relative timeout, 296 struct GNUNET_TIME_Relative timeout,
307 GNUNET_TRANSPORT_AddressLookUpCallback aluc, 297 GNUNET_TRANSPORT_AddressToStringCallback aluc,
308 void *aluc_cls); 298 void *aluc_cls);
309 299
310 300
@@ -314,18 +304,12 @@ GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
314 * @param alc handle for the request to cancel 304 * @param alc handle for the request to cancel
315 */ 305 */
316void 306void
317GNUNET_TRANSPORT_address_lookup_cancel (struct 307GNUNET_TRANSPORT_address_to_string_cancel (struct
318 GNUNET_TRANSPORT_AddressLookupContext 308 GNUNET_TRANSPORT_AddressToStringContext
319 *alc); 309 *alc);
320 310
321 311
322/** 312/**
323 * Handle to cancel a pending address lookup.
324 */
325struct GNUNET_TRANSPORT_AddressLookupContext;
326
327
328/**
329 * Return all the known addresses for a peer. FIXME: document better! 313 * Return all the known addresses for a peer. FIXME: document better!
330 * FIXME: use better name! 314 * FIXME: use better name!
331 * CHANGE: Returns the address(es) that we are currently using for this 315 * CHANGE: Returns the address(es) that we are currently using for this
@@ -342,17 +326,12 @@ struct GNUNET_TRANSPORT_AddressLookupContext;
342 * @param peer_address_callback function to call with the results 326 * @param peer_address_callback function to call with the results
343 * @param peer_address_callback_cls closure for peer_address_callback 327 * @param peer_address_callback_cls closure for peer_address_callback
344 */ 328 */
345// RENAME: peer_get_active_addresses
346struct GNUNET_TRANSPORT_PeerAddressLookupContext * 329struct GNUNET_TRANSPORT_PeerAddressLookupContext *
347GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle 330GNUNET_TRANSPORT_peer_get_active_addresses (const struct GNUNET_CONFIGURATION_Handle *cfg,
348 *cfg,
349 const struct GNUNET_PeerIdentity *peer, 331 const struct GNUNET_PeerIdentity *peer,
350 // FIXME: add argument: one_shot 332 // FIXME: add argument: one_shot
351 struct GNUNET_TIME_Relative timeout, 333 struct GNUNET_TIME_Relative timeout,
352 // FIXME: change to the 'Binary' lookup callback (which will 334 GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback,
353 // be renamed, so the argument type actually won't change)
354 GNUNET_TRANSPORT_AddressLookUpCallback
355 peer_address_callback,
356 void *peer_address_callback_cls); 335 void *peer_address_callback_cls);
357 336
358 337
@@ -362,9 +341,9 @@ GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle
362 * @param alc handle for the request to cancel 341 * @param alc handle for the request to cancel
363 */ 342 */
364void 343void
365GNUNET_TRANSPORT_peer_address_lookup_cancel (struct 344GNUNET_TRANSPORT_peer_get_active_addresses_cancel (struct
366 GNUNET_TRANSPORT_PeerAddressLookupContext 345 GNUNET_TRANSPORT_PeerAddressLookupContext
367 *alc); 346*alc);
368 347
369 348
370/** 349/**
@@ -381,7 +360,7 @@ GNUNET_TRANSPORT_peer_address_lookup_cancel (struct
381void 360void
382GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, 361GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
383 struct GNUNET_TIME_Relative timeout, 362 struct GNUNET_TIME_Relative timeout,
384 GNUNET_TRANSPORT_AddressLookUpBinaryCallback 363 GNUNET_TRANSPORT_AddressLookUpCallback
385 peer_address_callback, 364 peer_address_callback,
386 void *peer_address_callback_cls); 365 void *peer_address_callback_cls);
387 366