aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/gnunet_common.h65
-rw-r--r--src/include/gnunet_configuration_lib.h51
-rw-r--r--src/include/gnunet_crypto_lib.h64
-rw-r--r--src/include/gnunet_dht_service.h4
-rw-r--r--src/include/gnunet_protocols.h4
-rw-r--r--src/include/gnunet_scheduler_lib.h90
-rw-r--r--src/include/gnunet_time_lib.h6
7 files changed, 207 insertions, 77 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index ab0876ef9..4552e860e 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2006, 2009 Christian Grothoff (and other contributing authors) 3 (C) 2006-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -26,6 +26,9 @@
26 * 26 *
27 * @author Christian Grothoff 27 * @author Christian Grothoff
28 * @author Nils Durner 28 * @author Nils Durner
29 *
30 * @defgroup logging Logging
31 * @defgroup memory Memory management
29 */ 32 */
30#ifndef GNUNET_COMMON_H 33#ifndef GNUNET_COMMON_H
31#define GNUNET_COMMON_H 34#define GNUNET_COMMON_H
@@ -104,6 +107,7 @@ extern "C"
104#endif 107#endif
105 108
106/** 109/**
110 * @ingroup logging
107 * define GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source 111 * define GNUNET_EXTRA_LOGGING if using this header outside the GNUnet source
108 * tree where gnunet_config.h is unavailable 112 * tree where gnunet_config.h is unavailable
109 */ 113 */
@@ -288,6 +292,7 @@ typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename);
288/* ****************************** logging ***************************** */ 292/* ****************************** logging ***************************** */
289 293
290/** 294/**
295 * @ingroup logging
291 * Types of errors. 296 * Types of errors.
292 */ 297 */
293enum GNUNET_ErrorType 298enum GNUNET_ErrorType
@@ -304,6 +309,7 @@ enum GNUNET_ErrorType
304 309
305 310
306/** 311/**
312 * @ingroup logging
307 * User-defined handler for log messages. 313 * User-defined handler for log messages.
308 * 314 *
309 * @param cls closure 315 * @param cls closure
@@ -318,6 +324,7 @@ typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind,
318 324
319 325
320/** 326/**
327 * @ingroup logging
321 * Get the number of log calls that are going to be skipped 328 * Get the number of log calls that are going to be skipped
322 * 329 *
323 * @return number of log calls to be ignored 330 * @return number of log calls to be ignored
@@ -333,6 +340,7 @@ GNUNET_get_log_call_status (int caller_level, const char *comp,
333 340
334 341
335/** 342/**
343 * @ingroup logging
336 * Main log function. 344 * Main log function.
337 * 345 *
338 * @param kind how serious is the error? 346 * @param kind how serious is the error?
@@ -364,7 +372,9 @@ GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...);
364#define GNUNET_LOG_CALL_STATUS -1 372#define GNUNET_LOG_CALL_STATUS -1
365#endif 373#endif
366 374
375
367/** 376/**
377 * @ingroup logging
368 * Log function that specifies an alternative component. 378 * Log function that specifies an alternative component.
369 * This function should be used by plugins. 379 * This function should be used by plugins.
370 * 380 *
@@ -410,6 +420,7 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, const char *comp,
410 420
411 421
412/** 422/**
423 * @ingroup logging
413 * Log error message about missing configuration option. 424 * Log error message about missing configuration option.
414 * 425 *
415 * @param kind log level 426 * @param kind log level
@@ -423,6 +434,7 @@ GNUNET_log_config_missing (enum GNUNET_ErrorType kind,
423 434
424 435
425/** 436/**
437 * @ingroup logging
426 * Log error message about invalid configuration option value. 438 * Log error message about invalid configuration option value.
427 * 439 *
428 * @param kind log level 440 * @param kind log level
@@ -438,13 +450,16 @@ GNUNET_log_config_invalid (enum GNUNET_ErrorType kind,
438 450
439 451
440/** 452/**
453 * @ingroup logging
441 * Abort the process, generate a core dump if possible. 454 * Abort the process, generate a core dump if possible.
442 */ 455 */
443void 456void
444GNUNET_abort (void) GNUNET_NORETURN; 457GNUNET_abort (void) GNUNET_NORETURN;
445 458
459
446/** 460/**
447 * Ignore the next n calls to the log function. 461 * @ingroup logging
462 * Ignore the next @a n calls to the log function.
448 * 463 *
449 * @param n number of log calls to ignore (could be negative) 464 * @param n number of log calls to ignore (could be negative)
450 * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero 465 * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero
@@ -454,6 +469,7 @@ GNUNET_log_skip (int n, int check_reset);
454 469
455 470
456/** 471/**
472 * @ingroup logging
457 * Setup logging. 473 * Setup logging.
458 * 474 *
459 * @param comp default component to use 475 * @param comp default component to use
@@ -466,6 +482,7 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile);
466 482
467 483
468/** 484/**
485 * @ingroup logging
469 * Add a custom logger. 486 * Add a custom logger.
470 * 487 *
471 * @param logger log function 488 * @param logger log function
@@ -476,6 +493,7 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
476 493
477 494
478/** 495/**
496 * @ingroup logging
479 * Remove a custom logger. 497 * Remove a custom logger.
480 * 498 *
481 * @param logger log function 499 * @param logger log function
@@ -486,6 +504,7 @@ GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
486 504
487 505
488/** 506/**
507 * @ingroup logging
489 * Convert a short hash value to a string (for printing debug messages). 508 * Convert a short hash value to a string (for printing debug messages).
490 * This is one of the very few calls in the entire API that is 509 * This is one of the very few calls in the entire API that is
491 * NOT reentrant! 510 * NOT reentrant!
@@ -498,6 +517,7 @@ GNUNET_short_h2s (const struct GNUNET_CRYPTO_ShortHashCode * hc);
498 517
499 518
500/** 519/**
520 * @ingroup logging
501 * Convert a short hash value to a string (for printing debug messages). 521 * Convert a short hash value to a string (for printing debug messages).
502 * This prints all 104 characters of a hashcode! 522 * This prints all 104 characters of a hashcode!
503 * This is one of the very few calls in the entire API that is 523 * This is one of the very few calls in the entire API that is
@@ -511,6 +531,7 @@ GNUNET_short_h2s_full (const struct GNUNET_CRYPTO_ShortHashCode * hc);
511 531
512 532
513/** 533/**
534 * @ingroup logging
514 * Convert a hash value to a string (for printing debug messages). 535 * Convert a hash value to a string (for printing debug messages).
515 * This is one of the very few calls in the entire API that is 536 * This is one of the very few calls in the entire API that is
516 * NOT reentrant! 537 * NOT reentrant!
@@ -523,6 +544,7 @@ GNUNET_h2s (const struct GNUNET_HashCode * hc);
523 544
524 545
525/** 546/**
547 * @ingroup logging
526 * Convert a hash value to a string (for printing debug messages). 548 * Convert a hash value to a string (for printing debug messages).
527 * This prints all 104 characters of a hashcode! 549 * This prints all 104 characters of a hashcode!
528 * This is one of the very few calls in the entire API that is 550 * This is one of the very few calls in the entire API that is
@@ -536,6 +558,7 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc);
536 558
537 559
538/** 560/**
561 * @ingroup logging
539 * Convert a peer identity to a string (for printing debug messages). 562 * Convert a peer identity to a string (for printing debug messages).
540 * This is one of the very few calls in the entire API that is 563 * This is one of the very few calls in the entire API that is
541 * NOT reentrant! 564 * NOT reentrant!
@@ -547,7 +570,9 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc);
547const char * 570const char *
548GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); 571GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
549 572
573
550/** 574/**
575 * @ingroup logging
551 * Convert a peer identity to a string (for printing debug messages). 576 * Convert a peer identity to a string (for printing debug messages).
552 * This is one of the very few calls in the entire API that is 577 * This is one of the very few calls in the entire API that is
553 * NOT reentrant! 578 * NOT reentrant!
@@ -559,7 +584,9 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
559const char * 584const char *
560GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid); 585GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
561 586
587
562/** 588/**
589 * @ingroup logging
563 * Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string 590 * Convert a "struct sockaddr*" (IPv4 or IPv6 address) to a string
564 * (for printing debug messages). This is one of the very few calls 591 * (for printing debug messages). This is one of the very few calls
565 * in the entire API that is NOT reentrant! 592 * in the entire API that is NOT reentrant!
@@ -572,7 +599,9 @@ GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
572const char * 599const char *
573GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); 600GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen);
574 601
602
575/** 603/**
604 * @ingroup logging
576 * Convert error type to string. 605 * Convert error type to string.
577 * 606 *
578 * @param kind type to convert 607 * @param kind type to convert
@@ -583,22 +612,29 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
583 612
584 613
585/** 614/**
615 * @ingroup logging
586 * Use this for fatal errors that cannot be handled 616 * Use this for fatal errors that cannot be handled
587 */ 617 */
588#define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort(); } } while(0) 618#define GNUNET_assert(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); GNUNET_abort(); } } while(0)
589 619
620
590/** 621/**
622 * @ingroup logging
591 * Use this for fatal errors that cannot be handled 623 * Use this for fatal errors that cannot be handled
592 */ 624 */
593#define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); GNUNET_abort(); } } while(0) 625#define GNUNET_assert_at(cond, f, l) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), f, l); GNUNET_abort(); } } while(0)
594 626
627
595/** 628/**
629 * @ingroup logging
596 * Use this for internal assertion violations that are 630 * Use this for internal assertion violations that are
597 * not fatal (can be handled) but should not occur. 631 * not fatal (can be handled) but should not occur.
598 */ 632 */
599#define GNUNET_break(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); } } while(0) 633#define GNUNET_break(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_ERROR, _("Assertion failed at %s:%d.\n"), __FILE__, __LINE__); } } while(0)
600 634
635
601/** 636/**
637 * @ingroup logging
602 * Use this for assertion violations caused by other 638 * Use this for assertion violations caused by other
603 * peers (i.e. protocol violations). We do not want to 639 * peers (i.e. protocol violations). We do not want to
604 * confuse end-users (say, some other peer runs an 640 * confuse end-users (say, some other peer runs an
@@ -608,28 +644,36 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
608 */ 644 */
609#define GNUNET_break_op(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, _("External protocol violation detected at %s:%d.\n"), __FILE__, __LINE__); } } while(0) 645#define GNUNET_break_op(cond) do { if (! (cond)) { GNUNET_log(GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, _("External protocol violation detected at %s:%d.\n"), __FILE__, __LINE__); } } while(0)
610 646
647
611/** 648/**
649 * @ingroup logging
612 * Log an error message at log-level 'level' that indicates 650 * Log an error message at log-level 'level' that indicates
613 * a failure of the command 'cmd' with the message given 651 * a failure of the command 'cmd' with the message given
614 * by strerror(errno). 652 * by strerror(errno).
615 */ 653 */
616#define GNUNET_log_strerror(level, cmd) do { GNUNET_log(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0) 654#define GNUNET_log_strerror(level, cmd) do { GNUNET_log(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0)
617 655
656
618/** 657/**
658 * @ingroup logging
619 * Log an error message at log-level 'level' that indicates 659 * Log an error message at log-level 'level' that indicates
620 * a failure of the command 'cmd' with the message given 660 * a failure of the command 'cmd' with the message given
621 * by strerror(errno). 661 * by strerror(errno).
622 */ 662 */
623#define GNUNET_log_from_strerror(level, component, cmd) do { GNUNET_log_from (level, component, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0) 663#define GNUNET_log_from_strerror(level, component, cmd) do { GNUNET_log_from (level, component, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, STRERROR(errno)); } while(0)
624 664
665
625/** 666/**
667 * @ingroup logging
626 * Log an error message at log-level 'level' that indicates 668 * Log an error message at log-level 'level' that indicates
627 * a failure of the command 'cmd' with the message given 669 * a failure of the command 'cmd' with the message given
628 * by strerror(errno). 670 * by strerror(errno).
629 */ 671 */
630#define GNUNET_log_strerror_file(level, cmd, filename) do { GNUNET_log(level, _("`%s' failed on file `%s' at %s:%d with error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } while(0) 672#define GNUNET_log_strerror_file(level, cmd, filename) do { GNUNET_log(level, _("`%s' failed on file `%s' at %s:%d with error: %s\n"), cmd, filename,__FILE__, __LINE__, STRERROR(errno)); } while(0)
631 673
674
632/** 675/**
676 * @ingroup logging
633 * Log an error message at log-level 'level' that indicates 677 * Log an error message at log-level 'level' that indicates
634 * a failure of the command 'cmd' with the message given 678 * a failure of the command 'cmd' with the message given
635 * by strerror(errno). 679 * by strerror(errno).
@@ -673,11 +717,13 @@ GNUNET_ntoh_double (double d);
673/* ************************* allocation functions ****************** */ 717/* ************************* allocation functions ****************** */
674 718
675/** 719/**
720 * @ingroup memory
676 * Maximum allocation with GNUNET_malloc macro. 721 * Maximum allocation with GNUNET_malloc macro.
677 */ 722 */
678#define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40) 723#define GNUNET_MAX_MALLOC_CHECKED (1024 * 1024 * 40)
679 724
680/** 725/**
726 * @ingroup memory
681 * Allocate a struct or union of the given 'type'. 727 * Allocate a struct or union of the given 'type'.
682 * Wrapper around GNUNET_malloc that returns a pointer 728 * Wrapper around GNUNET_malloc that returns a pointer
683 * to the newly created object of the correct type. 729 * to the newly created object of the correct type.
@@ -687,6 +733,7 @@ GNUNET_ntoh_double (double d);
687#define GNUNET_new(type) (type *) GNUNET_malloc (sizeof (type)) 733#define GNUNET_new(type) (type *) GNUNET_malloc (sizeof (type))
688 734
689/** 735/**
736 * @ingroup memory
690 * Wrapper around malloc. Allocates size bytes of memory. 737 * Wrapper around malloc. Allocates size bytes of memory.
691 * The memory will be zero'ed out. 738 * The memory will be zero'ed out.
692 * 739 *
@@ -697,6 +744,7 @@ GNUNET_ntoh_double (double d);
697#define GNUNET_malloc(size) GNUNET_xmalloc_(size, __FILE__, __LINE__) 744#define GNUNET_malloc(size) GNUNET_xmalloc_(size, __FILE__, __LINE__)
698 745
699/** 746/**
747 * @ingroup memory
700 * Allocate and initialize a block of memory. 748 * Allocate and initialize a block of memory.
701 * 749 *
702 * @param buf data to initalize the block with 750 * @param buf data to initalize the block with
@@ -706,6 +754,7 @@ GNUNET_ntoh_double (double d);
706#define GNUNET_memdup(buf,size) GNUNET_xmemdup_(buf, size, __FILE__, __LINE__) 754#define GNUNET_memdup(buf,size) GNUNET_xmemdup_(buf, size, __FILE__, __LINE__)
707 755
708/** 756/**
757 * @ingroup memory
709 * Wrapper around malloc. Allocates size bytes of memory. 758 * Wrapper around malloc. Allocates size bytes of memory.
710 * The memory will be zero'ed out. 759 * The memory will be zero'ed out.
711 * 760 *
@@ -715,6 +764,7 @@ GNUNET_ntoh_double (double d);
715#define GNUNET_malloc_large(size) GNUNET_xmalloc_unchecked_(size, __FILE__, __LINE__) 764#define GNUNET_malloc_large(size) GNUNET_xmalloc_unchecked_(size, __FILE__, __LINE__)
716 765
717/** 766/**
767 * @ingroup memory
718 * Wrapper around realloc. Rellocates size bytes of memory. 768 * Wrapper around realloc. Rellocates size bytes of memory.
719 * 769 *
720 * @param ptr the pointer to reallocate 770 * @param ptr the pointer to reallocate
@@ -724,6 +774,7 @@ GNUNET_ntoh_double (double d);
724#define GNUNET_realloc(ptr, size) GNUNET_xrealloc_(ptr, size, __FILE__, __LINE__) 774#define GNUNET_realloc(ptr, size) GNUNET_xrealloc_(ptr, size, __FILE__, __LINE__)
725 775
726/** 776/**
777 * @ingroup memory
727 * Wrapper around free. Frees the memory referred to by ptr. 778 * Wrapper around free. Frees the memory referred to by ptr.
728 * Note that is is generally better to free memory that was 779 * Note that is is generally better to free memory that was
729 * allocated with GNUNET_array_grow using GNUNET_array_grow(mem, size, 0) instead of GNUNET_free. 780 * allocated with GNUNET_array_grow using GNUNET_array_grow(mem, size, 0) instead of GNUNET_free.
@@ -734,6 +785,7 @@ GNUNET_ntoh_double (double d);
734#define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__) 785#define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__)
735 786
736/** 787/**
788 * @ingroup memory
737 * Free the memory pointed to by ptr if ptr is not NULL. 789 * Free the memory pointed to by ptr if ptr is not NULL.
738 * Equivalent to if (ptr!=null)GNUNET_free(ptr). 790 * Equivalent to if (ptr!=null)GNUNET_free(ptr).
739 * 791 *
@@ -742,6 +794,7 @@ GNUNET_ntoh_double (double d);
742#define GNUNET_free_non_null(ptr) do { void * __x__ = ptr; if (__x__ != NULL) { GNUNET_free(__x__); } } while(0) 794#define GNUNET_free_non_null(ptr) do { void * __x__ = ptr; if (__x__ != NULL) { GNUNET_free(__x__); } } while(0)
743 795
744/** 796/**
797 * @ingroup memory
745 * Wrapper around GNUNET_strdup. Makes a copy of the zero-terminated string 798 * Wrapper around GNUNET_strdup. Makes a copy of the zero-terminated string
746 * pointed to by a. 799 * pointed to by a.
747 * 800 *
@@ -751,6 +804,7 @@ GNUNET_ntoh_double (double d);
751#define GNUNET_strdup(a) GNUNET_xstrdup_(a,__FILE__,__LINE__) 804#define GNUNET_strdup(a) GNUNET_xstrdup_(a,__FILE__,__LINE__)
752 805
753/** 806/**
807 * @ingroup memory
754 * Wrapper around GNUNET_strndup. Makes a partial copy of the string 808 * Wrapper around GNUNET_strndup. Makes a partial copy of the string
755 * pointed to by a. 809 * pointed to by a.
756 * 810 *
@@ -761,6 +815,7 @@ GNUNET_ntoh_double (double d);
761#define GNUNET_strndup(a,length) GNUNET_xstrndup_(a,length,__FILE__,__LINE__) 815#define GNUNET_strndup(a,length) GNUNET_xstrndup_(a,length,__FILE__,__LINE__)
762 816
763/** 817/**
818 * @ingroup memory
764 * Grow a well-typed (!) array. This is a convenience 819 * Grow a well-typed (!) array. This is a convenience
765 * method to grow a vector <tt>arr</tt> of size <tt>size</tt> 820 * method to grow a vector <tt>arr</tt> of size <tt>size</tt>
766 * to the new (target) size <tt>tsize</tt>. 821 * to the new (target) size <tt>tsize</tt>.
@@ -796,12 +851,14 @@ GNUNET_ntoh_double (double d);
796#define GNUNET_array_grow(arr,size,tsize) GNUNET_xgrow_((void**)&arr, sizeof(arr[0]), &size, tsize, __FILE__, __LINE__) 851#define GNUNET_array_grow(arr,size,tsize) GNUNET_xgrow_((void**)&arr, sizeof(arr[0]), &size, tsize, __FILE__, __LINE__)
797 852
798/** 853/**
854 * @ingroup memory
799 * Append an element to a list (growing the 855 * Append an element to a list (growing the
800 * list by one). 856 * list by one).
801 */ 857 */
802#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0) 858#define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0)
803 859
804/** 860/**
861 * @ingroup memory
805 * Like snprintf, just aborts if the buffer is of insufficient size. 862 * Like snprintf, just aborts if the buffer is of insufficient size.
806 * 863 *
807 * @param buf pointer to buffer that is written to 864 * @param buf pointer to buffer that is written to
@@ -815,6 +872,7 @@ GNUNET_snprintf (char *buf, size_t size, const char *format, ...);
815 872
816 873
817/** 874/**
875 * @ingroup memory
818 * Like asprintf, just portable. 876 * Like asprintf, just portable.
819 * 877 *
820 * @param buf set to a buffer of sufficient size (allocated, caller must free) 878 * @param buf set to a buffer of sufficient size (allocated, caller must free)
@@ -938,6 +996,7 @@ GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount,
938 996
939 997
940/** 998/**
999 * @ingroup memory
941 * Create a copy of the given message. 1000 * Create a copy of the given message.
942 * 1001 *
943 * @param msg message to copy 1002 * @param msg message to copy
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 0c87a537d..5ef58bf95 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -21,10 +21,10 @@
21/** 21/**
22 * @file include/gnunet_configuration_lib.h 22 * @file include/gnunet_configuration_lib.h
23 * @brief configuration API 23 * @brief configuration API
24 *
25 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @defgroup configuration Configuration management
26 * @{
26 */ 27 */
27
28#ifndef GNUNET_CONFIGURATION_LIB_H 28#ifndef GNUNET_CONFIGURATION_LIB_H
29#define GNUNET_CONFIGURATION_LIB_H 29#define GNUNET_CONFIGURATION_LIB_H
30 30
@@ -79,7 +79,7 @@ GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg);
79 * 79 *
80 * @param cfg configuration to update 80 * @param cfg configuration to update
81 * @param filename name of the configuration file, NULL to load defaults 81 * @param filename name of the configuration file, NULL to load defaults
82 * @return GNUNET_OK on success, GNUNET_SYSERR on error 82 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
83 */ 83 */
84int 84int
85GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, 85GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -92,7 +92,7 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
92 * 92 *
93 * @param cfg configuration to update 93 * @param cfg configuration to update
94 * @param defaults_d directory with the defaults 94 * @param defaults_d directory with the defaults
95 * @return GNUNET_OK on success, GNUNET_SYSERR on error 95 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
96 */ 96 */
97int 97int
98GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, 98GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -105,7 +105,7 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
105 * 105 *
106 * @param cfg configuration to update 106 * @param cfg configuration to update
107 * @param filename name of the configuration file 107 * @param filename name of the configuration file
108 * @return GNUNET_OK on success, GNUNET_SYSERR on error 108 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
109 */ 109 */
110int 110int
111GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, 111GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -131,10 +131,10 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
131 * @param cfg configuration to update 131 * @param cfg configuration to update
132 * @param mem the memory block of serialized configuration 132 * @param mem the memory block of serialized configuration
133 * @param size the size of the memory block 133 * @param size the size of the memory block
134 * @param allow_inline set to GNUNET_YES if we recursively load configuration 134 * @param allow_inline set to #GNUNET_YES if we recursively load configuration
135 * from inlined configurations; GNUNET_NO if not and raise warnings 135 * from inlined configurations; #GNUNET_NO if not and raise warnings
136 * when we come across them 136 * when we come across them
137 * @return GNUNET_OK on success, GNUNET_ERROR on error 137 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
138 */ 138 */
139int 139int
140GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, 140GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -148,7 +148,7 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
148 * 148 *
149 * @param cfg configuration to write 149 * @param cfg configuration to write
150 * @param filename where to write the configuration 150 * @param filename where to write the configuration
151 * @return GNUNET_OK on success, GNUNET_SYSERR on error 151 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
152 */ 152 */
153int 153int
154GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, 154GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -160,7 +160,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
160 * @param cfgDefault default configuration 160 * @param cfgDefault default configuration
161 * @param cfgNew new configuration 161 * @param cfgNew new configuration
162 * @param filename where to write the configuration diff between default and new 162 * @param filename where to write the configuration diff between default and new
163 * @return GNUNET_OK on success, GNUNET_SYSERR on error 163 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
164 */ 164 */
165int 165int
166GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle 166GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
@@ -188,7 +188,7 @@ GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle
188 * changed since the last save. 188 * changed since the last save.
189 * 189 *
190 * @param cfg configuration to inspect 190 * @param cfg configuration to inspect
191 * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) 191 * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed)
192 */ 192 */
193int 193int
194GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); 194GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
@@ -261,7 +261,7 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
261 * @param section section of interest 261 * @param section section of interest
262 * @param option option of interest 262 * @param option option of interest
263 * @param number where to store the numeric value of the option 263 * @param number where to store the numeric value of the option
264 * @return GNUNET_OK on success, GNUNET_SYSERR on error 264 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
265 */ 265 */
266int 266int
267GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle 267GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
@@ -277,7 +277,7 @@ GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
277 * @param section section of interest 277 * @param section section of interest
278 * @param option option of interest 278 * @param option option of interest
279 * @param time set to the time value stored in the configuration 279 * @param time set to the time value stored in the configuration
280 * @return GNUNET_OK on success, GNUNET_SYSERR on error 280 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
281 */ 281 */
282int 282int
283GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle 283GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
@@ -294,7 +294,7 @@ GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
294 * @param section section of interest 294 * @param section section of interest
295 * @param option option of interest 295 * @param option option of interest
296 * @param size set to the size in bytes as stored in the configuration 296 * @param size set to the size in bytes as stored in the configuration
297 * @return GNUNET_OK on success, GNUNET_SYSERR on error 297 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
298 */ 298 */
299int 299int
300GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle 300GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle
@@ -309,7 +309,7 @@ GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle
309 * @param cfg configuration to inspect 309 * @param cfg configuration to inspect
310 * @param section section of interest 310 * @param section section of interest
311 * @param option option of interest 311 * @param option option of interest
312 * @return GNUNET_YES if so, GNUNET_NO if not. 312 * @return #GNUNET_YES if so, #GNUNET_NO if not.
313 */ 313 */
314int 314int
315GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, 315GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -324,7 +324,7 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
324 * @param option option of interest 324 * @param option option of interest
325 * @param value will be set to a freshly allocated configuration 325 * @param value will be set to a freshly allocated configuration
326 * value, or NULL if option is not specified 326 * value, or NULL if option is not specified
327 * @return GNUNET_OK on success, GNUNET_SYSERR on error 327 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
328 */ 328 */
329int 329int
330GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle 330GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
@@ -341,7 +341,7 @@ GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
341 * @param option option of interest 341 * @param option option of interest
342 * @param value will be set to a freshly allocated configuration 342 * @param value will be set to a freshly allocated configuration
343 * value, or NULL if option is not specified 343 * value, or NULL if option is not specified
344 * @return GNUNET_OK on success, GNUNET_SYSERR on error 344 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
345 */ 345 */
346int 346int
347GNUNET_CONFIGURATION_get_value_filename (const struct 347GNUNET_CONFIGURATION_get_value_filename (const struct
@@ -356,7 +356,7 @@ GNUNET_CONFIGURATION_get_value_filename (const struct
356 * @param section section of interest 356 * @param section section of interest
357 * @param option option of interest 357 * @param option option of interest
358 * @param cb function to call on each filename 358 * @param cb function to call on each filename
359 * @param cb_cls closure for cb 359 * @param cb_cls closure for @a cb
360 * @return number of filenames iterated over, -1 on error 360 * @return number of filenames iterated over, -1 on error
361 */ 361 */
362int 362int
@@ -373,7 +373,7 @@ GNUNET_CONFIGURATION_iterate_value_filenames (const struct
373 * @param cfg configuration to inspect 373 * @param cfg configuration to inspect
374 * @param section the section 374 * @param section the section
375 * @param iter function to call on each option 375 * @param iter function to call on each option
376 * @param iter_cls closure for iter 376 * @param iter_cls closure for @a iter
377 */ 377 */
378void 378void
379GNUNET_CONFIGURATION_iterate_section_values (const struct 379GNUNET_CONFIGURATION_iterate_section_values (const struct
@@ -392,7 +392,7 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct
392 * @param choices NULL-terminated list of legal values 392 * @param choices NULL-terminated list of legal values
393 * @param value will be set to an entry in the legal list, 393 * @param value will be set to an entry in the legal list,
394 * or NULL if option is not specified and no default given 394 * or NULL if option is not specified and no default given
395 * @return GNUNET_OK on success, GNUNET_SYSERR on error 395 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
396 */ 396 */
397int 397int
398GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle 398GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
@@ -407,7 +407,7 @@ GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
407 * @param cfg configuration to inspect 407 * @param cfg configuration to inspect
408 * @param section section of interest 408 * @param section section of interest
409 * @param option option of interest 409 * @param option option of interest
410 * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR 410 * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR
411 */ 411 */
412int 412int
413GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle 413GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
@@ -465,8 +465,8 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
465 * @param section section of interest 465 * @param section section of interest
466 * @param option option of interest 466 * @param option option of interest
467 * @param value filename to remove 467 * @param value filename to remove
468 * @return GNUNET_OK on success, 468 * @return #GNUNET_OK on success,
469 * GNUNET_SYSERR if the filename is not in the list 469 * #GNUNET_SYSERR if the filename is not in the list
470 */ 470 */
471int 471int
472GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle 472GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
@@ -482,8 +482,8 @@ GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
482 * @param section section of interest 482 * @param section section of interest
483 * @param option option of interest 483 * @param option option of interest
484 * @param value filename to append 484 * @param value filename to append
485 * @return GNUNET_OK on success, 485 * @return #GNUNET_OK on success,
486 * GNUNET_SYSERR if the filename already in the list 486 * #GNUNET_SYSERR if the filename already in the list
487 */ 487 */
488int 488int
489GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle 489GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
@@ -491,6 +491,7 @@ GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
491 const char *option, 491 const char *option,
492 const char *value); 492 const char *value);
493 493
494/** @} */ /* end of group configuration */
494 495
495#if 0 /* keep Emacsens' auto-indent happy */ 496#if 0 /* keep Emacsens' auto-indent happy */
496{ 497{
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 19813a693..73a3db382 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -27,6 +27,9 @@
27 * @author Gerd Knorr <kraxel@bytesex.org> 27 * @author Gerd Knorr <kraxel@bytesex.org>
28 * @author Ioana Patrascu 28 * @author Ioana Patrascu
29 * @author Tzvetan Horozov 29 * @author Tzvetan Horozov
30 *
31 * @defgroup crypto Cryptographic operations
32 * @defgroup hash Hashing and operations on hashes
30 */ 33 */
31 34
32#ifndef GNUNET_CRYPTO_LIB_H 35#ifndef GNUNET_CRYPTO_LIB_H
@@ -220,6 +223,7 @@ struct GNUNET_CRYPTO_AuthKey
220/* **************** Functions and Macros ************* */ 223/* **************** Functions and Macros ************* */
221 224
222/** 225/**
226 * @ingroup crypto
223 * Seed a weak random generator. Only #GNUNET_CRYPTO_QUALITY_WEAK-mode generator 227 * Seed a weak random generator. Only #GNUNET_CRYPTO_QUALITY_WEAK-mode generator
224 * can be seeded. 228 * can be seeded.
225 * 229 *
@@ -252,6 +256,7 @@ GNUNET_CRYPTO_crc16_finish (uint32_t sum);
252 256
253 257
254/** 258/**
259 * @ingroup hash
255 * Calculate the checksum of a buffer in one step. 260 * Calculate the checksum of a buffer in one step.
256 * 261 *
257 * @param buf buffer to calculate CRC over (must be 16-bit aligned) 262 * @param buf buffer to calculate CRC over (must be 16-bit aligned)
@@ -263,11 +268,12 @@ GNUNET_CRYPTO_crc16_n (const void *buf, size_t len);
263 268
264 269
265/** 270/**
271 * @ingroup hash
266 * Compute the CRC32 checksum for the first len 272 * Compute the CRC32 checksum for the first len
267 * bytes of the buffer. 273 * bytes of the buffer.
268 * 274 *
269 * @param buf the data over which we're taking the CRC 275 * @param buf the data over which we're taking the CRC
270 * @param len the length of the buffer @buf in bytes 276 * @param len the length of the buffer @a buf in bytes
271 * @return the resulting CRC32 checksum 277 * @return the resulting CRC32 checksum
272 */ 278 */
273int32_t 279int32_t
@@ -275,6 +281,7 @@ GNUNET_CRYPTO_crc32_n (const void *buf, size_t len);
275 281
276 282
277/** 283/**
284 * @ingroup crypto
278 * Produce a random value. 285 * Produce a random value.
279 * 286 *
280 * @param mode desired quality of the random number 287 * @param mode desired quality of the random number
@@ -286,6 +293,7 @@ GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i);
286 293
287 294
288/** 295/**
296 * @ingroup crypto
289 * Random on unsigned 64-bit values. 297 * Random on unsigned 64-bit values.
290 * 298 *
291 * @param mode desired quality of the random number 299 * @param mode desired quality of the random number
@@ -297,6 +305,7 @@ GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max);
297 305
298 306
299/** 307/**
308 * @ingroup crypto
300 * Get an array with a random permutation of the 309 * Get an array with a random permutation of the
301 * numbers 0...n-1. 310 * numbers 0...n-1.
302 * @param mode #GNUNET_CRYPTO_QUALITY_STRONG if the strong (but expensive) PRNG should be used, 311 * @param mode #GNUNET_CRYPTO_QUALITY_STRONG if the strong (but expensive) PRNG should be used,
@@ -309,7 +318,8 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n);
309 318
310 319
311/** 320/**
312 * Create a new Session key. 321 * @ingroup crypto
322 * Create a new random session key.
313 * 323 *
314 * @param key key to initialize 324 * @param key key to initialize
315 */ 325 */
@@ -318,8 +328,8 @@ GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key);
318 328
319 329
320/** 330/**
321 * Encrypt a block with the public key of another 331 * @ingroup crypto
322 * host that uses the same cyper. 332 * Encrypt a block using a symmetric sessionkey.
323 * 333 *
324 * @param block the block to encrypt 334 * @param block the block to encrypt
325 * @param len the size of the block 335 * @param len the size of the block
@@ -336,7 +346,8 @@ GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len,
336 346
337 347
338/** 348/**
339 * Decrypt a given block with the sessionkey. 349 * @ingroup crypto
350 * Decrypt a given block using a symmetric sessionkey.
340 * 351 *
341 * @param block the data to decrypt, encoded as returned by encrypt 352 * @param block the data to decrypt, encoded as returned by encrypt
342 * @param size how big is the block? 353 * @param size how big is the block?
@@ -353,6 +364,7 @@ GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size,
353 364
354 365
355/** 366/**
367 * @ingroup crypto
356 * @brief Derive an IV 368 * @brief Derive an IV
357 * @param iv initialization vector 369 * @param iv initialization vector
358 * @param skey session key 370 * @param skey session key
@@ -381,6 +393,7 @@ GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv,
381 393
382 394
383/** 395/**
396 * @ingroup hash
384 * Convert hash to ASCII encoding. 397 * Convert hash to ASCII encoding.
385 * @param block the hash code 398 * @param block the hash code
386 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be 399 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
@@ -392,6 +405,7 @@ GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode * block,
392 405
393 406
394/** 407/**
408 * @ingroup hash
395 * Convert short hash to ASCII encoding. 409 * Convert short hash to ASCII encoding.
396 * 410 *
397 * @param block the hash code 411 * @param block the hash code
@@ -404,6 +418,7 @@ GNUNET_CRYPTO_short_hash_to_enc (const struct GNUNET_CRYPTO_ShortHashCode * bloc
404 418
405 419
406/** 420/**
421 * @ingroup hash
407 * Convert ASCII encoding back to a 'struct GNUNET_HashCode' 422 * Convert ASCII encoding back to a 'struct GNUNET_HashCode'
408 * 423 *
409 * @param enc the encoding 424 * @param enc the encoding
@@ -417,6 +432,7 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen,
417 432
418 433
419/** 434/**
435 * @ingroup hash
420 * Convert ASCII encoding back to a 'struct GNUNET_CRYPTO_ShortHash' 436 * Convert ASCII encoding back to a 'struct GNUNET_CRYPTO_ShortHash'
421 * 437 *
422 * @param enc the encoding 438 * @param enc the encoding
@@ -430,6 +446,7 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
430 446
431 447
432/** 448/**
449 * @ingroup hash
433 * Convert ASCII encoding back to struct GNUNET_HashCode 450 * Convert ASCII encoding back to struct GNUNET_HashCode
434 * 451 *
435 * @param enc the encoding 452 * @param enc the encoding
@@ -441,6 +458,7 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
441 458
442 459
443/** 460/**
461 * @ingroup hash
444 * Convert ASCII encoding back to a 'struct GNUNET_CRYPTO_ShortHash' 462 * Convert ASCII encoding back to a 'struct GNUNET_CRYPTO_ShortHash'
445 * 463 *
446 * @param enc the encoding 464 * @param enc the encoding
@@ -452,6 +470,7 @@ GNUNET_CRYPTO_short_hash_from_string2 (const char *enc, size_t enclen,
452 470
453 471
454/** 472/**
473 * @ingroup hash
455 * Compare function for ShortHashCodes, producing a total ordering 474 * Compare function for ShortHashCodes, producing a total ordering
456 * of all hashcodes. 475 * of all hashcodes.
457 * 476 *
@@ -464,6 +483,7 @@ GNUNET_CRYPTO_short_hash_cmp (const struct GNUNET_CRYPTO_ShortHashCode * h1,
464 const struct GNUNET_CRYPTO_ShortHashCode * h2); 483 const struct GNUNET_CRYPTO_ShortHashCode * h2);
465 484
466/** 485/**
486 * @ingroup hash
467 * Compute the distance between 2 hashcodes. 487 * Compute the distance between 2 hashcodes.
468 * The computation must be fast, not involve 488 * The computation must be fast, not involve
469 * a.a or a.e (they're used elsewhere), and 489 * a.a or a.e (they're used elsewhere), and
@@ -480,6 +500,7 @@ GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode * a,
480 500
481 501
482/** 502/**
503 * @ingroup hash
483 * Compute hash of a given block. 504 * Compute hash of a given block.
484 * 505 *
485 * @param block the data to hash 506 * @param block the data to hash
@@ -491,6 +512,7 @@ GNUNET_CRYPTO_hash (const void *block, size_t size, struct GNUNET_HashCode * ret
491 512
492 513
493/** 514/**
515 * @ingroup hash
494 * Compute short (256-bit) hash of a given block. 516 * Compute short (256-bit) hash of a given block.
495 * 517 *
496 * @param block the data to hash 518 * @param block the data to hash
@@ -503,6 +525,7 @@ GNUNET_CRYPTO_short_hash (const void *block, size_t size,
503 525
504 526
505/** 527/**
528 * @ingroup hash
506 * Double short (256-bit) hash to create a long hash. 529 * Double short (256-bit) hash to create a long hash.
507 * 530 *
508 * @param sh short hash to double 531 * @param sh short hash to double
@@ -514,6 +537,7 @@ GNUNET_CRYPTO_short_hash_double (const struct GNUNET_CRYPTO_ShortHashCode *sh,
514 537
515 538
516/** 539/**
540 * @ingroup hash
517 * Truncate doubled short hash back to a short hash. 541 * Truncate doubled short hash back to a short hash.
518 * 542 *
519 * @param dh doubled short hash to reduce again 543 * @param dh doubled short hash to reduce again
@@ -527,6 +551,7 @@ GNUNET_CRYPTO_short_hash_from_truncation (const struct GNUNET_HashCode *dh,
527 551
528 552
529/** 553/**
554 * @ingroup hash
530 * Calculate HMAC of a message (RFC 2104) 555 * Calculate HMAC of a message (RFC 2104)
531 * 556 *
532 * @param key secret key 557 * @param key secret key
@@ -557,7 +582,9 @@ typedef void (*GNUNET_CRYPTO_HashCompletedCallback) (void *cls,
557 */ 582 */
558struct GNUNET_CRYPTO_FileHashContext; 583struct GNUNET_CRYPTO_FileHashContext;
559 584
585
560/** 586/**
587 * @ingroup hash
561 * Compute the hash of an entire file. 588 * Compute the hash of an entire file.
562 * 589 *
563 * @param priority scheduling priority to use 590 * @param priority scheduling priority to use
@@ -584,6 +611,7 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
584 611
585 612
586/** 613/**
614 * @ingroup hash
587 * Create a random hash code. 615 * Create a random hash code.
588 * 616 *
589 * @param mode desired quality level 617 * @param mode desired quality level
@@ -595,6 +623,7 @@ GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
595 623
596 624
597/** 625/**
626 * @ingroup hash
598 * compute result(delta) = b - a 627 * compute result(delta) = b - a
599 * 628 *
600 * @param a some hash code 629 * @param a some hash code
@@ -608,6 +637,7 @@ GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode * a,
608 637
609 638
610/** 639/**
640 * @ingroup hash
611 * compute result(b) = a + delta 641 * compute result(b) = a + delta
612 * 642 *
613 * @param a some hash code 643 * @param a some hash code
@@ -621,6 +651,7 @@ GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode * a,
621 651
622 652
623/** 653/**
654 * @ingroup hash
624 * compute result = a ^ b 655 * compute result = a ^ b
625 * 656 *
626 * @param a some hash code 657 * @param a some hash code
@@ -633,6 +664,7 @@ GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode * a, const struct GNUNET_Ha
633 664
634 665
635/** 666/**
667 * @ingroup hash
636 * Convert a hashcode into a key. 668 * Convert a hashcode into a key.
637 * 669 *
638 * @param hc hash code that serves to generate the key 670 * @param hc hash code that serves to generate the key
@@ -647,6 +679,7 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc,
647 679
648 680
649/** 681/**
682 * @ingroup hash
650 * Obtain a bit from a hashcode. 683 * Obtain a bit from a hashcode.
651 * 684 *
652 * @param code the GNUNET_CRYPTO_hash to index bit-wise 685 * @param code the GNUNET_CRYPTO_hash to index bit-wise
@@ -658,6 +691,7 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode * code, unsigned int bi
658 691
659 692
660/** 693/**
694 * @ingroup hash
661 * Determine how many low order bits match in two 695 * Determine how many low order bits match in two
662 * struct GNUNET_HashCodes. i.e. - 010011 and 011111 share 696 * struct GNUNET_HashCodes. i.e. - 010011 and 011111 share
663 * the first two lowest order bits, and therefore the 697 * the first two lowest order bits, and therefore the
@@ -674,6 +708,7 @@ GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode * first,
674 708
675 709
676/** 710/**
711 * @ingroup hash
677 * Compare function for HashCodes, producing a total ordering 712 * Compare function for HashCodes, producing a total ordering
678 * of all hashcodes. 713 * of all hashcodes.
679 * 714 *
@@ -686,6 +721,7 @@ GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode * h1, const struct GNUNET_H
686 721
687 722
688/** 723/**
724 * @ingroup hash
689 * Find out which of the two GNUNET_CRYPTO_hash codes is closer to target 725 * Find out which of the two GNUNET_CRYPTO_hash codes is closer to target
690 * in the XOR metric (Kademlia). 726 * in the XOR metric (Kademlia).
691 * 727 *
@@ -701,6 +737,7 @@ GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode * h1,
701 737
702 738
703/** 739/**
740 * @ingroup hash
704 * @brief Derive an authentication key 741 * @brief Derive an authentication key
705 * @param key authentication key 742 * @param key authentication key
706 * @param rkey root key 743 * @param rkey root key
@@ -716,6 +753,7 @@ GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key,
716 753
717 754
718/** 755/**
756 * @ingroup hash
719 * @brief Derive an authentication key 757 * @brief Derive an authentication key
720 * @param key authentication key 758 * @param key authentication key
721 * @param rkey root key 759 * @param rkey root key
@@ -730,6 +768,7 @@ GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
730 768
731 769
732/** 770/**
771 * @ingroup hash
733 * @brief Derive key 772 * @brief Derive key
734 * @param result buffer for the derived key, allocated by caller 773 * @param result buffer for the derived key, allocated by caller
735 * @param out_len desired length of the derived key 774 * @param out_len desired length of the derived key
@@ -749,6 +788,7 @@ GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
749 788
750 789
751/** 790/**
791 * @ingroup hash
752 * @brief Derive key 792 * @brief Derive key
753 * @param result buffer for the derived key, allocated by caller 793 * @param result buffer for the derived key, allocated by caller
754 * @param out_len desired length of the derived key 794 * @param out_len desired length of the derived key
@@ -785,6 +825,7 @@ GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
785 825
786 826
787/** 827/**
828 * @ingroup hash
788 * @brief Derive key 829 * @brief Derive key
789 * @param result buffer for the derived key, allocated by caller 830 * @param result buffer for the derived key, allocated by caller
790 * @param out_len desired length of the derived key 831 * @param out_len desired length of the derived key
@@ -813,6 +854,7 @@ typedef void (*GNUNET_CRYPTO_EccKeyCallback)(void *cls,
813 854
814 855
815/** 856/**
857 * @ingroup crypto
816 * Free memory occupied by ECC key 858 * Free memory occupied by ECC key
817 * 859 *
818 * @param priv pointer to the memory to free 860 * @param priv pointer to the memory to free
@@ -822,6 +864,7 @@ GNUNET_CRYPTO_ecc_key_free (struct GNUNET_CRYPTO_EccPrivateKey *priv);
822 864
823 865
824/** 866/**
867 * @ingroup crypto
825 * Extract the public key for the given private key. 868 * Extract the public key for the given private key.
826 * 869 *
827 * @param priv the private key 870 * @param priv the private key
@@ -857,6 +900,7 @@ GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc,
857 900
858 901
859/** 902/**
903 * @ingroup crypto
860 * Create a new private key by reading it from a file. If the 904 * Create a new private key by reading it from a file. If the
861 * files does not exist, create a new key and write it to the 905 * files does not exist, create a new key and write it to the
862 * file. Caller must free return value. Note that this function 906 * file. Caller must free return value. Note that this function
@@ -875,6 +919,7 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename);
875 919
876 920
877/** 921/**
922 * @ingroup crypto
878 * Create a new private key by reading our peer's key from 923 * Create a new private key by reading our peer's key from
879 * the file specified in the configuration. 924 * the file specified in the configuration.
880 * 925 *
@@ -886,6 +931,7 @@ GNUNET_CRYPTO_ecc_key_create_from_configuration (const struct GNUNET_CONFIGURATI
886 931
887 932
888/** 933/**
934 * @ingroup crypto
889 * Create a new private key. Caller must free return value. 935 * Create a new private key. Caller must free return value.
890 * 936 *
891 * @return fresh private key 937 * @return fresh private key
@@ -895,6 +941,7 @@ GNUNET_CRYPTO_ecc_key_create (void);
895 941
896 942
897/** 943/**
944 * @ingroup crypto
898 * Get the shared private key we use for anonymous users. 945 * Get the shared private key we use for anonymous users.
899 * 946 *
900 * @return "anonymous" private key 947 * @return "anonymous" private key
@@ -904,6 +951,7 @@ GNUNET_CRYPTO_ecc_key_get_anonymous (void);
904 951
905 952
906/** 953/**
954 * @ingroup crypto
907 * Setup a hostkey file for a peer given the name of the 955 * Setup a hostkey file for a peer given the name of the
908 * configuration file (!). This function is used so that 956 * configuration file (!). This function is used so that
909 * at a later point code can be certain that reading a 957 * at a later point code can be certain that reading a
@@ -916,6 +964,7 @@ GNUNET_CRYPTO_ecc_setup_hostkey (const char *cfg_name);
916 964
917 965
918/** 966/**
967 * @ingroup crypto
919 * Retrieve the identity of the host's peer. 968 * Retrieve the identity of the host's peer.
920 * 969 *
921 * @param cfg configuration to use 970 * @param cfg configuration to use
@@ -929,6 +978,7 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
929 978
930 979
931/** 980/**
981 * @ingroup crypto
932 * Derive key material from a public and a private ECC key. 982 * Derive key material from a public and a private ECC key.
933 * 983 *
934 * @param priv private key to use for the ECDH (x) 984 * @param priv private key to use for the ECDH (x)
@@ -943,6 +993,7 @@ GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
943 993
944 994
945/** 995/**
996 * @ingroup crypto
946 * Sign a given block. 997 * Sign a given block.
947 * 998 *
948 * @param priv private key to use for the signing 999 * @param priv private key to use for the signing
@@ -957,6 +1008,7 @@ GNUNET_CRYPTO_ecc_sign (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
957 1008
958 1009
959/** 1010/**
1011 * @ingroup crypto
960 * Verify signature. 1012 * Verify signature.
961 * 1013 *
962 * @param purpose what is the purpose that the signature should have? 1014 * @param purpose what is the purpose that the signature should have?
@@ -974,6 +1026,7 @@ GNUNET_CRYPTO_ecc_verify (uint32_t purpose,
974 1026
975 1027
976/** 1028/**
1029 * @ingroup crypto
977 * Derive a private key from a given private key and a label. 1030 * Derive a private key from a given private key and a label.
978 * Essentially calculates a private key 'h = H(l,P) * d mod n' 1031 * Essentially calculates a private key 'h = H(l,P) * d mod n'
979 * where n is the size of the ECC group and P is the public 1032 * where n is the size of the ECC group and P is the public
@@ -992,6 +1045,7 @@ GNUNET_CRYPTO_ecc_key_derive (const struct GNUNET_CRYPTO_EccPrivateKey *priv,
992 1045
993 1046
994/** 1047/**
1048 * @ingroup crypto
995 * Derive a public key from a given public key and a label. 1049 * Derive a public key from a given public key and a label.
996 * Essentially calculates a public key 'V = H(l,P) * P'. 1050 * Essentially calculates a public key 'V = H(l,P) * P'.
997 * 1051 *
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 46ef5847b..53a212dd3 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -22,6 +22,8 @@
22 * @file include/gnunet_dht_service.h 22 * @file include/gnunet_dht_service.h
23 * @brief API to the DHT service 23 * @brief API to the DHT service
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @defgroup dht Distributed Hash Table
26 * @{
25 */ 27 */
26 28
27#ifndef GNUNET_DHT_SERVICE_H 29#ifndef GNUNET_DHT_SERVICE_H
@@ -396,6 +398,8 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle);
396} 398}
397#endif 399#endif
398 400
401/** @} */ /* end of group dht */
402
399 403
400#endif 404#endif
401/* gnunet_dht_service.h */ 405/* gnunet_dht_service.h */
diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h
index e934b0fe0..b3a1c009d 100644
--- a/src/include/gnunet_protocols.h
+++ b/src/include/gnunet_protocols.h
@@ -22,6 +22,8 @@
22 * @file include/gnunet_protocols.h 22 * @file include/gnunet_protocols.h
23 * @brief constants for network protocols 23 * @brief constants for network protocols
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @defgroup protocols Types of messages used in GNUnet
26 * @{
25 */ 27 */
26 28
27/******************************************************************************* 29/*******************************************************************************
@@ -1972,6 +1974,8 @@ extern "C"
1972} 1974}
1973#endif 1975#endif
1974 1976
1977/** @} */ /* end of group protocols */
1978
1975/* ifndef GNUNET_PROTOCOLS_H */ 1979/* ifndef GNUNET_PROTOCOLS_H */
1976#endif 1980#endif
1977/* end of gnunet_protocols.h */ 1981/* end of gnunet_protocols.h */
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index c482a000c..110c0ce77 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -22,6 +22,8 @@
22 * @file include/gnunet_scheduler_lib.h 22 * @file include/gnunet_scheduler_lib.h
23 * @brief API to schedule computations using continuation passing style 23 * @brief API to schedule computations using continuation passing style
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @defgroup scheduler Event loop (scheduler)
26 * @{
25 */ 27 */
26 28
27#ifndef GNUNET_SCHEDULER_LIB_H 29#ifndef GNUNET_SCHEDULER_LIB_H
@@ -198,29 +200,29 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
198 200
199/** 201/**
200 * Signature of the select function used by the scheduler. 202 * Signature of the select function used by the scheduler.
201 * GNUNET_NETWORK_socket_select matches it. 203 * #GNUNET_NETWORK_socket_select matches it.
202 * 204 *
203 * @param cls closure 205 * @param cls closure
204 * @param rfds set of sockets to be checked for readability 206 * @param rfds set of sockets to be checked for readability
205 * @param wfds set of sockets to be checked for writability 207 * @param wfds set of sockets to be checked for writability
206 * @param efds set of sockets to be checked for exceptions 208 * @param efds set of sockets to be checked for exceptions
207 * @param timeout relative value when to return 209 * @param timeout relative value when to return
208 * @return number of selected sockets, GNUNET_SYSERR on error 210 * @return number of selected sockets, #GNUNET_SYSERR on error
209 */ 211 */
210typedef int (*GNUNET_SCHEDULER_select) (void *cls, 212typedef int (*GNUNET_SCHEDULER_select) (void *cls,
211 struct GNUNET_NETWORK_FDSet * rfds, 213 struct GNUNET_NETWORK_FDSet *rfds,
212 struct GNUNET_NETWORK_FDSet * wfds, 214 struct GNUNET_NETWORK_FDSet *wfds,
213 struct GNUNET_NETWORK_FDSet * efds, 215 struct GNUNET_NETWORK_FDSet *efds,
214 struct GNUNET_TIME_Relative timeout); 216 struct GNUNET_TIME_Relative timeout);
215 217
216 218
217/** 219/**
218 * Initialize and run scheduler. This function will return when all 220 * Initialize and run scheduler. This function will return when all
219 * tasks have completed. On systems with signals, receiving a SIGTERM 221 * tasks have completed. On systems with signals, receiving a SIGTERM
220 * (and other similar signals) will cause "GNUNET_SCHEDULER_shutdown" 222 * (and other similar signals) will cause #GNUNET_SCHEDULER_shutdown
221 * to be run after the active task is complete. As a result, SIGTERM 223 * to be run after the active task is complete. As a result, SIGTERM
222 * causes all active tasks to be scheduled with reason 224 * causes all active tasks to be scheduled with reason
223 * "GNUNET_SCHEDULER_REASON_SHUTDOWN". (However, tasks added 225 * #GNUNET_SCHEDULER_REASON_SHUTDOWN. (However, tasks added
224 * afterwards will execute normally!). Note that any particular 226 * afterwards will execute normally!). Note that any particular
225 * signal will only shut down one scheduler; applications should 227 * signal will only shut down one scheduler; applications should
226 * always only create a single scheduler. 228 * always only create a single scheduler.
@@ -249,7 +251,7 @@ GNUNET_SCHEDULER_shutdown (void);
249 * dropped (if the decision should be made based on the number of 251 * dropped (if the decision should be made based on the number of
250 * tasks ready to run). 252 * tasks ready to run).
251 * 253 *
252 * * @param p priority-level to query, use KEEP to query the level 254 * @param p priority-level to query, use KEEP to query the level
253 * of the current task, use COUNT to get the sum over 255 * of the current task, use COUNT to get the sum over
254 * all priority levels 256 * all priority levels
255 * @return number of tasks pending right now 257 * @return number of tasks pending right now
@@ -263,7 +265,7 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p);
263 * started. Will return the same value as 265 * started. Will return the same value as
264 * the GNUNET_SCHEDULER_TaskContext's reason field. 266 * the GNUNET_SCHEDULER_TaskContext's reason field.
265 * 267 *
266 * * @return reason(s) why the current task is run 268 * @return reason(s) why the current task is run
267 */ 269 */
268enum GNUNET_SCHEDULER_Reason 270enum GNUNET_SCHEDULER_Reason
269GNUNET_SCHEDULER_get_reason (void); 271GNUNET_SCHEDULER_get_reason (void);
@@ -273,7 +275,7 @@ GNUNET_SCHEDULER_get_reason (void);
273 * Cancel the task with the specified identifier. 275 * Cancel the task with the specified identifier.
274 * The task must not yet have run. 276 * The task must not yet have run.
275 * 277 *
276 * * @param task id of the task to cancel 278 * @param task id of the task to cancel
277 * @return the closure of the callback of the cancelled task 279 * @return the closure of the callback of the cancelled task
278 */ 280 */
279void * 281void *
@@ -285,7 +287,7 @@ GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
285 * similar to the other "add" functions except that there is no delay 287 * similar to the other "add" functions except that there is no delay
286 * and the reason code can be specified. 288 * and the reason code can be specified.
287 * 289 *
288 * * @param task main function of the task 290 * @param task main function of the task
289 * @param task_cls closure of task 291 * @param task_cls closure of task
290 * @param reason reason for task invocation 292 * @param reason reason for task invocation
291 */ 293 */
@@ -300,7 +302,7 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
300 * and the reason code can be specified. 302 * and the reason code can be specified.
301 * 303 *
302 * @param task main function of the task 304 * @param task main function of the task
303 * @param task_cls closure for 'main' 305 * @param task_cls closure for @a task
304 * @param reason reason for task invocation 306 * @param reason reason for task invocation
305 * @param priority priority to use for the task 307 * @param priority priority to use for the task
306 */ 308 */
@@ -313,11 +315,11 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
313/** 315/**
314 * Schedule a new task to be run with a specified priority. 316 * Schedule a new task to be run with a specified priority.
315 * 317 *
316 * * @param prio how important is the new task? 318 * @param prio how important is the new task?
317 * @param task main function of the task 319 * @param task main function of the task
318 * @param task_cls closure of task 320 * @param task_cls closure of @a task
319 * @return unique task identifier for the job 321 * @return unique task identifier for the job
320 * only valid until "task" is started! 322 * only valid until @a task is started!
321 */ 323 */
322GNUNET_SCHEDULER_TaskIdentifier 324GNUNET_SCHEDULER_TaskIdentifier
323GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, 325GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
@@ -328,10 +330,10 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
328 * Schedule a new task to be run as soon as possible. The task 330 * Schedule a new task to be run as soon as possible. The task
329 * will be run with the DEFAULT priority. 331 * will be run with the DEFAULT priority.
330 * 332 *
331 * * @param task main function of the task 333 * @param task main function of the task
332 * @param task_cls closure of task 334 * @param task_cls closure of @a task
333 * @return unique task identifier for the job 335 * @return unique task identifier for the job
334 * only valid until "task" is started! 336 * only valid until @a task is started!
335 */ 337 */
336GNUNET_SCHEDULER_TaskIdentifier 338GNUNET_SCHEDULER_TaskIdentifier
337GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); 339GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
@@ -345,11 +347,11 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
345 * not count for the 'lifeness' of the process. This API is only 347 * not count for the 'lifeness' of the process. This API is only
346 * useful in a few special cases. 348 * useful in a few special cases.
347 * 349 *
348 * @param lifeness GNUNET_YES if the task counts for lifeness, GNUNET_NO if not. 350 * @param lifeness #GNUNET_YES if the task counts for lifeness, #GNUNET_NO if not.
349 * @param task main function of the task 351 * @param task main function of the task
350 * @param task_cls closure of task 352 * @param task_cls closure of @a task
351 * @return unique task identifier for the job 353 * @return unique task identifier for the job
352 * only valid until "task" is started! 354 * only valid until @a task is started!
353 */ 355 */
354GNUNET_SCHEDULER_TaskIdentifier 356GNUNET_SCHEDULER_TaskIdentifier
355GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, 357GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
@@ -363,11 +365,11 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
363 * will be run with the DEFAULT priority. 365 * will be run with the DEFAULT priority.
364 * 366 *
365 * * @param delay when should this operation time out? Use 367 * * @param delay when should this operation time out? Use
366 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 368 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
367 * @param task main function of the task 369 * @param task main function of the task
368 * @param task_cls closure of task 370 * @param task_cls closure of @a task
369 * @return unique task identifier for the job 371 * @return unique task identifier for the job
370 * only valid until "task" is started! 372 * only valid until @a task is started!
371 */ 373 */
372GNUNET_SCHEDULER_TaskIdentifier 374GNUNET_SCHEDULER_TaskIdentifier
373GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, 375GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
@@ -379,12 +381,12 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
379 * will be scheduled for execution once the delay has expired. 381 * will be scheduled for execution once the delay has expired.
380 * 382 *
381 * @param delay when should this operation time out? Use 383 * @param delay when should this operation time out? Use
382 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 384 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
383 * @param priority priority to use for the task 385 * @param priority priority to use for the task
384 * @param task main function of the task 386 * @param task main function of the task
385 * @param task_cls closure of task 387 * @param task_cls closure of @a task
386 * @return unique task identifier for the job 388 * @return unique task identifier for the job
387 * only valid until "task" is started! 389 * only valid until @a task is started!
388 */ 390 */
389GNUNET_SCHEDULER_TaskIdentifier 391GNUNET_SCHEDULER_TaskIdentifier
390GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, 392GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
@@ -400,12 +402,12 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
400 * socket operation is ready. It will be run with the DEFAULT priority. 402 * socket operation is ready. It will be run with the DEFAULT priority.
401 * 403 *
402 * * @param delay when should this operation time out? Use 404 * * @param delay when should this operation time out? Use
403 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 405 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
404 * @param rfd read file-descriptor 406 * @param rfd read file-descriptor
405 * @param task main function of the task 407 * @param task main function of the task
406 * @param task_cls closure of task 408 * @param task_cls closure of @a task
407 * @return unique task identifier for the job 409 * @return unique task identifier for the job
408 * only valid until "task" is started! 410 * only valid until @a task is started!
409 */ 411 */
410GNUNET_SCHEDULER_TaskIdentifier 412GNUNET_SCHEDULER_TaskIdentifier
411GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, 413GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
@@ -422,13 +424,13 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
422 * will be run with the DEFAULT priority. 424 * will be run with the DEFAULT priority.
423 * 425 *
424 * @param delay when should this operation time out? Use 426 * @param delay when should this operation time out? Use
425 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 427 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
426 * @param priority priority to use for the task 428 * @param priority priority to use for the task
427 * @param rfd read file-descriptor 429 * @param rfd read file-descriptor
428 * @param task main function of the task 430 * @param task main function of the task
429 * @param task_cls closure of task 431 * @param task_cls closure of @a task
430 * @return unique task identifier for the job 432 * @return unique task identifier for the job
431 * only valid until "task" is started! 433 * only valid until @a task is started!
432 */ 434 */
433GNUNET_SCHEDULER_TaskIdentifier 435GNUNET_SCHEDULER_TaskIdentifier
434GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, 436GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
@@ -445,12 +447,12 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
445 * socket operation is ready. It will be run with the DEFAULT priority. 447 * socket operation is ready. It will be run with the DEFAULT priority.
446 * 448 *
447 * * @param delay when should this operation time out? Use 449 * * @param delay when should this operation time out? Use
448 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 450 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
449 * @param wfd write file-descriptor 451 * @param wfd write file-descriptor
450 * @param task main function of the task 452 * @param task main function of the task
451 * @param task_cls closure of task 453 * @param task_cls closure of @a task
452 * @return unique task identifier for the job 454 * @return unique task identifier for the job
453 * only valid until "task" is started! 455 * only valid until @a task is started!
454 */ 456 */
455GNUNET_SCHEDULER_TaskIdentifier 457GNUNET_SCHEDULER_TaskIdentifier
456GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, 458GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
@@ -466,10 +468,10 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
466 * socket operation is ready. It will be run with the DEFAULT priority. 468 * socket operation is ready. It will be run with the DEFAULT priority.
467 * 469 *
468 * * @param delay when should this operation time out? Use 470 * * @param delay when should this operation time out? Use
469 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 471 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
470 * @param rfd read file-descriptor 472 * @param rfd read file-descriptor
471 * @param task main function of the task 473 * @param task main function of the task
472 * @param task_cls closure of task 474 * @param task_cls closure of @a task
473 * @return unique task identifier for the job 475 * @return unique task identifier for the job
474 * only valid until "task" is started! 476 * only valid until "task" is started!
475 */ 477 */
@@ -487,12 +489,12 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
487 * socket operation is ready. It will be run with the DEFAULT priority. 489 * socket operation is ready. It will be run with the DEFAULT priority.
488 * 490 *
489 * * @param delay when should this operation time out? Use 491 * * @param delay when should this operation time out? Use
490 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 492 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
491 * @param wfd write file-descriptor 493 * @param wfd write file-descriptor
492 * @param task main function of the task 494 * @param task main function of the task
493 * @param task_cls closure of task 495 * @param task_cls closure of @a task
494 * @return unique task identifier for the job 496 * @return unique task identifier for the job
495 * only valid until "task" is started! 497 * only valid until @a task is started!
496 */ 498 */
497GNUNET_SCHEDULER_TaskIdentifier 499GNUNET_SCHEDULER_TaskIdentifier
498GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, 500GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
@@ -518,12 +520,12 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
518 * </code> 520 * </code>
519 * 521 *
520 * @param prio how important is this task? 522 * @param prio how important is this task?
521 * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever", 523 * @param delay how long should we wait? Use #GNUNET_TIME_UNIT_FOREVER_REL for "forever",
522 * which means that the task will only be run after we receive SIGTERM 524 * which means that the task will only be run after we receive SIGTERM
523 * @param rs set of file descriptors we want to read (can be NULL) 525 * @param rs set of file descriptors we want to read (can be NULL)
524 * @param ws set of file descriptors we want to write (can be NULL) 526 * @param ws set of file descriptors we want to write (can be NULL)
525 * @param task main function of the task 527 * @param task main function of the task
526 * @param task_cls closure of task 528 * @param task_cls closure of @a task
527 * @return unique task identifier for the job 529 * @return unique task identifier for the job
528 * only valid until "task" is started! 530 * only valid until "task" is started!
529 */ 531 */
@@ -545,6 +547,8 @@ GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select,
545 void *new_select_cls); 547 void *new_select_cls);
546 548
547 549
550/** @} */ /* end of group scheduler */
551
548#if 0 /* keep Emacsens' auto-indent happy */ 552#if 0 /* keep Emacsens' auto-indent happy */
549{ 553{
550#endif 554#endif
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index 298f3284a..a739d6d7f 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -21,8 +21,9 @@
21/** 21/**
22 * @file include/gnunet_time_lib.h 22 * @file include/gnunet_time_lib.h
23 * @brief functions related to time 23 * @brief functions related to time
24 *
25 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @defgroup time Time and time calculations
26 * @{
26 */ 27 */
27 28
28#ifndef GNUNET_TIME_LIB_H 29#ifndef GNUNET_TIME_LIB_H
@@ -493,6 +494,9 @@ GNUNET_TIME_get_offset (void);
493} 494}
494#endif 495#endif
495 496
497/** @} */ /* end of group time */
498
499
496/* ifndef GNUNET_TIME_LIB_H */ 500/* ifndef GNUNET_TIME_LIB_H */
497#endif 501#endif
498/* end of gnunet_time_lib.h */ 502/* end of gnunet_time_lib.h */