diff options
author | Gabor X Toth <*@tg-x.net> | 2012-11-18 18:09:34 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2012-11-18 18:09:34 +0000 |
commit | a618961d96910d622476341e7efdf6d1180acdd3 (patch) | |
tree | 0b6b383f354d1a27b5259a993723cc5a60dced8b /src/include/gnunet_hello_lib.h | |
parent | ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6 (diff) | |
download | gnunet-a618961d96910d622476341e7efdf6d1180acdd3.tar.gz gnunet-a618961d96910d622476341e7efdf6d1180acdd3.zip |
moved hello uri functions to hello lib
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r-- | src/include/gnunet_hello_lib.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 244ec3648..6a334a7e5 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -40,6 +40,12 @@ extern "C" | |||
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Prefix that every HELLO URI must start with. | ||
44 | */ | ||
45 | #define GNUNET_HELLO_URI_PREFIX "gnunet://hello/" | ||
46 | |||
47 | |||
48 | /** | ||
43 | * An address for communicating with a peer. We frequently | 49 | * An address for communicating with a peer. We frequently |
44 | * need this tuple and the components cannot really be | 50 | * need this tuple and the components cannot really be |
45 | * separated. This is NOT the format that would be used | 51 | * separated. This is NOT the format that would be used |
@@ -332,6 +338,42 @@ struct GNUNET_MessageHeader * | |||
332 | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); | 338 | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); |
333 | 339 | ||
334 | 340 | ||
341 | |||
342 | typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | ||
343 | size_t max, | ||
344 | void *buf); | ||
345 | |||
346 | |||
347 | typedef struct GNUNET_TRANSPORT_PluginFunctions * | ||
348 | (*GNUNET_HELLO_TransportPluginsFind) (const char *name); | ||
349 | |||
350 | |||
351 | /** | ||
352 | * Compose a hello URI string from a hello message. | ||
353 | * | ||
354 | * @param hello Hello message | ||
355 | * @param plugins_find Function to find transport plugins by name | ||
356 | * @return Hello URI string | ||
357 | */ | ||
358 | char * | ||
359 | GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | ||
360 | GNUNET_HELLO_TransportPluginsFind plugins_find); | ||
361 | |||
362 | /** | ||
363 | * Parse a hello URI string to a hello message. | ||
364 | * | ||
365 | * @param uri URI string to parse | ||
366 | * @param pubkey Pointer to struct where public key is parsed | ||
367 | * @param hello Pointer to struct where hello message is parsed | ||
368 | * @param plugins_find Function to find transport plugins by name | ||
369 | * @return GNUNET_OK on success, GNUNET_SYSERR if the URI was invalid, GNUNET_NO on other errors | ||
370 | */ | ||
371 | int | ||
372 | GNUNET_HELLO_parse_uri (const char *uri, | ||
373 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *pubkey, | ||
374 | struct GNUNET_HELLO_Message **hello, | ||
375 | GNUNET_HELLO_TransportPluginsFind plugins_find); | ||
376 | |||
335 | #if 0 /* keep Emacsens' auto-indent happy */ | 377 | #if 0 /* keep Emacsens' auto-indent happy */ |
336 | { | 378 | { |
337 | #endif | 379 | #endif |