aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-30 19:24:12 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-30 19:24:12 +0000
commit427dd6f998fb1fde515a3b5c800f9f6d308197b2 (patch)
tree8cbe9bf7b43fafae07ed1a25753ccccdbe430148 /src
parentb18fa7b1e7fcb4d48e2ef314a7d822ccddd8bd60 (diff)
downloadgnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.tar.gz
gnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.zip
-towards addressing #3047, note this causes the code to FTBFS
Diffstat (limited to 'src')
-rw-r--r--src/arm/arm_api.c2
-rw-r--r--src/arm/mockup-service.c7
-rw-r--r--src/hello/hello.c10
-rw-r--r--src/include/gnunet_arm_service.h5
-rw-r--r--src/include/gnunet_client_lib.h5
-rw-r--r--src/include/gnunet_common.h70
-rw-r--r--src/include/gnunet_configuration_lib.h3
-rw-r--r--src/include/gnunet_crypto_lib.h31
-rw-r--r--src/include/gnunet_hello_lib.h3
-rw-r--r--src/include/gnunet_strings_lib.h4
-rw-r--r--src/include/gnunet_util_lib.h4
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c50
-rw-r--r--src/peerinfo/peerinfo_api.c7
-rw-r--r--src/peerinfo/peerinfo_api_notify.c3
-rw-r--r--src/statistics/gnunet-statistics.c2
-rw-r--r--src/statistics/statistics_api.c5
-rw-r--r--src/testing/testing.c7
-rw-r--r--src/util/Makefile.am2
-rw-r--r--src/util/common_allocation.c2
-rw-r--r--src/util/common_endian.c2
-rw-r--r--src/util/common_logging.c27
-rw-r--r--src/util/configuration.c3
-rw-r--r--src/util/connection.c2
-rw-r--r--src/util/container_bloomfilter.c4
-rw-r--r--src/util/container_meta_data.c5
-rw-r--r--src/util/container_multihashmap.c4
-rw-r--r--src/util/container_multihashmap32.c4
-rw-r--r--src/util/container_multipeermap.c4
-rw-r--r--src/util/crypto_crc.c3
-rw-r--r--src/util/crypto_ecc.c5
-rw-r--r--src/util/crypto_hash.c5
-rw-r--r--src/util/crypto_random.c4
-rw-r--r--src/util/crypto_symmetric.c3
-rw-r--r--src/util/disk.c6
-rw-r--r--src/util/disk.h6
-rw-r--r--src/util/getopt.c4
-rw-r--r--src/util/getopt_helpers.c2
-rw-r--r--src/util/gnunet-ecc.c11
-rw-r--r--src/util/mq.c2
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_installation.c6
-rw-r--r--src/util/os_network.c4
-rw-r--r--src/util/os_priority.c6
-rw-r--r--src/util/peer.c23
-rw-r--r--src/util/plugin.c4
-rw-r--r--src/util/program.c10
-rw-r--r--src/util/scheduler.c6
-rw-r--r--src/util/server.c1
-rw-r--r--src/util/server_mst.c6
-rw-r--r--src/util/server_nc.c7
-rw-r--r--src/util/server_tc.c6
-rw-r--r--src/util/service.c11
-rw-r--r--src/util/signal.c3
-rw-r--r--src/util/strings.c3
-rw-r--r--src/util/test_client.c7
-rw-r--r--src/util/test_common_allocation.c2
-rw-r--r--src/util/test_common_endian.c2
-rw-r--r--src/util/test_common_logging.c2
-rw-r--r--src/util/test_common_logging_dummy.c4
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c6
-rw-r--r--src/util/test_configuration.c4
-rw-r--r--src/util/test_connection.c5
-rw-r--r--src/util/test_connection_addressing.c5
-rw-r--r--src/util/test_connection_receive_cancel.c5
-rw-r--r--src/util/test_connection_timeout.c5
-rw-r--r--src/util/test_connection_timeout_no_connect.c5
-rw-r--r--src/util/test_connection_transmit_cancel.c5
-rw-r--r--src/util/test_container_bloomfilter.c3
-rw-r--r--src/util/test_container_heap.c3
-rw-r--r--src/util/test_container_meta_data.c3
-rw-r--r--src/util/test_container_multihashmap.c3
-rw-r--r--src/util/test_container_multihashmap32.c3
-rw-r--r--src/util/test_container_multipeermap.c3
-rw-r--r--src/util/test_container_slist.c3
-rw-r--r--src/util/test_crypto_crc.c3
-rw-r--r--src/util/test_crypto_hash.c4
-rw-r--r--src/util/test_crypto_random.c3
-rw-r--r--src/util/test_crypto_symmetric.c3
-rw-r--r--src/util/test_disk.c4
-rw-r--r--src/util/test_getopt.c4
-rw-r--r--src/util/test_mq_client.c1
-rw-r--r--src/util/test_os_network.c4
-rw-r--r--src/util/test_os_start_process.c6
-rw-r--r--src/util/test_peer.c9
-rw-r--r--src/util/test_plugin.c2
-rw-r--r--src/util/test_program.c5
-rw-r--r--src/util/test_scheduler.c5
-rw-r--r--src/util/test_server.c6
-rw-r--r--src/util/test_server_disconnect.c6
-rw-r--r--src/util/test_server_mst_interrupt.c6
-rw-r--r--src/util/test_server_with_client.c6
-rw-r--r--src/util/test_server_with_client_unix.c6
-rw-r--r--src/util/test_service.c8
-rw-r--r--src/util/test_strings.c3
-rw-r--r--src/util/test_strings_to_data.c4
-rw-r--r--src/util/time.c2
96 files changed, 213 insertions, 391 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 116b3a517..f844551e4 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -25,8 +25,8 @@
25 * @author LRN 25 * @author LRN
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_arm_service.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_arm_service.h"
30#include "gnunet_protocols.h" 30#include "gnunet_protocols.h"
31#include "arm.h" 31#include "arm.h"
32 32
diff --git a/src/arm/mockup-service.c b/src/arm/mockup-service.c
index 2e021627e..d525dfbd9 100644
--- a/src/arm/mockup-service.c
+++ b/src/arm/mockup-service.c
@@ -20,13 +20,8 @@
20 20
21#include <stdlib.h> 21#include <stdlib.h>
22#include "platform.h" 22#include "platform.h"
23#include "gnunet_disk_lib.h" 23#include "gnunet_util_lib.h"
24#include "gnunet_getopt_lib.h"
25#include "gnunet_protocols.h" 24#include "gnunet_protocols.h"
26#include "gnunet_service_lib.h"
27#include "gnunet_statistics_service.h"
28#include "gnunet_strings_lib.h"
29#include "gnunet_time_lib.h"
30 25
31 26
32static int special_ret = 0; 27static int special_ret = 0;
diff --git a/src/hello/hello.c b/src/hello/hello.c
index 53003e296..9e246d473 100644
--- a/src/hello/hello.c
+++ b/src/hello/hello.c
@@ -296,9 +296,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
296 insize = msize - sizeof (struct GNUNET_HELLO_Message); 296 insize = msize - sizeof (struct GNUNET_HELLO_Message);
297 wpos = 0; 297 wpos = 0;
298 woff = (ret != NULL) ? (char *) &ret[1] : NULL; 298 woff = (ret != NULL) ? (char *) &ret[1] : NULL;
299 GNUNET_CRYPTO_hash (&msg->publicKey, 299 address.peer.public_key = msg->publicKey;
300 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
301 &address.peer.hashPubKey);
302 while (insize > 0) 300 while (insize > 0)
303 { 301 {
304 esize = get_hello_address_size (inptr, insize, &alen); 302 esize = get_hello_address_size (inptr, insize, &alen);
@@ -549,7 +547,7 @@ GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello,
549 * 547 *
550 * @param hello the hello message 548 * @param hello the hello message
551 * @param peer where to store the peer's identity 549 * @param peer where to store the peer's identity
552 * @return GNUNET_SYSERR if the HELLO was malformed 550 * @return #GNUNET_SYSERR if the HELLO was malformed
553 */ 551 */
554int 552int
555GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, 553GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
@@ -560,9 +558,7 @@ GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
560 if ((ret < sizeof (struct GNUNET_HELLO_Message)) || 558 if ((ret < sizeof (struct GNUNET_HELLO_Message)) ||
561 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO)) 559 (ntohs (hello->header.type) != GNUNET_MESSAGE_TYPE_HELLO))
562 return GNUNET_SYSERR; 560 return GNUNET_SYSERR;
563 GNUNET_CRYPTO_hash (&hello->publicKey, 561 peer->public_key = hello->publicKey;
564 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
565 &peer->hashPubKey);
566 return GNUNET_OK; 562 return GNUNET_OK;
567} 563}
568 564
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h
index a6244b5bc..7c35b0b20 100644
--- a/src/include/gnunet_arm_service.h
+++ b/src/include/gnunet_arm_service.h
@@ -35,10 +35,7 @@ extern "C"
35#endif 35#endif
36#endif 36#endif
37 37
38#include "gnunet_configuration_lib.h" 38#include "gnunet_util_lib.h"
39#include "gnunet_scheduler_lib.h"
40#include "gnunet_os_lib.h"
41#include "gnunet_time_lib.h"
42 39
43/** 40/**
44 * Version of the arm API. 41 * Version of the arm API.
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h
index d6eaca56a..e4cdd26cc 100644
--- a/src/include/gnunet_client_lib.h
+++ b/src/include/gnunet_client_lib.h
@@ -37,11 +37,6 @@ extern "C"
37#endif 37#endif
38#endif 38#endif
39 39
40#include "gnunet_common.h"
41#include "gnunet_configuration_lib.h"
42#include "gnunet_connection_lib.h"
43#include "gnunet_scheduler_lib.h"
44#include "gnunet_time_lib.h"
45 40
46/** 41/**
47 * Opaque handle for a connection to a service. 42 * Opaque handle for a connection to a service.
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 6c27b88a3..ab639122c 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -248,24 +248,6 @@ struct GNUNET_MessageHeader
248 248
249}; 249};
250 250
251
252/**
253 * @brief A SHA-512 hashcode
254 */
255struct GNUNET_HashCode
256{
257 uint32_t bits[512 / 8 / sizeof (uint32_t)]; /* = 16 */
258};
259
260
261/**
262 * The identity of the host (basically the SHA-512 hashcode of
263 * it's public key).
264 */
265struct GNUNET_PeerIdentity
266{
267 struct GNUNET_HashCode hashPubKey;
268};
269GNUNET_NETWORK_STRUCT_END 251GNUNET_NETWORK_STRUCT_END
270 252
271/** 253/**
@@ -273,9 +255,9 @@ GNUNET_NETWORK_STRUCT_END
273 * 255 *
274 * @param cls closure 256 * @param cls closure
275 * @param filename complete filename (absolute path) 257 * @param filename complete filename (absolute path)
276 * @return GNUNET_OK to continue to iterate, 258 * @return #GNUNET_OK to continue to iterate,
277 * GNUNET_NO to stop iteration with no error, 259 * #GNUNET_NO to stop iteration with no error,
278 * GNUNET_SYSERR to abort iteration with error! 260 * #GNUNET_SYSERR to abort iteration with error!
279 */ 261 */
280typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); 262typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename);
281 263
@@ -325,8 +307,10 @@ GNUNET_get_log_skip ();
325 307
326#if !defined(GNUNET_CULL_LOGGING) 308#if !defined(GNUNET_CULL_LOGGING)
327int 309int
328GNUNET_get_log_call_status (int caller_level, const char *comp, 310GNUNET_get_log_call_status (int caller_level,
329 const char *file, const char *function, int line); 311 const char *comp,
312 const char *file,
313 const char *function, int line);
330#endif 314#endif
331 315
332 316
@@ -529,7 +513,7 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc);
529 * 513 *
530 * @param pid the peer identity 514 * @param pid the peer identity
531 * @return string form of the pid; will be overwritten by next 515 * @return string form of the pid; will be overwritten by next
532 * call to GNUNET_i2s. 516 * call to #GNUNET_i2s.
533 */ 517 */
534const char * 518const char *
535GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); 519GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
@@ -543,7 +527,7 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
543 * 527 *
544 * @param pid the peer identity 528 * @param pid the peer identity
545 * @return string form of the pid; will be overwritten by next 529 * @return string form of the pid; will be overwritten by next
546 * call to GNUNET_i2s. 530 * call to #GNUNET_i2s.
547 */ 531 */
548const char * 532const char *
549GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid); 533GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
@@ -688,8 +672,8 @@ GNUNET_ntoh_double (double d);
688 672
689/** 673/**
690 * @ingroup memory 674 * @ingroup memory
691 * Allocate a struct or union of the given 'type'. 675 * Allocate a struct or union of the given @a type.
692 * Wrapper around GNUNET_malloc that returns a pointer 676 * Wrapper around #GNUNET_malloc that returns a pointer
693 * to the newly created object of the correct type. 677 * to the newly created object of the correct type.
694 * 678 *
695 * @param type name of the struct or union, i.e. pass 'struct Foo'. 679 * @param type name of the struct or union, i.e. pass 'struct Foo'.
@@ -741,17 +725,17 @@ GNUNET_ntoh_double (double d);
741 * @ingroup memory 725 * @ingroup memory
742 * Wrapper around free. Frees the memory referred to by ptr. 726 * Wrapper around free. Frees the memory referred to by ptr.
743 * Note that is is generally better to free memory that was 727 * Note that is is generally better to free memory that was
744 * allocated with GNUNET_array_grow using GNUNET_array_grow(mem, size, 0) instead of GNUNET_free. 728 * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free.
745 * 729 *
746 * @param ptr location where to free the memory. ptr must have 730 * @param ptr location where to free the memory. ptr must have
747 * been returned by GNUNET_strdup, GNUNET_strndup, GNUNET_malloc or GNUNET_array_grow earlier. 731 * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier.
748 */ 732 */
749#define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__) 733#define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__)
750 734
751/** 735/**
752 * @ingroup memory 736 * @ingroup memory
753 * Free the memory pointed to by ptr if ptr is not NULL. 737 * Free the memory pointed to by ptr if ptr is not NULL.
754 * Equivalent to if (ptr!=null)GNUNET_free(ptr). 738 * Equivalent to `if (NULL != ptr) GNUNET_free(ptr)`.
755 * 739 *
756 * @param ptr the location in memory to free 740 * @param ptr the location in memory to free
757 */ 741 */
@@ -759,7 +743,7 @@ GNUNET_ntoh_double (double d);
759 743
760/** 744/**
761 * @ingroup memory 745 * @ingroup memory
762 * Wrapper around GNUNET_strdup. Makes a copy of the zero-terminated string 746 * Wrapper around #GNUNET_xstrdup_. Makes a copy of the zero-terminated string
763 * pointed to by a. 747 * pointed to by a.
764 * 748 *
765 * @param a pointer to a zero-terminated string 749 * @param a pointer to a zero-terminated string
@@ -769,7 +753,7 @@ GNUNET_ntoh_double (double d);
769 753
770/** 754/**
771 * @ingroup memory 755 * @ingroup memory
772 * Wrapper around GNUNET_strndup. Makes a partial copy of the string 756 * Wrapper around #GNUNET_xstrndup_. Makes a partial copy of the string
773 * pointed to by a. 757 * pointed to by a.
774 * 758 *
775 * @param a pointer to a string 759 * @param a pointer to a string
@@ -781,8 +765,8 @@ GNUNET_ntoh_double (double d);
781/** 765/**
782 * @ingroup memory 766 * @ingroup memory
783 * Grow a well-typed (!) array. This is a convenience 767 * Grow a well-typed (!) array. This is a convenience
784 * method to grow a vector <tt>arr</tt> of size <tt>size</tt> 768 * method to grow a vector @a arr of size @a size
785 * to the new (target) size <tt>tsize</tt>. 769 * to the new (target) size @a tsize.
786 * <p> 770 * <p>
787 * 771 *
788 * Example (simple, well-typed stack): 772 * Example (simple, well-typed stack):
@@ -826,7 +810,7 @@ GNUNET_ntoh_double (double d);
826 * Like snprintf, just aborts if the buffer is of insufficient size. 810 * Like snprintf, just aborts if the buffer is of insufficient size.
827 * 811 *
828 * @param buf pointer to buffer that is written to 812 * @param buf pointer to buffer that is written to
829 * @param size number of bytes in buf 813 * @param size number of bytes in @a buf
830 * @param format format strings 814 * @param format format strings
831 * @param ... data for format string 815 * @param ... data for format string
832 * @return number of bytes written to buf or negative value on error 816 * @return number of bytes written to buf or negative value on error
@@ -853,7 +837,7 @@ GNUNET_asprintf (char **buf, const char *format, ...);
853/** 837/**
854 * Allocate memory. Checks the return value, aborts if no more 838 * Allocate memory. Checks the return value, aborts if no more
855 * memory is available. Don't use GNUNET_xmalloc_ directly. Use the 839 * memory is available. Don't use GNUNET_xmalloc_ directly. Use the
856 * GNUNET_malloc macro. 840 * #GNUNET_malloc macro.
857 * The memory will be zero'ed out. 841 * The memory will be zero'ed out.
858 * 842 *
859 * @param size number of bytes to allocate 843 * @param size number of bytes to allocate
@@ -868,7 +852,7 @@ GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
868/** 852/**
869 * Allocate and initialize memory. Checks the return value, aborts if no more 853 * Allocate and initialize memory. Checks the return value, aborts if no more
870 * memory is available. Don't use GNUNET_xmemdup_ directly. Use the 854 * memory is available. Don't use GNUNET_xmemdup_ directly. Use the
871 * GNUNET_memdup macro. 855 * #GNUNET_memdup macro.
872 * 856 *
873 * @param buf buffer to initialize from (must contain size bytes) 857 * @param buf buffer to initialize from (must contain size bytes)
874 * @param size number of bytes to allocate 858 * @param size number of bytes to allocate
@@ -885,7 +869,7 @@ GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename,
885 * Allocate memory. This function does not check if the allocation 869 * Allocate memory. This function does not check if the allocation
886 * request is within reasonable bounds, allowing allocations larger 870 * request is within reasonable bounds, allowing allocations larger
887 * than 40 MB. If you don't expect the possibility of very large 871 * than 40 MB. If you don't expect the possibility of very large
888 * allocations, use GNUNET_malloc instead. The memory will be zero'ed 872 * allocations, use #GNUNET_malloc instead. The memory will be zero'ed
889 * out. 873 * out.
890 * 874 *
891 * @param size number of bytes to allocate 875 * @param size number of bytes to allocate
@@ -896,6 +880,7 @@ GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename,
896void * 880void *
897GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); 881GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber);
898 882
883
899/** 884/**
900 * Reallocate memory. Checks the return value, aborts if no more 885 * Reallocate memory. Checks the return value, aborts if no more
901 * memory is available. 886 * memory is available.
@@ -903,10 +888,11 @@ GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber);
903void * 888void *
904GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); 889GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber);
905 890
891
906/** 892/**
907 * Free memory. Merely a wrapper for the case that we 893 * Free memory. Merely a wrapper for the case that we
908 * want to keep track of allocations. Don't use GNUNET_xfree_ 894 * want to keep track of allocations. Don't use GNUNET_xfree_
909 * directly. Use the GNUNET_free macro. 895 * directly. Use the #GNUNET_free macro.
910 * 896 *
911 * @param ptr pointer to memory to free 897 * @param ptr pointer to memory to free
912 * @param filename where is this call being made (for debugging) 898 * @param filename where is this call being made (for debugging)
@@ -917,7 +903,7 @@ GNUNET_xfree_ (void *ptr, const char *filename, int linenumber);
917 903
918 904
919/** 905/**
920 * Dup a string. Don't call GNUNET_xstrdup_ directly. Use the GNUNET_strdup macro. 906 * Dup a string. Don't call GNUNET_xstrdup_ directly. Use the #GNUNET_strdup macro.
921 * @param str string to duplicate 907 * @param str string to duplicate
922 * @param filename where is this call being made (for debugging) 908 * @param filename where is this call being made (for debugging)
923 * @param linenumber line where this call is being made (for debugging) 909 * @param linenumber line where this call is being made (for debugging)
@@ -927,7 +913,7 @@ char *
927GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); 913GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber);
928 914
929/** 915/**
930 * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. 916 * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the #GNUNET_strndup macro.
931 * 917 *
932 * @param str string to duplicate 918 * @param str string to duplicate
933 * @param len length of the string to duplicate 919 * @param len length of the string to duplicate
@@ -944,7 +930,7 @@ GNUNET_xstrndup_ (const char *str, size_t len, const char *filename,
944 * Grows old by (*oldCount-newCount)*elementSize 930 * Grows old by (*oldCount-newCount)*elementSize
945 * bytes and sets *oldCount to newCount. 931 * bytes and sets *oldCount to newCount.
946 * 932 *
947 * Don't call GNUNET_xgrow_ directly. Use the GNUNET_array_grow macro. 933 * Don't call GNUNET_xgrow_ directly. Use the #GNUNET_array_grow macro.
948 * 934 *
949 * @param old address of the pointer to the array 935 * @param old address of the pointer to the array
950 * *old may be NULL 936 * *old may be NULL
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 98602f8b9..74f7bf5ce 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -37,9 +37,6 @@ extern "C"
37#endif 37#endif
38#endif 38#endif
39 39
40#include "gnunet_common.h"
41#include "gnunet_time_lib.h"
42
43/** 40/**
44 * A configuration object. 41 * A configuration object.
45 */ 42 */
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 1d000c29a..a0935363b 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -43,11 +43,30 @@ extern "C"
43#endif 43#endif
44#endif 44#endif
45 45
46/**
47 * @brief A 512-bit hashcode
48 */
49struct GNUNET_HashCode;
50
51/**
52 * The identity of the host (wraps the signing key of the peer).
53 */
54struct GNUNET_PeerIdentity;
55
46#include "gnunet_common.h" 56#include "gnunet_common.h"
47#include "gnunet_scheduler_lib.h" 57#include "gnunet_scheduler_lib.h"
48 58
49 59
50/** 60/**
61 * @brief A 512-bit hashcode
62 */
63struct GNUNET_HashCode
64{
65 uint32_t bits[512 / 8 / sizeof (uint32_t)]; /* = 16 */
66};
67
68
69/**
51 * Maximum length of an ECC signature. 70 * Maximum length of an ECC signature.
52 * Note: round up to multiple of 8 minus 2 for alignment. 71 * Note: round up to multiple of 8 minus 2 for alignment.
53 */ 72 */
@@ -170,6 +189,16 @@ struct GNUNET_CRYPTO_EccPublicSignKey
170}; 189};
171 190
172 191
192
193/**
194 * The identity of the host (wraps the signing key of the peer).
195 */
196struct GNUNET_PeerIdentity
197{
198 struct GNUNET_CRYPTO_EccPublicSignKey public_key;
199};
200
201
173/** 202/**
174 * Public ECC key (always for NIST P-521) encoded in a format suitable 203 * Public ECC key (always for NIST P-521) encoded in a format suitable
175 * for network transmission and encryption (ECDH). 204 * for network transmission and encryption (ECDH).
@@ -556,7 +585,7 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
556 */ 585 */
557void 586void
558GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, 587GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
559 struct GNUNET_HashCode * result); 588 struct GNUNET_HashCode *result);
560 589
561 590
562/** 591/**
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index 6ecf8754a..901aa4f24 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -35,8 +35,7 @@ extern "C"
35#endif 35#endif
36#endif 36#endif
37 37
38#include "gnunet_common.h" 38#include "gnunet_util_lib.h"
39#include "gnunet_crypto_lib.h"
40 39
41 40
42/** 41/**
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index 8fd7a4e10..1fe04da6b 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -55,7 +55,7 @@ extern "C"
55 * 55 *
56 * @param fancy_size human readable string (i.e. 1 MB) 56 * @param fancy_size human readable string (i.e. 1 MB)
57 * @param size set to the size in bytes 57 * @param size set to the size in bytes
58 * @return GNUNET_OK on success, GNUNET_SYSERR on error 58 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
59 */ 59 */
60int 60int
61GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, 61GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size,
@@ -68,7 +68,7 @@ GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size,
68 * 68 *
69 * @param fancy_time human readable string (i.e. 1 minute) 69 * @param fancy_time human readable string (i.e. 1 minute)
70 * @param rtime set to the relative time 70 * @param rtime set to the relative time
71 * @return GNUNET_OK on success, GNUNET_SYSERR on error 71 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
72 */ 72 */
73int 73int
74GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time, 74GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time,
diff --git a/src/include/gnunet_util_lib.h b/src/include/gnunet_util_lib.h
index b5aa1a0e0..025dbed90 100644
--- a/src/include/gnunet_util_lib.h
+++ b/src/include/gnunet_util_lib.h
@@ -36,14 +36,14 @@ extern "C"
36#endif 36#endif
37#endif 37#endif
38 38
39#include "gnunet_crypto_lib.h"
39#include "gnunet_common.h" 40#include "gnunet_common.h"
40#include "gnunet_bandwidth_lib.h" 41#include "gnunet_bandwidth_lib.h"
41#include "gnunet_bio_lib.h" 42#include "gnunet_bio_lib.h"
43#include "gnunet_connection_lib.h"
42#include "gnunet_client_lib.h" 44#include "gnunet_client_lib.h"
43#include "gnunet_configuration_lib.h" 45#include "gnunet_configuration_lib.h"
44#include "gnunet_connection_lib.h"
45#include "gnunet_container_lib.h" 46#include "gnunet_container_lib.h"
46#include "gnunet_crypto_lib.h"
47#include "gnunet_disk_lib.h" 47#include "gnunet_disk_lib.h"
48#include "gnunet_getopt_lib.h" 48#include "gnunet_getopt_lib.h"
49#include "gnunet_helper_lib.h" 49#include "gnunet_helper_lib.h"
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index f0e298cf5..cf28484eb 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -136,7 +136,7 @@ struct NotificationContext
136 * The in-memory list of known hosts, mapping of 136 * The in-memory list of known hosts, mapping of
137 * host IDs to 'struct HostEntry*' values. 137 * host IDs to 'struct HostEntry*' values.
138 */ 138 */
139static struct GNUNET_CONTAINER_MultiHashMap *hostmap; 139static struct GNUNET_CONTAINER_MultiPeerMap *hostmap;
140 140
141/** 141/**
142 * Clients to immediately notify about all changes. 142 * Clients to immediately notify about all changes.
@@ -249,13 +249,12 @@ count_addresses (void *cls, const struct GNUNET_HELLO_Address *address,
249static char * 249static char *
250get_host_filename (const struct GNUNET_PeerIdentity *id) 250get_host_filename (const struct GNUNET_PeerIdentity *id)
251{ 251{
252 struct GNUNET_CRYPTO_HashAsciiEncoded fil;
253 char *fn; 252 char *fn;
254 253
255 if (NULL == networkIdDirectory) 254 if (NULL == networkIdDirectory)
256 return NULL; 255 return NULL;
257 GNUNET_CRYPTO_hash_to_enc (&id->hashPubKey, &fil); 256 GNUNET_asprintf (&fn, "%s%s%s", networkIdDirectory, DIR_SEPARATOR_STR,
258 GNUNET_asprintf (&fn, "%s%s%s", networkIdDirectory, DIR_SEPARATOR_STR, &fil); 257 GNUNET_i2s_full (id));
259 return fn; 258 return fn;
260} 259}
261 260
@@ -441,7 +440,7 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
441 struct ReadHostFileContext r; 440 struct ReadHostFileContext r;
442 char *fn; 441 char *fn;
443 442
444 entry = GNUNET_CONTAINER_multihashmap_get (hostmap, &identity->hashPubKey); 443 entry = GNUNET_CONTAINER_multipeermap_get (hostmap, identity);
445 if (NULL == entry) 444 if (NULL == entry)
446 { 445 {
447 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding new peer `%s'\n", GNUNET_i2s (identity)); 446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding new peer `%s'\n", GNUNET_i2s (identity));
@@ -449,7 +448,7 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
449 GNUNET_NO); 448 GNUNET_NO);
450 entry = GNUNET_malloc (sizeof (struct HostEntry)); 449 entry = GNUNET_malloc (sizeof (struct HostEntry));
451 entry->identity = *identity; 450 entry->identity = *identity;
452 GNUNET_CONTAINER_multihashmap_put (hostmap, &entry->identity.hashPubKey, entry, 451 GNUNET_CONTAINER_multipeermap_put (hostmap, &entry->identity, entry,
453 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); 452 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
454 notify_all (entry); 453 notify_all (entry);
455 fn = get_host_filename (identity); 454 fn = get_host_filename (identity);
@@ -576,7 +575,9 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
576 remove_garbage (fullname); 575 remove_garbage (fullname);
577 return GNUNET_OK; 576 return GNUNET_OK;
578 } 577 }
579 if (GNUNET_OK == GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey)) 578 if (GNUNET_OK == GNUNET_CRYPTO_ecc_public_sign_key_from_string (filename,
579 strlen (filename),
580 &identity.public_key))
580 { 581 {
581 if (0 != memcmp (&id, &identity, sizeof (id_friend))) 582 if (0 != memcmp (&id, &identity, sizeof (id_friend)))
582 { 583 {
@@ -699,7 +700,7 @@ update_hello (const struct GNUNET_PeerIdentity *peer,
699 int pos; 700 int pos;
700 char *buffer; 701 char *buffer;
701 702
702 host = GNUNET_CONTAINER_multihashmap_get (hostmap, &peer->hashPubKey); 703 host = GNUNET_CONTAINER_multipeermap_get (hostmap, peer);
703 GNUNET_assert (NULL != host); 704 GNUNET_assert (NULL != host);
704 705
705 friend_hello_type = GNUNET_HELLO_is_friend_only (hello); 706 friend_hello_type = GNUNET_HELLO_is_friend_only (hello);
@@ -830,7 +831,7 @@ update_hello (const struct GNUNET_PeerIdentity *peer,
830 * @return GNUNET_YES (continue to iterate) 831 * @return GNUNET_YES (continue to iterate)
831 */ 832 */
832static int 833static int
833add_to_tc (void *cls, const struct GNUNET_HashCode * key, void *value) 834add_to_tc (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
834{ 835{
835 struct TransmitContext *tc = cls; 836 struct TransmitContext *tc = cls;
836 struct HostEntry *pos = value; 837 struct HostEntry *pos = value;
@@ -848,8 +849,9 @@ add_to_tc (void *cls, const struct GNUNET_HashCode * key, void *value)
848 GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - 849 GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE -
849 sizeof (struct InfoMessage)); 850 sizeof (struct InfoMessage));
850 memcpy (&im[1], pos->hello, hs); 851 memcpy (&im[1], pos->hello, hs);
851 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending public HELLO with size %u for peer `%4s'\n", 852 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
852 hs, GNUNET_h2s (key)); 853 "Sending public HELLO with size %u for peer `%4s'\n",
854 hs, GNUNET_i2s (key));
853 } 855 }
854 else if ((pos->friend_only_hello != NULL) && (GNUNET_YES == tc->friend_only)) 856 else if ((pos->friend_only_hello != NULL) && (GNUNET_YES == tc->friend_only))
855 { 857 {
@@ -858,13 +860,15 @@ add_to_tc (void *cls, const struct GNUNET_HashCode * key, void *value)
858 GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE - 860 GNUNET_assert (hs < GNUNET_SERVER_MAX_MESSAGE_SIZE -
859 sizeof (struct InfoMessage)); 861 sizeof (struct InfoMessage));
860 memcpy (&im[1], pos->friend_only_hello, hs); 862 memcpy (&im[1], pos->friend_only_hello, hs);
861 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending friend-only HELLO with size %u for peer `%4s'\n", 863 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
862 hs, GNUNET_h2s (key)); 864 "Sending friend-only HELLO with size %u for peer `%4s'\n",
865 hs, GNUNET_i2s (key));
863 } 866 }
864 else 867 else
865 { 868 {
866 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding no HELLO for peer `%s'\n", 869 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
867 GNUNET_h2s (key)); 870 "Adding no HELLO for peer `%s'\n",
871 GNUNET_i2s (key));
868 } 872 }
869 873
870 im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO); 874 im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
@@ -1027,7 +1031,7 @@ handle_get (void *cls, struct GNUNET_SERVER_Client *client,
1027 "GET", GNUNET_i2s (&lpm->peer)); 1031 "GET", GNUNET_i2s (&lpm->peer));
1028 tcx.friend_only = ntohl (lpm->include_friend_only); 1032 tcx.friend_only = ntohl (lpm->include_friend_only);
1029 tcx.tc = GNUNET_SERVER_transmit_context_create (client); 1033 tcx.tc = GNUNET_SERVER_transmit_context_create (client);
1030 GNUNET_CONTAINER_multihashmap_get_multiple (hostmap, &lpm->peer.hashPubKey, 1034 GNUNET_CONTAINER_multipeermap_get_multiple (hostmap, &lpm->peer,
1031 &add_to_tc, &tcx); 1035 &add_to_tc, &tcx);
1032 GNUNET_SERVER_transmit_context_append_data (tcx.tc, NULL, 0, 1036 GNUNET_SERVER_transmit_context_append_data (tcx.tc, NULL, 0,
1033 GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END); 1037 GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END);
@@ -1053,7 +1057,7 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
1053 tcx.friend_only = ntohl (lapm->include_friend_only); 1057 tcx.friend_only = ntohl (lapm->include_friend_only);
1054 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL"); 1058 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL");
1055 tcx.tc = GNUNET_SERVER_transmit_context_create (client); 1059 tcx.tc = GNUNET_SERVER_transmit_context_create (client);
1056 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &add_to_tc, &tcx); 1060 GNUNET_CONTAINER_multipeermap_iterate (hostmap, &add_to_tc, &tcx);
1057 GNUNET_SERVER_transmit_context_append_data (tcx.tc, NULL, 0, 1061 GNUNET_SERVER_transmit_context_append_data (tcx.tc, NULL, 0,
1058 GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END); 1062 GNUNET_MESSAGE_TYPE_PEERINFO_INFO_END);
1059 GNUNET_SERVER_transmit_context_run (tcx.tc, GNUNET_TIME_UNIT_FOREVER_REL); 1063 GNUNET_SERVER_transmit_context_run (tcx.tc, GNUNET_TIME_UNIT_FOREVER_REL);
@@ -1071,7 +1075,7 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
1071 * @return GNUNET_YES (always, continue to iterate) 1075 * @return GNUNET_YES (always, continue to iterate)
1072 */ 1076 */
1073static int 1077static int
1074do_notify_entry (void *cls, const struct GNUNET_HashCode * key, void *value) 1078do_notify_entry (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
1075{ 1079{
1076 struct NotificationContext *nc = cls; 1080 struct NotificationContext *nc = cls;
1077 struct HostEntry *he = value; 1081 struct HostEntry *he = value;
@@ -1124,7 +1128,7 @@ handle_notify (void *cls, struct GNUNET_SERVER_Client *client,
1124 GNUNET_CONTAINER_DLL_insert (nc_head, nc_tail, nc); 1128 GNUNET_CONTAINER_DLL_insert (nc_head, nc_tail, nc);
1125 GNUNET_SERVER_client_mark_monitor (client); 1129 GNUNET_SERVER_client_mark_monitor (client);
1126 GNUNET_SERVER_notification_context_add (notify_list, client); 1130 GNUNET_SERVER_notification_context_add (notify_list, client);
1127 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &do_notify_entry, nc); 1131 GNUNET_CONTAINER_multipeermap_iterate (hostmap, &do_notify_entry, nc);
1128 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1132 GNUNET_SERVER_receive_done (client, GNUNET_OK);
1129} 1133}
1130 1134
@@ -1159,7 +1163,7 @@ disconnect_cb (void *cls,struct GNUNET_SERVER_Client *client)
1159 * @return GNUNET_YES (continue to iterate) 1163 * @return GNUNET_YES (continue to iterate)
1160 */ 1164 */
1161static int 1165static int
1162free_host_entry (void *cls, const struct GNUNET_HashCode * key, void *value) 1166free_host_entry (void *cls, const struct GNUNET_PeerIdentity *key, void *value)
1163{ 1167{
1164 struct HostEntry *he = value; 1168 struct HostEntry *he = value;
1165 1169
@@ -1191,8 +1195,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1191 GNUNET_CONTAINER_DLL_remove (nc_head, nc_tail, cur); 1195 GNUNET_CONTAINER_DLL_remove (nc_head, nc_tail, cur);
1192 GNUNET_free (cur); 1196 GNUNET_free (cur);
1193 } 1197 }
1194 GNUNET_CONTAINER_multihashmap_iterate (hostmap, &free_host_entry, NULL); 1198 GNUNET_CONTAINER_multipeermap_iterate (hostmap, &free_host_entry, NULL);
1195 GNUNET_CONTAINER_multihashmap_destroy (hostmap); 1199 GNUNET_CONTAINER_multipeermap_destroy (hostmap);
1196 if (NULL != stats) 1200 if (NULL != stats)
1197 { 1201 {
1198 GNUNET_STATISTICS_destroy (stats, GNUNET_NO); 1202 GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
@@ -1228,7 +1232,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
1228 int noio; 1232 int noio;
1229 int use_included; 1233 int use_included;
1230 1234
1231 hostmap = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_YES); 1235 hostmap = GNUNET_CONTAINER_multipeermap_create (1024, GNUNET_YES);
1232 stats = GNUNET_STATISTICS_create ("peerinfo", cfg); 1236 stats = GNUNET_STATISTICS_create ("peerinfo", cfg);
1233 notify_list = GNUNET_SERVER_notification_context_create (server, 0); 1237 notify_list = GNUNET_SERVER_notification_context_create (server, 0);
1234 noio = GNUNET_CONFIGURATION_get_value_yesno (cfg, "peerinfo", "NO_IO"); 1238 noio = GNUNET_CONFIGURATION_get_value_yesno (cfg, "peerinfo", "NO_IO");
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index faa56e908..fad77a194 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -24,11 +24,8 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_client_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_container_lib.h"
29#include "gnunet_peerinfo_service.h"
30#include "gnunet_protocols.h" 28#include "gnunet_protocols.h"
31#include "gnunet_time_lib.h"
32#include "peerinfo.h" 29#include "peerinfo.h"
33 30
34#define LOG(kind,...) GNUNET_log_from (kind, "peerinfo-api",__VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "peerinfo-api",__VA_ARGS__)
@@ -558,7 +555,7 @@ peerinfo_handler (void *cls, const struct GNUNET_MessageHeader *msg)
558 /* bogus message (from a different iteration call?); out of sequence! */ 555 /* bogus message (from a different iteration call?); out of sequence! */
559 LOG (GNUNET_ERROR_TYPE_ERROR, 556 LOG (GNUNET_ERROR_TYPE_ERROR,
560 "Received HELLO for peer `%s', expected peer `%s'\n", 557 "Received HELLO for peer `%s', expected peer `%s'\n",
561 GNUNET_h2s (&im->peer.hashPubKey), 558 GNUNET_i2s (&im->peer),
562 GNUNET_i2s (&ic->peer)); 559 GNUNET_i2s (&ic->peer));
563 560
564 GNUNET_break (0); 561 GNUNET_break (0);
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index 194664d62..f5a076a20 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -24,10 +24,9 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_client_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_peerinfo_service.h" 28#include "gnunet_peerinfo_service.h"
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "gnunet_time_lib.h"
31#include "peerinfo.h" 30#include "peerinfo.h"
32 31
33#define LOG(kind,...) GNUNET_log_from (kind, "nse-api",__VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "nse-api",__VA_ARGS__)
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index 8dc84190d..d05765c4a 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -25,8 +25,6 @@
25 * @author Igor Wronsky 25 * @author Igor Wronsky
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_getopt_lib.h"
29#include "gnunet_program_lib.h"
30#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
31#include "gnunet_statistics_service.h" 29#include "gnunet_statistics_service.h"
32#include "statistics.h" 30#include "statistics.h"
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 1a767e9e7..7aa109930 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -24,13 +24,10 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_client_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_container_lib.h"
30#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
31#include "gnunet_server_lib.h"
32#include "gnunet_statistics_service.h" 30#include "gnunet_statistics_service.h"
33#include "gnunet_strings_lib.h"
34#include "statistics.h" 31#include "statistics.h"
35 32
36/** 33/**
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 8502809f3..10d25637e 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -701,7 +701,6 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
701 struct GNUNET_PeerIdentity *id) 701 struct GNUNET_PeerIdentity *id)
702{ 702{
703 struct GNUNET_CRYPTO_EccPrivateKey *private_key; 703 struct GNUNET_CRYPTO_EccPrivateKey *private_key;
704 struct GNUNET_CRYPTO_EccPublicSignKey public_key;
705 704
706 if ((NULL == id) || (NULL == system->hostkeys_data)) 705 if ((NULL == id) || (NULL == system->hostkeys_data))
707 return NULL; 706 return NULL;
@@ -716,10 +715,8 @@ GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
716 system->hostkeys_data + 715 system->hostkeys_data +
717 (key_number * GNUNET_TESTING_HOSTKEYFILESIZE), 716 (key_number * GNUNET_TESTING_HOSTKEYFILESIZE),
718 GNUNET_TESTING_HOSTKEYFILESIZE); 717 GNUNET_TESTING_HOSTKEYFILESIZE);
719 GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key, &public_key); 718 GNUNET_CRYPTO_ecc_key_get_public_for_signature (private_key,
720 GNUNET_CRYPTO_hash (&public_key, 719 &id->public_key);
721 sizeof (struct GNUNET_CRYPTO_EccPublicSignKey),
722 &(id->hashPubKey));
723 return private_key; 720 return private_key;
724} 721}
725 722
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index ee3349db7..564204862 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -416,7 +416,7 @@ test_os_network_LDADD = \
416test_peer_SOURCES = \ 416test_peer_SOURCES = \
417 test_peer.c 417 test_peer.c
418test_peer_LDADD = \ 418test_peer_LDADD = \
419$(top_builddir)/src/util/libgnunetutil.la 419$(top_builddir)/src/util/libgnunetutil.la -lgcrypt
420 420
421test_plugin_SOURCES = \ 421test_plugin_SOURCES = \
422 test_plugin.c 422 test_plugin.c
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index a7f6d1c67..27dda5e59 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -24,7 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#if HAVE_MALLOC_H 28#if HAVE_MALLOC_H
29#include <malloc.h> 29#include <malloc.h>
30#endif 30#endif
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 3d69f99e3..247e9e876 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29 29
30#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
31 31
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 0c9973d44..6493aae38 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -25,7 +25,6 @@
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
30#include <regex.h> 29#include <regex.h>
31 30
@@ -1082,16 +1081,19 @@ GNUNET_h2s_full (const struct GNUNET_HashCode * hc)
1082 * 1081 *
1083 * @param pid the peer identity 1082 * @param pid the peer identity
1084 * @return string form of the pid; will be overwritten by next 1083 * @return string form of the pid; will be overwritten by next
1085 * call to GNUNET_i2s. 1084 * call to #GNUNET_i2s.
1086 */ 1085 */
1087const char * 1086const char *
1088GNUNET_i2s (const struct GNUNET_PeerIdentity *pid) 1087GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
1089{ 1088{
1090 static struct GNUNET_CRYPTO_HashAsciiEncoded ret; 1089 static char buf[256];
1091 1090 char *ret;
1092 GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); 1091
1093 ret.encoding[4] = '\0'; 1092 ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
1094 return (const char *) ret.encoding; 1093 strcpy (buf, ret);
1094 GNUNET_free (ret);
1095 buf[4] = '\0';
1096 return buf;
1095} 1097}
1096 1098
1097 1099
@@ -1102,15 +1104,18 @@ GNUNET_i2s (const struct GNUNET_PeerIdentity *pid)
1102 * 1104 *
1103 * @param pid the peer identity 1105 * @param pid the peer identity
1104 * @return string form of the pid; will be overwritten by next 1106 * @return string form of the pid; will be overwritten by next
1105 * call to GNUNET_i2s. 1107 * call to #GNUNET_i2s_full.
1106 */ 1108 */
1107const char * 1109const char *
1108GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid) 1110GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid)
1109{ 1111{
1110 static struct GNUNET_CRYPTO_HashAsciiEncoded ret; 1112 static char buf[256];
1113 char *ret;
1111 1114
1112 GNUNET_CRYPTO_hash_to_enc (&pid->hashPubKey, &ret); 1115 ret = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pid->public_key);
1113 return (const char *) ret.encoding; 1116 strcpy (buf, ret);
1117 GNUNET_free (ret);
1118 return buf;
1114} 1119}
1115 1120
1116 1121
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 0899ed7c9..69e2168c1 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -25,10 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
30#include "gnunet_crypto_lib.h"
31#include "gnunet_strings_lib.h"
32 29
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
34 31
diff --git a/src/util/connection.c b/src/util/connection.c
index 3290abcfc..e90fa9f51 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -30,9 +30,7 @@
30 * These rules should apply in general, but for this 30 * These rules should apply in general, but for this
31 * module they are VERY, VERY important. 31 * module they are VERY, VERY important.
32 */ 32 */
33
34#include "platform.h" 33#include "platform.h"
35#include "gnunet_common.h"
36#include "gnunet_util_lib.h" 34#include "gnunet_util_lib.h"
37#include "gnunet_resolver_service.h" 35#include "gnunet_resolver_service.h"
38 36
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 825a45f55..f9487f98f 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -40,9 +40,7 @@
40 */ 40 */
41 41
42#include "platform.h" 42#include "platform.h"
43#include "gnunet_common.h" 43#include "gnunet_util_lib.h"
44#include "gnunet_container_lib.h"
45#include "gnunet_disk_lib.h"
46 44
47#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 45#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
48 46
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index 777e0b6c3..6e77c40a2 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -25,10 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30#include "gnunet_strings_lib.h"
31#include "gnunet_time_lib.h"
32#include <extractor.h> 29#include <extractor.h>
33#include <zlib.h> 30#include <zlib.h>
34 31
diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c
index 5d12644cf..24eae9f0d 100644
--- a/src/util/container_multihashmap.c
+++ b/src/util/container_multihashmap.c
@@ -24,9 +24,7 @@
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_container_lib.h"
29#include "gnunet_crypto_lib.h"
30 28
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 30
diff --git a/src/util/container_multihashmap32.c b/src/util/container_multihashmap32.c
index 29ad14d3a..5448a3cde 100644
--- a/src/util/container_multihashmap32.c
+++ b/src/util/container_multihashmap32.c
@@ -26,9 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_container_lib.h"
31#include "gnunet_crypto_lib.h"
32 30
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
34 32
diff --git a/src/util/container_multipeermap.c b/src/util/container_multipeermap.c
index 6519f6c84..54a1d1635 100644
--- a/src/util/container_multipeermap.c
+++ b/src/util/container_multipeermap.c
@@ -24,9 +24,7 @@
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_container_lib.h"
29#include "gnunet_crypto_lib.h"
30 28
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 30
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c
index 82ca59456..cda6243be 100644
--- a/src/util/crypto_crc.c
+++ b/src/util/crypto_crc.c
@@ -28,8 +28,7 @@
28 * @author Christian Grothoff 28 * @author Christian Grothoff
29 */ 29 */
30#include "platform.h" 30#include "platform.h"
31#include "gnunet_common.h" 31#include "gnunet_util_lib.h"
32#include "gnunet_crypto_lib.h"
33 32
34#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
35 34
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index e393ad1e5..770b0c37c 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -25,7 +25,6 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include <gcrypt.h> 27#include <gcrypt.h>
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
30 29
31#define EXTRA_CHECKS ALLOW_EXTRA_CHECKS 30#define EXTRA_CHECKS ALLOW_EXTRA_CHECKS
@@ -746,7 +745,6 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
746 struct GNUNET_PeerIdentity *dst) 745 struct GNUNET_PeerIdentity *dst)
747{ 746{
748 struct GNUNET_CRYPTO_EccPrivateKey *priv; 747 struct GNUNET_CRYPTO_EccPrivateKey *priv;
749 struct GNUNET_CRYPTO_EccPublicSignKey pub;
750 748
751 if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg))) 749 if (NULL == (priv = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg)))
752 { 750 {
@@ -754,9 +752,8 @@ GNUNET_CRYPTO_get_host_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
754 _("Could not load peer's private key\n")); 752 _("Could not load peer's private key\n"));
755 return GNUNET_SYSERR; 753 return GNUNET_SYSERR;
756 } 754 }
757 GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &pub); 755 GNUNET_CRYPTO_ecc_key_get_public_for_signature (priv, &dst->public_key);
758 GNUNET_free (priv); 756 GNUNET_free (priv);
759 GNUNET_CRYPTO_hash (&pub, sizeof (pub), &dst->hashPubKey);
760 return GNUNET_OK; 757 return GNUNET_OK;
761} 758}
762 759
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index e1997c3bb..67cf92d17 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -26,10 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_crypto_lib.h"
31#include "gnunet_disk_lib.h"
32#include "gnunet_strings_lib.h"
33#include <gcrypt.h> 30#include <gcrypt.h>
34 31
35#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 935bbc3ea..e3388faad 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -25,9 +25,7 @@
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_crypto_lib.h"
30#include "gnunet_os_lib.h"
31#include <gcrypt.h> 29#include <gcrypt.h>
32 30
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/crypto_symmetric.c b/src/util/crypto_symmetric.c
index 3e4f9d748..3cc546652 100644
--- a/src/util/crypto_symmetric.c
+++ b/src/util/crypto_symmetric.c
@@ -26,8 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_crypto_lib.h"
31#include <gcrypt.h> 30#include <gcrypt.h>
32 31
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/disk.c b/src/util/disk.c
index 066b0b99b..7729fd8ee 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -26,12 +26,8 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h"
30#include "gnunet_directories.h" 29#include "gnunet_directories.h"
31#include "gnunet_disk_lib.h" 30#include "gnunet_util_lib.h"
32#include "gnunet_scheduler_lib.h"
33#include "gnunet_strings_lib.h"
34#include "gnunet_crypto_lib.h"
35#include "disk.h" 31#include "disk.h"
36 32
37#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/disk.h b/src/util/disk.h
index 890281a93..fa786ea68 100644
--- a/src/util/disk.h
+++ b/src/util/disk.h
@@ -26,7 +26,7 @@
26#ifndef GNUNET_DISK_H_ 26#ifndef GNUNET_DISK_H_
27#define GNUNET_DISK_H_ 27#define GNUNET_DISK_H_
28 28
29#include "gnunet_disk_lib.h" 29#include "gnunet_util_lib.h"
30 30
31/** 31/**
32 * Retrieve OS file handle 32 * Retrieve OS file handle
@@ -34,8 +34,8 @@
34 * @internal 34 * @internal
35 * @param fh GNUnet file descriptor 35 * @param fh GNUnet file descriptor
36 * @param dst destination buffer 36 * @param dst destination buffer
37 * @param dst_len length of dst 37 * @param dst_len length of @a dst
38 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 38 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
39 */ 39 */
40int 40int
41GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh, 41GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh,
diff --git a/src/util/getopt.c b/src/util/getopt.c
index 936e3b1e3..7b2f3cf5d 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -37,10 +37,8 @@ Copyright (C) 2006 Christian Grothoff
37 * replace main GNU getopt parser with one that 37 * replace main GNU getopt parser with one that
38 * actually fits our API. 38 * actually fits our API.
39 */ 39 */
40
41#include "platform.h" 40#include "platform.h"
42#include "gnunet_common.h" 41#include "gnunet_util_lib.h"
43#include "gnunet_getopt_lib.h"
44 42
45#ifdef VMS 43#ifdef VMS
46#include <unixlib.h> 44#include <unixlib.h>
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index 349f9e477..798ced005 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -23,9 +23,7 @@
23 * @brief implements command line that sets option 23 * @brief implements command line that sets option
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26
27#include "platform.h" 26#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
30 28
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c
index 9f76d6b8e..59c0f5fe2 100644
--- a/src/util/gnunet-ecc.c
+++ b/src/util/gnunet-ecc.c
@@ -111,7 +111,6 @@ run (void *cls, char *const *args, const char *cfgfile,
111{ 111{
112 struct GNUNET_CRYPTO_EccPrivateKey *pk; 112 struct GNUNET_CRYPTO_EccPrivateKey *pk;
113 struct GNUNET_CRYPTO_EccPublicSignKey pub; 113 struct GNUNET_CRYPTO_EccPublicSignKey pub;
114 struct GNUNET_PeerIdentity pid;
115 114
116 if (NULL == args[0]) 115 if (NULL == args[0])
117 { 116 {
@@ -137,12 +136,14 @@ run (void *cls, char *const *args, const char *cfgfile,
137 } 136 }
138 if (print_peer_identity) 137 if (print_peer_identity)
139 { 138 {
140 struct GNUNET_CRYPTO_HashAsciiEncoded enc; 139 char *str;
141 140
142 GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub); 141 GNUNET_CRYPTO_ecc_key_get_public_for_signature (pk, &pub);
143 GNUNET_CRYPTO_hash (&pub, sizeof (pub), &pid.hashPubKey); 142 str = GNUNET_CRYPTO_ecc_public_sign_key_to_string (&pub);
144 GNUNET_CRYPTO_hash_to_enc (&pid.hashPubKey, &enc); 143 fprintf (stdout,
145 fprintf (stdout, "%s\n", enc.encoding); 144 "%s\n",
145 str);
146 GNUNET_free (str);
146 } 147 }
147 GNUNET_free (pk); 148 GNUNET_free (pk);
148} 149}
diff --git a/src/util/mq.c b/src/util/mq.c
index 289ac1ade..733329a2c 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -23,9 +23,7 @@
23 * @file util/mq.c 23 * @file util/mq.c
24 * @brief general purpose request queue 24 * @brief general purpose request queue
25 */ 25 */
26
27#include "platform.h" 26#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 27#include "gnunet_util_lib.h"
30 28
31#define LOG(kind,...) GNUNET_log_from (kind, "mq",__VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "mq",__VA_ARGS__)
diff --git a/src/util/network.c b/src/util/network.c
index c0b977368..162948420 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -25,8 +25,8 @@
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 */ 26 */
27#include "platform.h" 27#include "platform.h"
28#include "disk.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "disk.h"
30 30
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) 32#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index a596ca2c0..06eb4ed60 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -30,11 +30,7 @@
30#include <unistr.h> /* for u16_to_u8 */ 30#include <unistr.h> /* for u16_to_u8 */
31 31
32#include "platform.h" 32#include "platform.h"
33#include "gnunet_common.h" 33#include "gnunet_util_lib.h"
34#include "gnunet_configuration_lib.h"
35#include "gnunet_disk_lib.h"
36#include "gnunet_os_lib.h"
37#include "gnunet_strings_lib.h"
38#if DARWIN 34#if DARWIN
39#include <mach-o/ldsyms.h> 35#include <mach-o/ldsyms.h>
40#include <mach-o/dyld.h> 36#include <mach-o/dyld.h>
diff --git a/src/util/os_network.c b/src/util/os_network.c
index b11f07157..4d9155ae2 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -27,10 +27,8 @@
27 * @author Jake Dust 27 * @author Jake Dust
28 * @author LRN 28 * @author LRN
29 */ 29 */
30
31#include "platform.h" 30#include "platform.h"
32#include "gnunet_common.h" 31#include "gnunet_util_lib.h"
33#include "gnunet_os_lib.h"
34 32
35 33
36#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 34#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index f019bd605..7a6d93858 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -25,11 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_os_lib.h"
30#include "gnunet_scheduler_lib.h"
31#include "gnunet_strings_lib.h"
32#include "gnunet_crypto_lib.h"
33#include "disk.h" 29#include "disk.h"
34#include <unistr.h> 30#include <unistr.h>
35 31
diff --git a/src/util/peer.c b/src/util/peer.c
index e58b96211..08062e364 100644
--- a/src/util/peer.c
+++ b/src/util/peer.c
@@ -23,7 +23,6 @@
23 * @brief peer-ID table that assigns integer IDs to peer-IDs to save memory 23 * @brief peer-ID table that assigns integer IDs to peer-IDs to save memory
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26
27#include "platform.h" 26#include "platform.h"
28#include "gnunet_peer_lib.h" 27#include "gnunet_peer_lib.h"
29 28
@@ -56,11 +55,11 @@ struct PeerEntry
56static struct PeerEntry **table; 55static struct PeerEntry **table;
57 56
58/** 57/**
59 * Hashmap of PeerIdentities to "struct PeerEntry" 58 * Peermap of PeerIdentities to "struct PeerEntry"
60 * (for fast lookup). NULL until the library 59 * (for fast lookup). NULL until the library
61 * is actually being used. 60 * is actually being used.
62 */ 61 */
63static struct GNUNET_CONTAINER_MultiHashMap *map; 62static struct GNUNET_CONTAINER_MultiPeerMap *map;
64 63
65/** 64/**
66 * Size of the "table". 65 * Size of the "table".
@@ -89,7 +88,7 @@ GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid)
89 return 0; 88 return 0;
90 if (NULL == map) 89 if (NULL == map)
91 return 0; 90 return 0;
92 e = GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey); 91 e = GNUNET_CONTAINER_multipeermap_get (map, pid);
93 if (NULL == e) 92 if (NULL == e)
94 return 0; 93 return 0;
95 GNUNET_assert (e->rc > 0); 94 GNUNET_assert (e->rc > 0);
@@ -114,8 +113,8 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
114 if (NULL == pid) 113 if (NULL == pid)
115 return 0; 114 return 0;
116 if (NULL == map) 115 if (NULL == map)
117 map = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES); 116 map = GNUNET_CONTAINER_multipeermap_create (32, GNUNET_YES);
118 e = GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey); 117 e = GNUNET_CONTAINER_multipeermap_get (map, pid);
119 if (NULL != e) 118 if (NULL != e)
120 { 119 {
121 GNUNET_assert (e->rc > 0); 120 GNUNET_assert (e->rc > 0);
@@ -145,8 +144,8 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
145 table[ret]->rc = 1; 144 table[ret]->rc = 1;
146 table[ret]->pid = ret; 145 table[ret]->pid = ret;
147 GNUNET_break (GNUNET_OK == 146 GNUNET_break (GNUNET_OK ==
148 GNUNET_CONTAINER_multihashmap_put (map, 147 GNUNET_CONTAINER_multipeermap_put (map,
149 &table[ret]->id.hashPubKey, 148 &table[ret]->id,
150 table[ret], 149 table[ret],
151 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); 150 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
152 return ret; 151 return ret;
@@ -178,8 +177,8 @@ GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count)
178 if (0 == table[id]->rc) 177 if (0 == table[id]->rc)
179 { 178 {
180 GNUNET_break (GNUNET_OK == 179 GNUNET_break (GNUNET_OK ==
181 GNUNET_CONTAINER_multihashmap_remove (map, 180 GNUNET_CONTAINER_multipeermap_remove (map,
182 &table[id]->id.hashPubKey, 181 &table[id]->id,
183 table[id])); 182 table[id]));
184 table[id]->pid = free_list_start; 183 table[id]->pid = free_list_start;
185 free_list_start = id; 184 free_list_start = id;
@@ -206,8 +205,8 @@ GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta)
206 if (0 == table[id]->rc) 205 if (0 == table[id]->rc)
207 { 206 {
208 GNUNET_break (GNUNET_OK == 207 GNUNET_break (GNUNET_OK ==
209 GNUNET_CONTAINER_multihashmap_remove (map, 208 GNUNET_CONTAINER_multipeermap_remove (map,
210 &table[id]->id.hashPubKey, 209 &table[id]->id,
211 table[id])); 210 table[id]));
212 table[id]->pid = free_list_start; 211 table[id]->pid = free_list_start;
213 free_list_start = id; 212 free_list_start = id;
diff --git a/src/util/plugin.c b/src/util/plugin.c
index b22976574..fe8281c32 100644
--- a/src/util/plugin.c
+++ b/src/util/plugin.c
@@ -26,9 +26,7 @@
26 26
27#include "platform.h" 27#include "platform.h"
28#include <ltdl.h> 28#include <ltdl.h>
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_os_lib.h"
31#include "gnunet_plugin_lib.h"
32 30
33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
34 32
diff --git a/src/util/program.c b/src/util/program.c
index 16a2f5086..aae58db49 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -25,15 +25,9 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_configuration_lib.h"
30#include "gnunet_crypto_lib.h"
31#include "gnunet_directories.h"
32#include "gnunet_getopt_lib.h"
33#include "gnunet_os_lib.h"
34#include "gnunet_program_lib.h"
35#include "gnunet_resolver_service.h" 29#include "gnunet_resolver_service.h"
36#include "gnunet_scheduler_lib.h" 30#include "gnunet_directories.h"
37#include <gcrypt.h> 31#include <gcrypt.h>
38 32
39#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 33#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index b7c24e2ad..a38bebf84 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -24,11 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_os_lib.h"
29#include "gnunet_scheduler_lib.h"
30#include "gnunet_signal_lib.h"
31#include "gnunet_time_lib.h"
32#include "disk.h" 28#include "disk.h"
33 29
34#define LOG(kind,...) GNUNET_log_from (kind, "util-scheduler", __VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util-scheduler", __VA_ARGS__)
diff --git a/src/util/server.c b/src/util/server.c
index 9e88992ca..dce03bdcf 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -25,7 +25,6 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h"
29#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
30#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
31 30
diff --git a/src/util/server_mst.c b/src/util/server_mst.c
index 7eac75bed..34ffc6da7 100644
--- a/src/util/server_mst.c
+++ b/src/util/server_mst.c
@@ -25,11 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_connection_lib.h"
30#include "gnunet_scheduler_lib.h"
31#include "gnunet_server_lib.h"
32#include "gnunet_time_lib.h"
33 29
34 30
35#if HAVE_UNALIGNED_64_ACCESS 31#if HAVE_UNALIGNED_64_ACCESS
diff --git a/src/util/server_nc.c b/src/util/server_nc.c
index 37dd9d84c..d11025680 100644
--- a/src/util/server_nc.c
+++ b/src/util/server_nc.c
@@ -26,12 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_connection_lib.h"
31#include "gnunet_container_lib.h"
32#include "gnunet_scheduler_lib.h"
33#include "gnunet_server_lib.h"
34#include "gnunet_time_lib.h"
35 30
36#define LOG(kind,...) GNUNET_log_from (kind, "util-server-nc", __VA_ARGS__) 31#define LOG(kind,...) GNUNET_log_from (kind, "util-server-nc", __VA_ARGS__)
37 32
diff --git a/src/util/server_tc.c b/src/util/server_tc.c
index f02d06d2c..780b5f003 100644
--- a/src/util/server_tc.c
+++ b/src/util/server_tc.c
@@ -26,11 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_connection_lib.h"
31#include "gnunet_scheduler_lib.h"
32#include "gnunet_server_lib.h"
33#include "gnunet_time_lib.h"
34 30
35 31
36#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 32#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
diff --git a/src/util/service.c b/src/util/service.c
index b91be9664..cab8a8aef 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -24,17 +24,10 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_configuration_lib.h"
29#include "gnunet_crypto_lib.h"
30#include "gnunet_directories.h"
31#include "gnunet_disk_lib.h"
32#include "gnunet_getopt_lib.h"
33#include "gnunet_os_lib.h"
34#include "gnunet_protocols.h" 28#include "gnunet_protocols.h"
29#include "gnunet_directories.h"
35#include "gnunet_resolver_service.h" 30#include "gnunet_resolver_service.h"
36#include "gnunet_server_lib.h"
37#include "gnunet_service_lib.h"
38 31
39#if HAVE_MALLINFO 32#if HAVE_MALLINFO
40#include <malloc.h> 33#include <malloc.h>
diff --git a/src/util/signal.c b/src/util/signal.c
index c3f5f023e..edce5f653 100644
--- a/src/util/signal.c
+++ b/src/util/signal.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_signal_lib.h"
30 29
31#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
32 31
diff --git a/src/util/strings.c b/src/util/strings.c
index 6380ea5ec..3d061fb57 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -29,8 +29,7 @@
29#if HAVE_ICONV 29#if HAVE_ICONV
30#include <iconv.h> 30#include <iconv.h>
31#endif 31#endif
32#include "gnunet_common.h" 32#include "gnunet_util_lib.h"
33#include "gnunet_strings_lib.h"
34#include <unicase.h> 33#include <unicase.h>
35#include <unistr.h> 34#include <unistr.h>
36#include <uniconv.h> 35#include <uniconv.h>
diff --git a/src/util/test_client.c b/src/util/test_client.c
index 7d7ec8cff..6dfb8349a 100644
--- a/src/util/test_client.c
+++ b/src/util/test_client.c
@@ -22,12 +22,7 @@
22 * @brief tests for client.c 22 * @brief tests for client.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_client_lib.h"
27#include "gnunet_configuration_lib.h"
28#include "gnunet_scheduler_lib.h"
29#include "gnunet_server_lib.h"
30#include "gnunet_time_lib.h"
31 26
32 27
33#define PORT 14325 28#define PORT 14325
diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c
index 438d39751..0c6f5fc5a 100644
--- a/src/util/test_common_allocation.c
+++ b/src/util/test_common_allocation.c
@@ -23,7 +23,7 @@
23 * @brief testcase for common_allocation.c 23 * @brief testcase for common_allocation.c
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_common.h" 26#include "gnunet_util_lib.h"
27 27
28static int 28static int
29check () 29check ()
diff --git a/src/util/test_common_endian.c b/src/util/test_common_endian.c
index a709abec6..8974b43fe 100644
--- a/src/util/test_common_endian.c
+++ b/src/util/test_common_endian.c
@@ -22,7 +22,7 @@
22 * @brief testcase for common_endian.c 22 * @brief testcase for common_endian.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26 26
27#define CHECK(n) if (n != GNUNET_htonll(GNUNET_ntohll(n))) return 1; 27#define CHECK(n) if (n != GNUNET_htonll(GNUNET_ntohll(n))) return 1;
28 28
diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c
index 934586926..2bf719782 100644
--- a/src/util/test_common_logging.c
+++ b/src/util/test_common_logging.c
@@ -24,7 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28 28
29static void 29static void
30my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component, 30my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component,
diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c
index 679dd9178..fcdf9cd27 100644
--- a/src/util/test_common_logging_dummy.c
+++ b/src/util/test_common_logging_dummy.c
@@ -28,9 +28,7 @@
28#undef GNUNET_EXTRA_LOGGING 28#undef GNUNET_EXTRA_LOGGING
29#define GNUNET_EXTRA_LOGGING GNUNET_YES 29#define GNUNET_EXTRA_LOGGING GNUNET_YES
30 30
31#include "gnunet_common.h" 31#include "gnunet_util_lib.h"
32#include "gnunet_time_lib.h"
33#include "gnunet_network_lib.h"
34 32
35/** 33/**
36 * Artificial delay attached to each log call that is not skipped out. 34 * Artificial delay attached to each log call that is not skipped out.
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index 8edf95194..c608d59c5 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -24,11 +24,7 @@
24 * @author LRN 24 * @author LRN
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_scheduler_lib.h"
29#include "gnunet_network_lib.h"
30#include "gnunet_disk_lib.h"
31#include "gnunet_os_lib.h"
32 28
33#define VERBOSE GNUNET_NO 29#define VERBOSE GNUNET_NO
34 30
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index 62ad5fa92..2d2806956 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -24,9 +24,7 @@
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_configuration_lib.h"
29#include "gnunet_disk_lib.h"
30 28
31 29
32/* Test Configuration Diffs Options */ 30/* Test Configuration Diffs Options */
diff --git a/src/util/test_connection.c b/src/util/test_connection.c
index 1ba20498f..124f3c9d3 100644
--- a/src/util/test_connection.c
+++ b/src/util/test_connection.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c 22 * @brief tests for connection.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30#define PORT 12435 27#define PORT 12435
31 28
diff --git a/src/util/test_connection_addressing.c b/src/util/test_connection_addressing.c
index eeb610dd1..ea6acdd53 100644
--- a/src/util/test_connection_addressing.c
+++ b/src/util/test_connection_addressing.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c 22 * @brief tests for connection.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30 27
31#define PORT 12435 28#define PORT 12435
diff --git a/src/util/test_connection_receive_cancel.c b/src/util/test_connection_receive_cancel.c
index 99905e232..e47712d3f 100644
--- a/src/util/test_connection_receive_cancel.c
+++ b/src/util/test_connection_receive_cancel.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c 22 * @brief tests for connection.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30#define PORT 12435 27#define PORT 12435
31 28
diff --git a/src/util/test_connection_timeout.c b/src/util/test_connection_timeout.c
index 6608e18db..27170ed41 100644
--- a/src/util/test_connection_timeout.c
+++ b/src/util/test_connection_timeout.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c 22 * @brief tests for connection.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30#define PORT 12435 27#define PORT 12435
31 28
diff --git a/src/util/test_connection_timeout_no_connect.c b/src/util/test_connection_timeout_no_connect.c
index 50eaf709a..cf1f8ecde 100644
--- a/src/util/test_connection_timeout_no_connect.c
+++ b/src/util/test_connection_timeout_no_connect.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c, doing timeout which connect failure 22 * @brief tests for connection.c, doing timeout which connect failure
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30#define PORT 13425 27#define PORT 13425
31 28
diff --git a/src/util/test_connection_transmit_cancel.c b/src/util/test_connection_transmit_cancel.c
index 195ac689b..c5fa5cc32 100644
--- a/src/util/test_connection_transmit_cancel.c
+++ b/src/util/test_connection_transmit_cancel.c
@@ -22,10 +22,7 @@
22 * @brief tests for connection.c 22 * @brief tests for connection.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_connection_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30#define PORT 12435 27#define PORT 12435
31 28
diff --git a/src/util/test_container_bloomfilter.c b/src/util/test_container_bloomfilter.c
index f9743bdca..f568e2548 100644
--- a/src/util/test_container_bloomfilter.c
+++ b/src/util/test_container_bloomfilter.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31#define K 4 30#define K 4
32#define SIZE 65536 31#define SIZE 65536
diff --git a/src/util/test_container_heap.c b/src/util/test_container_heap.c
index a2a004aa7..7ae7f05af 100644
--- a/src/util/test_container_heap.c
+++ b/src/util/test_container_heap.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31static int 30static int
32iterator_callback (void *cls, struct GNUNET_CONTAINER_HeapNode *node, 31iterator_callback (void *cls, struct GNUNET_CONTAINER_HeapNode *node,
diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c
index fe1dd79c1..2da3bb251 100644
--- a/src/util/test_container_meta_data.c
+++ b/src/util/test_container_meta_data.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; } 30#define ABORT(m) { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_meta_data_destroy(m); return 1; }
32 31
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c
index 6b079a109..a66ae6d82 100644
--- a/src/util/test_container_multihashmap.c
+++ b/src/util/test_container_multihashmap.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy(m); return 1; } 30#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy(m); return 1; }
32#define CHECK(c) { if (! (c)) ABORT(); } 31#define CHECK(c) { if (! (c)) ABORT(); }
diff --git a/src/util/test_container_multihashmap32.c b/src/util/test_container_multihashmap32.c
index 7997c73ac..af21ecec9 100644
--- a/src/util/test_container_multihashmap32.c
+++ b/src/util/test_container_multihashmap32.c
@@ -26,8 +26,7 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_container_lib.h"
31 30
32#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap32_destroy(m); return 1; } 31#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (m != NULL) GNUNET_CONTAINER_multihashmap32_destroy(m); return 1; }
33#define CHECK(c) { if (! (c)) ABORT(); } 32#define CHECK(c) { if (! (c)) ABORT(); }
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c
index aa67eb5e0..5eda0c8aa 100644
--- a/src/util/test_container_multipeermap.c
+++ b/src/util/test_container_multipeermap.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); return 1; } 30#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); return 1; }
32#define CHECK(c) { if (! (c)) ABORT(); } 31#define CHECK(c) { if (! (c)) ABORT(); }
diff --git a/src/util/test_container_slist.c b/src/util/test_container_slist.c
index 1b63d3dbc..8b4ff93d0 100644
--- a/src/util/test_container_slist.c
+++ b/src/util/test_container_slist.c
@@ -25,8 +25,7 @@
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_common.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_container_lib.h"
30 29
31int 30int
32main (int argc, char *argv[]) 31main (int argc, char *argv[])
diff --git a/src/util/test_crypto_crc.c b/src/util/test_crypto_crc.c
index 99eca0cc0..3000fed34 100644
--- a/src/util/test_crypto_crc.c
+++ b/src/util/test_crypto_crc.c
@@ -27,8 +27,7 @@
27 * @brief testcase for crypto_crc.c 27 * @brief testcase for crypto_crc.c
28 */ 28 */
29#include "platform.h" 29#include "platform.h"
30#include "gnunet_common.h" 30#include "gnunet_util_lib.h"
31#include "gnunet_crypto_lib.h"
32 31
33static int expected[] = { 32static int expected[] = {
34 -1223996378, 929797997, -1048047323, 1791081351, -425765913, 2138425902, 33 -1223996378, 929797997, -1048047323, 1791081351, -425765913, 2138425902,
diff --git a/src/util/test_crypto_hash.c b/src/util/test_crypto_hash.c
index 9e10702ce..1a3f90957 100644
--- a/src/util/test_crypto_hash.c
+++ b/src/util/test_crypto_hash.c
@@ -24,9 +24,7 @@
24 * @brief Test for crypto_hash.c 24 * @brief Test for crypto_hash.c
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_crypto_lib.h"
29#include "gnunet_scheduler_lib.h"
30 28
31static char block[65536]; 29static char block[65536];
32 30
diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c
index 681947a60..11af6580a 100644
--- a/src/util/test_crypto_random.c
+++ b/src/util/test_crypto_random.c
@@ -24,8 +24,7 @@
24 * @brief testcase for crypto_random.c 24 * @brief testcase for crypto_random.c
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_crypto_lib.h"
29 28
30static int 29static int
31test (enum GNUNET_CRYPTO_Quality mode) 30test (enum GNUNET_CRYPTO_Quality mode)
diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c
index b350e9efe..90214a4b5 100644
--- a/src/util/test_crypto_symmetric.c
+++ b/src/util/test_crypto_symmetric.c
@@ -24,8 +24,7 @@
24 * @brief test for AES ciphers 24 * @brief test for AES ciphers
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_crypto_lib.h"
29 28
30#define TESTSTRING "Hello World!" 29#define TESTSTRING "Hello World!"
31#define INITVALUE "InitializationVectorValueinitializationvectorvalue" 30#define INITVALUE "InitializationVectorValueinitializationvectorvalue"
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index 7fc8618ce..7579ac7dc 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -24,9 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_disk_lib.h"
29#include "gnunet_scheduler_lib.h"
30 28
31#define TESTSTRING "Hello World\0" 29#define TESTSTRING "Hello World\0"
32 30
diff --git a/src/util/test_getopt.c b/src/util/test_getopt.c
index 313167d17..9e56bc843 100644
--- a/src/util/test_getopt.c
+++ b/src/util/test_getopt.c
@@ -22,9 +22,7 @@
22 * @brief testcase for util/getopt.c 22 * @brief testcase for util/getopt.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_configuration_lib.h"
27#include "gnunet_getopt_lib.h"
28 26
29 27
30static int 28static int
diff --git a/src/util/test_mq_client.c b/src/util/test_mq_client.c
index 18cd8a948..4e460ebdb 100644
--- a/src/util/test_mq_client.c
+++ b/src/util/test_mq_client.c
@@ -23,7 +23,6 @@
23 * @brief tests for mq with connection client 23 * @brief tests for mq with connection client
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_common.h"
27#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
28 27
29#define PORT 23336 28#define PORT 23336
diff --git a/src/util/test_os_network.c b/src/util/test_os_network.c
index 2cdd75040..b46ef8f1d 100644
--- a/src/util/test_os_network.c
+++ b/src/util/test_os_network.c
@@ -22,9 +22,7 @@
22 * @brief testcase for util/os_network.c 22 * @brief testcase for util/os_network.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_configuration_lib.h"
27#include "gnunet_os_lib.h"
28 26
29 27
30/** 28/**
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 124b364fb..2b1d9070c 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -26,11 +26,7 @@
26 * correct data "HELLO" is read then all is well. 26 * correct data "HELLO" is read then all is well.
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_common.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_getopt_lib.h"
31#include "gnunet_os_lib.h"
32#include "gnunet_program_lib.h"
33#include "gnunet_scheduler_lib.h"
34#include "disk.h" 30#include "disk.h"
35 31
36 32
diff --git a/src/util/test_peer.c b/src/util/test_peer.c
index fa4d31b8d..51f759867 100644
--- a/src/util/test_peer.c
+++ b/src/util/test_peer.c
@@ -24,8 +24,8 @@
24 */ 24 */
25 25
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_crypto_lib.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_peer_lib.h" 28#include <gcrypt.h>
29 29
30#define NUMBER_OF_PEERS 10 30#define NUMBER_OF_PEERS 10
31 31
@@ -42,8 +42,9 @@ generatePeerIdList ()
42 42
43 for (i = 0; i < NUMBER_OF_PEERS; i++) 43 for (i = 0; i < NUMBER_OF_PEERS; i++)
44 { 44 {
45 GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, 45 gcry_randomize (&pidArr[i],
46 &pidArr[i].hashPubKey); 46 sizeof (struct GNUNET_PeerIdentity),
47 GCRY_STRONG_RANDOM);
47 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 48 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
48 "Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i])); 49 "Peer %d: %s\n", i, GNUNET_i2s (&pidArr[i]));
49 } 50 }
diff --git a/src/util/test_plugin.c b/src/util/test_plugin.c
index f2abfa77d..e819e678a 100644
--- a/src/util/test_plugin.c
+++ b/src/util/test_plugin.c
@@ -22,7 +22,7 @@
22 * @brief testcase for plugin.c 22 * @brief testcase for plugin.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_plugin_lib.h" 25#include "gnunet_util_lib.h"
26 26
27 27
28static void 28static void
diff --git a/src/util/test_program.c b/src/util/test_program.c
index faeb4e716..6f4a035ad 100644
--- a/src/util/test_program.c
+++ b/src/util/test_program.c
@@ -22,10 +22,7 @@
22 * @brief tests for program.c 22 * @brief tests for program.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_program_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_time_lib.h"
29 26
30static int setme1, setme2; 27static int setme1, setme2;
31 28
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 50354825a..70ff95550 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -22,10 +22,7 @@
22 * @brief tests for the scheduler 22 * @brief tests for the scheduler
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_scheduler_lib.h"
27#include "gnunet_time_lib.h"
28#include "gnunet_disk_lib.h"
29 26
30 27
31struct GNUNET_DISK_PipeHandle *p; 28struct GNUNET_DISK_PipeHandle *p;
diff --git a/src/util/test_server.c b/src/util/test_server.c
index 454fc6413..c39744f8a 100644
--- a/src/util/test_server.c
+++ b/src/util/test_server.c
@@ -22,11 +22,7 @@
22 * @brief tests for server.c 22 * @brief tests for server.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_client_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_server_lib.h"
29#include "gnunet_time_lib.h"
30 26
31#define PORT 12435 27#define PORT 12435
32 28
diff --git a/src/util/test_server_disconnect.c b/src/util/test_server_disconnect.c
index b54df4889..917784d8e 100644
--- a/src/util/test_server_disconnect.c
+++ b/src/util/test_server_disconnect.c
@@ -22,11 +22,7 @@
22 * @brief tests for server.c, specifically GNUNET_SERVER_client_disconnect 22 * @brief tests for server.c, specifically GNUNET_SERVER_client_disconnect
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_client_lib.h"
27#include "gnunet_scheduler_lib.h"
28#include "gnunet_server_lib.h"
29#include "gnunet_time_lib.h"
30 26
31 27
32#define PORT 12435 28#define PORT 12435
diff --git a/src/util/test_server_mst_interrupt.c b/src/util/test_server_mst_interrupt.c
index 8fd7a2b54..cfd891522 100644
--- a/src/util/test_server_mst_interrupt.c
+++ b/src/util/test_server_mst_interrupt.c
@@ -22,12 +22,8 @@
22 * @brief test for interrupt message processing in server_mst.c 22 * @brief test for interrupt message processing in server_mst.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h"
26#include "gnunet_protocols.h" 25#include "gnunet_protocols.h"
27#include "gnunet_client_lib.h" 26#include "gnunet_util_lib.h"
28#include "gnunet_scheduler_lib.h"
29#include "gnunet_server_lib.h"
30#include "gnunet_time_lib.h"
31 27
32static struct GNUNET_SERVER_MessageStreamTokenizer * mst; 28static struct GNUNET_SERVER_MessageStreamTokenizer * mst;
33 29
diff --git a/src/util/test_server_with_client.c b/src/util/test_server_with_client.c
index c49456301..01971d96d 100644
--- a/src/util/test_server_with_client.c
+++ b/src/util/test_server_with_client.c
@@ -24,11 +24,7 @@
24 * client_get_address and receive_done (resume processing) 24 * client_get_address and receive_done (resume processing)
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_scheduler_lib.h"
29#include "gnunet_client_lib.h"
30#include "gnunet_server_lib.h"
31#include "gnunet_time_lib.h"
32 28
33#define PORT 22335 29#define PORT 22335
34 30
diff --git a/src/util/test_server_with_client_unix.c b/src/util/test_server_with_client_unix.c
index 57a67d3f4..30e993411 100644
--- a/src/util/test_server_with_client_unix.c
+++ b/src/util/test_server_with_client_unix.c
@@ -24,11 +24,7 @@
24 * client_get_address and receive_done (resume processing) 24 * client_get_address and receive_done (resume processing)
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_common.h" 27#include "gnunet_util_lib.h"
28#include "gnunet_scheduler_lib.h"
29#include "gnunet_client_lib.h"
30#include "gnunet_server_lib.h"
31#include "gnunet_time_lib.h"
32 28
33#define MY_TYPE 128 29#define MY_TYPE 128
34 30
diff --git a/src/util/test_service.c b/src/util/test_service.c
index bdd3d8521..eee0cecc1 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -23,13 +23,7 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_common.h" 26#include "gnunet_util_lib.h"
27#include "gnunet_client_lib.h"
28#include "gnunet_getopt_lib.h"
29#include "gnunet_program_lib.h"
30#include "gnunet_service_lib.h"
31#include "gnunet_scheduler_lib.h"
32#include "gnunet_time_lib.h"
33 27
34 28
35#define PORT 12435 29#define PORT 12435
diff --git a/src/util/test_strings.c b/src/util/test_strings.c
index e0c3cfebf..f6f872211 100644
--- a/src/util/test_strings.c
+++ b/src/util/test_strings.c
@@ -22,8 +22,7 @@
22 * @brief testcase for strings.c 22 * @brief testcase for strings.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_strings_lib.h"
27 26
28 27
29#define WANT(a,b) if (0 != strcmp(a,b)) { fprintf(stderr, "Got `%s', wanted `%s'\n", b, a); GNUNET_free(b); GNUNET_break(0); return 1;} else { GNUNET_free (b); } 28#define WANT(a,b) if (0 != strcmp(a,b)) { fprintf(stderr, "Got `%s', wanted `%s'\n", b, a); GNUNET_free(b); GNUNET_break(0); return 1;} else { GNUNET_free (b); }
diff --git a/src/util/test_strings_to_data.c b/src/util/test_strings_to_data.c
index 2ac680b83..125101e55 100644
--- a/src/util/test_strings_to_data.c
+++ b/src/util/test_strings_to_data.c
@@ -22,9 +22,7 @@
22 * @brief testcase for strings.c 22 * @brief testcase for strings.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_crypto_lib.h"
27#include "gnunet_strings_lib.h"
28 26
29 27
30int 28int
diff --git a/src/util/time.c b/src/util/time.c
index fea0947bd..6b1b43062 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -24,7 +24,7 @@
24 * @brief functions for handling time and time arithmetic 24 * @brief functions for handling time and time arithmetic
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_time_lib.h" 27#include "gnunet_util_lib.h"
28 28
29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) 29#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
30 30