aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_hello_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r--src/include/gnunet_hello_lib.h67
1 files changed, 32 insertions, 35 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index c46e847f1..3b494f0a2 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -35,9 +35,8 @@
35#define GNUNET_HELLO_LIB_H 35#define GNUNET_HELLO_LIB_H
36 36
37#ifdef __cplusplus 37#ifdef __cplusplus
38extern "C" 38extern "C" {
39{ 39#if 0 /* keep Emacsens' auto-indent happy */
40#if 0 /* keep Emacsens' auto-indent happy */
41} 40}
42#endif 41#endif
43#endif 42#endif
@@ -122,7 +121,6 @@ struct GNUNET_HELLO_Address
122 * when a #GNUNET_HELLO_Message is created 121 * when a #GNUNET_HELLO_Message is created
123 */ 122 */
124 enum GNUNET_HELLO_AddressInfo local_info; 123 enum GNUNET_HELLO_AddressInfo local_info;
125
126}; 124};
127 125
128 126
@@ -194,7 +192,7 @@ GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address *address,
194 * 192 *
195 * @param addr address to free 193 * @param addr address to free
196 */ 194 */
197#define GNUNET_HELLO_address_free(addr) GNUNET_free(addr) 195#define GNUNET_HELLO_address_free(addr) GNUNET_free (addr)
198 196
199 197
200GNUNET_NETWORK_STRUCT_BEGIN 198GNUNET_NETWORK_STRUCT_BEGIN
@@ -228,12 +226,10 @@ struct GNUNET_HELLO_Message
228 * The public key of the peer. 226 * The public key of the peer.
229 */ 227 */
230 struct GNUNET_CRYPTO_EddsaPublicKey publicKey; 228 struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
231
232}; 229};
233GNUNET_NETWORK_STRUCT_END 230GNUNET_NETWORK_STRUCT_END
234 231
235 232
236
237/** 233/**
238 * Return HELLO type 234 * Return HELLO type
239 * 235 *
@@ -273,10 +269,9 @@ GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address,
273 * @return number of bytes written or 0, #GNUNET_SYSERR to signal the 269 * @return number of bytes written or 0, #GNUNET_SYSERR to signal the
274 * end of the iteration. 270 * end of the iteration.
275 */ 271 */
276typedef ssize_t 272typedef ssize_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls,
277(*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, 273 size_t max,
278 size_t max, 274 void *buf);
279 void *buf);
280 275
281 276
282/** 277/**
@@ -356,10 +351,10 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
356 * #GNUNET_NO to delete it from the HELLO 351 * #GNUNET_NO to delete it from the HELLO
357 * #GNUNET_SYSERR to stop iterating (but keep current address) 352 * #GNUNET_SYSERR to stop iterating (but keep current address)
358 */ 353 */
359typedef int 354typedef int (*GNUNET_HELLO_AddressIterator) (
360(*GNUNET_HELLO_AddressIterator) (void *cls, 355 void *cls,
361 const struct GNUNET_HELLO_Address *address, 356 const struct GNUNET_HELLO_Address *address,
362 struct GNUNET_TIME_Absolute expiration); 357 struct GNUNET_TIME_Absolute expiration);
363 358
364 359
365/** 360/**
@@ -387,7 +382,8 @@ GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg);
387struct GNUNET_HELLO_Message * 382struct GNUNET_HELLO_Message *
388GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, 383GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
389 int return_modified, 384 int return_modified,
390 GNUNET_HELLO_AddressIterator it, void *it_cls); 385 GNUNET_HELLO_AddressIterator it,
386 void *it_cls);
391 387
392 388
393/** 389/**
@@ -404,11 +400,12 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
404 * @param it_cls closure for @a it 400 * @param it_cls closure for @a it
405 */ 401 */
406void 402void
407GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message *new_hello, 403GNUNET_HELLO_iterate_new_addresses (
408 const struct GNUNET_HELLO_Message *old_hello, 404 const struct GNUNET_HELLO_Message *new_hello,
409 struct GNUNET_TIME_Absolute expiration_limit, 405 const struct GNUNET_HELLO_Message *old_hello,
410 GNUNET_HELLO_AddressIterator it, 406 struct GNUNET_TIME_Absolute expiration_limit,
411 void *it_cls); 407 GNUNET_HELLO_AddressIterator it,
408 void *it_cls);
412 409
413 410
414/** 411/**
@@ -442,8 +439,8 @@ GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
442 * @param name name of the transport plugin to load 439 * @param name name of the transport plugin to load
443 * @return NULL if a plugin with name @a name is not known/loadable 440 * @return NULL if a plugin with name @a name is not known/loadable
444 */ 441 */
445typedef struct GNUNET_TRANSPORT_PluginFunctions * 442typedef struct GNUNET_TRANSPORT_PluginFunctions *(
446(*GNUNET_HELLO_TransportPluginsFind) (const char *name); 443 *GNUNET_HELLO_TransportPluginsFind) (const char *name);
447 444
448 445
449/** 446/**
@@ -474,7 +471,6 @@ GNUNET_HELLO_parse_uri (const char *uri,
474 GNUNET_HELLO_TransportPluginsFind plugins_find); 471 GNUNET_HELLO_TransportPluginsFind plugins_find);
475 472
476 473
477
478/* NG API */ 474/* NG API */
479#include "gnunet_nt_lib.h" 475#include "gnunet_nt_lib.h"
480 476
@@ -484,18 +480,19 @@ GNUNET_HELLO_parse_uri (const char *uri,
484 * 480 *
485 * @param address text address to sign 481 * @param address text address to sign
486 * @param nt network type of @a address 482 * @param nt network type of @a address
487 * @param expiration how long is @a address valid 483 * @param mono_time when was @a address valid
488 * @param private_key signing key to use 484 * @param private_key signing key to use
489 * @param result[out] where to write address record (allocated) 485 * @param result[out] where to write address record (allocated)
490 * @param result_size[out] set to size of @a result 486 * @param result_size[out] set to size of @a result
491 */ 487 */
492void 488void
493GNUNET_HELLO_sign_address (const char *address, 489GNUNET_HELLO_sign_address (
494 enum GNUNET_NetworkType nt, 490 const char *address,
495 struct GNUNET_TIME_Absolute expiration, 491 enum GNUNET_NetworkType nt,
496 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, 492 struct GNUNET_TIME_Absolute mono_time,
497 void **result, 493 const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key,
498 size_t *result_size); 494 void **result,
495 size_t *result_size);
499 496
500 497
501/** 498/**
@@ -505,7 +502,7 @@ GNUNET_HELLO_sign_address (const char *address,
505 * @param raw_size size of @a raw 502 * @param raw_size size of @a raw
506 * @param pid public key to use for signature verification 503 * @param pid public key to use for signature verification
507 * @param nt[out] set to network type 504 * @param nt[out] set to network type
508 * @param expiration[out] how long is the address valid 505 * @param mono_time[out] when was the address generated
509 * @return NULL on error, otherwise the address 506 * @return NULL on error, otherwise the address
510 */ 507 */
511char * 508char *
@@ -513,7 +510,7 @@ GNUNET_HELLO_extract_address (const void *raw,
513 size_t raw_size, 510 size_t raw_size,
514 const struct GNUNET_PeerIdentity *pid, 511 const struct GNUNET_PeerIdentity *pid,
515 enum GNUNET_NetworkType *nt, 512 enum GNUNET_NetworkType *nt,
516 struct GNUNET_TIME_Absolute *expiration); 513 struct GNUNET_TIME_Absolute *mono_time);
517 514
518 515
519/** 516/**
@@ -527,7 +524,7 @@ char *
527GNUNET_HELLO_address_to_prefix (const char *address); 524GNUNET_HELLO_address_to_prefix (const char *address);
528 525
529 526
530#if 0 /* keep Emacsens' auto-indent happy */ 527#if 0 /* keep Emacsens' auto-indent happy */
531{ 528{
532#endif 529#endif
533#ifdef __cplusplus 530#ifdef __cplusplus
@@ -537,6 +534,6 @@ GNUNET_HELLO_address_to_prefix (const char *address);
537/* ifndef GNUNET_HELLO_LIB_H */ 534/* ifndef GNUNET_HELLO_LIB_H */
538#endif 535#endif
539 536
540/** @} */ /* end of group */ 537/** @} */ /* end of group */
541 538
542/* end of gnunet_hello_lib.h */ 539/* end of gnunet_hello_lib.h */