diff options
Diffstat (limited to 'src/include/gnunet_hello_lib.h')
-rw-r--r-- | src/include/gnunet_hello_lib.h | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 595f1709e..14669d417 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -178,10 +178,11 @@ GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address); | |||
178 | struct GNUNET_HELLO_Message; | 178 | struct GNUNET_HELLO_Message; |
179 | 179 | ||
180 | 180 | ||
181 | /** Return HELLO type | 181 | /** |
182 | * Return HELLO type | ||
182 | * | 183 | * |
183 | * @param h HELLO Message to test | 184 | * @param h HELLO Message to test |
184 | * @return GNUNET_YES or GNUNET_NO | 185 | * @return #GNUNET_YES or #GNUNET_NO |
185 | */ | 186 | */ |
186 | int | 187 | int |
187 | GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h); | 188 | GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h); |
@@ -194,7 +195,7 @@ GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h); | |||
194 | * @param address address to add | 195 | * @param address address to add |
195 | * @param expiration expiration for the address | 196 | * @param expiration expiration for the address |
196 | * @param target where to copy the address | 197 | * @param target where to copy the address |
197 | * @param max maximum number of bytes to copy to target | 198 | * @param max maximum number of bytes to copy to @a target |
198 | * @return number of bytes copied, 0 if | 199 | * @return number of bytes copied, 0 if |
199 | * the target buffer was not big enough. | 200 | * the target buffer was not big enough. |
200 | */ | 201 | */ |
@@ -207,17 +208,18 @@ GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address, | |||
207 | /** | 208 | /** |
208 | * Callback function used to fill a buffer of max bytes with a list of | 209 | * Callback function used to fill a buffer of max bytes with a list of |
209 | * addresses in the format used by HELLOs. Should use | 210 | * addresses in the format used by HELLOs. Should use |
210 | * "GNUNET_HELLO_add_address" as a helper function. | 211 | * #GNUNET_HELLO_add_address() as a helper function. |
211 | * | 212 | * |
212 | * @param cls closure | 213 | * @param cls closure |
213 | * @param max maximum number of bytes that can be written to buf | 214 | * @param max maximum number of bytes that can be written to @a buf |
214 | * @param buf where to write the address information | 215 | * @param buf where to write the address information |
215 | * @return number of bytes written, 0 to signal the | 216 | * @return number of bytes written, 0 to signal the |
216 | * end of the iteration. | 217 | * end of the iteration. |
217 | */ | 218 | */ |
218 | typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | 219 | typedef size_t |
219 | size_t max, | 220 | (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, |
220 | void *buf); | 221 | size_t max, |
222 | void *buf); | ||
221 | 223 | ||
222 | 224 | ||
223 | /** | 225 | /** |
@@ -225,7 +227,7 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | |||
225 | * expiration time and an iterator that spews the | 227 | * expiration time and an iterator that spews the |
226 | * transport addresses. | 228 | * transport addresses. |
227 | * | 229 | * |
228 | * If friend only is set to GNUNET_YES we create a FRIEND_HELLO which will | 230 | * If friend only is set to #GNUNET_YES we create a FRIEND_HELLO which will |
229 | * not be gossiped to other peers | 231 | * not be gossiped to other peers |
230 | * | 232 | * |
231 | * @return the hello message | 233 | * @return the hello message |
@@ -288,15 +290,14 @@ GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, | |||
288 | * @param cls closure | 290 | * @param cls closure |
289 | * @param address the address | 291 | * @param address the address |
290 | * @param expiration expiration time | 292 | * @param expiration expiration time |
291 | * @return GNUNET_OK to keep the address, | 293 | * @return #GNUNET_OK to keep the address, |
292 | * GNUNET_NO to delete it from the HELLO | 294 | * #GNUNET_NO to delete it from the HELLO |
293 | * GNUNET_SYSERR to stop iterating (but keep current address) | 295 | * #GNUNET_SYSERR to stop iterating (but keep current address) |
294 | */ | 296 | */ |
295 | typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, | 297 | typedef int |
296 | const struct GNUNET_HELLO_Address * | 298 | (*GNUNET_HELLO_AddressIterator) (void *cls, |
297 | address, | 299 | const struct GNUNET_HELLO_Address *address, |
298 | struct GNUNET_TIME_Absolute | 300 | struct GNUNET_TIME_Absolute expiration); |
299 | expiration); | ||
300 | 301 | ||
301 | 302 | ||
302 | /** | 303 | /** |
@@ -318,7 +319,7 @@ GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg); | |||
318 | * @param return_modified if a modified copy should be returned, | 319 | * @param return_modified if a modified copy should be returned, |
319 | * otherwise NULL will be returned | 320 | * otherwise NULL will be returned |
320 | * @param it iterator to call on each address | 321 | * @param it iterator to call on each address |
321 | * @param it_cls closure for it | 322 | * @param it_cls closure for @a it |
322 | * @return the modified HELLO or NULL | 323 | * @return the modified HELLO or NULL |
323 | */ | 324 | */ |
324 | struct GNUNET_HELLO_Message * | 325 | struct GNUNET_HELLO_Message * |
@@ -339,12 +340,9 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, | |||
339 | * @param it_cls closure for it | 340 | * @param it_cls closure for it |
340 | */ | 341 | */ |
341 | void | 342 | void |
342 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | 343 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message *new_hello, |
343 | *new_hello, | 344 | const struct GNUNET_HELLO_Message *old_hello, |
344 | const struct GNUNET_HELLO_Message | 345 | struct GNUNET_TIME_Absolute expiration_limit, |
345 | *old_hello, | ||
346 | struct GNUNET_TIME_Absolute | ||
347 | expiration_limit, | ||
348 | GNUNET_HELLO_AddressIterator it, | 346 | GNUNET_HELLO_AddressIterator it, |
349 | void *it_cls); | 347 | void *it_cls); |
350 | 348 | ||
@@ -354,7 +352,7 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
354 | * | 352 | * |
355 | * @param hello the hello message | 353 | * @param hello the hello message |
356 | * @param publicKey where to copy the public key information, can be NULL | 354 | * @param publicKey where to copy the public key information, can be NULL |
357 | * @return GNUNET_SYSERR if the HELLO was malformed | 355 | * @return #GNUNET_SYSERR if the HELLO was malformed |
358 | */ | 356 | */ |
359 | int | 357 | int |
360 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 358 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
@@ -366,7 +364,7 @@ GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | |||
366 | * | 364 | * |
367 | * @param hello the hello message | 365 | * @param hello the hello message |
368 | * @param peer where to store the peer's identity | 366 | * @param peer where to store the peer's identity |
369 | * @return GNUNET_SYSERR if the HELLO was malformed | 367 | * @return #GNUNET_SYSERR if the HELLO was malformed |
370 | */ | 368 | */ |
371 | int | 369 | int |
372 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 370 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, |
@@ -407,7 +405,7 @@ GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello, | |||
407 | * @param pubkey Pointer to struct where public key is parsed | 405 | * @param pubkey Pointer to struct where public key is parsed |
408 | * @param hello Pointer to struct where hello message is parsed | 406 | * @param hello Pointer to struct where hello message is parsed |
409 | * @param plugins_find Function to find transport plugins by name | 407 | * @param plugins_find Function to find transport plugins by name |
410 | * @return GNUNET_OK on success, GNUNET_SYSERR if the URI was invalid, GNUNET_NO on other errors | 408 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors |
411 | */ | 409 | */ |
412 | int | 410 | int |
413 | GNUNET_HELLO_parse_uri (const char *uri, | 411 | GNUNET_HELLO_parse_uri (const char *uri, |