aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-05 15:09:28 +0200
committerChristian Grothoff <christian@grothoff.org>2019-10-05 15:09:28 +0200
commitc4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch)
treecac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/include
parentfbb71d527c7d6babf269a8fefce1db291b9f7068 (diff)
downloadgnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz
gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/include')
-rw-r--r--src/include/block_dns.h3
-rw-r--r--src/include/block_fs.h6
-rw-r--r--src/include/block_regex.h3
-rw-r--r--src/include/compat.h8
-rw-r--r--src/include/gauger.h92
-rw-r--r--src/include/gettext.h14
-rw-r--r--src/include/gnunet_abe_lib.h47
-rw-r--r--src/include/gnunet_arm_service.h57
-rw-r--r--src/include/gnunet_ats_application_service.h15
-rw-r--r--src/include/gnunet_ats_plugin.h27
-rw-r--r--src/include/gnunet_ats_plugin_new.h12
-rw-r--r--src/include/gnunet_ats_service.h137
-rw-r--r--src/include/gnunet_ats_transport_service.h37
-rw-r--r--src/include/gnunet_bandwidth_lib.h48
-rw-r--r--src/include/gnunet_bio_lib.h68
-rw-r--r--src/include/gnunet_block_group_lib.h22
-rw-r--r--src/include/gnunet_block_lib.h79
-rw-r--r--src/include/gnunet_block_plugin.h9
-rw-r--r--src/include/gnunet_cadet_service.h108
-rw-r--r--src/include/gnunet_common.h441
-rw-r--r--src/include/gnunet_configuration_lib.h221
-rw-r--r--src/include/gnunet_consensus_service.h35
-rw-r--r--src/include/gnunet_constants.h29
-rw-r--r--src/include/gnunet_container_lib.h647
-rw-r--r--src/include/gnunet_conversation_service.h89
-rw-r--r--src/include/gnunet_core_service.h37
-rw-r--r--src/include/gnunet_credential_service.h109
-rw-r--r--src/include/gnunet_crypto_lib.h524
-rw-r--r--src/include/gnunet_curl_lib.h70
-rw-r--r--src/include/gnunet_datacache_lib.h50
-rw-r--r--src/include/gnunet_datacache_plugin.h6
-rw-r--r--src/include/gnunet_datastore_plugin.h6
-rw-r--r--src/include/gnunet_datastore_service.h117
-rw-r--r--src/include/gnunet_db_lib.h3
-rw-r--r--src/include/gnunet_dht_service.h76
-rw-r--r--src/include/gnunet_dns_service.h23
-rw-r--r--src/include/gnunet_dnsparser_lib.h181
-rw-r--r--src/include/gnunet_dnsstub_lib.h28
-rw-r--r--src/include/gnunet_fragmentation_lib.h48
-rw-r--r--src/include/gnunet_friends_lib.h17
-rw-r--r--src/include/gnunet_fs_service.h558
-rw-r--r--src/include/gnunet_getopt_lib.h142
-rw-r--r--src/include/gnunet_gns_service.h37
-rw-r--r--src/include/gnunet_gnsrecord_lib.h92
-rw-r--r--src/include/gnunet_gnsrecord_plugin.h3
-rw-r--r--src/include/gnunet_hello_lib.h107
-rw-r--r--src/include/gnunet_helper_lib.h32
-rw-r--r--src/include/gnunet_identity_service.h84
-rw-r--r--src/include/gnunet_json_lib.h110
-rw-r--r--src/include/gnunet_load_lib.h14
-rw-r--r--src/include/gnunet_microphone_lib.h11
-rw-r--r--src/include/gnunet_mq_lib.h224
-rw-r--r--src/include/gnunet_mst_lib.h28
-rw-r--r--src/include/gnunet_my_lib.h75
-rw-r--r--src/include/gnunet_mysql_lib.h20
-rw-r--r--src/include/gnunet_namecache_plugin.h6
-rw-r--r--src/include/gnunet_namecache_service.h22
-rw-r--r--src/include/gnunet_namestore_plugin.h6
-rw-r--r--src/include/gnunet_namestore_service.h113
-rw-r--r--src/include/gnunet_nat_auto_service.h25
-rw-r--r--src/include/gnunet_nat_service.h63
-rw-r--r--src/include/gnunet_nc_lib.h16
-rw-r--r--src/include/gnunet_network_lib.h178
-rw-r--r--src/include/gnunet_nse_service.h8
-rw-r--r--src/include/gnunet_nt_lib.h15
-rw-r--r--src/include/gnunet_op_lib.h40
-rw-r--r--src/include/gnunet_peer_lib.h16
-rw-r--r--src/include/gnunet_peerinfo_service.h34
-rw-r--r--src/include/gnunet_peerstore_plugin.h3
-rw-r--r--src/include/gnunet_peerstore_service.h60
-rw-r--r--src/include/gnunet_plugin_lib.h18
-rw-r--r--src/include/gnunet_pq_lib.h128
-rw-r--r--src/include/gnunet_program_lib.h30
-rw-r--r--src/include/gnunet_reclaim_attribute_lib.h53
-rw-r--r--src/include/gnunet_reclaim_attribute_plugin.h3
-rw-r--r--src/include/gnunet_reclaim_service.h31
-rw-r--r--src/include/gnunet_regex_service.h20
-rw-r--r--src/include/gnunet_resolver_service.h38
-rw-r--r--src/include/gnunet_rest_lib.h23
-rw-r--r--src/include/gnunet_rest_plugin.h3
-rw-r--r--src/include/gnunet_revocation_service.h31
-rw-r--r--src/include/gnunet_rps_service.h74
-rw-r--r--src/include/gnunet_scalarproduct_service.h47
-rw-r--r--src/include/gnunet_secretsharing_service.h92
-rw-r--r--src/include/gnunet_set_service.h105
-rw-r--r--src/include/gnunet_signal_lib.h8
-rw-r--r--src/include/gnunet_socks.h8
-rw-r--r--src/include/gnunet_speaker_lib.h8
-rw-r--r--src/include/gnunet_sq_lib.h99
-rw-r--r--src/include/gnunet_statistics_service.h58
-rw-r--r--src/include/gnunet_strings_lib.h168
-rw-r--r--src/include/gnunet_testbed_logger_service.h18
-rw-r--r--src/include/gnunet_testbed_service.h452
-rw-r--r--src/include/gnunet_testing_lib.h102
-rw-r--r--src/include/gnunet_time_lib.h161
-rw-r--r--src/include/gnunet_transport_application_service.h10
-rw-r--r--src/include/gnunet_transport_communication_service.h22
-rw-r--r--src/include/gnunet_transport_core_service.h22
-rw-r--r--src/include/gnunet_transport_hello_service.h19
-rw-r--r--src/include/gnunet_transport_manipulation_service.h18
-rw-r--r--src/include/gnunet_transport_monitor_service.h18
-rw-r--r--src/include/gnunet_transport_plugin.h42
-rw-r--r--src/include/gnunet_transport_service.h67
-rw-r--r--src/include/gnunet_tun_lib.h144
-rw-r--r--src/include/gnunet_vpn_service.h36
-rw-r--r--src/include/platform.h16
106 files changed, 4177 insertions, 3706 deletions
diff --git a/src/include/block_dns.h b/src/include/block_dns.h
index 2e94e8c02..2186cb1a1 100644
--- a/src/include/block_dns.h
+++ b/src/include/block_dns.h
@@ -37,7 +37,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
37/** 37/**
38 * This is the structure describing an DNS exit service. 38 * This is the structure describing an DNS exit service.
39 */ 39 */
40struct GNUNET_DNS_Advertisement { 40struct GNUNET_DNS_Advertisement
41{
41 /** 42 /**
42 * Signature of the peer affirming that it is offering the service. 43 * Signature of the peer affirming that it is offering the service.
43 */ 44 */
diff --git a/src/include/block_fs.h b/src/include/block_fs.h
index fb651909a..358fb43fa 100644
--- a/src/include/block_fs.h
+++ b/src/include/block_fs.h
@@ -47,7 +47,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
47/** 47/**
48 * @brief universal block for keyword and namespace search results 48 * @brief universal block for keyword and namespace search results
49 */ 49 */
50struct UBlock { 50struct UBlock
51{
51 /** 52 /**
52 * Signature using pseudonym and search keyword / identifier. 53 * Signature using pseudonym and search keyword / identifier.
53 */ 54 */
@@ -78,7 +79,8 @@ struct UBlock {
78 * can be obtained directly from reading 79 * can be obtained directly from reading
79 * the plaintext file) 80 * the plaintext file)
80 */ 81 */
81struct OnDemandBlock { 82struct OnDemandBlock
83{
82 /** 84 /**
83 * Hash code of the entire content of the 85 * Hash code of the entire content of the
84 * file that was indexed (used to uniquely 86 * file that was indexed (used to uniquely
diff --git a/src/include/block_regex.h b/src/include/block_regex.h
index e29785cdf..cc78f2c32 100644
--- a/src/include/block_regex.h
+++ b/src/include/block_regex.h
@@ -46,7 +46,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
46/** 46/**
47 * @brief Block to announce a peer accepting a state. 47 * @brief Block to announce a peer accepting a state.
48 */ 48 */
49struct RegexAcceptBlock { 49struct RegexAcceptBlock
50{
50 /** 51 /**
51 * Accept blocks must be signed. Signature 52 * Accept blocks must be signed. Signature
52 * goes over expiration time and key. 53 * goes over expiration time and key.
diff --git a/src/include/compat.h b/src/include/compat.h
index 1a1103a81..19badcefc 100644
--- a/src/include/compat.h
+++ b/src/include/compat.h
@@ -41,11 +41,11 @@ extern "C"
41 * @param n search character limit 41 * @param n search character limit
42 */ 42 */
43void* 43void*
44GN_memrchr_(const void *s, 44GN_memrchr_ (const void *s,
45 int c, 45 int c,
46 size_t n); 46 size_t n);
47#ifndef HAVE_MEMRCHR 47#ifndef HAVE_MEMRCHR
48#define memrchr(s, c, n) GN_memrchr_(s, c, n) 48#define memrchr(s, c, n) GN_memrchr_ (s, c, n)
49#endif 49#endif
50 50
51#ifdef __cplusplus 51#ifdef __cplusplus
diff --git a/src/include/gauger.h b/src/include/gauger.h
index 562208e1f..ac86ee586 100644
--- a/src/include/gauger.h
+++ b/src/include/gauger.h
@@ -17,64 +17,64 @@
17 17
18#define GAUGER(category, counter, value, unit) \ 18#define GAUGER(category, counter, value, unit) \
19 { \ 19 { \
20 char* __gauger_v[10]; \ 20 char*__gauger_v[10]; \
21 char __gauger_s[32]; \ 21 char __gauger_s[32]; \
22 pid_t __gauger_p; \ 22 pid_t __gauger_p; \
23 if (!(__gauger_p = fork())) { \ 23 if (! (__gauger_p = fork ())) { \
24 close(1); \ 24 close (1); \
25 close(2); \ 25 close (2); \
26 if (!fork()) { \ 26 if (! fork ()) { \
27 sprintf(__gauger_s, "%Lf", (long double)(value)); \ 27 sprintf (__gauger_s, "%Lf", (long double) (value)); \
28 __gauger_v[0] = "gauger"; \ 28 __gauger_v[0] = "gauger"; \
29 __gauger_v[1] = "-n"; \ 29 __gauger_v[1] = "-n"; \
30 __gauger_v[2] = (char*)(counter); \ 30 __gauger_v[2] = (char*) (counter); \
31 __gauger_v[3] = "-d"; \ 31 __gauger_v[3] = "-d"; \
32 __gauger_v[4] = __gauger_s; \ 32 __gauger_v[4] = __gauger_s; \
33 __gauger_v[5] = "-u"; \ 33 __gauger_v[5] = "-u"; \
34 __gauger_v[6] = (char*)(unit); \ 34 __gauger_v[6] = (char*) (unit); \
35 __gauger_v[7] = "-c"; \ 35 __gauger_v[7] = "-c"; \
36 __gauger_v[8] = (char*)(category); \ 36 __gauger_v[8] = (char*) (category); \
37 __gauger_v[9] = (char*)NULL; \ 37 __gauger_v[9] = (char*) NULL; \
38 execvp("gauger", __gauger_v); \ 38 execvp ("gauger", __gauger_v); \
39 _exit(1); \ 39 _exit (1); \
40 }else{ \
41 _exit(0); \
42 } \
43 }else{ \ 40 }else{ \
44 waitpid(__gauger_p, NULL, 0); \ 41 _exit (0); \
45 } \ 42 } \
43 }else{ \
44 waitpid (__gauger_p, NULL, 0); \
45 } \
46 } 46 }
47 47
48#define GAUGER_ID(category, counter, value, unit, id) \ 48#define GAUGER_ID(category, counter, value, unit, id) \
49 { \ 49 { \
50 char* __gauger_v[12]; \ 50 char*__gauger_v[12]; \
51 char __gauger_s[32]; \ 51 char __gauger_s[32]; \
52 pid_t __gauger_p; \ 52 pid_t __gauger_p; \
53 if (!(__gauger_p = fork())) { \ 53 if (! (__gauger_p = fork ())) { \
54 close(1); \ 54 close (1); \
55 close(2); \ 55 close (2); \
56 if (!fork()) { \ 56 if (! fork ()) { \
57 sprintf(__gauger_s, "%Lf", (long double)(value)); \ 57 sprintf (__gauger_s, "%Lf", (long double) (value)); \
58 __gauger_v[0] = "gauger"; \ 58 __gauger_v[0] = "gauger"; \
59 __gauger_v[1] = "-n"; \ 59 __gauger_v[1] = "-n"; \
60 __gauger_v[2] = (char*)(counter); \ 60 __gauger_v[2] = (char*) (counter); \
61 __gauger_v[3] = "-d"; \ 61 __gauger_v[3] = "-d"; \
62 __gauger_v[4] = __gauger_s; \ 62 __gauger_v[4] = __gauger_s; \
63 __gauger_v[5] = "-u"; \ 63 __gauger_v[5] = "-u"; \
64 __gauger_v[6] = (char*)(unit); \ 64 __gauger_v[6] = (char*) (unit); \
65 __gauger_v[7] = "-i"; \ 65 __gauger_v[7] = "-i"; \
66 __gauger_v[8] = id; \ 66 __gauger_v[8] = id; \
67 __gauger_v[9] = "-c"; \ 67 __gauger_v[9] = "-c"; \
68 __gauger_v[10] = (char *)(category); \ 68 __gauger_v[10] = (char *) (category); \
69 __gauger_v[11] = (char *)NULL; \ 69 __gauger_v[11] = (char *) NULL; \
70 execvp("gauger", __gauger_v); \ 70 execvp ("gauger", __gauger_v); \
71 _exit(1); \ 71 _exit (1); \
72 }else{ \
73 _exit(0); \
74 } \
75 }else{ \ 72 }else{ \
76 waitpid(__gauger_p, NULL, 0); \ 73 _exit (0); \
77 } \ 74 } \
75 }else{ \
76 waitpid (__gauger_p, NULL, 0); \
77 } \
78 } 78 }
79 79
80#endif 80#endif
diff --git a/src/include/gettext.h b/src/include/gettext.h
index 1eb6cee93..458512657 100644
--- a/src/include/gettext.h
+++ b/src/include/gettext.h
@@ -42,20 +42,20 @@
42 for invalid uses of the value returned from these functions. 42 for invalid uses of the value returned from these functions.
43 On pre-ANSI systems without 'const', the config.h file is supposed to 43 On pre-ANSI systems without 'const', the config.h file is supposed to
44 contain "#define const". */ 44 contain "#define const". */
45#define gettext(Msgid) ((const char *)(Msgid)) 45#define gettext(Msgid) ((const char *) (Msgid))
46#define dgettext(Domainname, Msgid) ((const char *)(Msgid)) 46#define dgettext(Domainname, Msgid) ((const char *) (Msgid))
47#define dcgettext(Domainname, Msgid, Category) ((const char *)(Msgid)) 47#define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
48#define ngettext(Msgid1, Msgid2, N) \ 48#define ngettext(Msgid1, Msgid2, N) \
49 ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) 49 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
50#define dngettext(Domainname, Msgid1, Msgid2, N) \ 50#define dngettext(Domainname, Msgid1, Msgid2, N) \
51 ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) 51 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
52#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ 52#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
53 ((N) == 1 ? (const char *)(Msgid1) : (const char *)(Msgid2)) 53 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
54/* slight modification here to avoid warnings: generate GNUNET_NO code, 54/* slight modification here to avoid warnings: generate GNUNET_NO code,
55 not even the cast... */ 55 not even the cast... */
56#define textdomain(Domainname) 56#define textdomain(Domainname)
57#define bindtextdomain(Domainname, Dirname) 57#define bindtextdomain(Domainname, Dirname)
58#define bind_textdomain_codeset(Domainname, Codeset) ((const char *)(Codeset)) 58#define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
59 59
60#endif 60#endif
61 61
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h
index 1988f4dec..fd1df9f0d 100644
--- a/src/include/gnunet_abe_lib.h
+++ b/src/include/gnunet_abe_lib.h
@@ -60,7 +60,7 @@ struct GNUNET_CRYPTO_AbeKey;
60 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key 60 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key
61 */ 61 */
62struct GNUNET_ABE_AbeMasterKey * 62struct GNUNET_ABE_AbeMasterKey *
63GNUNET_ABE_cpabe_create_master_key(void); 63GNUNET_ABE_cpabe_create_master_key (void);
64 64
65/** 65/**
66 * @ingroup abe 66 * @ingroup abe
@@ -70,7 +70,7 @@ GNUNET_ABE_cpabe_create_master_key(void);
70 * @return fresh private key; free using #GNUNET_free 70 * @return fresh private key; free using #GNUNET_free
71 */ 71 */
72void 72void
73GNUNET_ABE_cpabe_delete_master_key(struct GNUNET_ABE_AbeMasterKey *key); 73GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key);
74 74
75/** 75/**
76 * @ingroup abe 76 * @ingroup abe
@@ -81,8 +81,8 @@ GNUNET_ABE_cpabe_delete_master_key(struct GNUNET_ABE_AbeMasterKey *key);
81 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key 81 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key
82 */ 82 */
83struct GNUNET_ABE_AbeKey * 83struct GNUNET_ABE_AbeKey *
84GNUNET_ABE_cpabe_create_key(struct GNUNET_ABE_AbeMasterKey *key, 84GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key,
85 char **attrs); 85 char **attrs);
86 86
87/** 87/**
88 * @ingroup abe 88 * @ingroup abe
@@ -93,8 +93,8 @@ GNUNET_ABE_cpabe_create_key(struct GNUNET_ABE_AbeMasterKey *key,
93 * @return fresh private key; free using #GNUNET_free 93 * @return fresh private key; free using #GNUNET_free
94 */ 94 */
95void 95void
96GNUNET_ABE_cpabe_delete_key(struct GNUNET_ABE_AbeKey *key, 96GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key,
97 int delete_pub); 97 int delete_pub);
98 98
99 99
100/** 100/**
@@ -109,11 +109,11 @@ GNUNET_ABE_cpabe_delete_key(struct GNUNET_ABE_AbeKey *key,
109 * @return the size of the encrypted block, -1 for errors 109 * @return the size of the encrypted block, -1 for errors
110 */ 110 */
111ssize_t 111ssize_t
112GNUNET_ABE_cpabe_encrypt(const void *block, 112GNUNET_ABE_cpabe_encrypt (const void *block,
113 size_t size, 113 size_t size,
114 const char *policy, 114 const char *policy,
115 const struct GNUNET_ABE_AbeMasterKey *key, 115 const struct GNUNET_ABE_AbeMasterKey *key,
116 void **result); 116 void **result);
117 117
118/** 118/**
119 * @ingroup abe 119 * @ingroup abe
@@ -126,10 +126,10 @@ GNUNET_ABE_cpabe_encrypt(const void *block,
126 * @return the size of the encrypted block, -1 for errors 126 * @return the size of the encrypted block, -1 for errors
127 */ 127 */
128ssize_t 128ssize_t
129GNUNET_ABE_cpabe_decrypt(const void *block, 129GNUNET_ABE_cpabe_decrypt (const void *block,
130 size_t size, 130 size_t size,
131 const struct GNUNET_ABE_AbeKey *key, 131 const struct GNUNET_ABE_AbeKey *key,
132 void **result); 132 void **result);
133 133
134/** 134/**
135 * @ingroup abe 135 * @ingroup abe
@@ -140,8 +140,8 @@ GNUNET_ABE_cpabe_decrypt(const void *block,
140 * @return the size of the encrypted block, -1 for errors 140 * @return the size of the encrypted block, -1 for errors
141 */ 141 */
142ssize_t 142ssize_t
143GNUNET_ABE_cpabe_serialize_key(const struct GNUNET_ABE_AbeKey *key, 143GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key,
144 void **result); 144 void **result);
145 145
146/** 146/**
147 * @ingroup abe 147 * @ingroup abe
@@ -152,8 +152,8 @@ GNUNET_ABE_cpabe_serialize_key(const struct GNUNET_ABE_AbeKey *key,
152 * @return the ABE key. NULL of unsuccessful 152 * @return the ABE key. NULL of unsuccessful
153 */ 153 */
154struct GNUNET_ABE_AbeKey* 154struct GNUNET_ABE_AbeKey*
155GNUNET_ABE_cpabe_deserialize_key(const void *data, 155GNUNET_ABE_cpabe_deserialize_key (const void *data,
156 size_t len); 156 size_t len);
157 157
158/** 158/**
159 * @ingroup abe 159 * @ingroup abe
@@ -164,8 +164,9 @@ GNUNET_ABE_cpabe_deserialize_key(const void *data,
164 * @return the size of the encrypted block, -1 for errors 164 * @return the size of the encrypted block, -1 for errors
165 */ 165 */
166ssize_t 166ssize_t
167GNUNET_ABE_cpabe_serialize_master_key(const struct GNUNET_ABE_AbeMasterKey *key, 167GNUNET_ABE_cpabe_serialize_master_key (const struct
168 void **result); 168 GNUNET_ABE_AbeMasterKey *key,
169 void **result);
169 170
170/** 171/**
171 * @ingroup abe 172 * @ingroup abe
@@ -176,8 +177,8 @@ GNUNET_ABE_cpabe_serialize_master_key(const struct GNUNET_ABE_AbeMasterKey *key,
176 * @return the ABE key. NULL of unsuccessful 177 * @return the ABE key. NULL of unsuccessful
177 */ 178 */
178struct GNUNET_ABE_AbeMasterKey* 179struct GNUNET_ABE_AbeMasterKey*
179GNUNET_ABE_cpabe_deserialize_master_key(const void *data, 180GNUNET_ABE_cpabe_deserialize_master_key (const void *data,
180 size_t len); 181 size_t len);
181 182
182 183
183#if 0 /* keep Emacsens' auto-indent happy */ 184#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h
index 32355a3e5..4dac317ec 100644
--- a/src/include/gnunet_arm_service.h
+++ b/src/include/gnunet_arm_service.h
@@ -54,7 +54,8 @@ extern "C"
54/** 54/**
55 * Statuses of the requests that client can send to ARM. 55 * Statuses of the requests that client can send to ARM.
56 */ 56 */
57enum GNUNET_ARM_RequestStatus { 57enum GNUNET_ARM_RequestStatus
58{
58 /** 59 /**
59 * Message was sent successfully. 60 * Message was sent successfully.
60 */ 61 */
@@ -70,7 +71,8 @@ enum GNUNET_ARM_RequestStatus {
70/** 71/**
71 * Statuses of services. 72 * Statuses of services.
72 */ 73 */
73enum GNUNET_ARM_ServiceMonitorStatus { 74enum GNUNET_ARM_ServiceMonitorStatus
75{
74 /** 76 /**
75 * Dummy message. 77 * Dummy message.
76 */ 78 */
@@ -96,7 +98,8 @@ enum GNUNET_ARM_ServiceMonitorStatus {
96/** 98/**
97 * Replies to ARM requests 99 * Replies to ARM requests
98 */ 100 */
99enum GNUNET_ARM_Result { 101enum GNUNET_ARM_Result
102{
100 /** 103 /**
101 * Service was stopped (never sent for ARM itself). 104 * Service was stopped (never sent for ARM itself).
102 */ 105 */
@@ -290,9 +293,9 @@ typedef void
290 * @return context to use for further ARM operations, NULL on error. 293 * @return context to use for further ARM operations, NULL on error.
291 */ 294 */
292struct GNUNET_ARM_Handle * 295struct GNUNET_ARM_Handle *
293GNUNET_ARM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 296GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
294 GNUNET_ARM_ConnectionStatusCallback conn_status, 297 GNUNET_ARM_ConnectionStatusCallback conn_status,
295 void *conn_status_cls); 298 void *conn_status_cls);
296 299
297 300
298/** 301/**
@@ -301,7 +304,7 @@ GNUNET_ARM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
301 * @param h the handle that was being used 304 * @param h the handle that was being used
302 */ 305 */
303void 306void
304GNUNET_ARM_disconnect(struct GNUNET_ARM_Handle *h); 307GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h);
305 308
306 309
307/** 310/**
@@ -311,7 +314,7 @@ GNUNET_ARM_disconnect(struct GNUNET_ARM_Handle *h);
311 * @param op operation to cancel 314 * @param op operation to cancel
312 */ 315 */
313void 316void
314GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op); 317GNUNET_ARM_operation_cancel (struct GNUNET_ARM_Operation *op);
315 318
316 319
317/** 320/**
@@ -323,9 +326,9 @@ GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op);
323 * @return handle for the operation, NULL on error 326 * @return handle for the operation, NULL on error
324 */ 327 */
325struct GNUNET_ARM_Operation * 328struct GNUNET_ARM_Operation *
326GNUNET_ARM_request_service_list(struct GNUNET_ARM_Handle *h, 329GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h,
327 GNUNET_ARM_ServiceListCallback cont, 330 GNUNET_ARM_ServiceListCallback cont,
328 void *cont_cls); 331 void *cont_cls);
329 332
330 333
331/** 334/**
@@ -343,10 +346,10 @@ GNUNET_ARM_request_service_list(struct GNUNET_ARM_Handle *h,
343 * @return handle for the operation, NULL on error 346 * @return handle for the operation, NULL on error
344 */ 347 */
345struct GNUNET_ARM_Operation * 348struct GNUNET_ARM_Operation *
346GNUNET_ARM_request_service_stop(struct GNUNET_ARM_Handle *h, 349GNUNET_ARM_request_service_stop (struct GNUNET_ARM_Handle *h,
347 const char *service_name, 350 const char *service_name,
348 GNUNET_ARM_ResultCallback cont, 351 GNUNET_ARM_ResultCallback cont,
349 void *cont_cls); 352 void *cont_cls);
350 353
351 354
352/** 355/**
@@ -360,11 +363,12 @@ GNUNET_ARM_request_service_stop(struct GNUNET_ARM_Handle *h,
360 * @return handle for the operation, NULL on error 363 * @return handle for the operation, NULL on error
361 */ 364 */
362struct GNUNET_ARM_Operation * 365struct GNUNET_ARM_Operation *
363GNUNET_ARM_request_service_start(struct GNUNET_ARM_Handle *h, 366GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
364 const char *service_name, 367 const char *service_name,
365 enum GNUNET_OS_InheritStdioFlags std_inheritance, 368 enum GNUNET_OS_InheritStdioFlags
366 GNUNET_ARM_ResultCallback cont, 369 std_inheritance,
367 void *cont_cls); 370 GNUNET_ARM_ResultCallback cont,
371 void *cont_cls);
368 372
369 373
370/** 374/**
@@ -382,8 +386,9 @@ struct GNUNET_ARM_MonitorHandle;
382 */ 386 */
383typedef void 387typedef void
384(*GNUNET_ARM_ServiceMonitorCallback) (void *cls, 388(*GNUNET_ARM_ServiceMonitorCallback) (void *cls,
385 const char *service, 389 const char *service,
386 enum GNUNET_ARM_ServiceMonitorStatus status); 390 enum GNUNET_ARM_ServiceMonitorStatus
391 status);
387 392
388 393
389/** 394/**
@@ -398,9 +403,9 @@ typedef void
398 * @return context to use for further ARM monitor operations, NULL on error. 403 * @return context to use for further ARM monitor operations, NULL on error.
399 */ 404 */
400struct GNUNET_ARM_MonitorHandle * 405struct GNUNET_ARM_MonitorHandle *
401GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 406GNUNET_ARM_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
402 GNUNET_ARM_ServiceMonitorCallback cont, 407 GNUNET_ARM_ServiceMonitorCallback cont,
403 void *cont_cls); 408 void *cont_cls);
404 409
405 410
406/** 411/**
@@ -409,7 +414,7 @@ GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
409 * @param h the handle that was being used 414 * @param h the handle that was being used
410 */ 415 */
411void 416void
412GNUNET_ARM_monitor_stop(struct GNUNET_ARM_MonitorHandle *h); 417GNUNET_ARM_monitor_stop (struct GNUNET_ARM_MonitorHandle *h);
413 418
414#if 0 /* keep Emacsens' auto-indent happy */ 419#if 0 /* keep Emacsens' auto-indent happy */
415{ 420{
diff --git a/src/include/gnunet_ats_application_service.h b/src/include/gnunet_ats_application_service.h
index f11807f22..8038f0cf3 100644
--- a/src/include/gnunet_ats_application_service.h
+++ b/src/include/gnunet_ats_application_service.h
@@ -51,7 +51,7 @@ struct GNUNET_ATS_ApplicationHandle;
51 * @return ats application handle, NULL on error 51 * @return ats application handle, NULL on error
52 */ 52 */
53struct GNUNET_ATS_ApplicationHandle * 53struct GNUNET_ATS_ApplicationHandle *
54GNUNET_ATS_application_init(const struct GNUNET_CONFIGURATION_Handle *cfg); 54GNUNET_ATS_application_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
55 55
56 56
57/** 57/**
@@ -60,7 +60,7 @@ GNUNET_ATS_application_init(const struct GNUNET_CONFIGURATION_Handle *cfg);
60 * @param ch handle to destroy 60 * @param ch handle to destroy
61 */ 61 */
62void 62void
63GNUNET_ATS_application_done(struct GNUNET_ATS_ApplicationHandle *ch); 63GNUNET_ATS_application_done (struct GNUNET_ATS_ApplicationHandle *ch);
64 64
65 65
66/** 66/**
@@ -82,10 +82,10 @@ struct GNUNET_ATS_ApplicationSuggestHandle;
82 * @return suggestion handle, NULL if request is already pending 82 * @return suggestion handle, NULL if request is already pending
83 */ 83 */
84struct GNUNET_ATS_ApplicationSuggestHandle * 84struct GNUNET_ATS_ApplicationSuggestHandle *
85GNUNET_ATS_application_suggest(struct GNUNET_ATS_ApplicationHandle *ch, 85GNUNET_ATS_application_suggest (struct GNUNET_ATS_ApplicationHandle *ch,
86 const struct GNUNET_PeerIdentity *peer, 86 const struct GNUNET_PeerIdentity *peer,
87 enum GNUNET_MQ_PreferenceKind pk, 87 enum GNUNET_MQ_PreferenceKind pk,
88 struct GNUNET_BANDWIDTH_Value32NBO bw); 88 struct GNUNET_BANDWIDTH_Value32NBO bw);
89 89
90 90
91/** 91/**
@@ -94,7 +94,8 @@ GNUNET_ATS_application_suggest(struct GNUNET_ATS_ApplicationHandle *ch,
94 * @param sh handle 94 * @param sh handle
95 */ 95 */
96void 96void
97GNUNET_ATS_application_suggest_cancel(struct GNUNET_ATS_ApplicationSuggestHandle *sh); 97GNUNET_ATS_application_suggest_cancel (struct
98 GNUNET_ATS_ApplicationSuggestHandle *sh);
98 99
99/** @} */ /* end of group */ 100/** @} */ /* end of group */
100 101
diff --git a/src/include/gnunet_ats_plugin.h b/src/include/gnunet_ats_plugin.h
index e2f052678..d27911a18 100644
--- a/src/include/gnunet_ats_plugin.h
+++ b/src/include/gnunet_ats_plugin.h
@@ -74,9 +74,12 @@ typedef void
74 */ 74 */
75typedef void 75typedef void
76(*GAS_solver_address_feedback_preference) (void *solver, 76(*GAS_solver_address_feedback_preference) (void *solver,
77 struct GNUNET_SERVICE_Client *application, 77 struct GNUNET_SERVICE_Client *
78 const struct GNUNET_PeerIdentity *peer, 78 application,
79 const struct GNUNET_TIME_Relative scope, 79 const struct
80 GNUNET_PeerIdentity *peer,
81 const struct GNUNET_TIME_Relative
82 scope,
80 enum GNUNET_ATS_PreferenceKind kind, 83 enum GNUNET_ATS_PreferenceKind kind,
81 double score); 84 double score);
82 85
@@ -154,7 +157,8 @@ typedef void
154 */ 157 */
155typedef void 158typedef void
156(*GAS_solver_stop_get_preferred_address) (void *solver, 159(*GAS_solver_stop_get_preferred_address) (void *solver,
157 const struct GNUNET_PeerIdentity *peer); 160 const struct
161 GNUNET_PeerIdentity *peer);
158 162
159 163
160/** 164/**
@@ -163,7 +167,8 @@ typedef void
163 * Each solver is required to set up and return an instance 167 * Each solver is required to set up and return an instance
164 * of this struct during initialization. 168 * of this struct during initialization.
165 */ 169 */
166struct GNUNET_ATS_SolverFunctions { 170struct GNUNET_ATS_SolverFunctions
171{
167 /** 172 /**
168 * Closure to pass to all solver functions in this struct. 173 * Closure to pass to all solver functions in this struct.
169 */ 174 */
@@ -246,7 +251,8 @@ struct GNUNET_ATS_SolverFunctions {
246 * #GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP 251 * #GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP
247 * 252 *
248 */ 253 */
249enum GAS_Solver_Operation { 254enum GAS_Solver_Operation
255{
250 /** 256 /**
251 * A solution iteration has been started 257 * A solution iteration has been started
252 */ 258 */
@@ -308,7 +314,8 @@ enum GAS_Solver_Operation {
308/** 314/**
309 * Status of a GAS_Solver_Operation operation 315 * Status of a GAS_Solver_Operation operation
310 */ 316 */
311enum GAS_Solver_Status { 317enum GAS_Solver_Status
318{
312 /** 319 /**
313 * Success 320 * Success
314 */ 321 */
@@ -324,7 +331,8 @@ enum GAS_Solver_Status {
324/** 331/**
325 * Status of the operation 332 * Status of the operation
326 */ 333 */
327enum GAS_Solver_Additional_Information { 334enum GAS_Solver_Additional_Information
335{
328 /** 336 /**
329 * No more specific information 337 * No more specific information
330 */ 338 */
@@ -411,7 +419,8 @@ typedef unsigned int
411 * of this type as to the initialization function 419 * of this type as to the initialization function
412 * of the ATS plugins. 420 * of the ATS plugins.
413 */ 421 */
414struct GNUNET_ATS_PluginEnvironment { 422struct GNUNET_ATS_PluginEnvironment
423{
415 /** 424 /**
416 * Configuration handle to be used by the solver 425 * Configuration handle to be used by the solver
417 */ 426 */
diff --git a/src/include/gnunet_ats_plugin_new.h b/src/include/gnunet_ats_plugin_new.h
index f9005ee73..b371321fa 100644
--- a/src/include/gnunet_ats_plugin_new.h
+++ b/src/include/gnunet_ats_plugin_new.h
@@ -46,7 +46,8 @@
46/** 46/**
47 * Preference being expressed by an application client. 47 * Preference being expressed by an application client.
48 */ 48 */
49struct GNUNET_ATS_Preference { 49struct GNUNET_ATS_Preference
50{
50 /** 51 /**
51 * Peer to get address suggestions for. 52 * Peer to get address suggestions for.
52 */ 53 */
@@ -72,7 +73,8 @@ struct GNUNET_ATS_Session;
72/** 73/**
73 * Plugin-relevant information about a session. 74 * Plugin-relevant information about a session.
74 */ 75 */
75struct GNUNET_ATS_SessionData { 76struct GNUNET_ATS_SessionData
77{
76 /** 78 /**
77 * Peer the session is with. 79 * Peer the session is with.
78 */ 80 */
@@ -113,7 +115,8 @@ struct GNUNET_ATS_SessionHandle;
113 * Each solver is required to set up and return an instance 115 * Each solver is required to set up and return an instance
114 * of this struct during initialization. 116 * of this struct during initialization.
115 */ 117 */
116struct GNUNET_ATS_SolverFunctions { 118struct GNUNET_ATS_SolverFunctions
119{
117 /** 120 /**
118 * Closure to pass to all solver functions in this struct. 121 * Closure to pass to all solver functions in this struct.
119 */ 122 */
@@ -189,7 +192,8 @@ struct GNUNET_ATS_SolverFunctions {
189 * of this type as to the initialization function 192 * of this type as to the initialization function
190 * of the ATS plugins. 193 * of the ATS plugins.
191 */ 194 */
192struct GNUNET_ATS_PluginEnvironment { 195struct GNUNET_ATS_PluginEnvironment
196{
193 /** 197 /**
194 * Configuration handle to be used by the solver 198 * Configuration handle to be used by the solver
195 */ 199 */
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h
index a226c7b55..cd1e62bee 100644
--- a/src/include/gnunet_ats_service.h
+++ b/src/include/gnunet_ats_service.h
@@ -68,7 +68,8 @@
68/** 68/**
69 * ATS performance characteristics for an address. 69 * ATS performance characteristics for an address.
70 */ 70 */
71struct GNUNET_ATS_Properties { 71struct GNUNET_ATS_Properties
72{
72 /** 73 /**
73 * Delay. Time between when the time packet is sent and the packet 74 * Delay. Time between when the time packet is sent and the packet
74 * arrives. FOREVER if we did not measure yet. 75 * arrives. FOREVER if we did not measure yet.
@@ -109,7 +110,8 @@ struct GNUNET_ATS_Properties {
109 * ATS performance characteristics for an address in 110 * ATS performance characteristics for an address in
110 * network byte order (for IPC). 111 * network byte order (for IPC).
111 */ 112 */
112struct GNUNET_ATS_PropertiesNBO { 113struct GNUNET_ATS_PropertiesNBO
114{
113 /** 115 /**
114 * Actual traffic on this connection from this peer to the other peer. 116 * Actual traffic on this connection from this peer to the other peer.
115 * Includes transport overhead. 117 * Includes transport overhead.
@@ -158,8 +160,8 @@ struct GNUNET_ATS_PropertiesNBO {
158 * @param hbo value read 160 * @param hbo value read
159 */ 161 */
160void 162void
161GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo, 163GNUNET_ATS_properties_hton (struct GNUNET_ATS_PropertiesNBO *nbo,
162 const struct GNUNET_ATS_Properties *hbo); 164 const struct GNUNET_ATS_Properties *hbo);
163 165
164 166
165/** 167/**
@@ -169,8 +171,8 @@ GNUNET_ATS_properties_hton(struct GNUNET_ATS_PropertiesNBO *nbo,
169 * @param nbo value read 171 * @param nbo value read
170 */ 172 */
171void 173void
172GNUNET_ATS_properties_ntoh(struct GNUNET_ATS_Properties *hbo, 174GNUNET_ATS_properties_ntoh (struct GNUNET_ATS_Properties *hbo,
173 const struct GNUNET_ATS_PropertiesNBO *nbo); 175 const struct GNUNET_ATS_PropertiesNBO *nbo);
174 176
175 177
176 178
@@ -195,7 +197,7 @@ struct GNUNET_ATS_ConnectivitySuggestHandle;
195 * @return ats connectivity handle, NULL on error 197 * @return ats connectivity handle, NULL on error
196 */ 198 */
197struct GNUNET_ATS_ConnectivityHandle * 199struct GNUNET_ATS_ConnectivityHandle *
198GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg); 200GNUNET_ATS_connectivity_init (const struct GNUNET_CONFIGURATION_Handle *cfg);
199 201
200 202
201/** 203/**
@@ -204,7 +206,7 @@ GNUNET_ATS_connectivity_init(const struct GNUNET_CONFIGURATION_Handle *cfg);
204 * @param ch handle to destroy 206 * @param ch handle to destroy
205 */ 207 */
206void 208void
207GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch); 209GNUNET_ATS_connectivity_done (struct GNUNET_ATS_ConnectivityHandle *ch);
208 210
209 211
210/** 212/**
@@ -217,9 +219,9 @@ GNUNET_ATS_connectivity_done(struct GNUNET_ATS_ConnectivityHandle *ch);
217 * @return suggestion handle, NULL if request is already pending 219 * @return suggestion handle, NULL if request is already pending
218 */ 220 */
219struct GNUNET_ATS_ConnectivitySuggestHandle * 221struct GNUNET_ATS_ConnectivitySuggestHandle *
220GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch, 222GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch,
221 const struct GNUNET_PeerIdentity *peer, 223 const struct GNUNET_PeerIdentity *peer,
222 uint32_t strength); 224 uint32_t strength);
223 225
224 226
225/** 227/**
@@ -228,7 +230,8 @@ GNUNET_ATS_connectivity_suggest(struct GNUNET_ATS_ConnectivityHandle *ch,
228 * @param sh handle 230 * @param sh handle
229 */ 231 */
230void 232void
231GNUNET_ATS_connectivity_suggest_cancel(struct GNUNET_ATS_ConnectivitySuggestHandle *sh); 233GNUNET_ATS_connectivity_suggest_cancel (struct
234 GNUNET_ATS_ConnectivitySuggestHandle *sh);
232 235
233 236
234/* ******************************** Scheduling API ***************************** */ 237/* ******************************** Scheduling API ***************************** */
@@ -263,10 +266,13 @@ struct GNUNET_ATS_Session;
263typedef void 266typedef void
264(*GNUNET_ATS_AddressSuggestionCallback) (void *cls, 267(*GNUNET_ATS_AddressSuggestionCallback) (void *cls,
265 const struct GNUNET_PeerIdentity *peer, 268 const struct GNUNET_PeerIdentity *peer,
266 const struct GNUNET_HELLO_Address *address, 269 const struct
270 GNUNET_HELLO_Address *address,
267 struct GNUNET_ATS_Session *session, 271 struct GNUNET_ATS_Session *session,
268 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 272 struct GNUNET_BANDWIDTH_Value32NBO
269 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); 273 bandwidth_out,
274 struct GNUNET_BANDWIDTH_Value32NBO
275 bandwidth_in);
270 276
271 277
272/** 278/**
@@ -278,9 +284,9 @@ typedef void
278 * @return ats context 284 * @return ats context
279 */ 285 */
280struct GNUNET_ATS_SchedulingHandle * 286struct GNUNET_ATS_SchedulingHandle *
281GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg, 287GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
282 GNUNET_ATS_AddressSuggestionCallback suggest_cb, 288 GNUNET_ATS_AddressSuggestionCallback suggest_cb,
283 void *suggest_cb_cls); 289 void *suggest_cb_cls);
284 290
285 291
286/** 292/**
@@ -289,7 +295,7 @@ GNUNET_ATS_scheduling_init(const struct GNUNET_CONFIGURATION_Handle *cfg,
289 * @param sh handle to release 295 * @param sh handle to release
290 */ 296 */
291void 297void
292GNUNET_ATS_scheduling_done(struct GNUNET_ATS_SchedulingHandle *sh); 298GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh);
293 299
294 300
295/** 301/**
@@ -311,10 +317,10 @@ struct GNUNET_ATS_AddressRecord;
311 * address is invalid) 317 * address is invalid)
312 */ 318 */
313struct GNUNET_ATS_AddressRecord * 319struct GNUNET_ATS_AddressRecord *
314GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh, 320GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
315 const struct GNUNET_HELLO_Address *address, 321 const struct GNUNET_HELLO_Address *address,
316 struct GNUNET_ATS_Session *session, 322 struct GNUNET_ATS_Session *session,
317 const struct GNUNET_ATS_Properties *prop); 323 const struct GNUNET_ATS_Properties *prop);
318 324
319 325
320/** 326/**
@@ -324,8 +330,8 @@ GNUNET_ATS_address_add(struct GNUNET_ATS_SchedulingHandle *sh,
324 * @param session session handle 330 * @param session session handle
325 */ 331 */
326void 332void
327GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar, 333GNUNET_ATS_address_add_session (struct GNUNET_ATS_AddressRecord *ar,
328 struct GNUNET_ATS_Session *session); 334 struct GNUNET_ATS_Session *session);
329 335
330 336
331/** 337/**
@@ -341,8 +347,8 @@ GNUNET_ATS_address_add_session(struct GNUNET_ATS_AddressRecord *ar,
341 * use it still to establish a new session 347 * use it still to establish a new session
342 */ 348 */
343int 349int
344GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar, 350GNUNET_ATS_address_del_session (struct GNUNET_ATS_AddressRecord *ar,
345 struct GNUNET_ATS_Session *session); 351 struct GNUNET_ATS_Session *session);
346 352
347 353
348/** 354/**
@@ -359,8 +365,8 @@ GNUNET_ATS_address_del_session(struct GNUNET_ATS_AddressRecord *ar,
359 * @param prop performance data for the address 365 * @param prop performance data for the address
360 */ 366 */
361void 367void
362GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar, 368GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar,
363 const struct GNUNET_ATS_Properties *prop); 369 const struct GNUNET_ATS_Properties *prop);
364 370
365 371
366/** 372/**
@@ -370,7 +376,7 @@ GNUNET_ATS_address_update(struct GNUNET_ATS_AddressRecord *ar,
370 * expired and ATS may no longer use it 376 * expired and ATS may no longer use it
371 */ 377 */
372void 378void
373GNUNET_ATS_address_destroy(struct GNUNET_ATS_AddressRecord *ar); 379GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar);
374 380
375 381
376 382
@@ -398,11 +404,15 @@ struct GNUNET_ATS_PerformanceHandle;
398 */ 404 */
399typedef void 405typedef void
400(*GNUNET_ATS_AddressInformationCallback) (void *cls, 406(*GNUNET_ATS_AddressInformationCallback) (void *cls,
401 const struct GNUNET_HELLO_Address *address, 407 const struct
408 GNUNET_HELLO_Address *address,
402 int address_active, 409 int address_active,
403 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 410 struct GNUNET_BANDWIDTH_Value32NBO
404 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, 411 bandwidth_out,
405 const struct GNUNET_ATS_Properties *prop); 412 struct GNUNET_BANDWIDTH_Value32NBO
413 bandwidth_in,
414 const struct
415 GNUNET_ATS_Properties *prop);
406 416
407 417
408/** 418/**
@@ -421,9 +431,9 @@ struct GNUNET_ATS_AddressListHandle;
421 * @return ats performance context 431 * @return ats performance context
422 */ 432 */
423struct GNUNET_ATS_PerformanceHandle * 433struct GNUNET_ATS_PerformanceHandle *
424GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, 434GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
425 GNUNET_ATS_AddressInformationCallback addr_info_cb, 435 GNUNET_ATS_AddressInformationCallback addr_info_cb,
426 void *addr_info_cb_cls); 436 void *addr_info_cb_cls);
427 437
428 438
429/** 439/**
@@ -439,11 +449,12 @@ GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg,
439 * @return handle to abort the operation 449 * @return handle to abort the operation
440 */ 450 */
441struct GNUNET_ATS_AddressListHandle * 451struct GNUNET_ATS_AddressListHandle *
442GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph, 452GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *ph,
443 const struct GNUNET_PeerIdentity *peer, 453 const struct GNUNET_PeerIdentity *peer,
444 int all, 454 int all,
445 GNUNET_ATS_AddressInformationCallback infocb, 455 GNUNET_ATS_AddressInformationCallback
446 void *infocb_cls); 456 infocb,
457 void *infocb_cls);
447 458
448 459
449/** 460/**
@@ -452,7 +463,8 @@ GNUNET_ATS_performance_list_addresses(struct GNUNET_ATS_PerformanceHandle *ph,
452 * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel 463 * @param alh the `struct GNUNET_ATS_AddressListHandle` handle to cancel
453 */ 464 */
454void 465void
455GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle *alh); 466GNUNET_ATS_performance_list_addresses_cancel (struct
467 GNUNET_ATS_AddressListHandle *alh);
456 468
457 469
458/** 470/**
@@ -461,7 +473,7 @@ GNUNET_ATS_performance_list_addresses_cancel(struct GNUNET_ATS_AddressListHandle
461 * @param ph handle 473 * @param ph handle
462 */ 474 */
463void 475void
464GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph); 476GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph);
465 477
466 478
467/** 479/**
@@ -502,11 +514,11 @@ struct GNUNET_ATS_ReservationContext;
502 * @deprecated will be replaced soon 514 * @deprecated will be replaced soon
503 */ 515 */
504struct GNUNET_ATS_ReservationContext * 516struct GNUNET_ATS_ReservationContext *
505GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph, 517GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
506 const struct GNUNET_PeerIdentity *peer, 518 const struct GNUNET_PeerIdentity *peer,
507 int32_t amount, 519 int32_t amount,
508 GNUNET_ATS_ReservationCallback rcb, 520 GNUNET_ATS_ReservationCallback rcb,
509 void *rcb_cls); 521 void *rcb_cls);
510 522
511 523
512/** 524/**
@@ -515,13 +527,15 @@ GNUNET_ATS_reserve_bandwidth(struct GNUNET_ATS_PerformanceHandle *ph,
515 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call 527 * @param rc context returned by the original GNUNET_ATS_reserve_bandwidth call
516 */ 528 */
517void 529void
518GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc); 530GNUNET_ATS_reserve_bandwidth_cancel (struct GNUNET_ATS_ReservationContext *rc);
519 531
520 532
521/** 533/**
522 * ATS preference types as array initializer 534 * ATS preference types as array initializer
523 */ 535 */
524#define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, GNUNET_ATS_PREFERENCE_LATENCY, GNUNET_ATS_PREFERENCE_END } 536#define GNUNET_ATS_PreferenceType { GNUNET_ATS_PREFERENCE_BANDWIDTH, \
537 GNUNET_ATS_PREFERENCE_LATENCY, \
538 GNUNET_ATS_PREFERENCE_END }
525 539
526/** 540/**
527 * ATS preference types as string array initializer 541 * ATS preference types as string array initializer
@@ -531,7 +545,8 @@ GNUNET_ATS_reserve_bandwidth_cancel(struct GNUNET_ATS_ReservationContext *rc);
531/** 545/**
532 * Enum defining all known preference categories. 546 * Enum defining all known preference categories.
533 */ 547 */
534enum GNUNET_ATS_PreferenceKind { 548enum GNUNET_ATS_PreferenceKind
549{
535 /** 550 /**
536 * Change the peer's bandwidth value (value per byte of bandwidth in 551 * Change the peer's bandwidth value (value per byte of bandwidth in
537 * the goal function) to the given amount. The argument is followed 552 * the goal function) to the given amount. The argument is followed
@@ -563,7 +578,7 @@ enum GNUNET_ATS_PreferenceKind {
563 * @return a string or NULL if invalid 578 * @return a string or NULL if invalid
564 */ 579 */
565const char * 580const char *
566GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type); 581GNUNET_ATS_print_preference_type (enum GNUNET_ATS_PreferenceKind type);
567 582
568 583
569/** 584/**
@@ -575,9 +590,11 @@ GNUNET_ATS_print_preference_type(enum GNUNET_ATS_PreferenceKind type);
575 * desired changes 590 * desired changes
576 */ 591 */
577void 592void
578GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph, 593GNUNET_ATS_performance_change_preference (struct
579 const struct GNUNET_PeerIdentity *peer, 594 GNUNET_ATS_PerformanceHandle *ph,
580 ...); 595 const struct
596 GNUNET_PeerIdentity *peer,
597 ...);
581 598
582 599
583/** 600/**
@@ -598,10 +615,10 @@ GNUNET_ATS_performance_change_preference(struct GNUNET_ATS_PerformanceHandle *ph
598 * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes 615 * @param ... #GNUNET_ATS_PREFERENCE_END-terminated specification of the desired changes
599 */ 616 */
600void 617void
601GNUNET_ATS_performance_give_feedback(struct GNUNET_ATS_PerformanceHandle *ph, 618GNUNET_ATS_performance_give_feedback (struct GNUNET_ATS_PerformanceHandle *ph,
602 const struct GNUNET_PeerIdentity *peer, 619 const struct GNUNET_PeerIdentity *peer,
603 const struct GNUNET_TIME_Relative scope, 620 const struct GNUNET_TIME_Relative scope,
604 ...); 621 ...);
605 622
606#endif 623#endif
607 624
diff --git a/src/include/gnunet_ats_transport_service.h b/src/include/gnunet_ats_transport_service.h
index 67138ae92..b5848a36a 100644
--- a/src/include/gnunet_ats_transport_service.h
+++ b/src/include/gnunet_ats_transport_service.h
@@ -43,7 +43,8 @@
43/** 43/**
44 * ATS performance characteristics for a session. 44 * ATS performance characteristics for a session.
45 */ 45 */
46struct GNUNET_ATS_Properties { 46struct GNUNET_ATS_Properties
47{
47 /** 48 /**
48 * Delay. Time between when the time packet is sent and the packet 49 * Delay. Time between when the time packet is sent and the packet
49 * arrives. FOREVER if we did not (successfully) measure yet. 50 * arrives. FOREVER if we did not (successfully) measure yet.
@@ -134,8 +135,10 @@ struct GNUNET_ATS_Session;
134typedef void 135typedef void
135(*GNUNET_ATS_AllocationCallback) (void *cls, 136(*GNUNET_ATS_AllocationCallback) (void *cls,
136 struct GNUNET_ATS_Session *session, 137 struct GNUNET_ATS_Session *session,
137 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, 138 struct GNUNET_BANDWIDTH_Value32NBO
138 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in); 139 bandwidth_out,
140 struct GNUNET_BANDWIDTH_Value32NBO
141 bandwidth_in);
139 142
140 143
141/** 144/**
@@ -163,11 +166,11 @@ typedef void
163 * @return ats context 166 * @return ats context
164 */ 167 */
165struct GNUNET_ATS_TransportHandle * 168struct GNUNET_ATS_TransportHandle *
166GNUNET_ATS_transport_init(const struct GNUNET_CONFIGURATION_Handle *cfg, 169GNUNET_ATS_transport_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
167 GNUNET_ATS_AllocationCallback alloc_cb, 170 GNUNET_ATS_AllocationCallback alloc_cb,
168 void *alloc_cb_cls, 171 void *alloc_cb_cls,
169 GNUNET_ATS_SuggestionCallback suggest_cb, 172 GNUNET_ATS_SuggestionCallback suggest_cb,
170 void *suggest_cb_cls); 173 void *suggest_cb_cls);
171 174
172 175
173/** 176/**
@@ -176,7 +179,7 @@ GNUNET_ATS_transport_init(const struct GNUNET_CONFIGURATION_Handle *cfg,
176 * @param ath handle to release 179 * @param ath handle to release
177 */ 180 */
178void 181void
179GNUNET_ATS_transport_done(struct GNUNET_ATS_TransportHandle *ath); 182GNUNET_ATS_transport_done (struct GNUNET_ATS_TransportHandle *ath);
180 183
181 184
182/** 185/**
@@ -200,11 +203,11 @@ struct GNUNET_ATS_SessionRecord;
200 * session is invalid) 203 * session is invalid)
201 */ 204 */
202struct GNUNET_ATS_SessionRecord * 205struct GNUNET_ATS_SessionRecord *
203GNUNET_ATS_session_add(struct GNUNET_ATS_TransportHandle *ath, 206GNUNET_ATS_session_add (struct GNUNET_ATS_TransportHandle *ath,
204 const struct GNUNET_PeerIdentity *pid, 207 const struct GNUNET_PeerIdentity *pid,
205 const char *address, 208 const char *address,
206 struct GNUNET_ATS_Session *session, 209 struct GNUNET_ATS_Session *session,
207 const struct GNUNET_ATS_Properties *prop); 210 const struct GNUNET_ATS_Properties *prop);
208 211
209 212
210/** 213/**
@@ -215,8 +218,8 @@ GNUNET_ATS_session_add(struct GNUNET_ATS_TransportHandle *ath,
215 * @param prop performance data for the session 218 * @param prop performance data for the session
216 */ 219 */
217void 220void
218GNUNET_ATS_session_update(struct GNUNET_ATS_SessionRecord *ar, 221GNUNET_ATS_session_update (struct GNUNET_ATS_SessionRecord *ar,
219 const struct GNUNET_ATS_Properties *prop); 222 const struct GNUNET_ATS_Properties *prop);
220 223
221 224
222/** 225/**
@@ -227,7 +230,7 @@ GNUNET_ATS_session_update(struct GNUNET_ATS_SessionRecord *ar,
227 * @param ar session record to drop 230 * @param ar session record to drop
228 */ 231 */
229void 232void
230GNUNET_ATS_session_del(struct GNUNET_ATS_SessionRecord *ar); 233GNUNET_ATS_session_del (struct GNUNET_ATS_SessionRecord *ar);
231 234
232 235
233#endif 236#endif
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index 945c0321a..9130ff57e 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -47,7 +47,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
47/** 47/**
48 * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second. 48 * 32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
49 */ 49 */
50struct GNUNET_BANDWIDTH_Value32NBO { 50struct GNUNET_BANDWIDTH_Value32NBO
51{
51 /** 52 /**
52 * The actual value (bytes per second). 53 * The actual value (bytes per second).
53 */ 54 */
@@ -82,7 +83,8 @@ typedef void (*GNUNET_BANDWIDTH_ExcessNotificationCallback) (void *cls);
82 * structures (reducing malloc-ing); however, values should not be 83 * structures (reducing malloc-ing); however, values should not be
83 * accessed directly by clients (hence the '__'). 84 * accessed directly by clients (hence the '__').
84 */ 85 */
85struct GNUNET_BANDWIDTH_Tracker { 86struct GNUNET_BANDWIDTH_Tracker
87{
86 /** 88 /**
87 * Closure for @e update_cb. 89 * Closure for @e update_cb.
88 */ 90 */
@@ -138,7 +140,7 @@ struct GNUNET_BANDWIDTH_Tracker {
138/** 140/**
139 * Convenience definition to use for 0-bandwidth. 141 * Convenience definition to use for 0-bandwidth.
140 */ 142 */
141#define GNUNET_BANDWIDTH_ZERO GNUNET_BANDWIDTH_value_init(0) 143#define GNUNET_BANDWIDTH_ZERO GNUNET_BANDWIDTH_value_init (0)
142 144
143 145
144/** 146/**
@@ -148,13 +150,13 @@ struct GNUNET_BANDWIDTH_Tracker {
148 * @return the new bandwidth value 150 * @return the new bandwidth value
149 */ 151 */
150struct GNUNET_BANDWIDTH_Value32NBO 152struct GNUNET_BANDWIDTH_Value32NBO
151GNUNET_BANDWIDTH_value_init(uint32_t bytes_per_second); 153GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second);
152 154
153 155
154/** 156/**
155 * Maximum possible bandwidth value. 157 * Maximum possible bandwidth value.
156 */ 158 */
157#define GNUNET_BANDWIDTH_VALUE_MAX GNUNET_BANDWIDTH_value_init(UINT32_MAX) 159#define GNUNET_BANDWIDTH_VALUE_MAX GNUNET_BANDWIDTH_value_init (UINT32_MAX)
158 160
159 161
160/** 162/**
@@ -166,7 +168,7 @@ GNUNET_BANDWIDTH_value_init(uint32_t bytes_per_second);
166 * @return number of bytes available at bps until deadline 168 * @return number of bytes available at bps until deadline
167 */ 169 */
168uint64_t 170uint64_t
169GNUNET_BANDWIDTH_value_get_available_until( 171GNUNET_BANDWIDTH_value_get_available_until (
170 struct GNUNET_BANDWIDTH_Value32NBO bps, 172 struct GNUNET_BANDWIDTH_Value32NBO bps,
171 struct GNUNET_TIME_Relative deadline); 173 struct GNUNET_TIME_Relative deadline);
172 174
@@ -180,8 +182,8 @@ GNUNET_BANDWIDTH_value_get_available_until(
180 * @return how long it would take 182 * @return how long it would take
181 */ 183 */
182struct GNUNET_TIME_Relative 184struct GNUNET_TIME_Relative
183GNUNET_BANDWIDTH_value_get_delay_for(struct GNUNET_BANDWIDTH_Value32NBO bps, 185GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps,
184 uint64_t size); 186 uint64_t size);
185 187
186 188
187/** 189/**
@@ -192,8 +194,8 @@ GNUNET_BANDWIDTH_value_get_delay_for(struct GNUNET_BANDWIDTH_Value32NBO bps,
192 * @return the min of b1 and b2 194 * @return the min of b1 and b2
193 */ 195 */
194struct GNUNET_BANDWIDTH_Value32NBO 196struct GNUNET_BANDWIDTH_Value32NBO
195GNUNET_BANDWIDTH_value_min(struct GNUNET_BANDWIDTH_Value32NBO b1, 197GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1,
196 struct GNUNET_BANDWIDTH_Value32NBO b2); 198 struct GNUNET_BANDWIDTH_Value32NBO b2);
197 199
198 200
199/** 201/**
@@ -204,8 +206,8 @@ GNUNET_BANDWIDTH_value_min(struct GNUNET_BANDWIDTH_Value32NBO b1,
204 * @return the min of b1 and b2 206 * @return the min of b1 and b2
205 */ 207 */
206struct GNUNET_BANDWIDTH_Value32NBO 208struct GNUNET_BANDWIDTH_Value32NBO
207GNUNET_BANDWIDTH_value_max(struct GNUNET_BANDWIDTH_Value32NBO b1, 209GNUNET_BANDWIDTH_value_max (struct GNUNET_BANDWIDTH_Value32NBO b1,
208 struct GNUNET_BANDWIDTH_Value32NBO b2); 210 struct GNUNET_BANDWIDTH_Value32NBO b2);
209 211
210 212
211/** 213/**
@@ -216,8 +218,8 @@ GNUNET_BANDWIDTH_value_max(struct GNUNET_BANDWIDTH_Value32NBO b1,
216 * @return the sum of b1 and b2 218 * @return the sum of b1 and b2
217 */ 219 */
218struct GNUNET_BANDWIDTH_Value32NBO 220struct GNUNET_BANDWIDTH_Value32NBO
219GNUNET_BANDWIDTH_value_sum(struct GNUNET_BANDWIDTH_Value32NBO b1, 221GNUNET_BANDWIDTH_value_sum (struct GNUNET_BANDWIDTH_Value32NBO b1,
220 struct GNUNET_BANDWIDTH_Value32NBO b2); 222 struct GNUNET_BANDWIDTH_Value32NBO b2);
221 223
222 224
223/** 225/**
@@ -237,7 +239,7 @@ GNUNET_BANDWIDTH_value_sum(struct GNUNET_BANDWIDTH_Value32NBO b1,
237 * may accumulate before it expires 239 * may accumulate before it expires
238 */ 240 */
239void 241void
240GNUNET_BANDWIDTH_tracker_init( 242GNUNET_BANDWIDTH_tracker_init (
241 struct GNUNET_BANDWIDTH_Tracker *av, 243 struct GNUNET_BANDWIDTH_Tracker *av,
242 GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, 244 GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb,
243 void *update_cb_cls, 245 void *update_cb_cls,
@@ -264,7 +266,7 @@ GNUNET_BANDWIDTH_tracker_init(
264 * @param excess_cb_cls closure for @a excess_cb 266 * @param excess_cb_cls closure for @a excess_cb
265 */ 267 */
266void 268void
267GNUNET_BANDWIDTH_tracker_init2( 269GNUNET_BANDWIDTH_tracker_init2 (
268 struct GNUNET_BANDWIDTH_Tracker *av, 270 struct GNUNET_BANDWIDTH_Tracker *av,
269 GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb, 271 GNUNET_BANDWIDTH_TrackerUpdateCallback update_cb,
270 void *update_cb_cls, 272 void *update_cb_cls,
@@ -280,7 +282,7 @@ GNUNET_BANDWIDTH_tracker_init2(
280 * @param av the respective trackers 282 * @param av the respective trackers
281 */ 283 */
282void 284void
283GNUNET_BANDWIDTH_tracker_notification_stop( 285GNUNET_BANDWIDTH_tracker_notification_stop (
284 struct GNUNET_BANDWIDTH_Tracker *av); 286 struct GNUNET_BANDWIDTH_Tracker *av);
285 287
286 288
@@ -296,8 +298,8 @@ GNUNET_BANDWIDTH_tracker_notification_stop(
296 * @return #GNUNET_YES if this consumption is above the limit 298 * @return #GNUNET_YES if this consumption is above the limit
297 */ 299 */
298int 300int
299GNUNET_BANDWIDTH_tracker_consume(struct GNUNET_BANDWIDTH_Tracker *av, 301GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av,
300 ssize_t size); 302 ssize_t size);
301 303
302 304
303/** 305/**
@@ -310,8 +312,8 @@ GNUNET_BANDWIDTH_tracker_consume(struct GNUNET_BANDWIDTH_Tracker *av,
310 * @return time to wait for consumption to be OK 312 * @return time to wait for consumption to be OK
311 */ 313 */
312struct GNUNET_TIME_Relative 314struct GNUNET_TIME_Relative
313GNUNET_BANDWIDTH_tracker_get_delay(struct GNUNET_BANDWIDTH_Tracker *av, 315GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av,
314 size_t size); 316 size_t size);
315 317
316 318
317/** 319/**
@@ -322,7 +324,7 @@ GNUNET_BANDWIDTH_tracker_get_delay(struct GNUNET_BANDWIDTH_Tracker *av,
322 * @return number of bytes available for consumption right now 324 * @return number of bytes available for consumption right now
323 */ 325 */
324int64_t 326int64_t
325GNUNET_BANDWIDTH_tracker_get_available(struct GNUNET_BANDWIDTH_Tracker *av); 327GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av);
326 328
327 329
328/** 330/**
@@ -332,7 +334,7 @@ GNUNET_BANDWIDTH_tracker_get_available(struct GNUNET_BANDWIDTH_Tracker *av);
332 * @param bytes_per_second_limit new limit to assume 334 * @param bytes_per_second_limit new limit to assume
333 */ 335 */
334void 336void
335GNUNET_BANDWIDTH_tracker_update_quota( 337GNUNET_BANDWIDTH_tracker_update_quota (
336 struct GNUNET_BANDWIDTH_Tracker *av, 338 struct GNUNET_BANDWIDTH_Tracker *av,
337 struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit); 339 struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit);
338 340
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h
index a1fd0e6ac..5529ca8f4 100644
--- a/src/include/gnunet_bio_lib.h
+++ b/src/include/gnunet_bio_lib.h
@@ -55,7 +55,7 @@ struct GNUNET_BIO_ReadHandle;
55 * @return IO handle on success, NULL on error 55 * @return IO handle on success, NULL on error
56 */ 56 */
57struct GNUNET_BIO_ReadHandle * 57struct GNUNET_BIO_ReadHandle *
58GNUNET_BIO_read_open(const char *fn); 58GNUNET_BIO_read_open (const char *fn);
59 59
60 60
61/** 61/**
@@ -67,7 +67,7 @@ GNUNET_BIO_read_open(const char *fn);
67 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 67 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
68 */ 68 */
69int 69int
70GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg); 70GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg);
71 71
72 72
73/** 73/**
@@ -80,8 +80,8 @@ GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg);
80 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 80 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
81 */ 81 */
82int 82int
83GNUNET_BIO_read(struct GNUNET_BIO_ReadHandle *h, const char *what, 83GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what,
84 void *result, size_t len); 84 void *result, size_t len);
85 85
86 86
87/** 87/**
@@ -95,9 +95,9 @@ GNUNET_BIO_read(struct GNUNET_BIO_ReadHandle *h, const char *what,
95 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 95 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
96 */ 96 */
97int 97int
98GNUNET_BIO_read_fn(struct GNUNET_BIO_ReadHandle *h, 98GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h,
99 const char *file, int line, 99 const char *file, int line,
100 void *result, size_t len); 100 void *result, size_t len);
101 101
102/** 102/**
103 * Read 0-terminated string from a file. 103 * Read 0-terminated string from a file.
@@ -110,8 +110,8 @@ GNUNET_BIO_read_fn(struct GNUNET_BIO_ReadHandle *h,
110 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 110 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
111 */ 111 */
112int 112int
113GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, 113GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what,
114 char **result, size_t max_length); 114 char **result, size_t max_length);
115 115
116 116
117/** 117/**
@@ -123,8 +123,8 @@ GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what,
123 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 123 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
124 */ 124 */
125int 125int
126GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, 126GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what,
127 struct GNUNET_CONTAINER_MetaData **result); 127 struct GNUNET_CONTAINER_MetaData **result);
128 128
129 129
130/** 130/**
@@ -133,7 +133,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what,
133 * @param h hande to open file 133 * @param h hande to open file
134 * @param f address of float to read 134 * @param f address of float to read
135 */ 135 */
136#define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(float))) 136#define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, \
137 f, sizeof(float)))
137 138
138 139
139 140
@@ -143,7 +144,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what,
143 * @param h hande to open file 144 * @param h hande to open file
144 * @param f address of double to read 145 * @param f address of double to read
145 */ 146 */
146#define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(double))) 147#define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, \
148 f, sizeof(double)))
147 149
148 150
149/** 151/**
@@ -156,8 +158,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what,
156 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 158 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
157 */ 159 */
158int 160int
159GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file, 161GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
160 int line, int32_t * i); 162 int line, int32_t *i);
161 163
162 164
163/** 165/**
@@ -166,7 +168,9 @@ GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file,
166 * @param h hande to open file 168 * @param h hande to open file
167 * @param i address of 32-bit integer to read 169 * @param i address of 32-bit integer to read
168 */ 170 */
169#define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__(h, __FILE__, __LINE__, (int32_t*)i) 171#define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__ (h, __FILE__, \
172 __LINE__, \
173 (int32_t*) i)
170 174
171 175
172/** 176/**
@@ -179,8 +183,8 @@ GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file,
179 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 183 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
180 */ 184 */
181int 185int
182GNUNET_BIO_read_int64__(struct GNUNET_BIO_ReadHandle *h, const char *file, 186GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file,
183 int line, int64_t * i); 187 int line, int64_t *i);
184 188
185 189
186/** 190/**
@@ -189,7 +193,9 @@ GNUNET_BIO_read_int64__(struct GNUNET_BIO_ReadHandle *h, const char *file,
189 * @param h hande to open file 193 * @param h hande to open file
190 * @param i address of 64-bit integer to read 194 * @param i address of 64-bit integer to read
191 */ 195 */
192#define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__(h, __FILE__, __LINE__, (int64_t*)i) 196#define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__ (h, __FILE__, \
197 __LINE__, \
198 (int64_t*) i)
193 199
194 200
195/** 201/**
@@ -204,7 +210,7 @@ struct GNUNET_BIO_WriteHandle;
204 * @return IO handle on success, NULL on error 210 * @return IO handle on success, NULL on error
205 */ 211 */
206struct GNUNET_BIO_WriteHandle * 212struct GNUNET_BIO_WriteHandle *
207GNUNET_BIO_write_open(const char *fn); 213GNUNET_BIO_write_open (const char *fn);
208 214
209 215
210/** 216/**
@@ -214,7 +220,7 @@ GNUNET_BIO_write_open(const char *fn);
214 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 220 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
215 */ 221 */
216int 222int
217GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h); 223GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h);
218 224
219 225
220/** 226/**
@@ -226,8 +232,8 @@ GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h);
226 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 232 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
227 */ 233 */
228int 234int
229GNUNET_BIO_write(struct GNUNET_BIO_WriteHandle *h, const void *buffer, 235GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer,
230 size_t n); 236 size_t n);
231 237
232 238
233/** 239/**
@@ -238,7 +244,7 @@ GNUNET_BIO_write(struct GNUNET_BIO_WriteHandle *h, const void *buffer,
238 * the file is closed 244 * the file is closed
239 */ 245 */
240int 246int
241GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h); 247GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h);
242 248
243 249
244/** 250/**
@@ -249,7 +255,7 @@ GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h);
249 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 255 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
250 */ 256 */
251int 257int
252GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *s); 258GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s);
253 259
254 260
255/** 261/**
@@ -260,8 +266,8 @@ GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *s);
260 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 266 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
261 */ 267 */
262int 268int
263GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, 269GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
264 const struct GNUNET_CONTAINER_MetaData *m); 270 const struct GNUNET_CONTAINER_MetaData *m);
265 271
266 272
267 273
@@ -271,7 +277,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h,
271 * @param h hande to open file 277 * @param h hande to open file
272 * @param f float to write (must be a variable) 278 * @param f float to write (must be a variable)
273 */ 279 */
274#define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write(h, &f, sizeof(float)) 280#define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float))
275 281
276 282
277 283
@@ -281,7 +287,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h,
281 * @param h hande to open file 287 * @param h hande to open file
282 * @param f double to write (must be a variable) 288 * @param f double to write (must be a variable)
283 */ 289 */
284#define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write(h, &f, sizeof(double)) 290#define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(double))
285 291
286 292
287/** 293/**
@@ -292,7 +298,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h,
292 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 298 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
293 */ 299 */
294int 300int
295GNUNET_BIO_write_int32(struct GNUNET_BIO_WriteHandle *h, int32_t i); 301GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i);
296 302
297 303
298/** 304/**
@@ -303,7 +309,7 @@ GNUNET_BIO_write_int32(struct GNUNET_BIO_WriteHandle *h, int32_t i);
303 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 309 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
304 */ 310 */
305int 311int
306GNUNET_BIO_write_int64(struct GNUNET_BIO_WriteHandle *h, int64_t i); 312GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i);
307 313
308 314
309#if 0 /* keep Emacsens' auto-indent happy */ 315#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_block_group_lib.h b/src/include/gnunet_block_group_lib.h
index 91d193015..6cb601757 100644
--- a/src/include/gnunet_block_group_lib.h
+++ b/src/include/gnunet_block_group_lib.h
@@ -57,8 +57,8 @@ extern "C"
57 * @return must be a power of two and smaller or equal to 2^15. 57 * @return must be a power of two and smaller or equal to 2^15.
58 */ 58 */
59size_t 59size_t
60GNUNET_BLOCK_GROUP_compute_bloomfilter_size(unsigned int entry_count, 60GNUNET_BLOCK_GROUP_compute_bloomfilter_size (unsigned int entry_count,
61 unsigned int k); 61 unsigned int k);
62 62
63 63
64/** 64/**
@@ -75,13 +75,13 @@ GNUNET_BLOCK_GROUP_compute_bloomfilter_size(unsigned int entry_count,
75 * by this @a type of block (this is not an error) 75 * by this @a type of block (this is not an error)
76 */ 76 */
77struct GNUNET_BLOCK_Group * 77struct GNUNET_BLOCK_Group *
78GNUNET_BLOCK_GROUP_bf_create(void *cls, 78GNUNET_BLOCK_GROUP_bf_create (void *cls,
79 size_t bf_size, 79 size_t bf_size,
80 unsigned int bf_k, 80 unsigned int bf_k,
81 enum GNUNET_BLOCK_Type type, 81 enum GNUNET_BLOCK_Type type,
82 uint32_t nonce, 82 uint32_t nonce,
83 const void *raw_data, 83 const void *raw_data,
84 size_t raw_data_size); 84 size_t raw_data_size);
85 85
86 86
87/** 87/**
@@ -95,8 +95,8 @@ GNUNET_BLOCK_GROUP_bf_create(void *cls,
95 * #GNUNET_NO if @a hc was definitively not in @bg (but now is) 95 * #GNUNET_NO if @a hc was definitively not in @bg (but now is)
96 */ 96 */
97int 97int
98GNUNET_BLOCK_GROUP_bf_test_and_set(struct GNUNET_BLOCK_Group *bg, 98GNUNET_BLOCK_GROUP_bf_test_and_set (struct GNUNET_BLOCK_Group *bg,
99 const struct GNUNET_HashCode *hc); 99 const struct GNUNET_HashCode *hc);
100 100
101 101
102#if 0 /* keep Emacsens' auto-indent happy */ 102#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h
index 29b64759c..18ca6f63f 100644
--- a/src/include/gnunet_block_lib.h
+++ b/src/include/gnunet_block_lib.h
@@ -44,7 +44,8 @@ extern "C"
44/** 44/**
45 * Blocks in the datastore and the datacache must have a unique type. 45 * Blocks in the datastore and the datacache must have a unique type.
46 */ 46 */
47enum GNUNET_BLOCK_Type { 47enum GNUNET_BLOCK_Type
48{
48 /** 49 /**
49 * Any type of block, used as a wildcard when searching. Should 50 * Any type of block, used as a wildcard when searching. Should
50 * never be attached to a specific block. 51 * never be attached to a specific block.
@@ -142,7 +143,8 @@ enum GNUNET_BLOCK_Type {
142/** 143/**
143 * Flags that can be set to control the evaluation. 144 * Flags that can be set to control the evaluation.
144 */ 145 */
145enum GNUNET_BLOCK_EvaluationOptions { 146enum GNUNET_BLOCK_EvaluationOptions
147{
146 /** 148 /**
147 * Default behavior. 149 * Default behavior.
148 */ 150 */
@@ -159,7 +161,8 @@ enum GNUNET_BLOCK_EvaluationOptions {
159/** 161/**
160 * Possible ways for how a block may relate to a query. 162 * Possible ways for how a block may relate to a query.
161 */ 163 */
162enum GNUNET_BLOCK_EvaluationResult { 164enum GNUNET_BLOCK_EvaluationResult
165{
163 /** 166 /**
164 * Valid result, and there may be more. 167 * Valid result, and there may be more.
165 */ 168 */
@@ -218,9 +221,9 @@ struct GNUNET_BLOCK_Context;
218 * @param hc where to store the result. 221 * @param hc where to store the result.
219 */ 222 */
220void 223void
221GNUNET_BLOCK_mingle_hash(const struct GNUNET_HashCode *in, 224GNUNET_BLOCK_mingle_hash (const struct GNUNET_HashCode *in,
222 uint32_t mingle_number, 225 uint32_t mingle_number,
223 struct GNUNET_HashCode *hc); 226 struct GNUNET_HashCode *hc);
224 227
225 228
226/** 229/**
@@ -230,7 +233,7 @@ GNUNET_BLOCK_mingle_hash(const struct GNUNET_HashCode *in,
230 * @return NULL on error 233 * @return NULL on error
231 */ 234 */
232struct GNUNET_BLOCK_Context * 235struct GNUNET_BLOCK_Context *
233GNUNET_BLOCK_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg); 236GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg);
234 237
235 238
236/** 239/**
@@ -239,7 +242,7 @@ GNUNET_BLOCK_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg);
239 * @param ctx context to destroy 242 * @param ctx context to destroy
240 */ 243 */
241void 244void
242GNUNET_BLOCK_context_destroy(struct GNUNET_BLOCK_Context *ctx); 245GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx);
243 246
244 247
245/** 248/**
@@ -263,12 +266,12 @@ struct GNUNET_BLOCK_Group;
263 * by this @a type of block (this is not an error) 266 * by this @a type of block (this is not an error)
264 */ 267 */
265struct GNUNET_BLOCK_Group * 268struct GNUNET_BLOCK_Group *
266GNUNET_BLOCK_group_create(struct GNUNET_BLOCK_Context *ctx, 269GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx,
267 enum GNUNET_BLOCK_Type type, 270 enum GNUNET_BLOCK_Type type,
268 uint32_t nonce, 271 uint32_t nonce,
269 const void *raw_data, 272 const void *raw_data,
270 size_t raw_data_size, 273 size_t raw_data_size,
271 ...); 274 ...);
272 275
273 276
274/** 277/**
@@ -282,10 +285,10 @@ GNUNET_BLOCK_group_create(struct GNUNET_BLOCK_Context *ctx,
282 * supported, #GNUNET_SYSERR on error 285 * supported, #GNUNET_SYSERR on error
283 */ 286 */
284int 287int
285GNUNET_BLOCK_group_serialize(struct GNUNET_BLOCK_Group *bg, 288GNUNET_BLOCK_group_serialize (struct GNUNET_BLOCK_Group *bg,
286 uint32_t *nonce, 289 uint32_t *nonce,
287 void **raw_data, 290 void **raw_data,
288 size_t *raw_data_size); 291 size_t *raw_data_size);
289 292
290 293
291/** 294/**
@@ -294,7 +297,7 @@ GNUNET_BLOCK_group_serialize(struct GNUNET_BLOCK_Group *bg,
294 * @param bg group to destroy, NULL is allowed 297 * @param bg group to destroy, NULL is allowed
295 */ 298 */
296void 299void
297GNUNET_BLOCK_group_destroy(struct GNUNET_BLOCK_Group *bg); 300GNUNET_BLOCK_group_destroy (struct GNUNET_BLOCK_Group *bg);
298 301
299 302
300/** 303/**
@@ -316,15 +319,15 @@ GNUNET_BLOCK_group_destroy(struct GNUNET_BLOCK_Group *bg);
316 * @return characterization of result 319 * @return characterization of result
317 */ 320 */
318enum GNUNET_BLOCK_EvaluationResult 321enum GNUNET_BLOCK_EvaluationResult
319GNUNET_BLOCK_evaluate(struct GNUNET_BLOCK_Context *ctx, 322GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx,
320 enum GNUNET_BLOCK_Type type, 323 enum GNUNET_BLOCK_Type type,
321 struct GNUNET_BLOCK_Group *group, 324 struct GNUNET_BLOCK_Group *group,
322 enum GNUNET_BLOCK_EvaluationOptions eo, 325 enum GNUNET_BLOCK_EvaluationOptions eo,
323 const struct GNUNET_HashCode *query, 326 const struct GNUNET_HashCode *query,
324 const void *xquery, 327 const void *xquery,
325 size_t xquery_size, 328 size_t xquery_size,
326 const void *reply_block, 329 const void *reply_block,
327 size_t reply_block_size); 330 size_t reply_block_size);
328 331
329 332
330/** 333/**
@@ -341,11 +344,11 @@ GNUNET_BLOCK_evaluate(struct GNUNET_BLOCK_Context *ctx,
341 * (or if extracting a key from a block of this type does not work) 344 * (or if extracting a key from a block of this type does not work)
342 */ 345 */
343int 346int
344GNUNET_BLOCK_get_key(struct GNUNET_BLOCK_Context *ctx, 347GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx,
345 enum GNUNET_BLOCK_Type type, 348 enum GNUNET_BLOCK_Type type,
346 const void *block, 349 const void *block,
347 size_t block_size, 350 size_t block_size,
348 struct GNUNET_HashCode *key); 351 struct GNUNET_HashCode *key);
349 352
350 353
351/** 354/**
@@ -360,9 +363,9 @@ GNUNET_BLOCK_get_key(struct GNUNET_BLOCK_Context *ctx,
360 * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success 363 * @return #GNUNET_SYSERR if not supported, #GNUNET_OK on success
361 */ 364 */
362int 365int
363GNUNET_BLOCK_group_set_seen(struct GNUNET_BLOCK_Group *bg, 366GNUNET_BLOCK_group_set_seen (struct GNUNET_BLOCK_Group *bg,
364 const struct GNUNET_HashCode *seen_results, 367 const struct GNUNET_HashCode *seen_results,
365 unsigned int seen_results_count); 368 unsigned int seen_results_count);
366 369
367 370
368/** 371/**
@@ -378,8 +381,8 @@ GNUNET_BLOCK_group_set_seen(struct GNUNET_BLOCK_Group *bg,
378 * #GNUNET_SYSERR if merging is not supported 381 * #GNUNET_SYSERR if merging is not supported
379 */ 382 */
380int 383int
381GNUNET_BLOCK_group_merge(struct GNUNET_BLOCK_Group *bg1, 384GNUNET_BLOCK_group_merge (struct GNUNET_BLOCK_Group *bg1,
382 struct GNUNET_BLOCK_Group *bg2); 385 struct GNUNET_BLOCK_Group *bg2);
383 386
384 387
385#if 0 /* keep Emacsens' auto-indent happy */ 388#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h
index 025d33c45..b01134f09 100644
--- a/src/include/gnunet_block_plugin.h
+++ b/src/include/gnunet_block_plugin.h
@@ -49,7 +49,8 @@
49 */ 49 */
50typedef void 50typedef void
51(*GNUNET_BLOCK_GroupMarkSeenFunction)(struct GNUNET_BLOCK_Group *bg, 51(*GNUNET_BLOCK_GroupMarkSeenFunction)(struct GNUNET_BLOCK_Group *bg,
52 const struct GNUNET_HashCode *seen_results, 52 const struct
53 GNUNET_HashCode *seen_results,
53 unsigned int seen_results_count); 54 unsigned int seen_results_count);
54 55
55 56
@@ -97,7 +98,8 @@ typedef void
97 * Block group data. The plugin must initialize the callbacks 98 * Block group data. The plugin must initialize the callbacks
98 * and can use the @e internal_cls as it likes. 99 * and can use the @e internal_cls as it likes.
99 */ 100 */
100struct GNUNET_BLOCK_Group { 101struct GNUNET_BLOCK_Group
102{
101 /** 103 /**
102 * Context owning the block group. Set by the main block library. 104 * Context owning the block group. Set by the main block library.
103 */ 105 */
@@ -218,7 +220,8 @@ typedef int
218 * Each plugin is required to return a pointer to a struct of this 220 * Each plugin is required to return a pointer to a struct of this
219 * type as the return value from its entry point. 221 * type as the return value from its entry point.
220 */ 222 */
221struct GNUNET_BLOCK_PluginFunctions { 223struct GNUNET_BLOCK_PluginFunctions
224{
222 /** 225 /**
223 * Closure for all of the callbacks. 226 * Closure for all of the callbacks.
224 */ 227 */
diff --git a/src/include/gnunet_cadet_service.h b/src/include/gnunet_cadet_service.h
index dccc51464..93c8aabb8 100644
--- a/src/include/gnunet_cadet_service.h
+++ b/src/include/gnunet_cadet_service.h
@@ -70,7 +70,8 @@ struct GNUNET_CADET_Port;
70/** 70/**
71 * Hash uniquely identifying a connection below a tunnel. 71 * Hash uniquely identifying a connection below a tunnel.
72 */ 72 */
73struct GNUNET_CADET_ConnectionTunnelIdentifier { 73struct GNUNET_CADET_ConnectionTunnelIdentifier
74{
74 struct GNUNET_ShortHashCode connection_of_tunnel; 75 struct GNUNET_ShortHashCode connection_of_tunnel;
75}; 76};
76 77
@@ -78,7 +79,8 @@ struct GNUNET_CADET_ConnectionTunnelIdentifier {
78/** 79/**
79 * Number identifying a CADET channel within a tunnel. 80 * Number identifying a CADET channel within a tunnel.
80 */ 81 */
81struct GNUNET_CADET_ChannelTunnelNumber { 82struct GNUNET_CADET_ChannelTunnelNumber
83{
82 /** 84 /**
83 * Which number does this channel have that uniquely identfies 85 * Which number does this channel have that uniquely identfies
84 * it within its tunnel, in network byte order. 86 * it within its tunnel, in network byte order.
@@ -152,7 +154,7 @@ typedef void (*GNUNET_CADET_WindowSizeEventHandler) (
152 * @return Handle to the cadet service NULL on error. 154 * @return Handle to the cadet service NULL on error.
153 */ 155 */
154struct GNUNET_CADET_Handle * 156struct GNUNET_CADET_Handle *
155GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 157GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
156 158
157 159
158/** 160/**
@@ -164,7 +166,7 @@ GNUNET_CADET_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
164 * @param handle connection to cadet to disconnect 166 * @param handle connection to cadet to disconnect
165 */ 167 */
166void 168void
167GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle); 169GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle);
168 170
169 171
170/** 172/**
@@ -181,13 +183,13 @@ GNUNET_CADET_disconnect(struct GNUNET_CADET_Handle *handle);
181 * @return Port handle, NULL if port is in use 183 * @return Port handle, NULL if port is in use
182 */ 184 */
183struct GNUNET_CADET_Port * 185struct GNUNET_CADET_Port *
184GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h, 186GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
185 const struct GNUNET_HashCode *port, 187 const struct GNUNET_HashCode *port,
186 GNUNET_CADET_ConnectEventHandler connects, 188 GNUNET_CADET_ConnectEventHandler connects,
187 void *connects_cls, 189 void *connects_cls,
188 GNUNET_CADET_WindowSizeEventHandler window_changes, 190 GNUNET_CADET_WindowSizeEventHandler window_changes,
189 GNUNET_CADET_DisconnectEventHandler disconnects, 191 GNUNET_CADET_DisconnectEventHandler disconnects,
190 const struct GNUNET_MQ_MessageHandler *handlers); 192 const struct GNUNET_MQ_MessageHandler *handlers);
191 193
192 194
193/** 195/**
@@ -197,7 +199,7 @@ GNUNET_CADET_open_port(struct GNUNET_CADET_Handle *h,
197 * @param p Port handle. 199 * @param p Port handle.
198 */ 200 */
199void 201void
200GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p); 202GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p);
201 203
202 204
203/** 205/**
@@ -221,13 +223,13 @@ GNUNET_CADET_close_port(struct GNUNET_CADET_Port *p);
221 * @return Handle to the channel. 223 * @return Handle to the channel.
222 */ 224 */
223struct GNUNET_CADET_Channel * 225struct GNUNET_CADET_Channel *
224GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h, 226GNUNET_CADET_channel_create (struct GNUNET_CADET_Handle *h,
225 void *channel_cls, 227 void *channel_cls,
226 const struct GNUNET_PeerIdentity *destination, 228 const struct GNUNET_PeerIdentity *destination,
227 const struct GNUNET_HashCode *port, 229 const struct GNUNET_HashCode *port,
228 GNUNET_CADET_WindowSizeEventHandler window_changes, 230 GNUNET_CADET_WindowSizeEventHandler window_changes,
229 GNUNET_CADET_DisconnectEventHandler disconnects, 231 GNUNET_CADET_DisconnectEventHandler disconnects,
230 const struct GNUNET_MQ_MessageHandler *handlers); 232 const struct GNUNET_MQ_MessageHandler *handlers);
231 233
232 234
233/** 235/**
@@ -240,7 +242,7 @@ GNUNET_CADET_channel_create(struct GNUNET_CADET_Handle *h,
240 * @param channel Channel handle, becomes invalid after this call. 242 * @param channel Channel handle, becomes invalid after this call.
241 */ 243 */
242void 244void
243GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel); 245GNUNET_CADET_channel_destroy (struct GNUNET_CADET_Channel *channel);
244 246
245 247
246/** 248/**
@@ -250,7 +252,7 @@ GNUNET_CADET_channel_destroy(struct GNUNET_CADET_Channel *channel);
250 * @return The message queue of the channel. 252 * @return The message queue of the channel.
251 */ 253 */
252struct GNUNET_MQ_Handle * 254struct GNUNET_MQ_Handle *
253GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel); 255GNUNET_CADET_get_mq (const struct GNUNET_CADET_Channel *channel);
254 256
255 257
256/** 258/**
@@ -261,7 +263,7 @@ GNUNET_CADET_get_mq(const struct GNUNET_CADET_Channel *channel);
261 * @param channel Channel that will be allowed to call another handler. 263 * @param channel Channel that will be allowed to call another handler.
262 */ 264 */
263void 265void
264GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel); 266GNUNET_CADET_receive_done (struct GNUNET_CADET_Channel *channel);
265 267
266 268
267/** 269/**
@@ -274,9 +276,10 @@ GNUNET_CADET_receive_done(struct GNUNET_CADET_Channel *channel);
274 * @return A GNUNET_HashCode usable for the new CADET API. 276 * @return A GNUNET_HashCode usable for the new CADET API.
275 */ 277 */
276const struct GNUNET_HashCode * 278const struct GNUNET_HashCode *
277GC_u2h(uint32_t port); 279GC_u2h (uint32_t port);
278 280
279enum GNUNET_CADET_ChannelInfoOption { 281enum GNUNET_CADET_ChannelInfoOption
282{
280 /** 283 /**
281 * Who is the peer at the other end of the channel. 284 * Who is the peer at the other end of the channel.
282 * Only for use in @c GNUNET_CADET_channel_get_info 285 * Only for use in @c GNUNET_CADET_channel_get_info
@@ -288,7 +291,8 @@ enum GNUNET_CADET_ChannelInfoOption {
288/** 291/**
289 * Union to retrieve info about a channel. 292 * Union to retrieve info about a channel.
290 */ 293 */
291union GNUNET_CADET_ChannelInfo { 294union GNUNET_CADET_ChannelInfo
295{
292 /** 296 /**
293 * #GNUNET_YES / #GNUNET_NO, for binary flags. 297 * #GNUNET_YES / #GNUNET_NO, for binary flags.
294 */ 298 */
@@ -309,9 +313,9 @@ union GNUNET_CADET_ChannelInfo {
309 * @return Union with an answer to the query. 313 * @return Union with an answer to the query.
310 */ 314 */
311const union GNUNET_CADET_ChannelInfo * 315const union GNUNET_CADET_ChannelInfo *
312GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel, 316GNUNET_CADET_channel_get_info (struct GNUNET_CADET_Channel *channel,
313 enum GNUNET_CADET_ChannelInfoOption option, 317 enum GNUNET_CADET_ChannelInfoOption option,
314 ...); 318 ...);
315 319
316 320
317/******************************************************************************/ 321/******************************************************************************/
@@ -328,7 +332,8 @@ GNUNET_CADET_channel_get_info(struct GNUNET_CADET_Channel *channel,
328/** 332/**
329 * Internal details about a channel. 333 * Internal details about a channel.
330 */ 334 */
331struct GNUNET_CADET_ChannelInternals { 335struct GNUNET_CADET_ChannelInternals
336{
332 /** 337 /**
333 * Root of the channel 338 * Root of the channel
334 */ 339 */
@@ -370,10 +375,10 @@ struct GNUNET_CADET_ChannelMonitor;
370 * @param callback_cls Closure for @c callback. 375 * @param callback_cls Closure for @c callback.
371 */ 376 */
372struct GNUNET_CADET_ChannelMonitor * 377struct GNUNET_CADET_ChannelMonitor *
373GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, 378GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg,
374 struct GNUNET_PeerIdentity *peer, 379 struct GNUNET_PeerIdentity *peer,
375 GNUNET_CADET_ChannelCB callback, 380 GNUNET_CADET_ChannelCB callback,
376 void *callback_cls); 381 void *callback_cls);
377 382
378 383
379/** 384/**
@@ -383,13 +388,14 @@ GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg,
383 * @return Closure that was given to #GNUNET_CADET_get_channel(). 388 * @return Closure that was given to #GNUNET_CADET_get_channel().
384 */ 389 */
385void * 390void *
386GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm); 391GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm);
387 392
388 393
389/** 394/**
390 * Information we return per peer. 395 * Information we return per peer.
391 */ 396 */
392struct GNUNET_CADET_PeerListEntry { 397struct GNUNET_CADET_PeerListEntry
398{
393 /** 399 /**
394 * Which peer is the information about? 400 * Which peer is the information about?
395 */ 401 */
@@ -443,9 +449,9 @@ struct GNUNET_CADET_PeersLister;
443 * @return NULL on error 449 * @return NULL on error
444 */ 450 */
445struct GNUNET_CADET_PeersLister * 451struct GNUNET_CADET_PeersLister *
446GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg, 452GNUNET_CADET_list_peers (const struct GNUNET_CONFIGURATION_Handle *cfg,
447 GNUNET_CADET_PeersCB callback, 453 GNUNET_CADET_PeersCB callback,
448 void *callback_cls); 454 void *callback_cls);
449 455
450 456
451/** 457/**
@@ -455,13 +461,14 @@ GNUNET_CADET_list_peers(const struct GNUNET_CONFIGURATION_Handle *cfg,
455 * @return Closure that was given to #GNUNET_CADET_list_peers(). 461 * @return Closure that was given to #GNUNET_CADET_list_peers().
456 */ 462 */
457void * 463void *
458GNUNET_CADET_list_peers_cancel(struct GNUNET_CADET_PeersLister *pl); 464GNUNET_CADET_list_peers_cancel (struct GNUNET_CADET_PeersLister *pl);
459 465
460 466
461/** 467/**
462 * Detailed information we return per peer. 468 * Detailed information we return per peer.
463 */ 469 */
464struct GNUNET_CADET_PeerPathDetail { 470struct GNUNET_CADET_PeerPathDetail
471{
465 /** 472 /**
466 * Peer this is about. 473 * Peer this is about.
467 */ 474 */
@@ -514,10 +521,10 @@ struct GNUNET_CADET_GetPath;
514 * @return NULL on error 521 * @return NULL on error
515 */ 522 */
516struct GNUNET_CADET_GetPath * 523struct GNUNET_CADET_GetPath *
517GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg, 524GNUNET_CADET_get_path (const struct GNUNET_CONFIGURATION_Handle *cfg,
518 const struct GNUNET_PeerIdentity *id, 525 const struct GNUNET_PeerIdentity *id,
519 GNUNET_CADET_PathCB callback, 526 GNUNET_CADET_PathCB callback,
520 void *callback_cls); 527 void *callback_cls);
521 528
522 529
523/** 530/**
@@ -527,13 +534,14 @@ GNUNET_CADET_get_path(const struct GNUNET_CONFIGURATION_Handle *cfg,
527 * @return closure from #GNUNET_CADET_get_path(). 534 * @return closure from #GNUNET_CADET_get_path().
528 */ 535 */
529void * 536void *
530GNUNET_CADET_get_path_cancel(struct GNUNET_CADET_GetPath *gp); 537GNUNET_CADET_get_path_cancel (struct GNUNET_CADET_GetPath *gp);
531 538
532 539
533/** 540/**
534 * Details about a tunnel managed by CADET. 541 * Details about a tunnel managed by CADET.
535 */ 542 */
536struct GNUNET_CADET_TunnelDetails { 543struct GNUNET_CADET_TunnelDetails
544{
537 /** 545 /**
538 * Target of the tunnel. 546 * Target of the tunnel.
539 */ 547 */
@@ -592,9 +600,9 @@ struct GNUNET_CADET_ListTunnels;
592 * @return NULL on error 600 * @return NULL on error
593 */ 601 */
594struct GNUNET_CADET_ListTunnels * 602struct GNUNET_CADET_ListTunnels *
595GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg, 603GNUNET_CADET_list_tunnels (const struct GNUNET_CONFIGURATION_Handle *cfg,
596 GNUNET_CADET_TunnelsCB callback, 604 GNUNET_CADET_TunnelsCB callback,
597 void *callback_cls); 605 void *callback_cls);
598 606
599 607
600/** 608/**
@@ -604,7 +612,7 @@ GNUNET_CADET_list_tunnels(const struct GNUNET_CONFIGURATION_Handle *cfg,
604 * @return Closure given to #GNUNET_CADET_list_tunnels(), if any. 612 * @return Closure given to #GNUNET_CADET_list_tunnels(), if any.
605 */ 613 */
606void * 614void *
607GNUNET_CADET_list_tunnels_cancel(struct GNUNET_CADET_ListTunnels *lt); 615GNUNET_CADET_list_tunnels_cancel (struct GNUNET_CADET_ListTunnels *lt);
608 616
609 617
610#if 0 /* keep Emacsens' auto-indent happy */ 618#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 555a98eb5..4af43d857 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -113,7 +113,7 @@ extern "C" {
113/** 113/**
114 * wrap va_arg for enums 114 * wrap va_arg for enums
115 */ 115 */
116#define GNUNET_VA_ARG_ENUM(va, X) ((enum X)va_arg(va, int)) 116#define GNUNET_VA_ARG_ENUM(va, X) ((enum X) va_arg (va, int))
117 117
118 118
119/** 119/**
@@ -130,36 +130,36 @@ extern "C" {
130 */ 130 */
131 131
132#if __BYTE_ORDER == __LITTLE_ENDIAN 132#if __BYTE_ORDER == __LITTLE_ENDIAN
133#define GNUNET_htobe16(x) __bswap_16(x) 133#define GNUNET_htobe16(x) __bswap_16 (x)
134#define GNUNET_htole16(x) (x) 134#define GNUNET_htole16(x) (x)
135#define GNUNET_be16toh(x) __bswap_16(x) 135#define GNUNET_be16toh(x) __bswap_16 (x)
136#define GNUNET_le16toh(x) (x) 136#define GNUNET_le16toh(x) (x)
137 137
138#define GNUNET_htobe32(x) __bswap_32(x) 138#define GNUNET_htobe32(x) __bswap_32 (x)
139#define GNUNET_htole32(x) (x) 139#define GNUNET_htole32(x) (x)
140#define GNUNET_be32toh(x) __bswap_32(x) 140#define GNUNET_be32toh(x) __bswap_32 (x)
141#define GNUNET_le32toh(x) (x) 141#define GNUNET_le32toh(x) (x)
142 142
143#define GNUNET_htobe64(x) __bswap_64(x) 143#define GNUNET_htobe64(x) __bswap_64 (x)
144#define GNUNET_htole64(x) (x) 144#define GNUNET_htole64(x) (x)
145#define GNUNET_be64toh(x) __bswap_64(x) 145#define GNUNET_be64toh(x) __bswap_64 (x)
146#define GNUNET_le64toh(x) (x) 146#define GNUNET_le64toh(x) (x)
147#endif 147#endif
148#if __BYTE_ORDER == __BIG_ENDIAN 148#if __BYTE_ORDER == __BIG_ENDIAN
149#define GNUNET_htobe16(x) (x) 149#define GNUNET_htobe16(x) (x)
150#define GNUNET_htole16(x) __bswap_16(x) 150#define GNUNET_htole16(x) __bswap_16 (x)
151#define GNUNET_be16toh(x) (x) 151#define GNUNET_be16toh(x) (x)
152#define GNUNET_le16toh(x) __bswap_16(x) 152#define GNUNET_le16toh(x) __bswap_16 (x)
153 153
154#define GNUNET_htobe32(x) (x) 154#define GNUNET_htobe32(x) (x)
155#define GNUNET_htole32(x) __bswap_32(x) 155#define GNUNET_htole32(x) __bswap_32 (x)
156#define GNUNET_be32toh(x) (x) 156#define GNUNET_be32toh(x) (x)
157#define GNUNET_le32toh(x) __bswap_32(x) 157#define GNUNET_le32toh(x) __bswap_32 (x)
158 158
159#define GNUNET_htobe64(x) (x) 159#define GNUNET_htobe64(x) (x)
160#define GNUNET_htole64(x) __bswap_64(x) 160#define GNUNET_htole64(x) __bswap_64 (x)
161#define GNUNET_be64toh(x) (x) 161#define GNUNET_be64toh(x) (x)
162#define GNUNET_le64toh(x) __bswap_64(x) 162#define GNUNET_le64toh(x) __bswap_64 (x)
163#endif 163#endif
164 164
165 165
@@ -175,7 +175,7 @@ extern "C" {
175 * on the stack with a variable-length that might be zero, write 175 * on the stack with a variable-length that might be zero, write
176 * "int[GNUNET_NZL(n)] x;" instead of "int[n] x". 176 * "int[GNUNET_NZL(n)] x;" instead of "int[n] x".
177 */ 177 */
178#define GNUNET_NZL(l) GNUNET_MAX(1, l) 178#define GNUNET_NZL(l) GNUNET_MAX (1, l)
179 179
180 180
181/** 181/**
@@ -194,9 +194,9 @@ extern "C" {
194 * bug #33594. 194 * bug #33594.
195 */ 195 */
196#ifdef __BIGGEST_ALIGNMENT__ 196#ifdef __BIGGEST_ALIGNMENT__
197#define GNUNET_ALIGN __attribute__ ((aligned(__BIGGEST_ALIGNMENT__))) 197#define GNUNET_ALIGN __attribute__ ((aligned (__BIGGEST_ALIGNMENT__)))
198#else 198#else
199#define GNUNET_ALIGN __attribute__ ((aligned(8))) 199#define GNUNET_ALIGN __attribute__ ((aligned (8)))
200#endif 200#endif
201 201
202/** 202/**
@@ -226,7 +226,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
226/** 226/**
227 * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512. 227 * @brief A 512-bit hashcode. These are the default length for GNUnet, using SHA-512.
228 */ 228 */
229struct GNUNET_HashCode { 229struct GNUNET_HashCode
230{
230 uint32_t bits[512 / 8 / sizeof(uint32_t)]; /* = 16 */ 231 uint32_t bits[512 / 8 / sizeof(uint32_t)]; /* = 16 */
231}; 232};
232 233
@@ -235,7 +236,8 @@ struct GNUNET_HashCode {
235 * @brief A 256-bit hashcode. Used under special conditions, like when space 236 * @brief A 256-bit hashcode. Used under special conditions, like when space
236 * is critical and security is not impacted by it. 237 * is critical and security is not impacted by it.
237 */ 238 */
238struct GNUNET_ShortHashCode { 239struct GNUNET_ShortHashCode
240{
239 uint32_t bits[256 / 8 / sizeof(uint32_t)]; /* = 8 */ 241 uint32_t bits[256 / 8 / sizeof(uint32_t)]; /* = 8 */
240}; 242};
241 243
@@ -243,7 +245,8 @@ struct GNUNET_ShortHashCode {
243/** 245/**
244 * A UUID, a 128 bit random value. 246 * A UUID, a 128 bit random value.
245 */ 247 */
246struct GNUNET_Uuid { 248struct GNUNET_Uuid
249{
247 /** 250 /**
248 * 128 random bits. 251 * 128 random bits.
249 */ 252 */
@@ -254,7 +257,8 @@ struct GNUNET_Uuid {
254/** 257/**
255 * Header for all communications. 258 * Header for all communications.
256 */ 259 */
257struct GNUNET_MessageHeader { 260struct GNUNET_MessageHeader
261{
258 /** 262 /**
259 * The length of the struct (in bytes, including the length field itself), 263 * The length of the struct (in bytes, including the length field itself),
260 * in big-endian format. 264 * in big-endian format.
@@ -271,7 +275,8 @@ struct GNUNET_MessageHeader {
271/** 275/**
272 * Answer from service to client about last operation. 276 * Answer from service to client about last operation.
273 */ 277 */
274struct GNUNET_OperationResultMessage { 278struct GNUNET_OperationResultMessage
279{
275 struct GNUNET_MessageHeader header; 280 struct GNUNET_MessageHeader header;
276 281
277 uint32_t reserved GNUNET_PACKED; 282 uint32_t reserved GNUNET_PACKED;
@@ -293,7 +298,8 @@ struct GNUNET_OperationResultMessage {
293/** 298/**
294 * Identifier for an asynchronous execution context. 299 * Identifier for an asynchronous execution context.
295 */ 300 */
296struct GNUNET_AsyncScopeId { 301struct GNUNET_AsyncScopeId
302{
297 uint32_t bits[16 / sizeof(uint32_t)]; /* = 16 bytes */ 303 uint32_t bits[16 / sizeof(uint32_t)]; /* = 16 bytes */
298}; 304};
299 305
@@ -303,7 +309,8 @@ GNUNET_NETWORK_STRUCT_END
303/** 309/**
304 * Saved async scope identifier or root scope. 310 * Saved async scope identifier or root scope.
305 */ 311 */
306struct GNUNET_AsyncScopeSave { 312struct GNUNET_AsyncScopeSave
313{
307 /** 314 /**
308 * Saved scope. Unused if 'have_scope==GNUNET_NO'. 315 * Saved scope. Unused if 'have_scope==GNUNET_NO'.
309 */ 316 */
@@ -360,7 +367,8 @@ typedef void (*GNUNET_ResultCallback) (void *cls,
360 * @ingroup logging 367 * @ingroup logging
361 * Types of errors. 368 * Types of errors.
362 */ 369 */
363enum GNUNET_ErrorType { 370enum GNUNET_ErrorType
371{
364 GNUNET_ERROR_TYPE_UNSPECIFIED = -1, 372 GNUNET_ERROR_TYPE_UNSPECIFIED = -1,
365 GNUNET_ERROR_TYPE_NONE = 0, 373 GNUNET_ERROR_TYPE_NONE = 0,
366 GNUNET_ERROR_TYPE_ERROR = 1, 374 GNUNET_ERROR_TYPE_ERROR = 1,
@@ -400,16 +408,16 @@ typedef void (*GNUNET_Logger) (void *cls,
400 * @return number of log calls to be ignored 408 * @return number of log calls to be ignored
401 */ 409 */
402int 410int
403GNUNET_get_log_skip(void); 411GNUNET_get_log_skip (void);
404 412
405 413
406#if !defined(GNUNET_CULL_LOGGING) 414#if ! defined(GNUNET_CULL_LOGGING)
407int 415int
408GNUNET_get_log_call_status(int caller_level, 416GNUNET_get_log_call_status (int caller_level,
409 const char *comp, 417 const char *comp,
410 const char *file, 418 const char *file,
411 const char *function, 419 const char *function,
412 int line); 420 int line);
413#endif 421#endif
414 422
415 423
@@ -422,28 +430,28 @@ GNUNET_get_log_call_status(int caller_level,
422 * @param ... arguments for format string 430 * @param ... arguments for format string
423 */ 431 */
424void 432void
425GNUNET_log_nocheck(enum GNUNET_ErrorType kind, const char *message, ...) 433GNUNET_log_nocheck (enum GNUNET_ErrorType kind, const char *message, ...)
426__attribute__ ((format(printf, 2, 3))); 434__attribute__ ((format (printf, 2, 3)));
427 435
428/* from glib */ 436/* from glib */
429#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) 437#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
430#define _GNUNET_BOOLEAN_EXPR(expr) \ 438#define _GNUNET_BOOLEAN_EXPR(expr) \
431 __extension__({ \ 439 __extension__ ({ \
432 int _gnunet_boolean_var_; \ 440 int _gnunet_boolean_var_; \
433 if (expr) \ 441 if (expr) \
434 _gnunet_boolean_var_ = 1; \ 442 _gnunet_boolean_var_ = 1; \
435 else \ 443 else \
436 _gnunet_boolean_var_ = 0; \ 444 _gnunet_boolean_var_ = 0; \
437 _gnunet_boolean_var_; \ 445 _gnunet_boolean_var_; \
438 }) 446 })
439#define GN_LIKELY(expr) (__builtin_expect(_GNUNET_BOOLEAN_EXPR(expr), 1)) 447#define GN_LIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 1))
440#define GN_UNLIKELY(expr) (__builtin_expect(_GNUNET_BOOLEAN_EXPR(expr), 0)) 448#define GN_UNLIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 0))
441#else 449#else
442#define GN_LIKELY(expr) (expr) 450#define GN_LIKELY(expr) (expr)
443#define GN_UNLIKELY(expr) (expr) 451#define GN_UNLIKELY(expr) (expr)
444#endif 452#endif
445 453
446#if !defined(GNUNET_LOG_CALL_STATUS) 454#if ! defined(GNUNET_LOG_CALL_STATUS)
447#define GNUNET_LOG_CALL_STATUS -1 455#define GNUNET_LOG_CALL_STATUS -1
448#endif 456#endif
449 457
@@ -459,12 +467,12 @@ __attribute__ ((format(printf, 2, 3)));
459 * @param ... arguments for format string 467 * @param ... arguments for format string
460 */ 468 */
461void 469void
462GNUNET_log_from_nocheck(enum GNUNET_ErrorType kind, 470GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind,
463 const char *comp, 471 const char *comp,
464 const char *message, 472 const char *message,
465 ...); 473 ...);
466 474
467#if !defined(GNUNET_CULL_LOGGING) 475#if ! defined(GNUNET_CULL_LOGGING)
468#define GNUNET_log_from(kind, comp, ...) \ 476#define GNUNET_log_from(kind, comp, ...) \
469 do \ 477 do \
470 { \ 478 { \
@@ -472,21 +480,21 @@ GNUNET_log_from_nocheck(enum GNUNET_ErrorType kind,
472 if ((GNUNET_EXTRA_LOGGING > 0) || \ 480 if ((GNUNET_EXTRA_LOGGING > 0) || \
473 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ 481 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \
474 { \ 482 { \
475 if (GN_UNLIKELY(log_call_enabled == -1)) \ 483 if (GN_UNLIKELY (log_call_enabled == -1)) \
476 log_call_enabled = \ 484 log_call_enabled = \
477 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ 485 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \
478 (comp), \ 486 (comp), \
479 __FILE__, \ 487 __FILE__, \
480 __FUNCTION__, \ 488 __FUNCTION__, \
481 __LINE__); \ 489 __LINE__); \
482 if (GN_UNLIKELY(GNUNET_get_log_skip() > 0)) \ 490 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \
483 { \ 491 { \
484 GNUNET_log_skip(-1, GNUNET_NO); \ 492 GNUNET_log_skip (-1, GNUNET_NO); \
485 } \ 493 } \
486 else \ 494 else \
487 { \ 495 { \
488 if (GN_UNLIKELY(log_call_enabled)) \ 496 if (GN_UNLIKELY (log_call_enabled)) \
489 GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ 497 GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \
490 } \ 498 } \
491 } \ 499 } \
492 } while (0) 500 } while (0)
@@ -498,21 +506,21 @@ GNUNET_log_from_nocheck(enum GNUNET_ErrorType kind,
498 if ((GNUNET_EXTRA_LOGGING > 0) || \ 506 if ((GNUNET_EXTRA_LOGGING > 0) || \
499 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ 507 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \
500 { \ 508 { \
501 if (GN_UNLIKELY(log_call_enabled == -1)) \ 509 if (GN_UNLIKELY (log_call_enabled == -1)) \
502 log_call_enabled = \ 510 log_call_enabled = \
503 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ 511 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \
504 NULL, \ 512 NULL, \
505 __FILE__, \ 513 __FILE__, \
506 __FUNCTION__, \ 514 __FUNCTION__, \
507 __LINE__); \ 515 __LINE__); \
508 if (GN_UNLIKELY(GNUNET_get_log_skip() > 0)) \ 516 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \
509 { \ 517 { \
510 GNUNET_log_skip(-1, GNUNET_NO); \ 518 GNUNET_log_skip (-1, GNUNET_NO); \
511 } \ 519 } \
512 else \ 520 else \
513 { \ 521 { \
514 if (GN_UNLIKELY(log_call_enabled)) \ 522 if (GN_UNLIKELY (log_call_enabled)) \
515 GNUNET_log_nocheck ((kind), __VA_ARGS__); \ 523 GNUNET_log_nocheck ((kind), __VA_ARGS__); \
516 } \ 524 } \
517 } \ 525 } \
518 } while (0) 526 } while (0)
@@ -531,9 +539,9 @@ GNUNET_log_from_nocheck(enum GNUNET_ErrorType kind,
531 * @param option name of missing option 539 * @param option name of missing option
532 */ 540 */
533void 541void
534GNUNET_log_config_missing(enum GNUNET_ErrorType kind, 542GNUNET_log_config_missing (enum GNUNET_ErrorType kind,
535 const char *section, 543 const char *section,
536 const char *option); 544 const char *option);
537 545
538 546
539/** 547/**
@@ -546,10 +554,10 @@ GNUNET_log_config_missing(enum GNUNET_ErrorType kind,
546 * @param required what is required that is invalid about the option 554 * @param required what is required that is invalid about the option
547 */ 555 */
548void 556void
549GNUNET_log_config_invalid(enum GNUNET_ErrorType kind, 557GNUNET_log_config_invalid (enum GNUNET_ErrorType kind,
550 const char *section, 558 const char *section,
551 const char *option, 559 const char *option,
552 const char *required); 560 const char *required);
553 561
554 562
555/** 563/**
@@ -559,7 +567,7 @@ GNUNET_log_config_invalid(enum GNUNET_ErrorType kind,
559 * first log the location of the failure. 567 * first log the location of the failure.
560 */ 568 */
561void 569void
562GNUNET_abort_(void) GNUNET_NORETURN; 570GNUNET_abort_ (void) GNUNET_NORETURN;
563 571
564 572
565/** 573/**
@@ -570,7 +578,7 @@ GNUNET_abort_(void) GNUNET_NORETURN;
570 * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero 578 * @param check_reset #GNUNET_YES to assert that the log skip counter is currently zero
571 */ 579 */
572void 580void
573GNUNET_log_skip(int n, int check_reset); 581GNUNET_log_skip (int n, int check_reset);
574 582
575 583
576/** 584/**
@@ -583,7 +591,7 @@ GNUNET_log_skip(int n, int check_reset);
583 * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened 591 * @return #GNUNET_OK on success, #GNUNET_SYSERR if logfile could not be opened
584 */ 592 */
585int 593int
586GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile); 594GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile);
587 595
588 596
589/** 597/**
@@ -597,7 +605,7 @@ GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile);
597 * @param logger_cls closure for @a logger 605 * @param logger_cls closure for @a logger
598 */ 606 */
599void 607void
600GNUNET_logger_add(GNUNET_Logger logger, void *logger_cls); 608GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls);
601 609
602 610
603/** 611/**
@@ -608,7 +616,7 @@ GNUNET_logger_add(GNUNET_Logger logger, void *logger_cls);
608 * @param logger_cls closure for @a logger 616 * @param logger_cls closure for @a logger
609 */ 617 */
610void 618void
611GNUNET_logger_remove(GNUNET_Logger logger, void *logger_cls); 619GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls);
612 620
613 621
614/** 622/**
@@ -621,7 +629,7 @@ GNUNET_logger_remove(GNUNET_Logger logger, void *logger_cls);
621 * @return string 629 * @return string
622 */ 630 */
623const char * 631const char *
624GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc); 632GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc);
625 633
626 634
627/** 635/**
@@ -634,7 +642,7 @@ GNUNET_sh2s(const struct GNUNET_ShortHashCode *shc);
634 * @return string 642 * @return string
635 */ 643 */
636const char * 644const char *
637GNUNET_uuid2s(const struct GNUNET_Uuid *uuid); 645GNUNET_uuid2s (const struct GNUNET_Uuid *uuid);
638 646
639 647
640/** 648/**
@@ -647,7 +655,7 @@ GNUNET_uuid2s(const struct GNUNET_Uuid *uuid);
647 * @return string 655 * @return string
648 */ 656 */
649const char * 657const char *
650GNUNET_h2s(const struct GNUNET_HashCode *hc); 658GNUNET_h2s (const struct GNUNET_HashCode *hc);
651 659
652 660
653/** 661/**
@@ -662,7 +670,7 @@ GNUNET_h2s(const struct GNUNET_HashCode *hc);
662 * @return string 670 * @return string
663 */ 671 */
664const char * 672const char *
665GNUNET_h2s2(const struct GNUNET_HashCode *hc); 673GNUNET_h2s2 (const struct GNUNET_HashCode *hc);
666 674
667 675
668/** 676/**
@@ -676,7 +684,7 @@ GNUNET_h2s2(const struct GNUNET_HashCode *hc);
676 * @return string 684 * @return string
677 */ 685 */
678const char * 686const char *
679GNUNET_h2s_full(const struct GNUNET_HashCode *hc); 687GNUNET_h2s_full (const struct GNUNET_HashCode *hc);
680 688
681 689
682/** 690/**
@@ -701,7 +709,7 @@ struct GNUNET_CRYPTO_EcdhePublicKey;
701 * @return string 709 * @return string
702 */ 710 */
703const char * 711const char *
704GNUNET_p2s(const struct GNUNET_CRYPTO_EddsaPublicKey *p); 712GNUNET_p2s (const struct GNUNET_CRYPTO_EddsaPublicKey *p);
705 713
706 714
707/** 715/**
@@ -714,7 +722,7 @@ GNUNET_p2s(const struct GNUNET_CRYPTO_EddsaPublicKey *p);
714 * @return string 722 * @return string
715 */ 723 */
716const char * 724const char *
717GNUNET_p2s2(const struct GNUNET_CRYPTO_EddsaPublicKey *p); 725GNUNET_p2s2 (const struct GNUNET_CRYPTO_EddsaPublicKey *p);
718 726
719 727
720/** 728/**
@@ -727,7 +735,7 @@ GNUNET_p2s2(const struct GNUNET_CRYPTO_EddsaPublicKey *p);
727 * @return string 735 * @return string
728 */ 736 */
729const char * 737const char *
730GNUNET_e2s(const struct GNUNET_CRYPTO_EcdhePublicKey *p); 738GNUNET_e2s (const struct GNUNET_CRYPTO_EcdhePublicKey *p);
731 739
732 740
733/** 741/**
@@ -740,7 +748,7 @@ GNUNET_e2s(const struct GNUNET_CRYPTO_EcdhePublicKey *p);
740 * @return string 748 * @return string
741 */ 749 */
742const char * 750const char *
743GNUNET_e2s2(const struct GNUNET_CRYPTO_EcdhePublicKey *p); 751GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p);
744 752
745 753
746/** 754/**
@@ -754,7 +762,7 @@ GNUNET_e2s2(const struct GNUNET_CRYPTO_EcdhePublicKey *p);
754 * call to #GNUNET_i2s(). 762 * call to #GNUNET_i2s().
755 */ 763 */
756const char * 764const char *
757GNUNET_i2s(const struct GNUNET_PeerIdentity *pid); 765GNUNET_i2s (const struct GNUNET_PeerIdentity *pid);
758 766
759 767
760/** 768/**
@@ -770,7 +778,7 @@ GNUNET_i2s(const struct GNUNET_PeerIdentity *pid);
770 * call to #GNUNET_i2s(). 778 * call to #GNUNET_i2s().
771 */ 779 */
772const char * 780const char *
773GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid); 781GNUNET_i2s2 (const struct GNUNET_PeerIdentity *pid);
774 782
775 783
776/** 784/**
@@ -784,7 +792,7 @@ GNUNET_i2s2(const struct GNUNET_PeerIdentity *pid);
784 * call to #GNUNET_i2s_full(). 792 * call to #GNUNET_i2s_full().
785 */ 793 */
786const char * 794const char *
787GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid); 795GNUNET_i2s_full (const struct GNUNET_PeerIdentity *pid);
788 796
789 797
790/** 798/**
@@ -799,7 +807,7 @@ GNUNET_i2s_full(const struct GNUNET_PeerIdentity *pid);
799 * will be overwritten by next call to #GNUNET_a2s(). 807 * will be overwritten by next call to #GNUNET_a2s().
800 */ 808 */
801const char * 809const char *
802GNUNET_a2s(const struct sockaddr *addr, socklen_t addrlen); 810GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen);
803 811
804 812
805/** 813/**
@@ -810,7 +818,7 @@ GNUNET_a2s(const struct sockaddr *addr, socklen_t addrlen);
810 * @return string corresponding to the type 818 * @return string corresponding to the type
811 */ 819 */
812const char * 820const char *
813GNUNET_error_type_to_string(enum GNUNET_ErrorType kind); 821GNUNET_error_type_to_string (enum GNUNET_ErrorType kind);
814 822
815 823
816/** 824/**
@@ -820,13 +828,13 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
820#define GNUNET_assert(cond) \ 828#define GNUNET_assert(cond) \
821 do \ 829 do \
822 { \ 830 { \
823 if (!(cond)) \ 831 if (! (cond)) \
824 { \ 832 { \
825 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ 833 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
826 _("Assertion failed at %s:%d. Aborting.\n"), \ 834 _ ("Assertion failed at %s:%d. Aborting.\n"), \
827 __FILE__, \ 835 __FILE__, \
828 __LINE__); \ 836 __LINE__); \
829 GNUNET_abort_(); \ 837 GNUNET_abort_ (); \
830 } \ 838 } \
831 } while (0) 839 } while (0)
832 840
@@ -838,13 +846,13 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
838#define GNUNET_assert_at(cond, f, l) \ 846#define GNUNET_assert_at(cond, f, l) \
839 do \ 847 do \
840 { \ 848 { \
841 if (!(cond)) \ 849 if (! (cond)) \
842 { \ 850 { \
843 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ 851 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
844 _("Assertion failed at %s:%d. Aborting.\n"), \ 852 _ ("Assertion failed at %s:%d. Aborting.\n"), \
845 f, \ 853 f, \
846 l); \ 854 l); \
847 GNUNET_abort_(); \ 855 GNUNET_abort_ (); \
848 } \ 856 } \
849 } while (0) 857 } while (0)
850 858
@@ -859,14 +867,14 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
859#define GNUNET_assert_from(cond, comp) \ 867#define GNUNET_assert_from(cond, comp) \
860 do \ 868 do \
861 { \ 869 { \
862 if (!(cond)) \ 870 if (! (cond)) \
863 { \ 871 { \
864 GNUNET_log_from(GNUNET_ERROR_TYPE_ERROR, \ 872 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, \
865 comp, \ 873 comp, \
866 _("Assertion failed at %s:%d. Aborting.\n"), \ 874 _ ("Assertion failed at %s:%d. Aborting.\n"), \
867 __FILE__, \ 875 __FILE__, \
868 __LINE__); \ 876 __LINE__); \
869 GNUNET_abort_(); \ 877 GNUNET_abort_ (); \
870 } \ 878 } \
871 } while (0) 879 } while (0)
872 880
@@ -879,12 +887,12 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
879#define GNUNET_break(cond) \ 887#define GNUNET_break(cond) \
880 do \ 888 do \
881 { \ 889 { \
882 if (!(cond)) \ 890 if (! (cond)) \
883 { \ 891 { \
884 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, \ 892 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, \
885 _("Assertion failed at %s:%d.\n"), \ 893 _ ("Assertion failed at %s:%d.\n"), \
886 __FILE__, \ 894 __FILE__, \
887 __LINE__); \ 895 __LINE__); \
888 } \ 896 } \
889 } while (0) 897 } while (0)
890 898
@@ -901,12 +909,12 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
901#define GNUNET_break_op(cond) \ 909#define GNUNET_break_op(cond) \
902 do \ 910 do \
903 { \ 911 { \
904 if (!(cond)) \ 912 if (! (cond)) \
905 { \ 913 { \
906 GNUNET_log(GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, \ 914 GNUNET_log (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, \
907 _("External protocol violation detected at %s:%d.\n"), \ 915 _ ("External protocol violation detected at %s:%d.\n"), \
908 __FILE__, \ 916 __FILE__, \
909 __LINE__); \ 917 __LINE__); \
910 } \ 918 } \
911 } while (0) 919 } while (0)
912 920
@@ -920,12 +928,12 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
920#define GNUNET_log_strerror(level, cmd) \ 928#define GNUNET_log_strerror(level, cmd) \
921 do \ 929 do \
922 { \ 930 { \
923 GNUNET_log(level, \ 931 GNUNET_log (level, \
924 _("`%s' failed at %s:%d with error: %s\n"), \ 932 _ ("`%s' failed at %s:%d with error: %s\n"), \
925 cmd, \ 933 cmd, \
926 __FILE__, \ 934 __FILE__, \
927 __LINE__, \ 935 __LINE__, \
928 strerror(errno)); \ 936 strerror (errno)); \
929 } while (0) 937 } while (0)
930 938
931 939
@@ -938,13 +946,13 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
938#define GNUNET_log_from_strerror(level, component, cmd) \ 946#define GNUNET_log_from_strerror(level, component, cmd) \
939 do \ 947 do \
940 { \ 948 { \
941 GNUNET_log_from(level, \ 949 GNUNET_log_from (level, \
942 component, \ 950 component, \
943 _("`%s' failed at %s:%d with error: %s\n"), \ 951 _ ("`%s' failed at %s:%d with error: %s\n"), \
944 cmd, \ 952 cmd, \
945 __FILE__, \ 953 __FILE__, \
946 __LINE__, \ 954 __LINE__, \
947 strerror(errno)); \ 955 strerror (errno)); \
948 } while (0) 956 } while (0)
949 957
950 958
@@ -957,13 +965,13 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
957#define GNUNET_log_strerror_file(level, cmd, filename) \ 965#define GNUNET_log_strerror_file(level, cmd, filename) \
958 do \ 966 do \
959 { \ 967 { \
960 GNUNET_log(level, \ 968 GNUNET_log (level, \
961 _("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ 969 _ ("`%s' failed on file `%s' at %s:%d with error: %s\n"), \
962 cmd, \ 970 cmd, \
963 filename, \ 971 filename, \
964 __FILE__, \ 972 __FILE__, \
965 __LINE__, \ 973 __LINE__, \
966 strerror(errno)); \ 974 strerror (errno)); \
967 } while (0) 975 } while (0)
968 976
969 977
@@ -976,14 +984,14 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
976#define GNUNET_log_from_strerror_file(level, component, cmd, filename) \ 984#define GNUNET_log_from_strerror_file(level, component, cmd, filename) \
977 do \ 985 do \
978 { \ 986 { \
979 GNUNET_log_from(level, \ 987 GNUNET_log_from (level, \
980 component, \ 988 component, \
981 _("`%s' failed on file `%s' at %s:%d with error: %s\n"), \ 989 _ ("`%s' failed on file `%s' at %s:%d with error: %s\n"), \
982 cmd, \ 990 cmd, \
983 filename, \ 991 filename, \
984 __FILE__, \ 992 __FILE__, \
985 __LINE__, \ 993 __LINE__, \
986 strerror(errno)); \ 994 strerror (errno)); \
987 } while (0) 995 } while (0)
988 996
989/* ************************* endianess conversion ****************** */ 997/* ************************* endianess conversion ****************** */
@@ -997,7 +1005,7 @@ GNUNET_error_type_to_string(enum GNUNET_ErrorType kind);
997 * @return The same value in network byte order. 1005 * @return The same value in network byte order.
998 */ 1006 */
999uint64_t 1007uint64_t
1000GNUNET_htonll(uint64_t n); 1008GNUNET_htonll (uint64_t n);
1001 1009
1002 1010
1003/** 1011/**
@@ -1009,7 +1017,7 @@ GNUNET_htonll(uint64_t n);
1009 * @return The same value in host byte order. 1017 * @return The same value in host byte order.
1010 */ 1018 */
1011uint64_t 1019uint64_t
1012GNUNET_ntohll(uint64_t n); 1020GNUNET_ntohll (uint64_t n);
1013 1021
1014 1022
1015/** 1023/**
@@ -1021,7 +1029,7 @@ GNUNET_ntohll(uint64_t n);
1021 * @return The same value in network byte order. 1029 * @return The same value in network byte order.
1022 */ 1030 */
1023double 1031double
1024GNUNET_hton_double(double d); 1032GNUNET_hton_double (double d);
1025 1033
1026 1034
1027/** 1035/**
@@ -1033,7 +1041,7 @@ GNUNET_hton_double(double d);
1033 * @return The same value in host byte order. 1041 * @return The same value in host byte order.
1034 */ 1042 */
1035double 1043double
1036GNUNET_ntoh_double(double d); 1044GNUNET_ntoh_double (double d);
1037 1045
1038 1046
1039/* ************************* allocation functions ****************** */ 1047/* ************************* allocation functions ****************** */
@@ -1052,7 +1060,7 @@ GNUNET_ntoh_double(double d);
1052 * 1060 *
1053 * @param type name of the struct or union, i.e. pass 'struct Foo'. 1061 * @param type name of the struct or union, i.e. pass 'struct Foo'.
1054 */ 1062 */
1055#define GNUNET_new(type) (type *)GNUNET_malloc(sizeof(type)) 1063#define GNUNET_new(type) (type *) GNUNET_malloc (sizeof(type))
1056 1064
1057 1065
1058/** 1066/**
@@ -1063,7 +1071,7 @@ GNUNET_ntoh_double(double d);
1063 ({ \ 1071 ({ \
1064 const typeof (*b) * _a = (a); \ 1072 const typeof (*b) * _a = (a); \
1065 const typeof (*a) * _b = (b); \ 1073 const typeof (*a) * _b = (b); \
1066 memcmp(_a, _b, sizeof(*a)); \ 1074 memcmp (_a, _b, sizeof(*a)); \
1067 }) 1075 })
1068 1076
1069 1077
@@ -1076,7 +1084,7 @@ GNUNET_ntoh_double(double d);
1076#define GNUNET_is_zero(a) \ 1084#define GNUNET_is_zero(a) \
1077 ({ \ 1085 ({ \
1078 static const typeof (*a) _z; \ 1086 static const typeof (*a) _z; \
1079 memcmp((a), &_z, sizeof(_z)); \ 1087 memcmp ((a), &_z, sizeof(_z)); \
1080 }) 1088 })
1081 1089
1082 1090
@@ -1094,7 +1102,7 @@ GNUNET_ntoh_double(double d);
1094 { \ 1102 { \
1095 if (0 != n) \ 1103 if (0 != n) \
1096 { \ 1104 { \
1097 (void)memcpy(dst, src, n); \ 1105 (void) memcpy (dst, src, n); \
1098 } \ 1106 } \
1099 } while (0) 1107 } while (0)
1100 1108
@@ -1108,7 +1116,7 @@ GNUNET_ntoh_double(double d);
1108 * @param n number of elements in the array 1116 * @param n number of elements in the array
1109 * @param type name of the struct or union, i.e. pass 'struct Foo'. 1117 * @param type name of the struct or union, i.e. pass 'struct Foo'.
1110 */ 1118 */
1111#define GNUNET_new_array(n, type) (type *)GNUNET_malloc((n) * sizeof(type)) 1119#define GNUNET_new_array(n, type) (type *) GNUNET_malloc ((n) * sizeof(type))
1112 1120
1113/** 1121/**
1114 * @ingroup memory 1122 * @ingroup memory
@@ -1120,7 +1128,7 @@ GNUNET_ntoh_double(double d);
1120 * @param type name of the struct or union, i.e. pass 'struct Foo'. 1128 * @param type name of the struct or union, i.e. pass 'struct Foo'.
1121 */ 1129 */
1122#define GNUNET_new_array_2d(n, m, type) \ 1130#define GNUNET_new_array_2d(n, m, type) \
1123 (type **)GNUNET_xnew_array_2d_(n, m, sizeof(type), __FILE__, __LINE__) 1131 (type **) GNUNET_xnew_array_2d_ (n, m, sizeof(type), __FILE__, __LINE__)
1124 1132
1125/** 1133/**
1126 * @ingroup memory 1134 * @ingroup memory
@@ -1133,7 +1141,7 @@ GNUNET_ntoh_double(double d);
1133 * @param type name of the struct or union, i.e. pass 'struct Foo'. 1141 * @param type name of the struct or union, i.e. pass 'struct Foo'.
1134 */ 1142 */
1135#define GNUNET_new_array_3d(n, m, o, type) \ 1143#define GNUNET_new_array_3d(n, m, o, type) \
1136 (type ***)GNUNET_xnew_array_3d_(n, m, o, sizeof(type), __FILE__, __LINE__) 1144 (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof(type), __FILE__, __LINE__)
1137 1145
1138/** 1146/**
1139 * @ingroup memory 1147 * @ingroup memory
@@ -1144,7 +1152,7 @@ GNUNET_ntoh_double(double d);
1144 * smaller than 40 MB. 1152 * smaller than 40 MB.
1145 * @return pointer to size bytes of memory, never NULL (!) 1153 * @return pointer to size bytes of memory, never NULL (!)
1146 */ 1154 */
1147#define GNUNET_malloc(size) GNUNET_xmalloc_(size, __FILE__, __LINE__) 1155#define GNUNET_malloc(size) GNUNET_xmalloc_ (size, __FILE__, __LINE__)
1148 1156
1149/** 1157/**
1150 * @ingroup memory 1158 * @ingroup memory
@@ -1154,7 +1162,7 @@ GNUNET_ntoh_double(double d);
1154 * @param size the number of bytes in buf (and size of the allocation) 1162 * @param size the number of bytes in buf (and size of the allocation)
1155 * @return pointer to size bytes of memory, never NULL (!) 1163 * @return pointer to size bytes of memory, never NULL (!)
1156 */ 1164 */
1157#define GNUNET_memdup(buf, size) GNUNET_xmemdup_(buf, size, __FILE__, __LINE__) 1165#define GNUNET_memdup(buf, size) GNUNET_xmemdup_ (buf, size, __FILE__, __LINE__)
1158 1166
1159/** 1167/**
1160 * @ingroup memory 1168 * @ingroup memory
@@ -1165,7 +1173,7 @@ GNUNET_ntoh_double(double d);
1165 * @return pointer to size bytes of memory, NULL if we do not have enough memory 1173 * @return pointer to size bytes of memory, NULL if we do not have enough memory
1166 */ 1174 */
1167#define GNUNET_malloc_large(size) \ 1175#define GNUNET_malloc_large(size) \
1168 GNUNET_xmalloc_unchecked_(size, __FILE__, __LINE__) 1176 GNUNET_xmalloc_unchecked_ (size, __FILE__, __LINE__)
1169 1177
1170/** 1178/**
1171 * @ingroup memory 1179 * @ingroup memory
@@ -1177,7 +1185,7 @@ GNUNET_ntoh_double(double d);
1177 * @return pointer to size bytes of memory 1185 * @return pointer to size bytes of memory
1178 */ 1186 */
1179#define GNUNET_realloc(ptr, size) \ 1187#define GNUNET_realloc(ptr, size) \
1180 GNUNET_xrealloc_(ptr, size, __FILE__, __LINE__) 1188 GNUNET_xrealloc_ (ptr, size, __FILE__, __LINE__)
1181 1189
1182/** 1190/**
1183 * @ingroup memory 1191 * @ingroup memory
@@ -1188,7 +1196,7 @@ GNUNET_ntoh_double(double d);
1188 * @param ptr location where to free the memory. ptr must have 1196 * @param ptr location where to free the memory. ptr must have
1189 * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. 1197 * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier.
1190 */ 1198 */
1191#define GNUNET_free(ptr) GNUNET_xfree_(ptr, __FILE__, __LINE__) 1199#define GNUNET_free(ptr) GNUNET_xfree_ (ptr, __FILE__, __LINE__)
1192 1200
1193/** 1201/**
1194 * @ingroup memory 1202 * @ingroup memory
@@ -1203,7 +1211,7 @@ GNUNET_ntoh_double(double d);
1203 void *__x__ = ptr; \ 1211 void *__x__ = ptr; \
1204 if (__x__ != NULL) \ 1212 if (__x__ != NULL) \
1205 { \ 1213 { \
1206 GNUNET_free(__x__); \ 1214 GNUNET_free (__x__); \
1207 } \ 1215 } \
1208 } while (0) 1216 } while (0)
1209 1217
@@ -1215,7 +1223,7 @@ GNUNET_ntoh_double(double d);
1215 * @param a pointer to a zero-terminated string 1223 * @param a pointer to a zero-terminated string
1216 * @return a copy of the string including zero-termination 1224 * @return a copy of the string including zero-termination
1217 */ 1225 */
1218#define GNUNET_strdup(a) GNUNET_xstrdup_(a, __FILE__, __LINE__) 1226#define GNUNET_strdup(a) GNUNET_xstrdup_ (a, __FILE__, __LINE__)
1219 1227
1220/** 1228/**
1221 * @ingroup memory 1229 * @ingroup memory
@@ -1227,7 +1235,7 @@ GNUNET_ntoh_double(double d);
1227 * @return a partial copy of the string including zero-termination 1235 * @return a partial copy of the string including zero-termination
1228 */ 1236 */
1229#define GNUNET_strndup(a, length) \ 1237#define GNUNET_strndup(a, length) \
1230 GNUNET_xstrndup_(a, length, __FILE__, __LINE__) 1238 GNUNET_xstrndup_ (a, length, __FILE__, __LINE__)
1231 1239
1232/** 1240/**
1233 * @ingroup memory 1241 * @ingroup memory
@@ -1265,12 +1273,12 @@ GNUNET_ntoh_double(double d);
1265 * free the vector (then, arr will be NULL afterwards). 1273 * free the vector (then, arr will be NULL afterwards).
1266 */ 1274 */
1267#define GNUNET_array_grow(arr, size, tsize) \ 1275#define GNUNET_array_grow(arr, size, tsize) \
1268 GNUNET_xgrow_((void **)&(arr), \ 1276 GNUNET_xgrow_ ((void **) &(arr), \
1269 sizeof((arr)[0]), \ 1277 sizeof((arr)[0]), \
1270 &size, \ 1278 &size, \
1271 tsize, \ 1279 tsize, \
1272 __FILE__, \ 1280 __FILE__, \
1273 __LINE__) 1281 __LINE__)
1274 1282
1275/** 1283/**
1276 * @ingroup memory 1284 * @ingroup memory
@@ -1288,8 +1296,8 @@ GNUNET_ntoh_double(double d);
1288#define GNUNET_array_append(arr, size, element) \ 1296#define GNUNET_array_append(arr, size, element) \
1289 do \ 1297 do \
1290 { \ 1298 { \
1291 GNUNET_array_grow(arr, size, size + 1); \ 1299 GNUNET_array_grow (arr, size, size + 1); \
1292 (arr)[size - 1] = element; \ 1300 (arr) [size - 1] = element; \
1293 } while (0) 1301 } while (0)
1294 1302
1295/** 1303/**
@@ -1303,7 +1311,7 @@ GNUNET_ntoh_double(double d);
1303 * @return number of bytes written to buf or negative value on error 1311 * @return number of bytes written to buf or negative value on error
1304 */ 1312 */
1305int 1313int
1306GNUNET_snprintf(char *buf, size_t size, const char *format, ...); 1314GNUNET_snprintf (char *buf, size_t size, const char *format, ...);
1307 1315
1308 1316
1309/** 1317/**
@@ -1316,7 +1324,7 @@ GNUNET_snprintf(char *buf, size_t size, const char *format, ...);
1316 * @return number of bytes in "*buf" excluding 0-termination 1324 * @return number of bytes in "*buf" excluding 0-termination
1317 */ 1325 */
1318int 1326int
1319GNUNET_asprintf(char **buf, const char *format, ...); 1327GNUNET_asprintf (char **buf, const char *format, ...);
1320 1328
1321 1329
1322/* ************** internal implementations, use macros above! ************** */ 1330/* ************** internal implementations, use macros above! ************** */
@@ -1333,7 +1341,7 @@ GNUNET_asprintf(char **buf, const char *format, ...);
1333 * @return allocated memory, never NULL 1341 * @return allocated memory, never NULL
1334 */ 1342 */
1335void * 1343void *
1336GNUNET_xmalloc_(size_t size, const char *filename, int linenumber); 1344GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
1337 1345
1338 1346
1339/** 1347/**
@@ -1351,11 +1359,11 @@ GNUNET_xmalloc_(size_t size, const char *filename, int linenumber);
1351 * @return allocated memory, never NULL 1359 * @return allocated memory, never NULL
1352 */ 1360 */
1353void ** 1361void **
1354GNUNET_xnew_array_2d_(size_t n, 1362GNUNET_xnew_array_2d_ (size_t n,
1355 size_t m, 1363 size_t m,
1356 size_t elementSize, 1364 size_t elementSize,
1357 const char *filename, 1365 const char *filename,
1358 int linenumber); 1366 int linenumber);
1359 1367
1360 1368
1361/** 1369/**
@@ -1374,12 +1382,12 @@ GNUNET_xnew_array_2d_(size_t n,
1374 * @return allocated memory, never NULL 1382 * @return allocated memory, never NULL
1375 */ 1383 */
1376void *** 1384void ***
1377GNUNET_xnew_array_3d_(size_t n, 1385GNUNET_xnew_array_3d_ (size_t n,
1378 size_t m, 1386 size_t m,
1379 size_t o, 1387 size_t o,
1380 size_t elementSize, 1388 size_t elementSize,
1381 const char *filename, 1389 const char *filename,
1382 int linenumber); 1390 int linenumber);
1383 1391
1384 1392
1385/** 1393/**
@@ -1394,10 +1402,10 @@ GNUNET_xnew_array_3d_(size_t n,
1394 * @return allocated memory, never NULL 1402 * @return allocated memory, never NULL
1395 */ 1403 */
1396void * 1404void *
1397GNUNET_xmemdup_(const void *buf, 1405GNUNET_xmemdup_ (const void *buf,
1398 size_t size, 1406 size_t size,
1399 const char *filename, 1407 const char *filename,
1400 int linenumber); 1408 int linenumber);
1401 1409
1402 1410
1403/** 1411/**
@@ -1413,7 +1421,7 @@ GNUNET_xmemdup_(const void *buf,
1413 * @return pointer to size bytes of memory, NULL if we do not have enough memory 1421 * @return pointer to size bytes of memory, NULL if we do not have enough memory
1414 */ 1422 */
1415void * 1423void *
1416GNUNET_xmalloc_unchecked_(size_t size, const char *filename, int linenumber); 1424GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber);
1417 1425
1418 1426
1419/** 1427/**
@@ -1421,7 +1429,7 @@ GNUNET_xmalloc_unchecked_(size_t size, const char *filename, int linenumber);
1421 * memory is available. 1429 * memory is available.
1422 */ 1430 */
1423void * 1431void *
1424GNUNET_xrealloc_(void *ptr, size_t n, const char *filename, int linenumber); 1432GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber);
1425 1433
1426 1434
1427/** 1435/**
@@ -1434,7 +1442,7 @@ GNUNET_xrealloc_(void *ptr, size_t n, const char *filename, int linenumber);
1434 * @param linenumber line where this call is being made (for debugging) 1442 * @param linenumber line where this call is being made (for debugging)
1435 */ 1443 */
1436void 1444void
1437GNUNET_xfree_(void *ptr, const char *filename, int linenumber); 1445GNUNET_xfree_ (void *ptr, const char *filename, int linenumber);
1438 1446
1439 1447
1440/** 1448/**
@@ -1445,7 +1453,7 @@ GNUNET_xfree_(void *ptr, const char *filename, int linenumber);
1445 * @return the duplicated string 1453 * @return the duplicated string
1446 */ 1454 */
1447char * 1455char *
1448GNUNET_xstrdup_(const char *str, const char *filename, int linenumber); 1456GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber);
1449 1457
1450/** 1458/**
1451 * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the #GNUNET_strndup macro. 1459 * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the #GNUNET_strndup macro.
@@ -1457,10 +1465,10 @@ GNUNET_xstrdup_(const char *str, const char *filename, int linenumber);
1457 * @return the duplicated string 1465 * @return the duplicated string
1458 */ 1466 */
1459char * 1467char *
1460GNUNET_xstrndup_(const char *str, 1468GNUNET_xstrndup_ (const char *str,
1461 size_t len, 1469 size_t len,
1462 const char *filename, 1470 const char *filename,
1463 int linenumber); 1471 int linenumber);
1464 1472
1465/** 1473/**
1466 * Grow an array, the new elements are zeroed out. 1474 * Grow an array, the new elements are zeroed out.
@@ -1478,12 +1486,12 @@ GNUNET_xstrndup_(const char *str,
1478 * @param linenumber line where this call is being made (for debugging) 1486 * @param linenumber line where this call is being made (for debugging)
1479 */ 1487 */
1480void 1488void
1481GNUNET_xgrow_(void **old, 1489GNUNET_xgrow_ (void **old,
1482 size_t elementSize, 1490 size_t elementSize,
1483 unsigned int *oldCount, 1491 unsigned int *oldCount,
1484 unsigned int newCount, 1492 unsigned int newCount,
1485 const char *filename, 1493 const char *filename,
1486 int linenumber); 1494 int linenumber);
1487 1495
1488 1496
1489/** 1497/**
@@ -1494,7 +1502,7 @@ GNUNET_xgrow_(void **old,
1494 * @return duplicate of the message 1502 * @return duplicate of the message
1495 */ 1503 */
1496struct GNUNET_MessageHeader * 1504struct GNUNET_MessageHeader *
1497GNUNET_copy_message(const struct GNUNET_MessageHeader *msg); 1505GNUNET_copy_message (const struct GNUNET_MessageHeader *msg);
1498 1506
1499 1507
1500/** 1508/**
@@ -1504,8 +1512,8 @@ GNUNET_copy_message(const struct GNUNET_MessageHeader *msg);
1504 * @param old_scope[out] location to save the old scope 1512 * @param old_scope[out] location to save the old scope
1505 */ 1513 */
1506void 1514void
1507GNUNET_async_scope_enter(const struct GNUNET_AsyncScopeId *aid, 1515GNUNET_async_scope_enter (const struct GNUNET_AsyncScopeId *aid,
1508 struct GNUNET_AsyncScopeSave *old_scope); 1516 struct GNUNET_AsyncScopeSave *old_scope);
1509 1517
1510 1518
1511/** 1519/**
@@ -1514,7 +1522,7 @@ GNUNET_async_scope_enter(const struct GNUNET_AsyncScopeId *aid,
1514 * @param old_scope scope to restore 1522 * @param old_scope scope to restore
1515 */ 1523 */
1516void 1524void
1517GNUNET_async_scope_restore(struct GNUNET_AsyncScopeSave *old_scope); 1525GNUNET_async_scope_restore (struct GNUNET_AsyncScopeSave *old_scope);
1518 1526
1519 1527
1520/** 1528/**
@@ -1523,7 +1531,7 @@ GNUNET_async_scope_restore(struct GNUNET_AsyncScopeSave *old_scope);
1523 * @param[out] scope_ret pointer to where the result is stored 1531 * @param[out] scope_ret pointer to where the result is stored
1524 */ 1532 */
1525void 1533void
1526GNUNET_async_scope_get(struct GNUNET_AsyncScopeSave *scope_ret); 1534GNUNET_async_scope_get (struct GNUNET_AsyncScopeSave *scope_ret);
1527 1535
1528 1536
1529/** 1537/**
@@ -1532,7 +1540,7 @@ GNUNET_async_scope_get(struct GNUNET_AsyncScopeSave *scope_ret);
1532 * @param[out] aid_ret pointer to where the result is stored 1540 * @param[out] aid_ret pointer to where the result is stored
1533 */ 1541 */
1534void 1542void
1535GNUNET_async_scope_fresh(struct GNUNET_AsyncScopeId *aid_ret); 1543GNUNET_async_scope_fresh (struct GNUNET_AsyncScopeId *aid_ret);
1536 1544
1537 1545
1538#if __STDC_VERSION__ < 199901L 1546#if __STDC_VERSION__ < 199901L
@@ -1551,7 +1559,8 @@ GNUNET_async_scope_fresh(struct GNUNET_AsyncScopeId *aid_ret);
1551 * be in gnunet_scheduler_lib.h, but it works if we declare it here. 1559 * be in gnunet_scheduler_lib.h, but it works if we declare it here.
1552 * Naturally, logically this is part of the scheduler. 1560 * Naturally, logically this is part of the scheduler.
1553 */ 1561 */
1554enum GNUNET_SCHEDULER_Priority { 1562enum GNUNET_SCHEDULER_Priority
1563{
1555 /** 1564 /**
1556 * Run with the same priority as the current job. 1565 * Run with the same priority as the current job.
1557 */ 1566 */
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 4d1bb6b79..4df8d8965 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -51,7 +51,7 @@ struct GNUNET_CONFIGURATION_Handle;
51 * @return fresh configuration object 51 * @return fresh configuration object
52 */ 52 */
53struct GNUNET_CONFIGURATION_Handle * 53struct GNUNET_CONFIGURATION_Handle *
54GNUNET_CONFIGURATION_create(void); 54GNUNET_CONFIGURATION_create (void);
55 55
56 56
57/** 57/**
@@ -61,7 +61,7 @@ GNUNET_CONFIGURATION_create(void);
61 * @return duplicate configuration 61 * @return duplicate configuration
62 */ 62 */
63struct GNUNET_CONFIGURATION_Handle * 63struct GNUNET_CONFIGURATION_Handle *
64GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg); 64GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg);
65 65
66 66
67/** 67/**
@@ -70,7 +70,7 @@ GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg);
70 * @param cfg configuration to destroy 70 * @param cfg configuration to destroy
71 */ 71 */
72void 72void
73GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg); 73GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg);
74 74
75 75
76/** 76/**
@@ -83,8 +83,8 @@ GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg);
83 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 83 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
84 */ 84 */
85int 85int
86GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, 86GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg,
87 const char *filename); 87 const char *filename);
88 88
89 89
90/** 90/**
@@ -96,8 +96,8 @@ GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg,
96 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 96 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
97 */ 97 */
98int 98int
99GNUNET_CONFIGURATION_load_from(struct GNUNET_CONFIGURATION_Handle *cfg, 99GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
100 const char *defaults_d); 100 const char *defaults_d);
101 101
102 102
103/** 103/**
@@ -109,8 +109,8 @@ GNUNET_CONFIGURATION_load_from(struct GNUNET_CONFIGURATION_Handle *cfg,
109 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 109 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
110 */ 110 */
111int 111int
112GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg, 112GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
113 const char *filename); 113 const char *filename);
114 114
115 115
116/** 116/**
@@ -122,8 +122,8 @@ GNUNET_CONFIGURATION_parse(struct GNUNET_CONFIGURATION_Handle *cfg,
122 * present. This memory should be freed by the caller 122 * present. This memory should be freed by the caller
123 */ 123 */
124char * 124char *
125GNUNET_CONFIGURATION_serialize(const struct GNUNET_CONFIGURATION_Handle *cfg, 125GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg,
126 size_t *size); 126 size_t *size);
127 127
128 128
129/** 129/**
@@ -138,10 +138,10 @@ GNUNET_CONFIGURATION_serialize(const struct GNUNET_CONFIGURATION_Handle *cfg,
138 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 138 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
139 */ 139 */
140int 140int
141GNUNET_CONFIGURATION_deserialize(struct GNUNET_CONFIGURATION_Handle *cfg, 141GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
142 const char *mem, 142 const char *mem,
143 size_t size, 143 size_t size,
144 const char *basedir); 144 const char *basedir);
145 145
146 146
147/** 147/**
@@ -152,8 +152,8 @@ GNUNET_CONFIGURATION_deserialize(struct GNUNET_CONFIGURATION_Handle *cfg,
152 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 152 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
153 */ 153 */
154int 154int
155GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg, 155GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
156 const char *filename); 156 const char *filename);
157 157
158 158
159/** 159/**
@@ -164,9 +164,11 @@ GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg,
164 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 164 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
165 */ 165 */
166int 166int
167GNUNET_CONFIGURATION_write_diffs(const struct GNUNET_CONFIGURATION_Handle *cfg_default, 167GNUNET_CONFIGURATION_write_diffs (const struct
168 const struct GNUNET_CONFIGURATION_Handle *cfg_new, 168 GNUNET_CONFIGURATION_Handle *cfg_default,
169 const char *filename); 169 const struct
170 GNUNET_CONFIGURATION_Handle *cfg_new,
171 const char *filename);
170 172
171 173
172/** 174/**
@@ -177,8 +179,10 @@ GNUNET_CONFIGURATION_write_diffs(const struct GNUNET_CONFIGURATION_Handle *cfg_d
177 * @return configuration with only the differences, never NULL 179 * @return configuration with only the differences, never NULL
178 */ 180 */
179struct GNUNET_CONFIGURATION_Handle * 181struct GNUNET_CONFIGURATION_Handle *
180GNUNET_CONFIGURATION_get_diff(const struct GNUNET_CONFIGURATION_Handle *cfg_default, 182GNUNET_CONFIGURATION_get_diff (const struct
181 const struct GNUNET_CONFIGURATION_Handle *cfg_new); 183 GNUNET_CONFIGURATION_Handle *cfg_default,
184 const struct
185 GNUNET_CONFIGURATION_Handle *cfg_new);
182 186
183 187
184/** 188/**
@@ -189,7 +193,7 @@ GNUNET_CONFIGURATION_get_diff(const struct GNUNET_CONFIGURATION_Handle *cfg_defa
189 * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed) 193 * @return #GNUNET_NO if clean, #GNUNET_YES if dirty, #GNUNET_SYSERR on error (i.e. last save failed)
190 */ 194 */
191int 195int
192GNUNET_CONFIGURATION_is_dirty(const struct GNUNET_CONFIGURATION_Handle *cfg); 196GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
193 197
194 198
195/** 199/**
@@ -216,9 +220,9 @@ typedef int
216 * otherwise return value from @a cb. 220 * otherwise return value from @a cb.
217 */ 221 */
218int 222int
219GNUNET_CONFIGURATION_parse_and_run(const char *filename, 223GNUNET_CONFIGURATION_parse_and_run (const char *filename,
220 GNUNET_CONFIGURATION_Callback cb, 224 GNUNET_CONFIGURATION_Callback cb,
221 void *cb_cls); 225 void *cb_cls);
222 226
223 227
224/** 228/**
@@ -255,9 +259,9 @@ typedef void
255 * @param iter_cls closure for @a iter 259 * @param iter_cls closure for @a iter
256 */ 260 */
257void 261void
258GNUNET_CONFIGURATION_iterate(const struct GNUNET_CONFIGURATION_Handle *cfg, 262GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
259 GNUNET_CONFIGURATION_Iterator iter, 263 GNUNET_CONFIGURATION_Iterator iter,
260 void *iter_cls); 264 void *iter_cls);
261 265
262 266
263/** 267/**
@@ -268,9 +272,11 @@ GNUNET_CONFIGURATION_iterate(const struct GNUNET_CONFIGURATION_Handle *cfg,
268 * @param iter_cls closure for @a iter 272 * @param iter_cls closure for @a iter
269 */ 273 */
270void 274void
271GNUNET_CONFIGURATION_iterate_sections(const struct GNUNET_CONFIGURATION_Handle *cfg, 275GNUNET_CONFIGURATION_iterate_sections (const struct
272 GNUNET_CONFIGURATION_Section_Iterator iter, 276 GNUNET_CONFIGURATION_Handle *cfg,
273 void *iter_cls); 277 GNUNET_CONFIGURATION_Section_Iterator
278 iter,
279 void *iter_cls);
274 280
275 281
276/** 282/**
@@ -280,8 +286,8 @@ GNUNET_CONFIGURATION_iterate_sections(const struct GNUNET_CONFIGURATION_Handle *
280 * @param section name of the section to remove 286 * @param section name of the section to remove
281 */ 287 */
282void 288void
283GNUNET_CONFIGURATION_remove_section(struct GNUNET_CONFIGURATION_Handle *cfg, 289GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
284 const char *section); 290 const char *section);
285 291
286 292
287/** 293/**
@@ -294,10 +300,11 @@ GNUNET_CONFIGURATION_remove_section(struct GNUNET_CONFIGURATION_Handle *cfg,
294 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 300 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
295 */ 301 */
296int 302int
297GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *cfg, 303GNUNET_CONFIGURATION_get_value_number (const struct
298 const char *section, 304 GNUNET_CONFIGURATION_Handle *cfg,
299 const char *option, 305 const char *section,
300 unsigned long long *number); 306 const char *option,
307 unsigned long long *number);
301 308
302 309
303/** 310/**
@@ -310,10 +317,11 @@ GNUNET_CONFIGURATION_get_value_number(const struct GNUNET_CONFIGURATION_Handle *
310 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 317 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
311 */ 318 */
312int 319int
313GNUNET_CONFIGURATION_get_value_float(const struct GNUNET_CONFIGURATION_Handle *cfg, 320GNUNET_CONFIGURATION_get_value_float (const struct
314 const char *section, 321 GNUNET_CONFIGURATION_Handle *cfg,
315 const char *option, 322 const char *section,
316 float *number); 323 const char *option,
324 float *number);
317 325
318 326
319/** 327/**
@@ -326,10 +334,11 @@ GNUNET_CONFIGURATION_get_value_float(const struct GNUNET_CONFIGURATION_Handle *c
326 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 334 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
327 */ 335 */
328int 336int
329GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cfg, 337GNUNET_CONFIGURATION_get_value_time (const struct
330 const char *section, 338 GNUNET_CONFIGURATION_Handle *cfg,
331 const char *option, 339 const char *section,
332 struct GNUNET_TIME_Relative *time); 340 const char *option,
341 struct GNUNET_TIME_Relative *time);
333 342
334 343
335 344
@@ -343,10 +352,11 @@ GNUNET_CONFIGURATION_get_value_time(const struct GNUNET_CONFIGURATION_Handle *cf
343 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 352 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
344 */ 353 */
345int 354int
346GNUNET_CONFIGURATION_get_value_size(const struct GNUNET_CONFIGURATION_Handle *cfg, 355GNUNET_CONFIGURATION_get_value_size (const struct
347 const char *section, 356 GNUNET_CONFIGURATION_Handle *cfg,
348 const char *option, 357 const char *section,
349 unsigned long long *size); 358 const char *option,
359 unsigned long long *size);
350 360
351 361
352/** 362/**
@@ -358,9 +368,9 @@ GNUNET_CONFIGURATION_get_value_size(const struct GNUNET_CONFIGURATION_Handle *cf
358 * @return #GNUNET_YES if so, #GNUNET_NO if not. 368 * @return #GNUNET_YES if so, #GNUNET_NO if not.
359 */ 369 */
360int 370int
361GNUNET_CONFIGURATION_have_value(const struct GNUNET_CONFIGURATION_Handle *cfg, 371GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
362 const char *section, 372 const char *section,
363 const char *option); 373 const char *option);
364 374
365 375
366/** 376/**
@@ -374,10 +384,11 @@ GNUNET_CONFIGURATION_have_value(const struct GNUNET_CONFIGURATION_Handle *cfg,
374 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 384 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
375 */ 385 */
376int 386int
377GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, 387GNUNET_CONFIGURATION_get_value_string (const struct
378 const char *section, 388 GNUNET_CONFIGURATION_Handle *cfg,
379 const char *option, 389 const char *section,
380 char **value); 390 const char *option,
391 char **value);
381 392
382 393
383/** 394/**
@@ -392,10 +403,11 @@ GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *
392 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 403 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
393 */ 404 */
394int 405int
395GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, 406GNUNET_CONFIGURATION_get_value_filename (const struct
396 const char *section, 407 GNUNET_CONFIGURATION_Handle *cfg,
397 const char *option, 408 const char *section,
398 char **value); 409 const char *option,
410 char **value);
399 411
400 412
401/** 413/**
@@ -409,11 +421,12 @@ GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle
409 * @return number of filenames iterated over, -1 on error 421 * @return number of filenames iterated over, -1 on error
410 */ 422 */
411int 423int
412GNUNET_CONFIGURATION_iterate_value_filenames(const struct GNUNET_CONFIGURATION_Handle *cfg, 424GNUNET_CONFIGURATION_iterate_value_filenames (const struct
413 const char *section, 425 GNUNET_CONFIGURATION_Handle *cfg,
414 const char *option, 426 const char *section,
415 GNUNET_FileNameCallback cb, 427 const char *option,
416 void *cb_cls); 428 GNUNET_FileNameCallback cb,
429 void *cb_cls);
417 430
418/** 431/**
419 * Iterate over values of a section in the configuration. 432 * Iterate over values of a section in the configuration.
@@ -424,10 +437,11 @@ GNUNET_CONFIGURATION_iterate_value_filenames(const struct GNUNET_CONFIGURATION_H
424 * @param iter_cls closure for @a iter 437 * @param iter_cls closure for @a iter
425 */ 438 */
426void 439void
427GNUNET_CONFIGURATION_iterate_section_values(const struct GNUNET_CONFIGURATION_Handle *cfg, 440GNUNET_CONFIGURATION_iterate_section_values (const struct
428 const char *section, 441 GNUNET_CONFIGURATION_Handle *cfg,
429 GNUNET_CONFIGURATION_Iterator iter, 442 const char *section,
430 void *iter_cls); 443 GNUNET_CONFIGURATION_Iterator iter,
444 void *iter_cls);
431 445
432/** 446/**
433 * Get a configuration value that should be in a set of 447 * Get a configuration value that should be in a set of
@@ -442,11 +456,12 @@ GNUNET_CONFIGURATION_iterate_section_values(const struct GNUNET_CONFIGURATION_Ha
442 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 456 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
443 */ 457 */
444int 458int
445GNUNET_CONFIGURATION_get_value_choice(const struct GNUNET_CONFIGURATION_Handle *cfg, 459GNUNET_CONFIGURATION_get_value_choice (const struct
446 const char *section, 460 GNUNET_CONFIGURATION_Handle *cfg,
447 const char *option, 461 const char *section,
448 const char *const *choices, 462 const char *option,
449 const char **value); 463 const char *const *choices,
464 const char **value);
450 465
451/** 466/**
452 * Get a configuration value that should be in a set of 467 * Get a configuration value that should be in a set of
@@ -458,9 +473,10 @@ GNUNET_CONFIGURATION_get_value_choice(const struct GNUNET_CONFIGURATION_Handle *
458 * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR 473 * @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR
459 */ 474 */
460int 475int
461GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, 476GNUNET_CONFIGURATION_get_value_yesno (const struct
462 const char *section, 477 GNUNET_CONFIGURATION_Handle *cfg,
463 const char *option); 478 const char *section,
479 const char *option);
464 480
465 481
466/** 482/**
@@ -476,11 +492,11 @@ GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *c
476 * #GNUNET_SYSERR on decoding error 492 * #GNUNET_SYSERR on decoding error
477 */ 493 */
478int 494int
479GNUNET_CONFIGURATION_get_data(const struct GNUNET_CONFIGURATION_Handle *cfg, 495GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg,
480 const char *section, 496 const char *section,
481 const char *option, 497 const char *option,
482 void *buf, 498 void *buf,
483 size_t buf_size); 499 size_t buf_size);
484 500
485 501
486/** 502/**
@@ -500,8 +516,9 @@ GNUNET_CONFIGURATION_get_data(const struct GNUNET_CONFIGURATION_Handle *cfg,
500 * @return $-expanded string 516 * @return $-expanded string
501 */ 517 */
502char * 518char *
503GNUNET_CONFIGURATION_expand_dollar(const struct GNUNET_CONFIGURATION_Handle *cfg, 519GNUNET_CONFIGURATION_expand_dollar (const struct
504 char *orig); 520 GNUNET_CONFIGURATION_Handle *cfg,
521 char *orig);
505 522
506 523
507/** 524/**
@@ -513,10 +530,10 @@ GNUNET_CONFIGURATION_expand_dollar(const struct GNUNET_CONFIGURATION_Handle *cfg
513 * @param number value to set 530 * @param number value to set
514 */ 531 */
515void 532void
516GNUNET_CONFIGURATION_set_value_number(struct GNUNET_CONFIGURATION_Handle *cfg, 533GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg,
517 const char *section, 534 const char *section,
518 const char *option, 535 const char *option,
519 unsigned long long number); 536 unsigned long long number);
520 537
521 538
522/** 539/**
@@ -528,10 +545,10 @@ GNUNET_CONFIGURATION_set_value_number(struct GNUNET_CONFIGURATION_Handle *cfg,
528 * @param value value to set 545 * @param value value to set
529 */ 546 */
530void 547void
531GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg, 548GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
532 const char *section, 549 const char *section,
533 const char *option, 550 const char *option,
534 const char *value); 551 const char *value);
535 552
536 553
537/** 554/**
@@ -546,10 +563,11 @@ GNUNET_CONFIGURATION_set_value_string(struct GNUNET_CONFIGURATION_Handle *cfg,
546 * #GNUNET_SYSERR if the filename is not in the list 563 * #GNUNET_SYSERR if the filename is not in the list
547 */ 564 */
548int 565int
549GNUNET_CONFIGURATION_remove_value_filename(struct GNUNET_CONFIGURATION_Handle *cfg, 566GNUNET_CONFIGURATION_remove_value_filename (struct
550 const char *section, 567 GNUNET_CONFIGURATION_Handle *cfg,
551 const char *option, 568 const char *section,
552 const char *value); 569 const char *option,
570 const char *value);
553 571
554 572
555/** 573/**
@@ -564,10 +582,11 @@ GNUNET_CONFIGURATION_remove_value_filename(struct GNUNET_CONFIGURATION_Handle *c
564 * #GNUNET_SYSERR if the filename already in the list 582 * #GNUNET_SYSERR if the filename already in the list
565 */ 583 */
566int 584int
567GNUNET_CONFIGURATION_append_value_filename(struct GNUNET_CONFIGURATION_Handle *cfg, 585GNUNET_CONFIGURATION_append_value_filename (struct
568 const char *section, 586 GNUNET_CONFIGURATION_Handle *cfg,
569 const char *option, 587 const char *section,
570 const char *value); 588 const char *option,
589 const char *value);
571 590
572#if 0 /* keep Emacsens' auto-indent happy */ 591#if 0 /* keep Emacsens' auto-indent happy */
573{ 592{
diff --git a/src/include/gnunet_consensus_service.h b/src/include/gnunet_consensus_service.h
index e864b5337..35cf424fb 100644
--- a/src/include/gnunet_consensus_service.h
+++ b/src/include/gnunet_consensus_service.h
@@ -64,7 +64,8 @@ extern "C"
64 * @param element new element, NULL on error 64 * @param element new element, NULL on error
65 */ 65 */
66typedef void (*GNUNET_CONSENSUS_ElementCallback) (void *cls, 66typedef void (*GNUNET_CONSENSUS_ElementCallback) (void *cls,
67 const struct GNUNET_SET_Element *element); 67 const struct
68 GNUNET_SET_Element *element);
68 69
69 70
70 71
@@ -93,14 +94,14 @@ struct GNUNET_CONSENSUS_Handle;
93 * @return handle to use, NULL on error 94 * @return handle to use, NULL on error
94 */ 95 */
95struct GNUNET_CONSENSUS_Handle * 96struct GNUNET_CONSENSUS_Handle *
96GNUNET_CONSENSUS_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 97GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
97 unsigned int num_peers, 98 unsigned int num_peers,
98 const struct GNUNET_PeerIdentity *peers, 99 const struct GNUNET_PeerIdentity *peers,
99 const struct GNUNET_HashCode *session_id, 100 const struct GNUNET_HashCode *session_id,
100 struct GNUNET_TIME_Absolute start, 101 struct GNUNET_TIME_Absolute start,
101 struct GNUNET_TIME_Absolute deadline, 102 struct GNUNET_TIME_Absolute deadline,
102 GNUNET_CONSENSUS_ElementCallback new_element_cb, 103 GNUNET_CONSENSUS_ElementCallback new_element_cb,
103 void *new_element_cls); 104 void *new_element_cls);
104 105
105 106
106/** 107/**
@@ -132,10 +133,10 @@ typedef void (*GNUNET_CONSENSUS_InsertDoneCallback) (void *cls,
132 * @param idc_cls closure for @a idc 133 * @param idc_cls closure for @a idc
133 */ 134 */
134void 135void
135GNUNET_CONSENSUS_insert(struct GNUNET_CONSENSUS_Handle *consensus, 136GNUNET_CONSENSUS_insert (struct GNUNET_CONSENSUS_Handle *consensus,
136 const struct GNUNET_SET_Element *element, 137 const struct GNUNET_SET_Element *element,
137 GNUNET_CONSENSUS_InsertDoneCallback idc, 138 GNUNET_CONSENSUS_InsertDoneCallback idc,
138 void *idc_cls); 139 void *idc_cls);
139 140
140 141
141 142
@@ -156,9 +157,9 @@ typedef void (*GNUNET_CONSENSUS_ConcludeCallback) (void *cls);
156 * @param conclude_cls closure for the conclude callback 157 * @param conclude_cls closure for the conclude callback
157 */ 158 */
158void 159void
159GNUNET_CONSENSUS_conclude(struct GNUNET_CONSENSUS_Handle *consensus, 160GNUNET_CONSENSUS_conclude (struct GNUNET_CONSENSUS_Handle *consensus,
160 GNUNET_CONSENSUS_ConcludeCallback conclude, 161 GNUNET_CONSENSUS_ConcludeCallback conclude,
161 void *conclude_cls); 162 void *conclude_cls);
162 163
163 164
164/** 165/**
@@ -168,7 +169,7 @@ GNUNET_CONSENSUS_conclude(struct GNUNET_CONSENSUS_Handle *consensus,
168 * @param consensus handle to destroy 169 * @param consensus handle to destroy
169 */ 170 */
170void 171void
171GNUNET_CONSENSUS_destroy(struct GNUNET_CONSENSUS_Handle *consensus); 172GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus);
172 173
173 174
174#if 0 /* keep Emacsens' auto-indent happy */ 175#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 39dbd4425..e2678a60e 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -48,35 +48,40 @@ extern "C"
48 * so that at least one maximum-size message can be send roughly once 48 * so that at least one maximum-size message can be send roughly once
49 * per minute. 49 * per minute.
50 */ 50 */
51#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init(1024) 51#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024)
52 52
53/** 53/**
54 * After how long do we consider a connection to a peer dead 54 * After how long do we consider a connection to a peer dead
55 * if we don't receive messages from the peer? 55 * if we don't receive messages from the peer?
56 */ 56 */
57#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5) 57#define GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply ( \
58 GNUNET_TIME_UNIT_MINUTES, 5)
58 59
59/** 60/**
60 * How long do we delay reading more from a peer after a quota violation? 61 * How long do we delay reading more from a peer after a quota violation?
61 */ 62 */
62#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 2) 63#define GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT GNUNET_TIME_relative_multiply ( \
64 GNUNET_TIME_UNIT_SECONDS, 2)
63 65
64/** 66/**
65 * After how long do we consider a service unresponsive 67 * After how long do we consider a service unresponsive
66 * even if we assume that the service commonly does not 68 * even if we assume that the service commonly does not
67 * respond instantly (DNS, Database, etc.). 69 * respond instantly (DNS, Database, etc.).
68 */ 70 */
69#define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 10) 71#define GNUNET_CONSTANTS_SERVICE_TIMEOUT GNUNET_TIME_relative_multiply ( \
72 GNUNET_TIME_UNIT_MINUTES, 10)
70 73
71/** 74/**
72 * How long do we delay messages to get larger packet sizes (CORKing)? 75 * How long do we delay messages to get larger packet sizes (CORKing)?
73 */ 76 */
74#define GNUNET_CONSTANTS_MAX_CORK_DELAY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1) 77#define GNUNET_CONSTANTS_MAX_CORK_DELAY GNUNET_TIME_relative_multiply ( \
78 GNUNET_TIME_UNIT_SECONDS, 1)
75 79
76/** 80/**
77 * After what amount of latency for a message do we print a warning? 81 * After what amount of latency for a message do we print a warning?
78 */ 82 */
79#define GNUNET_CONSTANTS_LATENCY_WARN GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3) 83#define GNUNET_CONSTANTS_LATENCY_WARN GNUNET_TIME_relative_multiply ( \
84 GNUNET_TIME_UNIT_SECONDS, 3)
80 85
81/** 86/**
82 * Until which load do we consider the peer overly idle 87 * Until which load do we consider the peer overly idle
@@ -100,20 +105,23 @@ extern "C"
100 * validated? This value is also used for our own addresses when we 105 * validated? This value is also used for our own addresses when we
101 * create a HELLO. 106 * create a HELLO.
102 */ 107 */
103#define GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 12) 108#define GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply ( \
109 GNUNET_TIME_UNIT_HOURS, 12)
104 110
105 111
106/** 112/**
107 * How long do we cache records at most in the DHT? 113 * How long do we cache records at most in the DHT?
108 */ 114 */
109#define GNUNET_CONSTANTS_DHT_MAX_EXPIRATION GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) 115#define GNUNET_CONSTANTS_DHT_MAX_EXPIRATION GNUNET_TIME_relative_multiply ( \
116 GNUNET_TIME_UNIT_HOURS, 24)
110 117
111 118
112/** 119/**
113 * Size of the `struct EncryptedMessage` of the core (which 120 * Size of the `struct EncryptedMessage` of the core (which
114 * is the per-message overhead of the core). 121 * is the per-message overhead of the core).
115 */ 122 */
116#define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof(struct GNUNET_HashCode)) 123#define GNUNET_CONSTANTS_CORE_SIZE_ENCRYPTED_MESSAGE (24 + sizeof(struct \
124 GNUNET_HashCode))
117 125
118/** 126/**
119 * What is the maximum size for encrypted messages? Note that this 127 * What is the maximum size for encrypted messages? Note that this
@@ -141,7 +149,8 @@ extern "C"
141 * Maximum message size that can be sent on CADET. 149 * Maximum message size that can be sent on CADET.
142 */ 150 */
143#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \ 151#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \
144 (GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD) 152 (GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE \
153 - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD)
145 154
146/** 155/**
147 * Largest block that can be stored in the DHT. 156 * Largest block that can be stored in the DHT.
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index d811995ff..a119a6632 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -67,10 +67,10 @@
67 * #GNUNET_NO if compression did not help 67 * #GNUNET_NO if compression did not help
68 */ 68 */
69int 69int
70GNUNET_try_compression(const char *data, 70GNUNET_try_compression (const char *data,
71 size_t old_size, 71 size_t old_size,
72 char **result, 72 char **result,
73 size_t *new_size); 73 size_t *new_size);
74 74
75 75
76/** 76/**
@@ -84,7 +84,7 @@ GNUNET_try_compression(const char *data,
84 * @return NULL on error, buffer of @a output_size decompressed bytes otherwise 84 * @return NULL on error, buffer of @a output_size decompressed bytes otherwise
85 */ 85 */
86char * 86char *
87GNUNET_decompress(const char *input, size_t input_size, size_t output_size); 87GNUNET_decompress (const char *input, size_t input_size, size_t output_size);
88 88
89 89
90#if HAVE_EXTRACTOR_H 90#if HAVE_EXTRACTOR_H
@@ -99,7 +99,8 @@ GNUNET_decompress(const char *input, size_t input_size, size_t output_size);
99 * Enumeration defining various sources of keywords. See also 99 * Enumeration defining various sources of keywords. See also
100 * http://dublincore.org/documents/1998/09/dces/ 100 * http://dublincore.org/documents/1998/09/dces/
101 */ 101 */
102enum EXTRACTOR_MetaType { 102enum EXTRACTOR_MetaType
103{
103 EXTRACTOR_METATYPE_RESERVED = 0, 104 EXTRACTOR_METATYPE_RESERVED = 0,
104 EXTRACTOR_METATYPE_MIMETYPE = 1, 105 EXTRACTOR_METATYPE_MIMETYPE = 1,
105 EXTRACTOR_METATYPE_FILENAME = 2, 106 EXTRACTOR_METATYPE_FILENAME = 2,
@@ -128,7 +129,8 @@ enum EXTRACTOR_MetaType {
128/** 129/**
129 * Format in which the extracted meta data is presented. 130 * Format in which the extracted meta data is presented.
130 */ 131 */
131enum EXTRACTOR_MetaFormat { 132enum EXTRACTOR_MetaFormat
133{
132 /** 134 /**
133 * Format is unknown. 135 * Format is unknown.
134 */ 136 */
@@ -228,9 +230,9 @@ typedef int (*GNUNET_CONTAINER_HashCodeIterator) (void *cls,
228 * @return the bloomfilter 230 * @return the bloomfilter
229 */ 231 */
230struct GNUNET_CONTAINER_BloomFilter * 232struct GNUNET_CONTAINER_BloomFilter *
231GNUNET_CONTAINER_bloomfilter_load(const char *filename, 233GNUNET_CONTAINER_bloomfilter_load (const char *filename,
232 size_t size, 234 size_t size,
233 unsigned int k); 235 unsigned int k);
234 236
235 237
236/** 238/**
@@ -248,9 +250,9 @@ GNUNET_CONTAINER_bloomfilter_load(const char *filename,
248 * @return the bloomfilter 250 * @return the bloomfilter
249 */ 251 */
250struct GNUNET_CONTAINER_BloomFilter * 252struct GNUNET_CONTAINER_BloomFilter *
251GNUNET_CONTAINER_bloomfilter_init(const char *data, 253GNUNET_CONTAINER_bloomfilter_init (const char *data,
252 size_t size, 254 size_t size,
253 unsigned int k); 255 unsigned int k);
254 256
255 257
256/** 258/**
@@ -263,7 +265,7 @@ GNUNET_CONTAINER_bloomfilter_init(const char *data,
263 * @return #GNUNET_SYSERR if the data array of the wrong size 265 * @return #GNUNET_SYSERR if the data array of the wrong size
264 */ 266 */
265int 267int
266GNUNET_CONTAINER_bloomfilter_get_raw_data( 268GNUNET_CONTAINER_bloomfilter_get_raw_data (
267 const struct GNUNET_CONTAINER_BloomFilter *bf, 269 const struct GNUNET_CONTAINER_BloomFilter *bf,
268 char *data, 270 char *data,
269 size_t size); 271 size_t size);
@@ -278,7 +280,7 @@ GNUNET_CONTAINER_bloomfilter_get_raw_data(
278 * @return #GNUNET_YES if the element is in the filter, #GNUNET_NO if not 280 * @return #GNUNET_YES if the element is in the filter, #GNUNET_NO if not
279 */ 281 */
280int 282int
281GNUNET_CONTAINER_bloomfilter_test( 283GNUNET_CONTAINER_bloomfilter_test (
282 const struct GNUNET_CONTAINER_BloomFilter *bf, 284 const struct GNUNET_CONTAINER_BloomFilter *bf,
283 const struct GNUNET_HashCode *e); 285 const struct GNUNET_HashCode *e);
284 286
@@ -291,8 +293,8 @@ GNUNET_CONTAINER_bloomfilter_test(
291 * @param e the element 293 * @param e the element
292 */ 294 */
293void 295void
294GNUNET_CONTAINER_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf, 296GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf,
295 const struct GNUNET_HashCode *e); 297 const struct GNUNET_HashCode *e);
296 298
297 299
298/** 300/**
@@ -303,8 +305,8 @@ GNUNET_CONTAINER_bloomfilter_add(struct GNUNET_CONTAINER_BloomFilter *bf,
303 * @param e the element to remove 305 * @param e the element to remove
304 */ 306 */
305void 307void
306GNUNET_CONTAINER_bloomfilter_remove(struct GNUNET_CONTAINER_BloomFilter *bf, 308GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
307 const struct GNUNET_HashCode *e); 309 const struct GNUNET_HashCode *e);
308 310
309 311
310/** 312/**
@@ -315,7 +317,7 @@ GNUNET_CONTAINER_bloomfilter_remove(struct GNUNET_CONTAINER_BloomFilter *bf,
315 * @return copy of bf 317 * @return copy of bf
316 */ 318 */
317struct GNUNET_CONTAINER_BloomFilter * 319struct GNUNET_CONTAINER_BloomFilter *
318GNUNET_CONTAINER_bloomfilter_copy( 320GNUNET_CONTAINER_bloomfilter_copy (
319 const struct GNUNET_CONTAINER_BloomFilter *bf); 321 const struct GNUNET_CONTAINER_BloomFilter *bf);
320 322
321 323
@@ -328,7 +330,7 @@ GNUNET_CONTAINER_bloomfilter_copy(
328 * @param bf the filter 330 * @param bf the filter
329 */ 331 */
330void 332void
331GNUNET_CONTAINER_bloomfilter_free(struct GNUNET_CONTAINER_BloomFilter *bf); 333GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf);
332 334
333 335
334/** 336/**
@@ -338,7 +340,7 @@ GNUNET_CONTAINER_bloomfilter_free(struct GNUNET_CONTAINER_BloomFilter *bf);
338 * @return addresses set per element in the bf 340 * @return addresses set per element in the bf
339 */ 341 */
340size_t 342size_t
341GNUNET_CONTAINER_bloomfilter_get_element_addresses( 343GNUNET_CONTAINER_bloomfilter_get_element_addresses (
342 const struct GNUNET_CONTAINER_BloomFilter *bf); 344 const struct GNUNET_CONTAINER_BloomFilter *bf);
343 345
344 346
@@ -350,7 +352,7 @@ GNUNET_CONTAINER_bloomfilter_get_element_addresses(
350 * @return number of bytes used for the data of the bloom filter 352 * @return number of bytes used for the data of the bloom filter
351 */ 353 */
352size_t 354size_t
353GNUNET_CONTAINER_bloomfilter_get_size( 355GNUNET_CONTAINER_bloomfilter_get_size (
354 const struct GNUNET_CONTAINER_BloomFilter *bf); 356 const struct GNUNET_CONTAINER_BloomFilter *bf);
355 357
356 358
@@ -361,7 +363,7 @@ GNUNET_CONTAINER_bloomfilter_get_size(
361 * @param bf the filter 363 * @param bf the filter
362 */ 364 */
363void 365void
364GNUNET_CONTAINER_bloomfilter_clear(struct GNUNET_CONTAINER_BloomFilter *bf); 366GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf);
365 367
366 368
367/** 369/**
@@ -377,9 +379,9 @@ GNUNET_CONTAINER_bloomfilter_clear(struct GNUNET_CONTAINER_BloomFilter *bf);
377 * @return #GNUNET_OK on success 379 * @return #GNUNET_OK on success
378 */ 380 */
379int 381int
380GNUNET_CONTAINER_bloomfilter_or(struct GNUNET_CONTAINER_BloomFilter *bf, 382GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf,
381 const char *data, 383 const char *data,
382 size_t size); 384 size_t size);
383 385
384 386
385/** 387/**
@@ -393,7 +395,7 @@ GNUNET_CONTAINER_bloomfilter_or(struct GNUNET_CONTAINER_BloomFilter *bf,
393 * @return #GNUNET_OK on success 395 * @return #GNUNET_OK on success
394 */ 396 */
395int 397int
396GNUNET_CONTAINER_bloomfilter_or2( 398GNUNET_CONTAINER_bloomfilter_or2 (
397 struct GNUNET_CONTAINER_BloomFilter *bf, 399 struct GNUNET_CONTAINER_BloomFilter *bf,
398 const struct GNUNET_CONTAINER_BloomFilter *to_or); 400 const struct GNUNET_CONTAINER_BloomFilter *to_or);
399 401
@@ -411,11 +413,11 @@ GNUNET_CONTAINER_bloomfilter_or2(
411 * @param k the new number of #GNUNET_CRYPTO_hash-function to apply per element 413 * @param k the new number of #GNUNET_CRYPTO_hash-function to apply per element
412 */ 414 */
413void 415void
414GNUNET_CONTAINER_bloomfilter_resize(struct GNUNET_CONTAINER_BloomFilter *bf, 416GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
415 GNUNET_CONTAINER_HashCodeIterator iterator, 417 GNUNET_CONTAINER_HashCodeIterator iterator,
416 void *iterator_cls, 418 void *iterator_cls,
417 size_t size, 419 size_t size,
418 unsigned int k); 420 unsigned int k);
419 421
420 422
421/* ****************** metadata ******************* */ 423/* ****************** metadata ******************* */
@@ -434,7 +436,7 @@ struct GNUNET_CONTAINER_MetaData;
434 * @return empty meta-data container 436 * @return empty meta-data container
435 */ 437 */
436struct GNUNET_CONTAINER_MetaData * 438struct GNUNET_CONTAINER_MetaData *
437GNUNET_CONTAINER_meta_data_create(void); 439GNUNET_CONTAINER_meta_data_create (void);
438 440
439 441
440/** 442/**
@@ -445,7 +447,7 @@ GNUNET_CONTAINER_meta_data_create(void);
445 * @return duplicate meta-data container 447 * @return duplicate meta-data container
446 */ 448 */
447struct GNUNET_CONTAINER_MetaData * 449struct GNUNET_CONTAINER_MetaData *
448GNUNET_CONTAINER_meta_data_duplicate( 450GNUNET_CONTAINER_meta_data_duplicate (
449 const struct GNUNET_CONTAINER_MetaData *md); 451 const struct GNUNET_CONTAINER_MetaData *md);
450 452
451 453
@@ -456,7 +458,7 @@ GNUNET_CONTAINER_meta_data_duplicate(
456 * @param md what to free 458 * @param md what to free
457 */ 459 */
458void 460void
459GNUNET_CONTAINER_meta_data_destroy(struct GNUNET_CONTAINER_MetaData *md); 461GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md);
460 462
461 463
462/** 464/**
@@ -471,7 +473,7 @@ GNUNET_CONTAINER_meta_data_destroy(struct GNUNET_CONTAINER_MetaData *md);
471 * @return #GNUNET_YES if they are equal 473 * @return #GNUNET_YES if they are equal
472 */ 474 */
473int 475int
474GNUNET_CONTAINER_meta_data_test_equal( 476GNUNET_CONTAINER_meta_data_test_equal (
475 const struct GNUNET_CONTAINER_MetaData *md1, 477 const struct GNUNET_CONTAINER_MetaData *md1,
476 const struct GNUNET_CONTAINER_MetaData *md2); 478 const struct GNUNET_CONTAINER_MetaData *md2);
477 479
@@ -495,13 +497,13 @@ GNUNET_CONTAINER_meta_data_test_equal(
495 * data_mime_type and plugin_name are not considered for "exists" checks 497 * data_mime_type and plugin_name are not considered for "exists" checks
496 */ 498 */
497int 499int
498GNUNET_CONTAINER_meta_data_insert(struct GNUNET_CONTAINER_MetaData *md, 500GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
499 const char *plugin_name, 501 const char *plugin_name,
500 enum EXTRACTOR_MetaType type, 502 enum EXTRACTOR_MetaType type,
501 enum EXTRACTOR_MetaFormat format, 503 enum EXTRACTOR_MetaFormat format,
502 const char *data_mime_type, 504 const char *data_mime_type,
503 const char *data, 505 const char *data,
504 size_t data_size); 506 size_t data_size);
505 507
506 508
507/** 509/**
@@ -513,8 +515,8 @@ GNUNET_CONTAINER_meta_data_insert(struct GNUNET_CONTAINER_MetaData *md,
513 * @param in metadata to merge 515 * @param in metadata to merge
514 */ 516 */
515void 517void
516GNUNET_CONTAINER_meta_data_merge(struct GNUNET_CONTAINER_MetaData *md, 518GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md,
517 const struct GNUNET_CONTAINER_MetaData *in); 519 const struct GNUNET_CONTAINER_MetaData *in);
518 520
519 521
520/** 522/**
@@ -529,10 +531,10 @@ GNUNET_CONTAINER_meta_data_merge(struct GNUNET_CONTAINER_MetaData *md,
529 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the item does not exist in md 531 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the item does not exist in md
530 */ 532 */
531int 533int
532GNUNET_CONTAINER_meta_data_delete(struct GNUNET_CONTAINER_MetaData *md, 534GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
533 enum EXTRACTOR_MetaType type, 535 enum EXTRACTOR_MetaType type,
534 const char *data, 536 const char *data,
535 size_t data_size); 537 size_t data_size);
536 538
537 539
538/** 540/**
@@ -542,7 +544,7 @@ GNUNET_CONTAINER_meta_data_delete(struct GNUNET_CONTAINER_MetaData *md,
542 * @param md metadata to manipulate 544 * @param md metadata to manipulate
543 */ 545 */
544void 546void
545GNUNET_CONTAINER_meta_data_clear(struct GNUNET_CONTAINER_MetaData *md); 547GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md);
546 548
547 549
548/** 550/**
@@ -553,7 +555,7 @@ GNUNET_CONTAINER_meta_data_clear(struct GNUNET_CONTAINER_MetaData *md);
553 * @param md metadata to modify 555 * @param md metadata to modify
554 */ 556 */
555void 557void
556GNUNET_CONTAINER_meta_data_add_publication_date( 558GNUNET_CONTAINER_meta_data_add_publication_date (
557 struct GNUNET_CONTAINER_MetaData *md); 559 struct GNUNET_CONTAINER_MetaData *md);
558 560
559 561
@@ -568,9 +570,9 @@ GNUNET_CONTAINER_meta_data_add_publication_date(
568 * @return number of entries 570 * @return number of entries
569 */ 571 */
570int 572int
571GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md, 573GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md,
572 EXTRACTOR_MetaDataProcessor iter, 574 EXTRACTOR_MetaDataProcessor iter,
573 void *iter_cls); 575 void *iter_cls);
574 576
575 577
576/** 578/**
@@ -585,7 +587,7 @@ GNUNET_CONTAINER_meta_data_iterate(const struct GNUNET_CONTAINER_MetaData *md,
585 * @return NULL if no entry was found 587 * @return NULL if no entry was found
586 */ 588 */
587char * 589char *
588GNUNET_CONTAINER_meta_data_get_by_type( 590GNUNET_CONTAINER_meta_data_get_by_type (
589 const struct GNUNET_CONTAINER_MetaData *md, 591 const struct GNUNET_CONTAINER_MetaData *md,
590 enum EXTRACTOR_MetaType type); 592 enum EXTRACTOR_MetaType type);
591 593
@@ -603,7 +605,7 @@ GNUNET_CONTAINER_meta_data_get_by_type(
603 * otherwise client is responsible for freeing the value! 605 * otherwise client is responsible for freeing the value!
604 */ 606 */
605char * 607char *
606GNUNET_CONTAINER_meta_data_get_first_by_types( 608GNUNET_CONTAINER_meta_data_get_first_by_types (
607 const struct GNUNET_CONTAINER_MetaData *md, 609 const struct GNUNET_CONTAINER_MetaData *md,
608 ...); 610 ...);
609 611
@@ -618,7 +620,7 @@ GNUNET_CONTAINER_meta_data_get_first_by_types(
618 * @return number of bytes in thumbnail, 0 if not available 620 * @return number of bytes in thumbnail, 0 if not available
619 */ 621 */
620size_t 622size_t
621GNUNET_CONTAINER_meta_data_get_thumbnail( 623GNUNET_CONTAINER_meta_data_get_thumbnail (
622 const struct GNUNET_CONTAINER_MetaData *md, 624 const struct GNUNET_CONTAINER_MetaData *md,
623 unsigned char **thumb); 625 unsigned char **thumb);
624 626
@@ -627,7 +629,8 @@ GNUNET_CONTAINER_meta_data_get_thumbnail(
627 * @ingroup metadata 629 * @ingroup metadata
628 * Options for metadata serialization. 630 * Options for metadata serialization.
629 */ 631 */
630enum GNUNET_CONTAINER_MetaDataSerializationOptions { 632enum GNUNET_CONTAINER_MetaDataSerializationOptions
633{
631 /** 634 /**
632 * @ingroup metadata 635 * @ingroup metadata
633 * Serialize all of the data. 636 * Serialize all of the data.
@@ -665,7 +668,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions {
665 * space) 668 * space)
666 */ 669 */
667ssize_t 670ssize_t
668GNUNET_CONTAINER_meta_data_serialize( 671GNUNET_CONTAINER_meta_data_serialize (
669 const struct GNUNET_CONTAINER_MetaData *md, 672 const struct GNUNET_CONTAINER_MetaData *md,
670 char **target, 673 char **target,
671 size_t max, 674 size_t max,
@@ -680,7 +683,7 @@ GNUNET_CONTAINER_meta_data_serialize(
680 * @return number of bytes needed for serialization, -1 on error 683 * @return number of bytes needed for serialization, -1 on error
681 */ 684 */
682ssize_t 685ssize_t
683GNUNET_CONTAINER_meta_data_get_serialized_size( 686GNUNET_CONTAINER_meta_data_get_serialized_size (
684 const struct GNUNET_CONTAINER_MetaData *md); 687 const struct GNUNET_CONTAINER_MetaData *md);
685 688
686 689
@@ -694,7 +697,7 @@ GNUNET_CONTAINER_meta_data_get_serialized_size(
694 * bad format) 697 * bad format)
695 */ 698 */
696struct GNUNET_CONTAINER_MetaData * 699struct GNUNET_CONTAINER_MetaData *
697GNUNET_CONTAINER_meta_data_deserialize(const char *input, size_t size); 700GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size);
698 701
699 702
700/* ******************************* HashMap **************************** */ 703/* ******************************* HashMap **************************** */
@@ -716,7 +719,8 @@ struct GNUNET_CONTAINER_MultiHashMapIterator;
716 * @ingroup hashmap 719 * @ingroup hashmap
717 * Options for storing values in the HashMap. 720 * Options for storing values in the HashMap.
718 */ 721 */
719enum GNUNET_CONTAINER_MultiHashMapOption { 722enum GNUNET_CONTAINER_MultiHashMapOption
723{
720 /** 724 /**
721 * @ingroup hashmap 725 * @ingroup hashmap
722 * If a value with the given key exists, replace it. Note that the 726 * If a value with the given key exists, replace it. Note that the
@@ -785,7 +789,7 @@ typedef int (*GNUNET_CONTAINER_MulitHashMapIteratorCallback) (
785 * @return NULL on error 789 * @return NULL on error
786 */ 790 */
787struct GNUNET_CONTAINER_MultiHashMap * 791struct GNUNET_CONTAINER_MultiHashMap *
788GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys); 792GNUNET_CONTAINER_multihashmap_create (unsigned int len, int do_not_copy_keys);
789 793
790 794
791/** 795/**
@@ -796,7 +800,7 @@ GNUNET_CONTAINER_multihashmap_create(unsigned int len, int do_not_copy_keys);
796 * @param map the map 800 * @param map the map
797 */ 801 */
798void 802void
799GNUNET_CONTAINER_multihashmap_destroy( 803GNUNET_CONTAINER_multihashmap_destroy (
800 struct GNUNET_CONTAINER_MultiHashMap *map); 804 struct GNUNET_CONTAINER_MultiHashMap *map);
801 805
802 806
@@ -812,7 +816,7 @@ GNUNET_CONTAINER_multihashmap_destroy(
812 * key-value pairs with value NULL 816 * key-value pairs with value NULL
813 */ 817 */
814void * 818void *
815GNUNET_CONTAINER_multihashmap_get( 819GNUNET_CONTAINER_multihashmap_get (
816 const struct GNUNET_CONTAINER_MultiHashMap *map, 820 const struct GNUNET_CONTAINER_MultiHashMap *map,
817 const struct GNUNET_HashCode *key); 821 const struct GNUNET_HashCode *key);
818 822
@@ -830,9 +834,9 @@ GNUNET_CONTAINER_multihashmap_get(
830 * is not in the map 834 * is not in the map
831 */ 835 */
832int 836int
833GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map, 837GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map,
834 const struct GNUNET_HashCode *key, 838 const struct GNUNET_HashCode *key,
835 const void *value); 839 const void *value);
836 840
837/** 841/**
838 * @ingroup hashmap 842 * @ingroup hashmap
@@ -844,7 +848,7 @@ GNUNET_CONTAINER_multihashmap_remove(struct GNUNET_CONTAINER_MultiHashMap *map,
844 * @return number of values removed 848 * @return number of values removed
845 */ 849 */
846int 850int
847GNUNET_CONTAINER_multihashmap_remove_all( 851GNUNET_CONTAINER_multihashmap_remove_all (
848 struct GNUNET_CONTAINER_MultiHashMap *map, 852 struct GNUNET_CONTAINER_MultiHashMap *map,
849 const struct GNUNET_HashCode *key); 853 const struct GNUNET_HashCode *key);
850 854
@@ -858,7 +862,7 @@ GNUNET_CONTAINER_multihashmap_remove_all(
858 * @return number of values removed 862 * @return number of values removed
859 */ 863 */
860unsigned int 864unsigned int
861GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map); 865GNUNET_CONTAINER_multihashmap_clear (struct GNUNET_CONTAINER_MultiHashMap *map);
862 866
863 867
864/** 868/**
@@ -872,7 +876,7 @@ GNUNET_CONTAINER_multihashmap_clear(struct GNUNET_CONTAINER_MultiHashMap *map);
872 * #GNUNET_NO if not 876 * #GNUNET_NO if not
873 */ 877 */
874int 878int
875GNUNET_CONTAINER_multihashmap_contains( 879GNUNET_CONTAINER_multihashmap_contains (
876 const struct GNUNET_CONTAINER_MultiHashMap *map, 880 const struct GNUNET_CONTAINER_MultiHashMap *map,
877 const struct GNUNET_HashCode *key); 881 const struct GNUNET_HashCode *key);
878 882
@@ -889,7 +893,7 @@ GNUNET_CONTAINER_multihashmap_contains(
889 * #GNUNET_NO if not 893 * #GNUNET_NO if not
890 */ 894 */
891int 895int
892GNUNET_CONTAINER_multihashmap_contains_value( 896GNUNET_CONTAINER_multihashmap_contains_value (
893 const struct GNUNET_CONTAINER_MultiHashMap *map, 897 const struct GNUNET_CONTAINER_MultiHashMap *map,
894 const struct GNUNET_HashCode *key, 898 const struct GNUNET_HashCode *key,
895 const void *value); 899 const void *value);
@@ -909,7 +913,7 @@ GNUNET_CONTAINER_multihashmap_contains_value(
909 * value already exists 913 * value already exists
910 */ 914 */
911int 915int
912GNUNET_CONTAINER_multihashmap_put( 916GNUNET_CONTAINER_multihashmap_put (
913 struct GNUNET_CONTAINER_MultiHashMap *map, 917 struct GNUNET_CONTAINER_MultiHashMap *map,
914 const struct GNUNET_HashCode *key, 918 const struct GNUNET_HashCode *key,
915 void *value, 919 void *value,
@@ -923,7 +927,7 @@ GNUNET_CONTAINER_multihashmap_put(
923 * @return the number of key value pairs 927 * @return the number of key value pairs
924 */ 928 */
925unsigned int 929unsigned int
926GNUNET_CONTAINER_multihashmap_size( 930GNUNET_CONTAINER_multihashmap_size (
927 const struct GNUNET_CONTAINER_MultiHashMap *map); 931 const struct GNUNET_CONTAINER_MultiHashMap *map);
928 932
929 933
@@ -938,7 +942,7 @@ GNUNET_CONTAINER_multihashmap_size(
938 * #GNUNET_SYSERR if it aborted iteration 942 * #GNUNET_SYSERR if it aborted iteration
939 */ 943 */
940int 944int
941GNUNET_CONTAINER_multihashmap_iterate( 945GNUNET_CONTAINER_multihashmap_iterate (
942 struct GNUNET_CONTAINER_MultiHashMap *map, 946 struct GNUNET_CONTAINER_MultiHashMap *map,
943 GNUNET_CONTAINER_MulitHashMapIteratorCallback it, 947 GNUNET_CONTAINER_MulitHashMapIteratorCallback it,
944 void *it_cls); 948 void *it_cls);
@@ -958,7 +962,7 @@ GNUNET_CONTAINER_multihashmap_iterate(
958 * @return an iterator over the given multihashmap @a map 962 * @return an iterator over the given multihashmap @a map
959 */ 963 */
960struct GNUNET_CONTAINER_MultiHashMapIterator * 964struct GNUNET_CONTAINER_MultiHashMapIterator *
961GNUNET_CONTAINER_multihashmap_iterator_create( 965GNUNET_CONTAINER_multihashmap_iterator_create (
962 const struct GNUNET_CONTAINER_MultiHashMap *map); 966 const struct GNUNET_CONTAINER_MultiHashMap *map);
963 967
964 968
@@ -978,7 +982,7 @@ GNUNET_CONTAINER_multihashmap_iterator_create(
978 * #GNUNET_NO if we are out of elements 982 * #GNUNET_NO if we are out of elements
979 */ 983 */
980int 984int
981GNUNET_CONTAINER_multihashmap_iterator_next( 985GNUNET_CONTAINER_multihashmap_iterator_next (
982 struct GNUNET_CONTAINER_MultiHashMapIterator *iter, 986 struct GNUNET_CONTAINER_MultiHashMapIterator *iter,
983 struct GNUNET_HashCode *key, 987 struct GNUNET_HashCode *key,
984 const void **value); 988 const void **value);
@@ -991,7 +995,7 @@ GNUNET_CONTAINER_multihashmap_iterator_next(
991 * @param iter the iterator to destroy 995 * @param iter the iterator to destroy
992 */ 996 */
993void 997void
994GNUNET_CONTAINER_multihashmap_iterator_destroy( 998GNUNET_CONTAINER_multihashmap_iterator_destroy (
995 struct GNUNET_CONTAINER_MultiHashMapIterator *iter); 999 struct GNUNET_CONTAINER_MultiHashMapIterator *iter);
996 1000
997 1001
@@ -1007,7 +1011,7 @@ GNUNET_CONTAINER_multihashmap_iterator_destroy(
1007 * #GNUNET_SYSERR if it aborted iteration 1011 * #GNUNET_SYSERR if it aborted iteration
1008 */ 1012 */
1009int 1013int
1010GNUNET_CONTAINER_multihashmap_get_multiple( 1014GNUNET_CONTAINER_multihashmap_get_multiple (
1011 struct GNUNET_CONTAINER_MultiHashMap *map, 1015 struct GNUNET_CONTAINER_MultiHashMap *map,
1012 const struct GNUNET_HashCode *key, 1016 const struct GNUNET_HashCode *key,
1013 GNUNET_CONTAINER_MulitHashMapIteratorCallback it, 1017 GNUNET_CONTAINER_MulitHashMapIteratorCallback it,
@@ -1026,7 +1030,7 @@ GNUNET_CONTAINER_multihashmap_get_multiple(
1026 * @return the number of key value pairs processed, zero or one. 1030 * @return the number of key value pairs processed, zero or one.
1027 */ 1031 */
1028unsigned int 1032unsigned int
1029GNUNET_CONTAINER_multihashmap_get_random( 1033GNUNET_CONTAINER_multihashmap_get_random (
1030 const struct GNUNET_CONTAINER_MultiHashMap *map, 1034 const struct GNUNET_CONTAINER_MultiHashMap *map,
1031 GNUNET_CONTAINER_MulitHashMapIteratorCallback it, 1035 GNUNET_CONTAINER_MulitHashMapIteratorCallback it,
1032 void *it_cls); 1036 void *it_cls);
@@ -1074,7 +1078,7 @@ struct GNUNET_CONTAINER_MultiPeerMap;
1074 * @return NULL on error 1078 * @return NULL on error
1075 */ 1079 */
1076struct GNUNET_CONTAINER_MultiPeerMap * 1080struct GNUNET_CONTAINER_MultiPeerMap *
1077GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys); 1081GNUNET_CONTAINER_multipeermap_create (unsigned int len, int do_not_copy_keys);
1078 1082
1079 1083
1080/** 1084/**
@@ -1085,7 +1089,7 @@ GNUNET_CONTAINER_multipeermap_create(unsigned int len, int do_not_copy_keys);
1085 * @param map the map 1089 * @param map the map
1086 */ 1090 */
1087void 1091void
1088GNUNET_CONTAINER_multipeermap_destroy( 1092GNUNET_CONTAINER_multipeermap_destroy (
1089 struct GNUNET_CONTAINER_MultiPeerMap *map); 1093 struct GNUNET_CONTAINER_MultiPeerMap *map);
1090 1094
1091 1095
@@ -1101,7 +1105,7 @@ GNUNET_CONTAINER_multipeermap_destroy(
1101 * key-value pairs with value NULL 1105 * key-value pairs with value NULL
1102 */ 1106 */
1103void * 1107void *
1104GNUNET_CONTAINER_multipeermap_get( 1108GNUNET_CONTAINER_multipeermap_get (
1105 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1109 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1106 const struct GNUNET_PeerIdentity *key); 1110 const struct GNUNET_PeerIdentity *key);
1107 1111
@@ -1119,9 +1123,9 @@ GNUNET_CONTAINER_multipeermap_get(
1119 * is not in the map 1123 * is not in the map
1120 */ 1124 */
1121int 1125int
1122GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map, 1126GNUNET_CONTAINER_multipeermap_remove (struct GNUNET_CONTAINER_MultiPeerMap *map,
1123 const struct GNUNET_PeerIdentity *key, 1127 const struct GNUNET_PeerIdentity *key,
1124 const void *value); 1128 const void *value);
1125 1129
1126/** 1130/**
1127 * @ingroup hashmap 1131 * @ingroup hashmap
@@ -1133,7 +1137,7 @@ GNUNET_CONTAINER_multipeermap_remove(struct GNUNET_CONTAINER_MultiPeerMap *map,
1133 * @return number of values removed 1137 * @return number of values removed
1134 */ 1138 */
1135int 1139int
1136GNUNET_CONTAINER_multipeermap_remove_all( 1140GNUNET_CONTAINER_multipeermap_remove_all (
1137 struct GNUNET_CONTAINER_MultiPeerMap *map, 1141 struct GNUNET_CONTAINER_MultiPeerMap *map,
1138 const struct GNUNET_PeerIdentity *key); 1142 const struct GNUNET_PeerIdentity *key);
1139 1143
@@ -1149,7 +1153,7 @@ GNUNET_CONTAINER_multipeermap_remove_all(
1149 * #GNUNET_NO if not 1153 * #GNUNET_NO if not
1150 */ 1154 */
1151int 1155int
1152GNUNET_CONTAINER_multipeermap_contains( 1156GNUNET_CONTAINER_multipeermap_contains (
1153 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1157 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1154 const struct GNUNET_PeerIdentity *key); 1158 const struct GNUNET_PeerIdentity *key);
1155 1159
@@ -1166,7 +1170,7 @@ GNUNET_CONTAINER_multipeermap_contains(
1166 * #GNUNET_NO if not 1170 * #GNUNET_NO if not
1167 */ 1171 */
1168int 1172int
1169GNUNET_CONTAINER_multipeermap_contains_value( 1173GNUNET_CONTAINER_multipeermap_contains_value (
1170 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1174 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1171 const struct GNUNET_PeerIdentity *key, 1175 const struct GNUNET_PeerIdentity *key,
1172 const void *value); 1176 const void *value);
@@ -1186,7 +1190,7 @@ GNUNET_CONTAINER_multipeermap_contains_value(
1186 * value already exists 1190 * value already exists
1187 */ 1191 */
1188int 1192int
1189GNUNET_CONTAINER_multipeermap_put( 1193GNUNET_CONTAINER_multipeermap_put (
1190 struct GNUNET_CONTAINER_MultiPeerMap *map, 1194 struct GNUNET_CONTAINER_MultiPeerMap *map,
1191 const struct GNUNET_PeerIdentity *key, 1195 const struct GNUNET_PeerIdentity *key,
1192 void *value, 1196 void *value,
@@ -1201,7 +1205,7 @@ GNUNET_CONTAINER_multipeermap_put(
1201 * @return the number of key value pairs 1205 * @return the number of key value pairs
1202 */ 1206 */
1203unsigned int 1207unsigned int
1204GNUNET_CONTAINER_multipeermap_size( 1208GNUNET_CONTAINER_multipeermap_size (
1205 const struct GNUNET_CONTAINER_MultiPeerMap *map); 1209 const struct GNUNET_CONTAINER_MultiPeerMap *map);
1206 1210
1207 1211
@@ -1216,7 +1220,7 @@ GNUNET_CONTAINER_multipeermap_size(
1216 * #GNUNET_SYSERR if it aborted iteration 1220 * #GNUNET_SYSERR if it aborted iteration
1217 */ 1221 */
1218int 1222int
1219GNUNET_CONTAINER_multipeermap_iterate( 1223GNUNET_CONTAINER_multipeermap_iterate (
1220 struct GNUNET_CONTAINER_MultiPeerMap *map, 1224 struct GNUNET_CONTAINER_MultiPeerMap *map,
1221 GNUNET_CONTAINER_PeerMapIterator it, 1225 GNUNET_CONTAINER_PeerMapIterator it,
1222 void *it_cls); 1226 void *it_cls);
@@ -1237,7 +1241,7 @@ struct GNUNET_CONTAINER_MultiPeerMapIterator;
1237 * @return an iterator over the given multihashmap @a map 1241 * @return an iterator over the given multihashmap @a map
1238 */ 1242 */
1239struct GNUNET_CONTAINER_MultiPeerMapIterator * 1243struct GNUNET_CONTAINER_MultiPeerMapIterator *
1240GNUNET_CONTAINER_multipeermap_iterator_create( 1244GNUNET_CONTAINER_multipeermap_iterator_create (
1241 const struct GNUNET_CONTAINER_MultiPeerMap *map); 1245 const struct GNUNET_CONTAINER_MultiPeerMap *map);
1242 1246
1243 1247
@@ -1257,7 +1261,7 @@ GNUNET_CONTAINER_multipeermap_iterator_create(
1257 * #GNUNET_NO if we are out of elements 1261 * #GNUNET_NO if we are out of elements
1258 */ 1262 */
1259int 1263int
1260GNUNET_CONTAINER_multipeermap_iterator_next( 1264GNUNET_CONTAINER_multipeermap_iterator_next (
1261 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter, 1265 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter,
1262 struct GNUNET_PeerIdentity *key, 1266 struct GNUNET_PeerIdentity *key,
1263 const void **value); 1267 const void **value);
@@ -1270,7 +1274,7 @@ GNUNET_CONTAINER_multipeermap_iterator_next(
1270 * @param iter the iterator to destroy 1274 * @param iter the iterator to destroy
1271 */ 1275 */
1272void 1276void
1273GNUNET_CONTAINER_multipeermap_iterator_destroy( 1277GNUNET_CONTAINER_multipeermap_iterator_destroy (
1274 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter); 1278 struct GNUNET_CONTAINER_MultiPeerMapIterator *iter);
1275 1279
1276 1280
@@ -1286,7 +1290,7 @@ GNUNET_CONTAINER_multipeermap_iterator_destroy(
1286 * #GNUNET_SYSERR if it aborted iteration 1290 * #GNUNET_SYSERR if it aborted iteration
1287 */ 1291 */
1288int 1292int
1289GNUNET_CONTAINER_multipeermap_get_multiple( 1293GNUNET_CONTAINER_multipeermap_get_multiple (
1290 struct GNUNET_CONTAINER_MultiPeerMap *map, 1294 struct GNUNET_CONTAINER_MultiPeerMap *map,
1291 const struct GNUNET_PeerIdentity *key, 1295 const struct GNUNET_PeerIdentity *key,
1292 GNUNET_CONTAINER_PeerMapIterator it, 1296 GNUNET_CONTAINER_PeerMapIterator it,
@@ -1305,7 +1309,7 @@ GNUNET_CONTAINER_multipeermap_get_multiple(
1305 * @return the number of key value pairs processed, zero or one. 1309 * @return the number of key value pairs processed, zero or one.
1306 */ 1310 */
1307unsigned int 1311unsigned int
1308GNUNET_CONTAINER_multipeermap_get_random( 1312GNUNET_CONTAINER_multipeermap_get_random (
1309 const struct GNUNET_CONTAINER_MultiPeerMap *map, 1313 const struct GNUNET_CONTAINER_MultiPeerMap *map,
1310 GNUNET_CONTAINER_PeerMapIterator it, 1314 GNUNET_CONTAINER_PeerMapIterator it,
1311 void *it_cls); 1315 void *it_cls);
@@ -1353,7 +1357,7 @@ struct GNUNET_CONTAINER_MultiShortmap;
1353 * @return NULL on error 1357 * @return NULL on error
1354 */ 1358 */
1355struct GNUNET_CONTAINER_MultiShortmap * 1359struct GNUNET_CONTAINER_MultiShortmap *
1356GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys); 1360GNUNET_CONTAINER_multishortmap_create (unsigned int len, int do_not_copy_keys);
1357 1361
1358 1362
1359/** 1363/**
@@ -1364,7 +1368,7 @@ GNUNET_CONTAINER_multishortmap_create(unsigned int len, int do_not_copy_keys);
1364 * @param map the map 1368 * @param map the map
1365 */ 1369 */
1366void 1370void
1367GNUNET_CONTAINER_multishortmap_destroy( 1371GNUNET_CONTAINER_multishortmap_destroy (
1368 struct GNUNET_CONTAINER_MultiShortmap *map); 1372 struct GNUNET_CONTAINER_MultiShortmap *map);
1369 1373
1370 1374
@@ -1380,7 +1384,7 @@ GNUNET_CONTAINER_multishortmap_destroy(
1380 * key-value pairs with value NULL 1384 * key-value pairs with value NULL
1381 */ 1385 */
1382void * 1386void *
1383GNUNET_CONTAINER_multishortmap_get( 1387GNUNET_CONTAINER_multishortmap_get (
1384 const struct GNUNET_CONTAINER_MultiShortmap *map, 1388 const struct GNUNET_CONTAINER_MultiShortmap *map,
1385 const struct GNUNET_ShortHashCode *key); 1389 const struct GNUNET_ShortHashCode *key);
1386 1390
@@ -1398,7 +1402,7 @@ GNUNET_CONTAINER_multishortmap_get(
1398 * is not in the map 1402 * is not in the map
1399 */ 1403 */
1400int 1404int
1401GNUNET_CONTAINER_multishortmap_remove( 1405GNUNET_CONTAINER_multishortmap_remove (
1402 struct GNUNET_CONTAINER_MultiShortmap *map, 1406 struct GNUNET_CONTAINER_MultiShortmap *map,
1403 const struct GNUNET_ShortHashCode *key, 1407 const struct GNUNET_ShortHashCode *key,
1404 const void *value); 1408 const void *value);
@@ -1413,7 +1417,7 @@ GNUNET_CONTAINER_multishortmap_remove(
1413 * @return number of values removed 1417 * @return number of values removed
1414 */ 1418 */
1415int 1419int
1416GNUNET_CONTAINER_multishortmap_remove_all( 1420GNUNET_CONTAINER_multishortmap_remove_all (
1417 struct GNUNET_CONTAINER_MultiShortmap *map, 1421 struct GNUNET_CONTAINER_MultiShortmap *map,
1418 const struct GNUNET_ShortHashCode *key); 1422 const struct GNUNET_ShortHashCode *key);
1419 1423
@@ -1429,7 +1433,7 @@ GNUNET_CONTAINER_multishortmap_remove_all(
1429 * #GNUNET_NO if not 1433 * #GNUNET_NO if not
1430 */ 1434 */
1431int 1435int
1432GNUNET_CONTAINER_multishortmap_contains( 1436GNUNET_CONTAINER_multishortmap_contains (
1433 const struct GNUNET_CONTAINER_MultiShortmap *map, 1437 const struct GNUNET_CONTAINER_MultiShortmap *map,
1434 const struct GNUNET_ShortHashCode *key); 1438 const struct GNUNET_ShortHashCode *key);
1435 1439
@@ -1446,7 +1450,7 @@ GNUNET_CONTAINER_multishortmap_contains(
1446 * #GNUNET_NO if not 1450 * #GNUNET_NO if not
1447 */ 1451 */
1448int 1452int
1449GNUNET_CONTAINER_multishortmap_contains_value( 1453GNUNET_CONTAINER_multishortmap_contains_value (
1450 const struct GNUNET_CONTAINER_MultiShortmap *map, 1454 const struct GNUNET_CONTAINER_MultiShortmap *map,
1451 const struct GNUNET_ShortHashCode *key, 1455 const struct GNUNET_ShortHashCode *key,
1452 const void *value); 1456 const void *value);
@@ -1466,7 +1470,7 @@ GNUNET_CONTAINER_multishortmap_contains_value(
1466 * value already exists 1470 * value already exists
1467 */ 1471 */
1468int 1472int
1469GNUNET_CONTAINER_multishortmap_put( 1473GNUNET_CONTAINER_multishortmap_put (
1470 struct GNUNET_CONTAINER_MultiShortmap *map, 1474 struct GNUNET_CONTAINER_MultiShortmap *map,
1471 const struct GNUNET_ShortHashCode *key, 1475 const struct GNUNET_ShortHashCode *key,
1472 void *value, 1476 void *value,
@@ -1481,7 +1485,7 @@ GNUNET_CONTAINER_multishortmap_put(
1481 * @return the number of key value pairs 1485 * @return the number of key value pairs
1482 */ 1486 */
1483unsigned int 1487unsigned int
1484GNUNET_CONTAINER_multishortmap_size( 1488GNUNET_CONTAINER_multishortmap_size (
1485 const struct GNUNET_CONTAINER_MultiShortmap *map); 1489 const struct GNUNET_CONTAINER_MultiShortmap *map);
1486 1490
1487 1491
@@ -1496,7 +1500,7 @@ GNUNET_CONTAINER_multishortmap_size(
1496 * #GNUNET_SYSERR if it aborted iteration 1500 * #GNUNET_SYSERR if it aborted iteration
1497 */ 1501 */
1498int 1502int
1499GNUNET_CONTAINER_multishortmap_iterate( 1503GNUNET_CONTAINER_multishortmap_iterate (
1500 struct GNUNET_CONTAINER_MultiShortmap *map, 1504 struct GNUNET_CONTAINER_MultiShortmap *map,
1501 GNUNET_CONTAINER_ShortmapIterator it, 1505 GNUNET_CONTAINER_ShortmapIterator it,
1502 void *it_cls); 1506 void *it_cls);
@@ -1519,7 +1523,7 @@ struct GNUNET_CONTAINER_MultiShortmapIterator;
1519 * @return an iterator over the given multihashmap @a map 1523 * @return an iterator over the given multihashmap @a map
1520 */ 1524 */
1521struct GNUNET_CONTAINER_MultiShortmapIterator * 1525struct GNUNET_CONTAINER_MultiShortmapIterator *
1522GNUNET_CONTAINER_multishortmap_iterator_create( 1526GNUNET_CONTAINER_multishortmap_iterator_create (
1523 const struct GNUNET_CONTAINER_MultiShortmap *map); 1527 const struct GNUNET_CONTAINER_MultiShortmap *map);
1524 1528
1525 1529
@@ -1539,7 +1543,7 @@ GNUNET_CONTAINER_multishortmap_iterator_create(
1539 * #GNUNET_NO if we are out of elements 1543 * #GNUNET_NO if we are out of elements
1540 */ 1544 */
1541int 1545int
1542GNUNET_CONTAINER_multishortmap_iterator_next( 1546GNUNET_CONTAINER_multishortmap_iterator_next (
1543 struct GNUNET_CONTAINER_MultiShortmapIterator *iter, 1547 struct GNUNET_CONTAINER_MultiShortmapIterator *iter,
1544 struct GNUNET_ShortHashCode *key, 1548 struct GNUNET_ShortHashCode *key,
1545 const void **value); 1549 const void **value);
@@ -1552,7 +1556,7 @@ GNUNET_CONTAINER_multishortmap_iterator_next(
1552 * @param iter the iterator to destroy 1556 * @param iter the iterator to destroy
1553 */ 1557 */
1554void 1558void
1555GNUNET_CONTAINER_multishortmap_iterator_destroy( 1559GNUNET_CONTAINER_multishortmap_iterator_destroy (
1556 struct GNUNET_CONTAINER_MultiShortmapIterator *iter); 1560 struct GNUNET_CONTAINER_MultiShortmapIterator *iter);
1557 1561
1558 1562
@@ -1568,7 +1572,7 @@ GNUNET_CONTAINER_multishortmap_iterator_destroy(
1568 * #GNUNET_SYSERR if it aborted iteration 1572 * #GNUNET_SYSERR if it aborted iteration
1569 */ 1573 */
1570int 1574int
1571GNUNET_CONTAINER_multishortmap_get_multiple( 1575GNUNET_CONTAINER_multishortmap_get_multiple (
1572 struct GNUNET_CONTAINER_MultiShortmap *map, 1576 struct GNUNET_CONTAINER_MultiShortmap *map,
1573 const struct GNUNET_ShortHashCode *key, 1577 const struct GNUNET_ShortHashCode *key,
1574 GNUNET_CONTAINER_ShortmapIterator it, 1578 GNUNET_CONTAINER_ShortmapIterator it,
@@ -1587,7 +1591,7 @@ GNUNET_CONTAINER_multishortmap_get_multiple(
1587 * @return the number of key value pairs processed, zero or one. 1591 * @return the number of key value pairs processed, zero or one.
1588 */ 1592 */
1589unsigned int 1593unsigned int
1590GNUNET_CONTAINER_multishortmap_get_random( 1594GNUNET_CONTAINER_multishortmap_get_random (
1591 const struct GNUNET_CONTAINER_MultiShortmap *map, 1595 const struct GNUNET_CONTAINER_MultiShortmap *map,
1592 GNUNET_CONTAINER_ShortmapIterator it, 1596 GNUNET_CONTAINER_ShortmapIterator it,
1593 void *it_cls); 1597 void *it_cls);
@@ -1636,7 +1640,7 @@ struct GNUNET_CONTAINER_MultiUuidmap;
1636 * @return NULL on error 1640 * @return NULL on error
1637 */ 1641 */
1638struct GNUNET_CONTAINER_MultiUuidmap * 1642struct GNUNET_CONTAINER_MultiUuidmap *
1639GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys); 1643GNUNET_CONTAINER_multiuuidmap_create (unsigned int len, int do_not_copy_keys);
1640 1644
1641 1645
1642/** 1646/**
@@ -1647,7 +1651,7 @@ GNUNET_CONTAINER_multiuuidmap_create(unsigned int len, int do_not_copy_keys);
1647 * @param map the map 1651 * @param map the map
1648 */ 1652 */
1649void 1653void
1650GNUNET_CONTAINER_multiuuidmap_destroy( 1654GNUNET_CONTAINER_multiuuidmap_destroy (
1651 struct GNUNET_CONTAINER_MultiUuidmap *map); 1655 struct GNUNET_CONTAINER_MultiUuidmap *map);
1652 1656
1653 1657
@@ -1663,7 +1667,7 @@ GNUNET_CONTAINER_multiuuidmap_destroy(
1663 * key-value pairs with value NULL 1667 * key-value pairs with value NULL
1664 */ 1668 */
1665void * 1669void *
1666GNUNET_CONTAINER_multiuuidmap_get( 1670GNUNET_CONTAINER_multiuuidmap_get (
1667 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1671 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1668 const struct GNUNET_Uuid *key); 1672 const struct GNUNET_Uuid *key);
1669 1673
@@ -1681,9 +1685,9 @@ GNUNET_CONTAINER_multiuuidmap_get(
1681 * is not in the map 1685 * is not in the map
1682 */ 1686 */
1683int 1687int
1684GNUNET_CONTAINER_multiuuidmap_remove(struct GNUNET_CONTAINER_MultiUuidmap *map, 1688GNUNET_CONTAINER_multiuuidmap_remove (struct GNUNET_CONTAINER_MultiUuidmap *map,
1685 const struct GNUNET_Uuid *key, 1689 const struct GNUNET_Uuid *key,
1686 const void *value); 1690 const void *value);
1687 1691
1688/** 1692/**
1689 * @ingroup hashmap 1693 * @ingroup hashmap
@@ -1695,7 +1699,7 @@ GNUNET_CONTAINER_multiuuidmap_remove(struct GNUNET_CONTAINER_MultiUuidmap *map,
1695 * @return number of values removed 1699 * @return number of values removed
1696 */ 1700 */
1697int 1701int
1698GNUNET_CONTAINER_multiuuidmap_remove_all( 1702GNUNET_CONTAINER_multiuuidmap_remove_all (
1699 struct GNUNET_CONTAINER_MultiUuidmap *map, 1703 struct GNUNET_CONTAINER_MultiUuidmap *map,
1700 const struct GNUNET_Uuid *key); 1704 const struct GNUNET_Uuid *key);
1701 1705
@@ -1711,7 +1715,7 @@ GNUNET_CONTAINER_multiuuidmap_remove_all(
1711 * #GNUNET_NO if not 1715 * #GNUNET_NO if not
1712 */ 1716 */
1713int 1717int
1714GNUNET_CONTAINER_multiuuidmap_contains( 1718GNUNET_CONTAINER_multiuuidmap_contains (
1715 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1719 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1716 const struct GNUNET_Uuid *key); 1720 const struct GNUNET_Uuid *key);
1717 1721
@@ -1728,7 +1732,7 @@ GNUNET_CONTAINER_multiuuidmap_contains(
1728 * #GNUNET_NO if not 1732 * #GNUNET_NO if not
1729 */ 1733 */
1730int 1734int
1731GNUNET_CONTAINER_multiuuidmap_contains_value( 1735GNUNET_CONTAINER_multiuuidmap_contains_value (
1732 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1736 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1733 const struct GNUNET_Uuid *key, 1737 const struct GNUNET_Uuid *key,
1734 const void *value); 1738 const void *value);
@@ -1748,7 +1752,7 @@ GNUNET_CONTAINER_multiuuidmap_contains_value(
1748 * value already exists 1752 * value already exists
1749 */ 1753 */
1750int 1754int
1751GNUNET_CONTAINER_multiuuidmap_put( 1755GNUNET_CONTAINER_multiuuidmap_put (
1752 struct GNUNET_CONTAINER_MultiUuidmap *map, 1756 struct GNUNET_CONTAINER_MultiUuidmap *map,
1753 const struct GNUNET_Uuid *key, 1757 const struct GNUNET_Uuid *key,
1754 void *value, 1758 void *value,
@@ -1763,7 +1767,7 @@ GNUNET_CONTAINER_multiuuidmap_put(
1763 * @return the number of key value pairs 1767 * @return the number of key value pairs
1764 */ 1768 */
1765unsigned int 1769unsigned int
1766GNUNET_CONTAINER_multiuuidmap_size( 1770GNUNET_CONTAINER_multiuuidmap_size (
1767 const struct GNUNET_CONTAINER_MultiUuidmap *map); 1771 const struct GNUNET_CONTAINER_MultiUuidmap *map);
1768 1772
1769 1773
@@ -1778,7 +1782,7 @@ GNUNET_CONTAINER_multiuuidmap_size(
1778 * #GNUNET_SYSERR if it aborted iteration 1782 * #GNUNET_SYSERR if it aborted iteration
1779 */ 1783 */
1780int 1784int
1781GNUNET_CONTAINER_multiuuidmap_iterate( 1785GNUNET_CONTAINER_multiuuidmap_iterate (
1782 struct GNUNET_CONTAINER_MultiUuidmap *map, 1786 struct GNUNET_CONTAINER_MultiUuidmap *map,
1783 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, 1787 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it,
1784 void *it_cls); 1788 void *it_cls);
@@ -1801,7 +1805,7 @@ struct GNUNET_CONTAINER_MultiUuidmapIterator;
1801 * @return an iterator over the given multihashmap @a map 1805 * @return an iterator over the given multihashmap @a map
1802 */ 1806 */
1803struct GNUNET_CONTAINER_MultiUuidmapIterator * 1807struct GNUNET_CONTAINER_MultiUuidmapIterator *
1804GNUNET_CONTAINER_multiuuidmap_iterator_create( 1808GNUNET_CONTAINER_multiuuidmap_iterator_create (
1805 const struct GNUNET_CONTAINER_MultiUuidmap *map); 1809 const struct GNUNET_CONTAINER_MultiUuidmap *map);
1806 1810
1807 1811
@@ -1821,7 +1825,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_create(
1821 * #GNUNET_NO if we are out of elements 1825 * #GNUNET_NO if we are out of elements
1822 */ 1826 */
1823int 1827int
1824GNUNET_CONTAINER_multiuuidmap_iterator_next( 1828GNUNET_CONTAINER_multiuuidmap_iterator_next (
1825 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter, 1829 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter,
1826 struct GNUNET_Uuid *key, 1830 struct GNUNET_Uuid *key,
1827 const void **value); 1831 const void **value);
@@ -1834,7 +1838,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_next(
1834 * @param iter the iterator to destroy 1838 * @param iter the iterator to destroy
1835 */ 1839 */
1836void 1840void
1837GNUNET_CONTAINER_multiuuidmap_iterator_destroy( 1841GNUNET_CONTAINER_multiuuidmap_iterator_destroy (
1838 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter); 1842 struct GNUNET_CONTAINER_MultiUuidmapIterator *iter);
1839 1843
1840 1844
@@ -1850,7 +1854,7 @@ GNUNET_CONTAINER_multiuuidmap_iterator_destroy(
1850 * #GNUNET_SYSERR if it aborted iteration 1854 * #GNUNET_SYSERR if it aborted iteration
1851 */ 1855 */
1852int 1856int
1853GNUNET_CONTAINER_multiuuidmap_get_multiple( 1857GNUNET_CONTAINER_multiuuidmap_get_multiple (
1854 struct GNUNET_CONTAINER_MultiUuidmap *map, 1858 struct GNUNET_CONTAINER_MultiUuidmap *map,
1855 const struct GNUNET_Uuid *key, 1859 const struct GNUNET_Uuid *key,
1856 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, 1860 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it,
@@ -1869,7 +1873,7 @@ GNUNET_CONTAINER_multiuuidmap_get_multiple(
1869 * @return the number of key value pairs processed, zero or one. 1873 * @return the number of key value pairs processed, zero or one.
1870 */ 1874 */
1871unsigned int 1875unsigned int
1872GNUNET_CONTAINER_multiuuidmap_get_random( 1876GNUNET_CONTAINER_multiuuidmap_get_random (
1873 const struct GNUNET_CONTAINER_MultiUuidmap *map, 1877 const struct GNUNET_CONTAINER_MultiUuidmap *map,
1874 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it, 1878 GNUNET_CONTAINER_MultiUuidmapIteratorCallback it,
1875 void *it_cls); 1879 void *it_cls);
@@ -1916,7 +1920,7 @@ typedef int (*GNUNET_CONTAINER_MulitHashMapIterator32Callback) (void *cls,
1916 * @return NULL on error 1920 * @return NULL on error
1917 */ 1921 */
1918struct GNUNET_CONTAINER_MultiHashMap32 * 1922struct GNUNET_CONTAINER_MultiHashMap32 *
1919GNUNET_CONTAINER_multihashmap32_create(unsigned int len); 1923GNUNET_CONTAINER_multihashmap32_create (unsigned int len);
1920 1924
1921 1925
1922/** 1926/**
@@ -1927,7 +1931,7 @@ GNUNET_CONTAINER_multihashmap32_create(unsigned int len);
1927 * @param map the map 1931 * @param map the map
1928 */ 1932 */
1929void 1933void
1930GNUNET_CONTAINER_multihashmap32_destroy( 1934GNUNET_CONTAINER_multihashmap32_destroy (
1931 struct GNUNET_CONTAINER_MultiHashMap32 *map); 1935 struct GNUNET_CONTAINER_MultiHashMap32 *map);
1932 1936
1933 1937
@@ -1939,7 +1943,7 @@ GNUNET_CONTAINER_multihashmap32_destroy(
1939 * @return the number of key value pairs 1943 * @return the number of key value pairs
1940 */ 1944 */
1941unsigned int 1945unsigned int
1942GNUNET_CONTAINER_multihashmap32_size( 1946GNUNET_CONTAINER_multihashmap32_size (
1943 const struct GNUNET_CONTAINER_MultiHashMap32 *map); 1947 const struct GNUNET_CONTAINER_MultiHashMap32 *map);
1944 1948
1945 1949
@@ -1955,7 +1959,7 @@ GNUNET_CONTAINER_multihashmap32_size(
1955 * key-value pairs with value NULL 1959 * key-value pairs with value NULL
1956 */ 1960 */
1957void * 1961void *
1958GNUNET_CONTAINER_multihashmap32_get( 1962GNUNET_CONTAINER_multihashmap32_get (
1959 const struct GNUNET_CONTAINER_MultiHashMap32 *map, 1963 const struct GNUNET_CONTAINER_MultiHashMap32 *map,
1960 uint32_t key); 1964 uint32_t key);
1961 1965
@@ -1971,7 +1975,7 @@ GNUNET_CONTAINER_multihashmap32_get(
1971 * #GNUNET_SYSERR if it aborted iteration 1975 * #GNUNET_SYSERR if it aborted iteration
1972 */ 1976 */
1973int 1977int
1974GNUNET_CONTAINER_multihashmap32_iterate( 1978GNUNET_CONTAINER_multihashmap32_iterate (
1975 struct GNUNET_CONTAINER_MultiHashMap32 *map, 1979 struct GNUNET_CONTAINER_MultiHashMap32 *map,
1976 GNUNET_CONTAINER_MulitHashMapIterator32Callback it, 1980 GNUNET_CONTAINER_MulitHashMapIterator32Callback it,
1977 void *it_cls); 1981 void *it_cls);
@@ -1990,7 +1994,7 @@ GNUNET_CONTAINER_multihashmap32_iterate(
1990 * is not in the map 1994 * is not in the map
1991 */ 1995 */
1992int 1996int
1993GNUNET_CONTAINER_multihashmap32_remove( 1997GNUNET_CONTAINER_multihashmap32_remove (
1994 struct GNUNET_CONTAINER_MultiHashMap32 *map, 1998 struct GNUNET_CONTAINER_MultiHashMap32 *map,
1995 uint32_t key, 1999 uint32_t key,
1996 const void *value); 2000 const void *value);
@@ -2006,7 +2010,7 @@ GNUNET_CONTAINER_multihashmap32_remove(
2006 * @return number of values removed 2010 * @return number of values removed
2007 */ 2011 */
2008int 2012int
2009GNUNET_CONTAINER_multihashmap32_remove_all( 2013GNUNET_CONTAINER_multihashmap32_remove_all (
2010 struct GNUNET_CONTAINER_MultiHashMap32 *map, 2014 struct GNUNET_CONTAINER_MultiHashMap32 *map,
2011 uint32_t key); 2015 uint32_t key);
2012 2016
@@ -2022,7 +2026,7 @@ GNUNET_CONTAINER_multihashmap32_remove_all(
2022 * #GNUNET_NO if not 2026 * #GNUNET_NO if not
2023 */ 2027 */
2024int 2028int
2025GNUNET_CONTAINER_multihashmap32_contains( 2029GNUNET_CONTAINER_multihashmap32_contains (
2026 const struct GNUNET_CONTAINER_MultiHashMap32 *map, 2030 const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2027 uint32_t key); 2031 uint32_t key);
2028 2032
@@ -2039,7 +2043,7 @@ GNUNET_CONTAINER_multihashmap32_contains(
2039 * #GNUNET_NO if not 2043 * #GNUNET_NO if not
2040 */ 2044 */
2041int 2045int
2042GNUNET_CONTAINER_multihashmap32_contains_value( 2046GNUNET_CONTAINER_multihashmap32_contains_value (
2043 const struct GNUNET_CONTAINER_MultiHashMap32 *map, 2047 const struct GNUNET_CONTAINER_MultiHashMap32 *map,
2044 uint32_t key, 2048 uint32_t key,
2045 const void *value); 2049 const void *value);
@@ -2059,7 +2063,7 @@ GNUNET_CONTAINER_multihashmap32_contains_value(
2059 * value already exists 2063 * value already exists
2060 */ 2064 */
2061int 2065int
2062GNUNET_CONTAINER_multihashmap32_put( 2066GNUNET_CONTAINER_multihashmap32_put (
2063 struct GNUNET_CONTAINER_MultiHashMap32 *map, 2067 struct GNUNET_CONTAINER_MultiHashMap32 *map,
2064 uint32_t key, 2068 uint32_t key,
2065 void *value, 2069 void *value,
@@ -2078,7 +2082,7 @@ GNUNET_CONTAINER_multihashmap32_put(
2078 * #GNUNET_SYSERR if it aborted iteration 2082 * #GNUNET_SYSERR if it aborted iteration
2079 */ 2083 */
2080int 2084int
2081GNUNET_CONTAINER_multihashmap32_get_multiple( 2085GNUNET_CONTAINER_multihashmap32_get_multiple (
2082 struct GNUNET_CONTAINER_MultiHashMap32 *map, 2086 struct GNUNET_CONTAINER_MultiHashMap32 *map,
2083 uint32_t key, 2087 uint32_t key,
2084 GNUNET_CONTAINER_MulitHashMapIterator32Callback it, 2088 GNUNET_CONTAINER_MulitHashMapIterator32Callback it,
@@ -2098,7 +2102,7 @@ GNUNET_CONTAINER_multihashmap32_get_multiple(
2098 * @return an iterator over the given multihashmap map 2102 * @return an iterator over the given multihashmap map
2099 */ 2103 */
2100struct GNUNET_CONTAINER_MultiHashMap32Iterator * 2104struct GNUNET_CONTAINER_MultiHashMap32Iterator *
2101GNUNET_CONTAINER_multihashmap32_iterator_create( 2105GNUNET_CONTAINER_multihashmap32_iterator_create (
2102 const struct GNUNET_CONTAINER_MultiHashMap32 *map); 2106 const struct GNUNET_CONTAINER_MultiHashMap32 *map);
2103 2107
2104 2108
@@ -2117,7 +2121,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_create(
2117 * #GNUNET_NO if we are out of elements 2121 * #GNUNET_NO if we are out of elements
2118 */ 2122 */
2119int 2123int
2120GNUNET_CONTAINER_multihashmap32_iterator_next( 2124GNUNET_CONTAINER_multihashmap32_iterator_next (
2121 struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter, 2125 struct GNUNET_CONTAINER_MultiHashMap32Iterator *iter,
2122 uint32_t *key, 2126 uint32_t *key,
2123 const void **value); 2127 const void **value);
@@ -2129,7 +2133,7 @@ GNUNET_CONTAINER_multihashmap32_iterator_next(
2129 * @param iter the iterator to destroy 2133 * @param iter the iterator to destroy
2130 */ 2134 */
2131void 2135void
2132GNUNET_CONTAINER_multihashmap32_iterator_destroy( 2136GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2133 struct GNUNET_CONTAINER_MultiHashMapIterator *iter); 2137 struct GNUNET_CONTAINER_MultiHashMapIterator *iter);
2134 2138
2135 2139
@@ -2147,17 +2151,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2147 */ 2151 */
2148#define GNUNET_CONTAINER_DLL_insert(head, tail, element) \ 2152#define GNUNET_CONTAINER_DLL_insert(head, tail, element) \
2149 do \ 2153 do \
2150 { \ 2154 { \
2151 GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ 2155 GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2152 GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ 2156 GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2153 (element)->next = (head); \ 2157 (element)->next = (head); \
2154 (element)->prev = NULL; \ 2158 (element)->prev = NULL; \
2155 if ((tail) == NULL) \ 2159 if ((tail) == NULL) \
2156 (tail) = element; \ 2160 (tail) = element; \
2157 else \ 2161 else \
2158 (head) ->prev = element; \ 2162 (head)->prev = element; \
2159 (head) = (element); \ 2163 (head) = (element); \
2160 } while (0) 2164 } while (0)
2161 2165
2162 2166
2163/** 2167/**
@@ -2171,17 +2175,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2171 */ 2175 */
2172#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \ 2176#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element) \
2173 do \ 2177 do \
2174 { \ 2178 { \
2175 GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ 2179 GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2176 GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ 2180 GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2177 (element)->prev = (tail); \ 2181 (element)->prev = (tail); \
2178 (element)->next = NULL; \ 2182 (element)->next = NULL; \
2179 if ((head) == NULL) \ 2183 if ((head) == NULL) \
2180 (head) = element; \ 2184 (head) = element; \
2181 else \ 2185 else \
2182 (tail) ->next = element; \ 2186 (tail)->next = element; \
2183 (tail) = (element); \ 2187 (tail) = (element); \
2184 } while (0) 2188 } while (0)
2185 2189
2186 2190
2187/** 2191/**
@@ -2196,25 +2200,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2196 */ 2200 */
2197#define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \ 2201#define GNUNET_CONTAINER_DLL_insert_after(head, tail, other, element) \
2198 do \ 2202 do \
2199 { \ 2203 { \
2200 GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ 2204 GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2201 GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ 2205 GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2202 (element)->prev = (other); \ 2206 (element)->prev = (other); \
2203 if (NULL == other) \ 2207 if (NULL == other) \
2204 { \ 2208 { \
2205 (element)->next = (head); \ 2209 (element)->next = (head); \
2206 (head) = (element); \ 2210 (head) = (element); \
2207 } \ 2211 } \
2208 else \ 2212 else \
2209 { \ 2213 { \
2210 (element)->next = (other)->next; \ 2214 (element)->next = (other)->next; \
2211 (other)->next = (element); \ 2215 (other)->next = (element); \
2212 } \ 2216 } \
2213 if (NULL == (element)->next) \ 2217 if (NULL == (element)->next) \
2214 (tail) = (element); \ 2218 (tail) = (element); \
2215 else \ 2219 else \
2216 (element) ->next->prev = (element); \ 2220 (element)->next->prev = (element); \
2217 } while (0) 2221 } while (0)
2218 2222
2219 2223
2220/** 2224/**
@@ -2229,25 +2233,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2229 */ 2233 */
2230#define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \ 2234#define GNUNET_CONTAINER_DLL_insert_before(head, tail, other, element) \
2231 do \ 2235 do \
2232 { \ 2236 { \
2233 GNUNET_assert(((element)->prev == NULL) && ((head) != (element))); \ 2237 GNUNET_assert (((element)->prev == NULL) && ((head) != (element))); \
2234 GNUNET_assert(((element)->next == NULL) && ((tail) != (element))); \ 2238 GNUNET_assert (((element)->next == NULL) && ((tail) != (element))); \
2235 (element)->next = (other); \ 2239 (element)->next = (other); \
2236 if (NULL == other) \ 2240 if (NULL == other) \
2237 { \ 2241 { \
2238 (element)->prev = (tail); \ 2242 (element)->prev = (tail); \
2239 (tail) = (element); \ 2243 (tail) = (element); \
2240 } \ 2244 } \
2241 else \ 2245 else \
2242 { \ 2246 { \
2243 (element)->prev = (other)->prev; \ 2247 (element)->prev = (other)->prev; \
2244 (other)->prev = (element); \ 2248 (other)->prev = (element); \
2245 } \ 2249 } \
2246 if (NULL == (element)->prev) \ 2250 if (NULL == (element)->prev) \
2247 (head) = (element); \ 2251 (head) = (element); \
2248 else \ 2252 else \
2249 (element) ->prev->next = (element); \ 2253 (element)->prev->next = (element); \
2250 } while (0) 2254 } while (0)
2251 2255
2252 2256
2253/** 2257/**
@@ -2266,20 +2270,20 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2266 */ 2270 */
2267#define GNUNET_CONTAINER_DLL_remove(head, tail, element) \ 2271#define GNUNET_CONTAINER_DLL_remove(head, tail, element) \
2268 do \ 2272 do \
2269 { \ 2273 { \
2270 GNUNET_assert(((element)->prev != NULL) || ((head) == (element))); \ 2274 GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2271 GNUNET_assert(((element)->next != NULL) || ((tail) == (element))); \ 2275 GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2272 if ((element)->prev == NULL) \ 2276 if ((element)->prev == NULL) \
2273 (head) = (element)->next; \ 2277 (head) = (element)->next; \
2274 else \ 2278 else \
2275 (element) ->prev->next = (element)->next; \ 2279 (element)->prev->next = (element)->next; \
2276 if ((element)->next == NULL) \ 2280 if ((element)->next == NULL) \
2277 (tail) = (element)->prev; \ 2281 (tail) = (element)->prev; \
2278 else \ 2282 else \
2279 (element) ->next->prev = (element)->prev; \ 2283 (element)->next->prev = (element)->prev; \
2280 (element)->next = NULL; \ 2284 (element)->next = NULL; \
2281 (element)->prev = NULL; \ 2285 (element)->prev = NULL; \
2282 } while (0) 2286 } while (0)
2283 2287
2284 2288
2285/* ************ Multi-DLL interface, allows DLL elements to be 2289/* ************ Multi-DLL interface, allows DLL elements to be
@@ -2297,17 +2301,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2297 */ 2301 */
2298#define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \ 2302#define GNUNET_CONTAINER_MDLL_insert(mdll, head, tail, element) \
2299 do \ 2303 do \
2300 { \ 2304 { \
2301 GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ 2305 GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2302 GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ 2306 GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2303 (element)->next_ ## mdll = (head); \ 2307 (element)->next_ ## mdll = (head); \
2304 (element)->prev_ ## mdll = NULL; \ 2308 (element)->prev_ ## mdll = NULL; \
2305 if ((tail) == NULL) \ 2309 if ((tail) == NULL) \
2306 (tail) = element; \ 2310 (tail) = element; \
2307 else \ 2311 else \
2308 (head) ->prev_ ## mdll = element; \ 2312 (head)->prev_ ## mdll = element; \
2309 (head) = (element); \ 2313 (head) = (element); \
2310 } while (0) 2314 } while (0)
2311 2315
2312 2316
2313/** 2317/**
@@ -2322,17 +2326,17 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2322 */ 2326 */
2323#define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \ 2327#define GNUNET_CONTAINER_MDLL_insert_tail(mdll, head, tail, element) \
2324 do \ 2328 do \
2325 { \ 2329 { \
2326 GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ 2330 GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2327 GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ 2331 GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2328 (element)->prev_ ## mdll = (tail); \ 2332 (element)->prev_ ## mdll = (tail); \
2329 (element)->next_ ## mdll = NULL; \ 2333 (element)->next_ ## mdll = NULL; \
2330 if ((head) == NULL) \ 2334 if ((head) == NULL) \
2331 (head) = element; \ 2335 (head) = element; \
2332 else \ 2336 else \
2333 (tail) ->next_ ## mdll = element; \ 2337 (tail)->next_ ## mdll = element; \
2334 (tail) = (element); \ 2338 (tail) = (element); \
2335 } while (0) 2339 } while (0)
2336 2340
2337 2341
2338/** 2342/**
@@ -2348,25 +2352,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2348 */ 2352 */
2349#define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \ 2353#define GNUNET_CONTAINER_MDLL_insert_after(mdll, head, tail, other, element) \
2350 do \ 2354 do \
2351 { \ 2355 { \
2352 GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ 2356 GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2353 GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ 2357 GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2354 (element)->prev_ ## mdll = (other); \ 2358 (element)->prev_ ## mdll = (other); \
2355 if (NULL == other) \ 2359 if (NULL == other) \
2356 { \ 2360 { \
2357 (element)->next_ ## mdll = (head); \ 2361 (element)->next_ ## mdll = (head); \
2358 (head) = (element); \ 2362 (head) = (element); \
2359 } \ 2363 } \
2360 else \ 2364 else \
2361 { \ 2365 { \
2362 (element)->next_ ## mdll = (other)->next_ ## mdll; \ 2366 (element)->next_ ## mdll = (other)->next_ ## mdll; \
2363 (other)->next_ ## mdll = (element); \ 2367 (other)->next_ ## mdll = (element); \
2364 } \ 2368 } \
2365 if (NULL == (element)->next_ ## mdll) \ 2369 if (NULL == (element)->next_ ## mdll) \
2366 (tail) = (element); \ 2370 (tail) = (element); \
2367 else \ 2371 else \
2368 (element) ->next_ ## mdll->prev_ ## mdll = (element); \ 2372 (element)->next_ ## mdll->prev_ ## mdll = (element); \
2369 } while (0) 2373 } while (0)
2370 2374
2371 2375
2372/** 2376/**
@@ -2382,25 +2386,25 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2382 */ 2386 */
2383#define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \ 2387#define GNUNET_CONTAINER_MDLL_insert_before(mdll, head, tail, other, element) \
2384 do \ 2388 do \
2385 { \ 2389 { \
2386 GNUNET_assert(((element)->prev_ ## mdll == NULL) && ((head) != (element))); \ 2390 GNUNET_assert (((element)->prev_ ## mdll == NULL) && ((head) != (element))); \
2387 GNUNET_assert(((element)->next_ ## mdll == NULL) && ((tail) != (element))); \ 2391 GNUNET_assert (((element)->next_ ## mdll == NULL) && ((tail) != (element))); \
2388 (element)->next_ ## mdll = (other); \ 2392 (element)->next_ ## mdll = (other); \
2389 if (NULL == other) \ 2393 if (NULL == other) \
2390 { \ 2394 { \
2391 (element)->prev = (tail); \ 2395 (element)->prev = (tail); \
2392 (tail) = (element); \ 2396 (tail) = (element); \
2393 } \ 2397 } \
2394 else \ 2398 else \
2395 { \ 2399 { \
2396 (element)->prev_ ## mdll = (other)->prev_ ## mdll; \ 2400 (element)->prev_ ## mdll = (other)->prev_ ## mdll; \
2397 (other)->prev_ ## mdll = (element); \ 2401 (other)->prev_ ## mdll = (element); \
2398 } \ 2402 } \
2399 if (NULL == (element)->prev_ ## mdll) \ 2403 if (NULL == (element)->prev_ ## mdll) \
2400 (head) = (element); \ 2404 (head) = (element); \
2401 else \ 2405 else \
2402 (element) ->prev_ ## mdll->next_ ## mdll = (element); \ 2406 (element)->prev_ ## mdll->next_ ## mdll = (element); \
2403 } while (0) 2407 } while (0)
2404 2408
2405 2409
2406/** 2410/**
@@ -2416,20 +2420,20 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2416 */ 2420 */
2417#define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \ 2421#define GNUNET_CONTAINER_MDLL_remove(mdll, head, tail, element) \
2418 do \ 2422 do \
2419 { \ 2423 { \
2420 GNUNET_assert(((element)->prev_ ## mdll != NULL) || ((head) == (element))); \ 2424 GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2421 GNUNET_assert(((element)->next_ ## mdll != NULL) || ((tail) == (element))); \ 2425 GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2422 if ((element)->prev_ ## mdll == NULL) \ 2426 if ((element)->prev_ ## mdll == NULL) \
2423 (head) = (element)->next_ ## mdll; \ 2427 (head) = (element)->next_ ## mdll; \
2424 else \ 2428 else \
2425 (element) ->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \ 2429 (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2426 if ((element)->next_ ## mdll == NULL) \ 2430 if ((element)->next_ ## mdll == NULL) \
2427 (tail) = (element)->prev_ ## mdll; \ 2431 (tail) = (element)->prev_ ## mdll; \
2428 else \ 2432 else \
2429 (element) ->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \ 2433 (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2430 (element)->next_ ## mdll = NULL; \ 2434 (element)->next_ ## mdll = NULL; \
2431 (element)->prev_ ## mdll = NULL; \ 2435 (element)->prev_ ## mdll = NULL; \
2432 } while (0) 2436 } while (0)
2433 2437
2434 2438
2435/** 2439/**
@@ -2452,29 +2456,29 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy(
2452 tail, \ 2456 tail, \
2453 element) \ 2457 element) \
2454 do \ 2458 do \
2455 { \ 2459 { \
2456 if ((NULL == head) || (0 < comparator(comparator_cls, element, head))) \ 2460 if ((NULL == head) || (0 < comparator (comparator_cls, element, head))) \
2457 { \ 2461 { \
2458 /* insert at head, element < head */ \ 2462 /* insert at head, element < head */ \
2459 GNUNET_CONTAINER_DLL_insert(head, tail, element); \ 2463 GNUNET_CONTAINER_DLL_insert (head, tail, element); \
2460 } \ 2464 } \
2461 else \ 2465 else \
2462 { \ 2466 { \
2463 TYPE *pos; \ 2467 TYPE *pos; \
2464 \ 2468 \
2465 for (pos = head; NULL != pos; pos = pos->next) \ 2469 for (pos = head; NULL != pos; pos = pos->next) \
2466 if (0 < comparator(comparator_cls, element, pos)) \ 2470 if (0 < comparator (comparator_cls, element, pos)) \
2467 break; /* element < pos */ \ 2471 break; /* element < pos */ \
2468 if (NULL == pos) /* => element > tail */ \ 2472 if (NULL == pos) /* => element > tail */ \
2469 { \ 2473 { \
2470 GNUNET_CONTAINER_DLL_insert_tail(head, tail, element); \ 2474 GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
2471 } \ 2475 } \
2472 else /* prev < element < pos */ \ 2476 else /* prev < element < pos */ \
2473 { \ 2477 { \
2474 GNUNET_CONTAINER_DLL_insert_after(head, tail, pos->prev, element); \ 2478 GNUNET_CONTAINER_DLL_insert_after (head, tail, pos->prev, element); \
2475 } \ 2479 } \
2476 } \ 2480 } \
2477 } while (0) 2481 } while (0)
2478 2482
2479 2483
2480/* ******************** Heap *************** */ 2484/* ******************** Heap *************** */
@@ -2491,7 +2495,8 @@ typedef uint64_t GNUNET_CONTAINER_HeapCostType;
2491 * @ingroup heap 2495 * @ingroup heap
2492 * Heap type, either max or min. 2496 * Heap type, either max or min.
2493 */ 2497 */
2494enum GNUNET_CONTAINER_HeapOrder { 2498enum GNUNET_CONTAINER_HeapOrder
2499{
2495 /** 2500 /**
2496 * @ingroup heap 2501 * @ingroup heap
2497 * Heap with the maximum cost at the root. 2502 * Heap with the maximum cost at the root.
@@ -2528,7 +2533,7 @@ struct GNUNET_CONTAINER_HeapNode;
2528 * @return handle to the heap 2533 * @return handle to the heap
2529 */ 2534 */
2530struct GNUNET_CONTAINER_Heap * 2535struct GNUNET_CONTAINER_Heap *
2531GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order); 2536GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order);
2532 2537
2533 2538
2534/** 2539/**
@@ -2539,7 +2544,7 @@ GNUNET_CONTAINER_heap_create(enum GNUNET_CONTAINER_HeapOrder order);
2539 * @param heap heap to destroy 2544 * @param heap heap to destroy
2540 */ 2545 */
2541void 2546void
2542GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap); 2547GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap);
2543 2548
2544 2549
2545/** 2550/**
@@ -2550,7 +2555,7 @@ GNUNET_CONTAINER_heap_destroy(struct GNUNET_CONTAINER_Heap *heap);
2550 * @return Element at the root, or NULL if heap is empty. 2555 * @return Element at the root, or NULL if heap is empty.
2551 */ 2556 */
2552void * 2557void *
2553GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap); 2558GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap);
2554 2559
2555 2560
2556/** 2561/**
@@ -2563,9 +2568,9 @@ GNUNET_CONTAINER_heap_peek(const struct GNUNET_CONTAINER_Heap *heap);
2563 * #GNUNET_NO if the heap is empty. 2568 * #GNUNET_NO if the heap is empty.
2564 */ 2569 */
2565int 2570int
2566GNUNET_CONTAINER_heap_peek2(const struct GNUNET_CONTAINER_Heap *heap, 2571GNUNET_CONTAINER_heap_peek2 (const struct GNUNET_CONTAINER_Heap *heap,
2567 void **element, 2572 void **element,
2568 GNUNET_CONTAINER_HeapCostType *cost); 2573 GNUNET_CONTAINER_HeapCostType *cost);
2569 2574
2570 2575
2571/** 2576/**
@@ -2576,7 +2581,7 @@ GNUNET_CONTAINER_heap_peek2(const struct GNUNET_CONTAINER_Heap *heap,
2576 * @return number of elements stored 2581 * @return number of elements stored
2577 */ 2582 */
2578unsigned int 2583unsigned int
2579GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap); 2584GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap);
2580 2585
2581 2586
2582/** 2587/**
@@ -2587,7 +2592,7 @@ GNUNET_CONTAINER_heap_get_size(const struct GNUNET_CONTAINER_Heap *heap);
2587 * @return cost of the node 2592 * @return cost of the node
2588 */ 2593 */
2589GNUNET_CONTAINER_HeapCostType 2594GNUNET_CONTAINER_HeapCostType
2590GNUNET_CONTAINER_heap_node_get_cost( 2595GNUNET_CONTAINER_heap_node_get_cost (
2591 const struct GNUNET_CONTAINER_HeapNode *node); 2596 const struct GNUNET_CONTAINER_HeapNode *node);
2592 2597
2593 2598
@@ -2618,9 +2623,9 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (
2618 * @param iterator_cls closure for @a iterator 2623 * @param iterator_cls closure for @a iterator
2619 */ 2624 */
2620void 2625void
2621GNUNET_CONTAINER_heap_iterate(const struct GNUNET_CONTAINER_Heap *heap, 2626GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
2622 GNUNET_CONTAINER_HeapIterator iterator, 2627 GNUNET_CONTAINER_HeapIterator iterator,
2623 void *iterator_cls); 2628 void *iterator_cls);
2624 2629
2625/** 2630/**
2626 * @ingroup heap 2631 * @ingroup heap
@@ -2635,7 +2640,7 @@ GNUNET_CONTAINER_heap_iterate(const struct GNUNET_CONTAINER_Heap *heap,
2635 * NULL if the tree is empty. 2640 * NULL if the tree is empty.
2636 */ 2641 */
2637void * 2642void *
2638GNUNET_CONTAINER_heap_walk_get_next(struct GNUNET_CONTAINER_Heap *heap); 2643GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap);
2639 2644
2640 2645
2641/** 2646/**
@@ -2648,9 +2653,9 @@ GNUNET_CONTAINER_heap_walk_get_next(struct GNUNET_CONTAINER_Heap *heap);
2648 * @return node for the new element 2653 * @return node for the new element
2649 */ 2654 */
2650struct GNUNET_CONTAINER_HeapNode * 2655struct GNUNET_CONTAINER_HeapNode *
2651GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap, 2656GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap,
2652 void *element, 2657 void *element,
2653 GNUNET_CONTAINER_HeapCostType cost); 2658 GNUNET_CONTAINER_HeapCostType cost);
2654 2659
2655 2660
2656/** 2661/**
@@ -2661,7 +2666,7 @@ GNUNET_CONTAINER_heap_insert(struct GNUNET_CONTAINER_Heap *heap,
2661 * @return element data stored at the root node 2666 * @return element data stored at the root node
2662 */ 2667 */
2663void * 2668void *
2664GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap); 2669GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap);
2665 2670
2666 2671
2667/** 2672/**
@@ -2672,7 +2677,7 @@ GNUNET_CONTAINER_heap_remove_root(struct GNUNET_CONTAINER_Heap *heap);
2672 * @return element data stored at the node, NULL if heap is empty 2677 * @return element data stored at the node, NULL if heap is empty
2673 */ 2678 */
2674void * 2679void *
2675GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node); 2680GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node);
2676 2681
2677 2682
2678/** 2683/**
@@ -2683,8 +2688,8 @@ GNUNET_CONTAINER_heap_remove_node(struct GNUNET_CONTAINER_HeapNode *node);
2683 * @param new_cost new cost for the node 2688 * @param new_cost new cost for the node
2684 */ 2689 */
2685void 2690void
2686GNUNET_CONTAINER_heap_update_cost(struct GNUNET_CONTAINER_HeapNode *node, 2691GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_HeapNode *node,
2687 GNUNET_CONTAINER_HeapCostType new_cost); 2692 GNUNET_CONTAINER_HeapCostType new_cost);
2688 2693
2689 2694
2690#if 0 /* keep Emacsens' auto-indent happy */ 2695#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_conversation_service.h b/src/include/gnunet_conversation_service.h
index a15e71f0d..4566caad0 100644
--- a/src/include/gnunet_conversation_service.h
+++ b/src/include/gnunet_conversation_service.h
@@ -86,7 +86,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
86 * may also specify the phone line that is used (typically zero). 86 * may also specify the phone line that is used (typically zero).
87 * The version is also right now always zero. 87 * The version is also right now always zero.
88 */ 88 */
89struct GNUNET_CONVERSATION_PhoneRecord { 89struct GNUNET_CONVERSATION_PhoneRecord
90{
90 /** 91 /**
91 * Version of the phone record, for now always one. We may 92 * Version of the phone record, for now always one. We may
92 * use other versions for anonymously hosted phone lines in 93 * use other versions for anonymously hosted phone lines in
@@ -115,7 +116,8 @@ GNUNET_NETWORK_STRUCT_END
115/** 116/**
116 * Information about active callers to a phone. 117 * Information about active callers to a phone.
117 */ 118 */
118enum GNUNET_CONVERSATION_PhoneEventCode { 119enum GNUNET_CONVERSATION_PhoneEventCode
120{
119 /** 121 /**
120 * We are the callee and the phone is ringing. 122 * We are the callee and the phone is ringing.
121 * We should accept the call or hang up. 123 * We should accept the call or hang up.
@@ -140,9 +142,12 @@ enum GNUNET_CONVERSATION_PhoneEventCode {
140 */ 142 */
141typedef void 143typedef void
142(*GNUNET_CONVERSATION_PhoneEventHandler)(void *cls, 144(*GNUNET_CONVERSATION_PhoneEventHandler)(void *cls,
143 enum GNUNET_CONVERSATION_PhoneEventCode code, 145 enum GNUNET_CONVERSATION_PhoneEventCode
144 struct GNUNET_CONVERSATION_Caller *caller, 146 code,
145 const struct GNUNET_CRYPTO_EcdsaPublicKey *caller_id); 147 struct GNUNET_CONVERSATION_Caller *
148 caller,
149 const struct
150 GNUNET_CRYPTO_EcdsaPublicKey *caller_id);
146 151
147 152
148/** 153/**
@@ -150,7 +155,8 @@ typedef void
150 * progresses from ring over ready to terminated. Steps may 155 * progresses from ring over ready to terminated. Steps may
151 * be skipped. 156 * be skipped.
152 */ 157 */
153enum GNUNET_CONVERSATION_CallerEventCode { 158enum GNUNET_CONVERSATION_CallerEventCode
159{
154 /** 160 /**
155 * We are the callee and the caller suspended the call. Note that 161 * We are the callee and the caller suspended the call. Note that
156 * both sides can independently suspend and resume calls; a call is 162 * both sides can independently suspend and resume calls; a call is
@@ -177,7 +183,9 @@ enum GNUNET_CONVERSATION_CallerEventCode {
177 */ 183 */
178typedef void 184typedef void
179(*GNUNET_CONVERSATION_CallerEventHandler)(void *cls, 185(*GNUNET_CONVERSATION_CallerEventHandler)(void *cls,
180 enum GNUNET_CONVERSATION_CallerEventCode code); 186 enum
187 GNUNET_CONVERSATION_CallerEventCode
188 code);
181 189
182 190
183/** 191/**
@@ -204,10 +212,11 @@ struct GNUNET_CONVERSATION_Phone;
204 * @param event_handler_cls closure for @a event_handler 212 * @param event_handler_cls closure for @a event_handler
205 */ 213 */
206struct GNUNET_CONVERSATION_Phone * 214struct GNUNET_CONVERSATION_Phone *
207GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 215GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
208 const struct GNUNET_IDENTITY_Ego *ego, 216 const struct GNUNET_IDENTITY_Ego *ego,
209 GNUNET_CONVERSATION_PhoneEventHandler event_handler, 217 GNUNET_CONVERSATION_PhoneEventHandler
210 void *event_handler_cls); 218 event_handler,
219 void *event_handler_cls);
211 220
212 221
213/** 222/**
@@ -219,8 +228,8 @@ GNUNET_CONVERSATION_phone_create(const struct GNUNET_CONFIGURATION_Handle *cfg,
219 * @param rd namestore record to fill in 228 * @param rd namestore record to fill in
220 */ 229 */
221void 230void
222GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone, 231GNUNET_CONVERSATION_phone_get_record (struct GNUNET_CONVERSATION_Phone *phone,
223 struct GNUNET_GNSRECORD_Data *rd); 232 struct GNUNET_GNSRECORD_Data *rd);
224 233
225 234
226/** 235/**
@@ -234,11 +243,12 @@ GNUNET_CONVERSATION_phone_get_record(struct GNUNET_CONVERSATION_Phone *phone,
234 * @param mic microphone to use 243 * @param mic microphone to use
235 */ 244 */
236void 245void
237GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller, 246GNUNET_CONVERSATION_caller_pick_up (struct GNUNET_CONVERSATION_Caller *caller,
238 GNUNET_CONVERSATION_CallerEventHandler event_handler, 247 GNUNET_CONVERSATION_CallerEventHandler
239 void *event_handler_cls, 248 event_handler,
240 struct GNUNET_SPEAKER_Handle *speaker, 249 void *event_handler_cls,
241 struct GNUNET_MICROPHONE_Handle *mic); 250 struct GNUNET_SPEAKER_Handle *speaker,
251 struct GNUNET_MICROPHONE_Handle *mic);
242 252
243 253
244/** 254/**
@@ -249,7 +259,7 @@ GNUNET_CONVERSATION_caller_pick_up(struct GNUNET_CONVERSATION_Caller *caller,
249 * @param caller call to suspend 259 * @param caller call to suspend
250 */ 260 */
251void 261void
252GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller); 262GNUNET_CONVERSATION_caller_suspend (struct GNUNET_CONVERSATION_Caller *caller);
253 263
254 264
255/** 265/**
@@ -260,9 +270,9 @@ GNUNET_CONVERSATION_caller_suspend(struct GNUNET_CONVERSATION_Caller *caller);
260 * @param mic microphone to use 270 * @param mic microphone to use
261 */ 271 */
262void 272void
263GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller, 273GNUNET_CONVERSATION_caller_resume (struct GNUNET_CONVERSATION_Caller *caller,
264 struct GNUNET_SPEAKER_Handle *speaker, 274 struct GNUNET_SPEAKER_Handle *speaker,
265 struct GNUNET_MICROPHONE_Handle *mic); 275 struct GNUNET_MICROPHONE_Handle *mic);
266 276
267 277
268/** 278/**
@@ -272,7 +282,7 @@ GNUNET_CONVERSATION_caller_resume(struct GNUNET_CONVERSATION_Caller *caller,
272 * @param caller who should we hang up on 282 * @param caller who should we hang up on
273 */ 283 */
274void 284void
275GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller); 285GNUNET_CONVERSATION_caller_hang_up (struct GNUNET_CONVERSATION_Caller *caller);
276 286
277 287
278/** 288/**
@@ -281,7 +291,7 @@ GNUNET_CONVERSATION_caller_hang_up(struct GNUNET_CONVERSATION_Caller *caller);
281 * @param phone phone to destroy 291 * @param phone phone to destroy
282 */ 292 */
283void 293void
284GNUNET_CONVERSATION_phone_destroy(struct GNUNET_CONVERSATION_Phone *phone); 294GNUNET_CONVERSATION_phone_destroy (struct GNUNET_CONVERSATION_Phone *phone);
285 295
286 296
287/* *********************** CALL API ************************ */ 297/* *********************** CALL API ************************ */
@@ -295,7 +305,8 @@ struct GNUNET_CONVERSATION_Call;
295/** 305/**
296 * Information about the current status of a call. 306 * Information about the current status of a call.
297 */ 307 */
298enum GNUNET_CONVERSATION_CallEventCode { 308enum GNUNET_CONVERSATION_CallEventCode
309{
299 /** 310 /**
300 * We are the caller and are now ringing the other party (GNS lookup 311 * We are the caller and are now ringing the other party (GNS lookup
301 * succeeded). 312 * succeeded).
@@ -355,7 +366,8 @@ enum GNUNET_CONVERSATION_CallEventCode {
355 */ 366 */
356typedef void 367typedef void
357(*GNUNET_CONVERSATION_CallEventHandler)(void *cls, 368(*GNUNET_CONVERSATION_CallEventHandler)(void *cls,
358 enum GNUNET_CONVERSATION_CallEventCode code); 369 enum GNUNET_CONVERSATION_CallEventCode
370 code);
359 371
360 372
361/** 373/**
@@ -374,13 +386,14 @@ typedef void
374 * @return handle for the call 386 * @return handle for the call
375 */ 387 */
376struct GNUNET_CONVERSATION_Call * 388struct GNUNET_CONVERSATION_Call *
377GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 389GNUNET_CONVERSATION_call_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
378 struct GNUNET_IDENTITY_Ego *caller_id, 390 struct GNUNET_IDENTITY_Ego *caller_id,
379 const char *callee, 391 const char *callee,
380 struct GNUNET_SPEAKER_Handle *speaker, 392 struct GNUNET_SPEAKER_Handle *speaker,
381 struct GNUNET_MICROPHONE_Handle *mic, 393 struct GNUNET_MICROPHONE_Handle *mic,
382 GNUNET_CONVERSATION_CallEventHandler event_handler, 394 GNUNET_CONVERSATION_CallEventHandler
383 void *event_handler_cls); 395 event_handler,
396 void *event_handler_cls);
384 397
385 398
386/** 399/**
@@ -390,7 +403,7 @@ GNUNET_CONVERSATION_call_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
390 * @param call call to pause 403 * @param call call to pause
391 */ 404 */
392void 405void
393GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call); 406GNUNET_CONVERSATION_call_suspend (struct GNUNET_CONVERSATION_Call *call);
394 407
395 408
396/** 409/**
@@ -401,9 +414,9 @@ GNUNET_CONVERSATION_call_suspend(struct GNUNET_CONVERSATION_Call *call);
401 * @param mic microphone to use 414 * @param mic microphone to use
402 */ 415 */
403void 416void
404GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call, 417GNUNET_CONVERSATION_call_resume (struct GNUNET_CONVERSATION_Call *call,
405 struct GNUNET_SPEAKER_Handle *speaker, 418 struct GNUNET_SPEAKER_Handle *speaker,
406 struct GNUNET_MICROPHONE_Handle *mic); 419 struct GNUNET_MICROPHONE_Handle *mic);
407 420
408 421
409/** 422/**
@@ -412,7 +425,7 @@ GNUNET_CONVERSATION_call_resume(struct GNUNET_CONVERSATION_Call *call,
412 * @param call call to terminate 425 * @param call call to terminate
413 */ 426 */
414void 427void
415GNUNET_CONVERSATION_call_stop(struct GNUNET_CONVERSATION_Call *call); 428GNUNET_CONVERSATION_call_stop (struct GNUNET_CONVERSATION_Call *call);
416 429
417 430
418#if 0 /* keep Emacsens' auto-indent happy */ 431#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index 4e6c48ee8..66b292c3c 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -125,12 +125,12 @@ typedef void (*GNUNET_CORE_StartupCallback) (
125 * NULL on error (in this case, init is never called) 125 * NULL on error (in this case, init is never called)
126 */ 126 */
127struct GNUNET_CORE_Handle * 127struct GNUNET_CORE_Handle *
128GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 128GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
129 void *cls, 129 void *cls,
130 GNUNET_CORE_StartupCallback init, 130 GNUNET_CORE_StartupCallback init,
131 GNUNET_CORE_ConnectEventHandler connects, 131 GNUNET_CORE_ConnectEventHandler connects,
132 GNUNET_CORE_DisconnectEventHandler disconnects, 132 GNUNET_CORE_DisconnectEventHandler disconnects,
133 const struct GNUNET_MQ_MessageHandler *handlers); 133 const struct GNUNET_MQ_MessageHandler *handlers);
134 134
135 135
136/** 136/**
@@ -139,7 +139,7 @@ GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
139 * @param handle connection to core to disconnect 139 * @param handle connection to core to disconnect
140 */ 140 */
141void 141void
142GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle); 142GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle);
143 143
144 144
145/** 145/**
@@ -150,8 +150,8 @@ GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle);
150 * @return NULL if @a pid is not connected 150 * @return NULL if @a pid is not connected
151 */ 151 */
152struct GNUNET_MQ_Handle * 152struct GNUNET_MQ_Handle *
153GNUNET_CORE_get_mq(const struct GNUNET_CORE_Handle *h, 153GNUNET_CORE_get_mq (const struct GNUNET_CORE_Handle *h,
154 const struct GNUNET_PeerIdentity *pid); 154 const struct GNUNET_PeerIdentity *pid);
155 155
156 156
157/** 157/**
@@ -173,7 +173,8 @@ struct GNUNET_CORE_MonitorHandle;
173 * #GNUNET_CORE_KX_STATE_REKEY_SENT until the rekey operation is 173 * #GNUNET_CORE_KX_STATE_REKEY_SENT until the rekey operation is
174 * confirmed by a PONG from the other peer. 174 * confirmed by a PONG from the other peer.
175 */ 175 */
176enum GNUNET_CORE_KxState { 176enum GNUNET_CORE_KxState
177{
177 /** 178 /**
178 * No handshake yet. 179 * No handshake yet.
179 */ 180 */
@@ -263,9 +264,9 @@ typedef void (*GNUNET_CORE_MonitorCallback) (
263 * @return NULL on error 264 * @return NULL on error
264 */ 265 */
265struct GNUNET_CORE_MonitorHandle * 266struct GNUNET_CORE_MonitorHandle *
266GNUNET_CORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 267GNUNET_CORE_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
267 GNUNET_CORE_MonitorCallback peer_cb, 268 GNUNET_CORE_MonitorCallback peer_cb,
268 void *peer_cb_cls); 269 void *peer_cb_cls);
269 270
270 271
271/** 272/**
@@ -274,7 +275,7 @@ GNUNET_CORE_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
274 * @param mh monitor to stop 275 * @param mh monitor to stop
275 */ 276 */
276void 277void
277GNUNET_CORE_monitor_stop(struct GNUNET_CORE_MonitorHandle *mh); 278GNUNET_CORE_monitor_stop (struct GNUNET_CORE_MonitorHandle *mh);
278 279
279 280
280/** 281/**
@@ -290,8 +291,8 @@ GNUNET_CORE_monitor_stop(struct GNUNET_CORE_MonitorHandle *mh);
290 * @return #GNUNET_YES if the peer is connected to us; #GNUNET_NO if not 291 * @return #GNUNET_YES if the peer is connected to us; #GNUNET_NO if not
291 */ 292 */
292int 293int
293GNUNET_CORE_is_peer_connected_sync(const struct GNUNET_CORE_Handle *h, 294GNUNET_CORE_is_peer_connected_sync (const struct GNUNET_CORE_Handle *h,
294 const struct GNUNET_PeerIdentity *pid); 295 const struct GNUNET_PeerIdentity *pid);
295 296
296 297
297/** 298/**
@@ -308,8 +309,8 @@ GNUNET_CORE_is_peer_connected_sync(const struct GNUNET_CORE_Handle *h,
308 * to the target peer 309 * to the target peer
309 */ 310 */
310struct GNUNET_MQ_Handle * 311struct GNUNET_MQ_Handle *
311GNUNET_CORE_mq_create(struct GNUNET_CORE_Handle *h, 312GNUNET_CORE_mq_create (struct GNUNET_CORE_Handle *h,
312 const struct GNUNET_PeerIdentity *target); 313 const struct GNUNET_PeerIdentity *target);
313 314
314 315
315#if 0 /* keep Emacsens' auto-indent happy */ 316#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h
index 9e1672ba3..05cdb7c9f 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -58,14 +58,15 @@ struct GNUNET_CREDENTIAL_Request;
58/* 58/*
59 * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 59 * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
60 */ 60 */
61enum GNUNET_CREDENTIAL_CredentialFlags { 61enum GNUNET_CREDENTIAL_CredentialFlags
62 //Subject had credentials before, but have been revoked now 62{
63 // Subject had credentials before, but have been revoked now
63 GNUNET_CREDENTIAL_FLAG_REVOKED=0, 64 GNUNET_CREDENTIAL_FLAG_REVOKED=0,
64 65
65 //Subject flag indicates that the subject is a holder of this credential and may present it as such 66 // Subject flag indicates that the subject is a holder of this credential and may present it as such
66 GNUNET_CREDENTIAL_FLAG_SUBJECT=1, 67 GNUNET_CREDENTIAL_FLAG_SUBJECT=1,
67 68
68 //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance 69 // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
69 GNUNET_CREDENTIAL_FLAG_ISSUER=2 70 GNUNET_CREDENTIAL_FLAG_ISSUER=2
70}; 71};
71 72
@@ -73,7 +74,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
73/** 74/**
74 * The attribute delegation record 75 * The attribute delegation record
75 */ 76 */
76struct GNUNET_CREDENTIAL_DelegationRecord { 77struct GNUNET_CREDENTIAL_DelegationRecord
78{
77 /** 79 /**
78 * Number of delegation sets in this record 80 * Number of delegation sets in this record
79 */ 81 */
@@ -92,7 +94,8 @@ struct GNUNET_CREDENTIAL_DelegationRecord {
92/** 94/**
93 * The attribute delegation record 95 * The attribute delegation record
94 */ 96 */
95struct GNUNET_CREDENTIAL_DelegationRecordSet { 97struct GNUNET_CREDENTIAL_DelegationRecordSet
98{
96 /** 99 /**
97 * Public key of the subject this attribute was delegated to 100 * Public key of the subject this attribute was delegated to
98 */ 101 */
@@ -110,7 +113,8 @@ GNUNET_NETWORK_STRUCT_END
110/** 113/**
111 * The attribute delegation record 114 * The attribute delegation record
112 */ 115 */
113struct GNUNET_CREDENTIAL_DelegationSet { 116struct GNUNET_CREDENTIAL_DelegationSet
117{
114 /** 118 /**
115 * Public key of the subject this attribute was delegated to 119 * Public key of the subject this attribute was delegated to
116 */ 120 */
@@ -128,7 +132,8 @@ struct GNUNET_CREDENTIAL_DelegationSet {
128/** 132/**
129 * A delegation 133 * A delegation
130 */ 134 */
131struct GNUNET_CREDENTIAL_Delegation { 135struct GNUNET_CREDENTIAL_Delegation
136{
132 /** 137 /**
133 * The issuer of the delegation 138 * The issuer of the delegation
134 */ 139 */
@@ -164,7 +169,8 @@ struct GNUNET_CREDENTIAL_Delegation {
164/** 169/**
165 * A credential 170 * A credential
166 */ 171 */
167struct GNUNET_CREDENTIAL_Credential { 172struct GNUNET_CREDENTIAL_Credential
173{
168 /** 174 /**
169 * The issuer of the credential 175 * The issuer of the credential
170 */ 176 */
@@ -205,7 +211,7 @@ struct GNUNET_CREDENTIAL_Credential {
205 * @return handle to the Credential service, or NULL on error 211 * @return handle to the Credential service, or NULL on error
206 */ 212 */
207struct GNUNET_CREDENTIAL_Handle * 213struct GNUNET_CREDENTIAL_Handle *
208GNUNET_CREDENTIAL_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 214GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
209 215
210 216
211/** 217/**
@@ -214,7 +220,7 @@ GNUNET_CREDENTIAL_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
214 * @param handle connection to shut down 220 * @param handle connection to shut down
215 */ 221 */
216void 222void
217GNUNET_CREDENTIAL_disconnect(struct GNUNET_CREDENTIAL_Handle *handle); 223GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
218 224
219 225
220/** 226/**
@@ -227,10 +233,16 @@ GNUNET_CREDENTIAL_disconnect(struct GNUNET_CREDENTIAL_Handle *handle);
227 * @param credential the credentials 233 * @param credential the credentials
228 */ 234 */
229typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls, 235typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls,
230 unsigned int d_count, 236 unsigned int
231 struct GNUNET_CREDENTIAL_Delegation *delegation_chain, 237 d_count,
232 unsigned int c_count, 238 struct
233 struct GNUNET_CREDENTIAL_Credential *credential); 239 GNUNET_CREDENTIAL_Delegation
240 *delegation_chain,
241 unsigned int
242 c_count,
243 struct
244 GNUNET_CREDENTIAL_Credential
245 *credential);
234 246
235/** 247/**
236 * Iterator called on obtained result for an attribute delegation. 248 * Iterator called on obtained result for an attribute delegation.
@@ -250,7 +262,8 @@ typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
250 * @param result the record data that can be handed to the subject 262 * @param result the record data that can be handed to the subject
251 */ 263 */
252typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls, 264typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
253 uint32_t success); 265 uint32_t
266 success);
254 267
255 268
256/** 269/**
@@ -272,23 +285,27 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
272 * @return handle to the queued request 285 * @return handle to the queued request
273 */ 286 */
274struct GNUNET_CREDENTIAL_Request* 287struct GNUNET_CREDENTIAL_Request*
275GNUNET_CREDENTIAL_verify(struct GNUNET_CREDENTIAL_Handle *handle, 288GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
276 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
277 const char *issuer_attribute,
278 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
279 uint32_t credential_count,
280 const struct GNUNET_CREDENTIAL_Credential *credentials,
281 GNUNET_CREDENTIAL_CredentialResultProcessor proc,
282 void *proc_cls);
283
284struct GNUNET_CREDENTIAL_Request*
285GNUNET_CREDENTIAL_collect(struct GNUNET_CREDENTIAL_Handle *handle,
286 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 289 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
287 const char *issuer_attribute, 290 const char *issuer_attribute,
288 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 291 const struct
292 GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
293 uint32_t credential_count,
294 const struct
295 GNUNET_CREDENTIAL_Credential *credentials,
289 GNUNET_CREDENTIAL_CredentialResultProcessor proc, 296 GNUNET_CREDENTIAL_CredentialResultProcessor proc,
290 void *proc_cls); 297 void *proc_cls);
291 298
299struct GNUNET_CREDENTIAL_Request*
300GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
301 const struct
302 GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
303 const char *issuer_attribute,
304 const struct
305 GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
306 GNUNET_CREDENTIAL_CredentialResultProcessor proc,
307 void *proc_cls);
308
292/** 309/**
293 * Delegate an attribute 310 * Delegate an attribute
294 * 311 *
@@ -302,13 +319,13 @@ GNUNET_CREDENTIAL_collect(struct GNUNET_CREDENTIAL_Handle *handle,
302 * @return handle to the queued request 319 * @return handle to the queued request
303 */ 320 */
304struct GNUNET_CREDENTIAL_Request * 321struct GNUNET_CREDENTIAL_Request *
305GNUNET_CREDENTIAL_add_delegation(struct GNUNET_CREDENTIAL_Handle *handle, 322GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
306 struct GNUNET_IDENTITY_Ego *issuer, 323 struct GNUNET_IDENTITY_Ego *issuer,
307 const char *attribute, 324 const char *attribute,
308 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 325 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
309 const char *delegated_attribute, 326 const char *delegated_attribute,
310 GNUNET_CREDENTIAL_DelegateResultProcessor proc, 327 GNUNET_CREDENTIAL_DelegateResultProcessor proc,
311 void *proc_cls); 328 void *proc_cls);
312 329
313/** 330/**
314 * Remove a delegation 331 * Remove a delegation
@@ -321,11 +338,12 @@ GNUNET_CREDENTIAL_add_delegation(struct GNUNET_CREDENTIAL_Handle *handle,
321 * @return handle to the queued request 338 * @return handle to the queued request
322 */ 339 */
323struct GNUNET_CREDENTIAL_Request * 340struct GNUNET_CREDENTIAL_Request *
324GNUNET_CREDENTIAL_remove_delegation(struct GNUNET_CREDENTIAL_Handle *handle, 341GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
325 struct GNUNET_IDENTITY_Ego *issuer, 342 struct GNUNET_IDENTITY_Ego *issuer,
326 const char *attribute, 343 const char *attribute,
327 GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc, 344 GNUNET_CREDENTIAL_RemoveDelegateResultProcessor
328 void *proc_cls); 345 proc,
346 void *proc_cls);
329 347
330 348
331 349
@@ -339,10 +357,11 @@ GNUNET_CREDENTIAL_remove_delegation(struct GNUNET_CREDENTIAL_Handle *handle,
339 * @return handle to the queued request 357 * @return handle to the queued request
340 */ 358 */
341struct GNUNET_CREDENTIAL_Credential* 359struct GNUNET_CREDENTIAL_Credential*
342GNUNET_CREDENTIAL_credential_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 360GNUNET_CREDENTIAL_credential_issue (const struct
343 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 361 GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
344 const char *attribute, 362 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
345 struct GNUNET_TIME_Absolute *expiration); 363 const char *attribute,
364 struct GNUNET_TIME_Absolute *expiration);
346 365
347 366
348 367
@@ -352,7 +371,7 @@ GNUNET_CREDENTIAL_credential_issue(const struct GNUNET_CRYPTO_EcdsaPrivateKey *i
352 * @param lr the lookup request to cancel 371 * @param lr the lookup request to cancel
353 */ 372 */
354void 373void
355GNUNET_CREDENTIAL_request_cancel(struct GNUNET_CREDENTIAL_Request *lr); 374GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr);
356 375
357 376
358#if 0 /* keep Emacsens' auto-indent happy */ 377#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 6e347c52b..507705e50 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -71,7 +71,8 @@ struct GNUNET_PeerIdentity;
71 * Desired quality level for random numbers. 71 * Desired quality level for random numbers.
72 * @ingroup crypto 72 * @ingroup crypto
73 */ 73 */
74enum GNUNET_CRYPTO_Quality { 74enum GNUNET_CRYPTO_Quality
75{
75 /** 76 /**
76 * No good quality of the operation is needed (i.e., 77 * No good quality of the operation is needed (i.e.,
77 * random numbers can be pseudo-random). 78 * random numbers can be pseudo-random).
@@ -112,7 +113,8 @@ enum GNUNET_CRYPTO_Quality {
112/** 113/**
113 * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode. 114 * @brief 0-terminated ASCII encoding of a struct GNUNET_HashCode.
114 */ 115 */
115struct GNUNET_CRYPTO_HashAsciiEncoded { 116struct GNUNET_CRYPTO_HashAsciiEncoded
117{
116 unsigned char encoding[104]; 118 unsigned char encoding[104];
117}; 119};
118 120
@@ -125,7 +127,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
125 * this must be followed by "size - 8" bytes of 127 * this must be followed by "size - 8" bytes of
126 * the actual signed data 128 * the actual signed data
127 */ 129 */
128struct GNUNET_CRYPTO_EccSignaturePurpose { 130struct GNUNET_CRYPTO_EccSignaturePurpose
131{
129 /** 132 /**
130 * How many bytes does this signature sign? 133 * How many bytes does this signature sign?
131 * (including this purpose header); in network 134 * (including this purpose header); in network
@@ -147,7 +150,8 @@ struct GNUNET_CRYPTO_EccSignaturePurpose {
147 * @brief an ECC signature using EdDSA. 150 * @brief an ECC signature using EdDSA.
148 * See cr.yp.to/papers.html#ed25519 151 * See cr.yp.to/papers.html#ed25519
149 */ 152 */
150struct GNUNET_CRYPTO_EddsaSignature { 153struct GNUNET_CRYPTO_EddsaSignature
154{
151 /** 155 /**
152 * R value. 156 * R value.
153 */ 157 */
@@ -163,7 +167,8 @@ struct GNUNET_CRYPTO_EddsaSignature {
163/** 167/**
164 * @brief an ECC signature using ECDSA 168 * @brief an ECC signature using ECDSA
165 */ 169 */
166struct GNUNET_CRYPTO_EcdsaSignature { 170struct GNUNET_CRYPTO_EcdsaSignature
171{
167 /** 172 /**
168 * R value. 173 * R value.
169 */ 174 */
@@ -180,7 +185,8 @@ struct GNUNET_CRYPTO_EcdsaSignature {
180 * Public ECC key (always for curve Ed25519) encoded in a format 185 * Public ECC key (always for curve Ed25519) encoded in a format
181 * suitable for network transmission and EdDSA signatures. 186 * suitable for network transmission and EdDSA signatures.
182 */ 187 */
183struct GNUNET_CRYPTO_EddsaPublicKey { 188struct GNUNET_CRYPTO_EddsaPublicKey
189{
184 /** 190 /**
185 * Point Q consists of a y-value mod p (256 bits); the x-value is 191 * Point Q consists of a y-value mod p (256 bits); the x-value is
186 * always positive. The point is stored in Ed25519 standard 192 * always positive. The point is stored in Ed25519 standard
@@ -194,7 +200,8 @@ struct GNUNET_CRYPTO_EddsaPublicKey {
194 * Public ECC key (always for Curve25519) encoded in a format suitable 200 * Public ECC key (always for Curve25519) encoded in a format suitable
195 * for network transmission and ECDSA signatures. 201 * for network transmission and ECDSA signatures.
196 */ 202 */
197struct GNUNET_CRYPTO_EcdsaPublicKey { 203struct GNUNET_CRYPTO_EcdsaPublicKey
204{
198 /** 205 /**
199 * Q consists of an x- and a y-value, each mod p (256 bits), given 206 * Q consists of an x- and a y-value, each mod p (256 bits), given
200 * here in affine coordinates and Ed25519 standard compact format. 207 * here in affine coordinates and Ed25519 standard compact format.
@@ -206,7 +213,8 @@ struct GNUNET_CRYPTO_EcdsaPublicKey {
206/** 213/**
207 * The identity of the host (wraps the signing key of the peer). 214 * The identity of the host (wraps the signing key of the peer).
208 */ 215 */
209struct GNUNET_PeerIdentity { 216struct GNUNET_PeerIdentity
217{
210 struct GNUNET_CRYPTO_EddsaPublicKey public_key; 218 struct GNUNET_CRYPTO_EddsaPublicKey public_key;
211}; 219};
212 220
@@ -216,7 +224,8 @@ struct GNUNET_PeerIdentity {
216 * for network transmission and encryption (ECDH), 224 * for network transmission and encryption (ECDH),
217 * See http://cr.yp.to/ecdh.html 225 * See http://cr.yp.to/ecdh.html
218 */ 226 */
219struct GNUNET_CRYPTO_EcdhePublicKey { 227struct GNUNET_CRYPTO_EcdhePublicKey
228{
220 /** 229 /**
221 * Q consists of an x- and a y-value, each mod p (256 bits), given 230 * Q consists of an x- and a y-value, each mod p (256 bits), given
222 * here in affine coordinates and Ed25519 standard compact format. 231 * here in affine coordinates and Ed25519 standard compact format.
@@ -229,7 +238,8 @@ struct GNUNET_CRYPTO_EcdhePublicKey {
229 * Private ECC key encoded for transmission. To be used only for ECDH 238 * Private ECC key encoded for transmission. To be used only for ECDH
230 * key exchange (ECDHE to be precise). 239 * key exchange (ECDHE to be precise).
231 */ 240 */
232struct GNUNET_CRYPTO_EcdhePrivateKey { 241struct GNUNET_CRYPTO_EcdhePrivateKey
242{
233 /** 243 /**
234 * d is a value mod n, where n has at most 256 bits. 244 * d is a value mod n, where n has at most 256 bits.
235 */ 245 */
@@ -240,7 +250,8 @@ struct GNUNET_CRYPTO_EcdhePrivateKey {
240 * Private ECC key encoded for transmission. To be used only for ECDSA 250 * Private ECC key encoded for transmission. To be used only for ECDSA
241 * signatures. 251 * signatures.
242 */ 252 */
243struct GNUNET_CRYPTO_EcdsaPrivateKey { 253struct GNUNET_CRYPTO_EcdsaPrivateKey
254{
244 /** 255 /**
245 * d is a value mod n, where n has at most 256 bits. 256 * d is a value mod n, where n has at most 256 bits.
246 */ 257 */
@@ -251,7 +262,8 @@ struct GNUNET_CRYPTO_EcdsaPrivateKey {
251 * Private ECC key encoded for transmission. To be used only for EdDSA 262 * Private ECC key encoded for transmission. To be used only for EdDSA
252 * signatures. 263 * signatures.
253 */ 264 */
254struct GNUNET_CRYPTO_EddsaPrivateKey { 265struct GNUNET_CRYPTO_EddsaPrivateKey
266{
255 /** 267 /**
256 * d is a value mod n, where n has at most 256 bits. 268 * d is a value mod n, where n has at most 256 bits.
257 */ 269 */
@@ -262,7 +274,8 @@ struct GNUNET_CRYPTO_EddsaPrivateKey {
262/** 274/**
263 * @brief type for session keys 275 * @brief type for session keys
264 */ 276 */
265struct GNUNET_CRYPTO_SymmetricSessionKey { 277struct GNUNET_CRYPTO_SymmetricSessionKey
278{
266 /** 279 /**
267 * Actual key for AES. 280 * Actual key for AES.
268 */ 281 */
@@ -282,7 +295,8 @@ GNUNET_NETWORK_STRUCT_END
282 * NOTE: must be smaller (!) in size than the 295 * NOTE: must be smaller (!) in size than the
283 * `struct GNUNET_HashCode`. 296 * `struct GNUNET_HashCode`.
284 */ 297 */
285struct GNUNET_CRYPTO_SymmetricInitializationVector { 298struct GNUNET_CRYPTO_SymmetricInitializationVector
299{
286 unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; 300 unsigned char aes_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2];
287 301
288 unsigned char twofish_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2]; 302 unsigned char twofish_iv[GNUNET_CRYPTO_AES_KEY_LENGTH / 2];
@@ -292,7 +306,8 @@ struct GNUNET_CRYPTO_SymmetricInitializationVector {
292/** 306/**
293 * @brief type for (message) authentication keys 307 * @brief type for (message) authentication keys
294 */ 308 */
295struct GNUNET_CRYPTO_AuthKey { 309struct GNUNET_CRYPTO_AuthKey
310{
296 unsigned char key[GNUNET_CRYPTO_HASH_LENGTH]; 311 unsigned char key[GNUNET_CRYPTO_HASH_LENGTH];
297}; 312};
298 313
@@ -307,7 +322,8 @@ struct GNUNET_CRYPTO_AuthKey {
307/** 322/**
308 * Paillier public key. 323 * Paillier public key.
309 */ 324 */
310struct GNUNET_CRYPTO_PaillierPublicKey { 325struct GNUNET_CRYPTO_PaillierPublicKey
326{
311 /** 327 /**
312 * N value. 328 * N value.
313 */ 329 */
@@ -318,7 +334,8 @@ struct GNUNET_CRYPTO_PaillierPublicKey {
318/** 334/**
319 * Paillier private key. 335 * Paillier private key.
320 */ 336 */
321struct GNUNET_CRYPTO_PaillierPrivateKey { 337struct GNUNET_CRYPTO_PaillierPrivateKey
338{
322 /** 339 /**
323 * Lambda-component of the private key. 340 * Lambda-component of the private key.
324 */ 341 */
@@ -333,7 +350,8 @@ struct GNUNET_CRYPTO_PaillierPrivateKey {
333/** 350/**
334 * Paillier ciphertext. 351 * Paillier ciphertext.
335 */ 352 */
336struct GNUNET_CRYPTO_PaillierCiphertext { 353struct GNUNET_CRYPTO_PaillierCiphertext
354{
337 /** 355 /**
338 * Guaranteed minimum number of homomorphic operations with this ciphertext, 356 * Guaranteed minimum number of homomorphic operations with this ciphertext,
339 * in network byte order (NBO). 357 * in network byte order (NBO).
@@ -357,7 +375,7 @@ struct GNUNET_CRYPTO_PaillierCiphertext {
357 * @param seed the seed to use 375 * @param seed the seed to use
358 */ 376 */
359void 377void
360GNUNET_CRYPTO_seed_weak_random(int32_t seed); 378GNUNET_CRYPTO_seed_weak_random (int32_t seed);
361 379
362 380
363/** 381/**
@@ -369,7 +387,7 @@ GNUNET_CRYPTO_seed_weak_random(int32_t seed);
369 * @return crc8 value 387 * @return crc8 value
370 */ 388 */
371uint8_t 389uint8_t
372GNUNET_CRYPTO_crc8_n(const void *buf, size_t len); 390GNUNET_CRYPTO_crc8_n (const void *buf, size_t len);
373 391
374 392
375/** 393/**
@@ -381,7 +399,7 @@ GNUNET_CRYPTO_crc8_n(const void *buf, size_t len);
381 * @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish to get actual crc16) 399 * @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish to get actual crc16)
382 */ 400 */
383uint32_t 401uint32_t
384GNUNET_CRYPTO_crc16_step(uint32_t sum, const void *buf, size_t len); 402GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len);
385 403
386 404
387/** 405/**
@@ -391,7 +409,7 @@ GNUNET_CRYPTO_crc16_step(uint32_t sum, const void *buf, size_t len);
391 * @return crc16 value 409 * @return crc16 value
392 */ 410 */
393uint16_t 411uint16_t
394GNUNET_CRYPTO_crc16_finish(uint32_t sum); 412GNUNET_CRYPTO_crc16_finish (uint32_t sum);
395 413
396 414
397/** 415/**
@@ -403,7 +421,7 @@ GNUNET_CRYPTO_crc16_finish(uint32_t sum);
403 * @return crc16 value 421 * @return crc16 value
404 */ 422 */
405uint16_t 423uint16_t
406GNUNET_CRYPTO_crc16_n(const void *buf, size_t len); 424GNUNET_CRYPTO_crc16_n (const void *buf, size_t len);
407 425
408 426
409/** 427/**
@@ -416,7 +434,7 @@ GNUNET_CRYPTO_crc16_n(const void *buf, size_t len);
416 * @return the resulting CRC32 checksum 434 * @return the resulting CRC32 checksum
417 */ 435 */
418int32_t 436int32_t
419GNUNET_CRYPTO_crc32_n(const void *buf, size_t len); 437GNUNET_CRYPTO_crc32_n (const void *buf, size_t len);
420 438
421/** 439/**
422 * @ingroup crypto 440 * @ingroup crypto
@@ -427,7 +445,7 @@ GNUNET_CRYPTO_crc32_n(const void *buf, size_t len);
427 * @param length buffer length 445 * @param length buffer length
428 */ 446 */
429void 447void
430GNUNET_CRYPTO_zero_keys(void *buffer, size_t length); 448GNUNET_CRYPTO_zero_keys (void *buffer, size_t length);
431 449
432 450
433/** 451/**
@@ -439,9 +457,9 @@ GNUNET_CRYPTO_zero_keys(void *buffer, size_t length);
439 * @param length buffer length 457 * @param length buffer length
440 */ 458 */
441void 459void
442GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode, 460GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode,
443 void *buffer, 461 void *buffer,
444 size_t length); 462 size_t length);
445 463
446/** 464/**
447 * @ingroup crypto 465 * @ingroup crypto
@@ -452,7 +470,7 @@ GNUNET_CRYPTO_random_block(enum GNUNET_CRYPTO_Quality mode,
452 * @return a random value in the interval [0,@a i) (exclusive). 470 * @return a random value in the interval [0,@a i) (exclusive).
453 */ 471 */
454uint32_t 472uint32_t
455GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i); 473GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i);
456 474
457 475
458/** 476/**
@@ -464,7 +482,7 @@ GNUNET_CRYPTO_random_u32(enum GNUNET_CRYPTO_Quality mode, uint32_t i);
464 * @return random 64-bit number 482 * @return random 64-bit number
465 */ 483 */
466uint64_t 484uint64_t
467GNUNET_CRYPTO_random_u64(enum GNUNET_CRYPTO_Quality mode, uint64_t max); 485GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max);
468 486
469 487
470/** 488/**
@@ -477,7 +495,7 @@ GNUNET_CRYPTO_random_u64(enum GNUNET_CRYPTO_Quality mode, uint64_t max);
477 * @return the permutation array (allocated from heap) 495 * @return the permutation array (allocated from heap)
478 */ 496 */
479unsigned int * 497unsigned int *
480GNUNET_CRYPTO_random_permute(enum GNUNET_CRYPTO_Quality mode, unsigned int n); 498GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n);
481 499
482 500
483/** 501/**
@@ -487,7 +505,7 @@ GNUNET_CRYPTO_random_permute(enum GNUNET_CRYPTO_Quality mode, unsigned int n);
487 * @param key key to initialize 505 * @param key key to initialize
488 */ 506 */
489void 507void
490GNUNET_CRYPTO_symmetric_create_session_key( 508GNUNET_CRYPTO_symmetric_create_session_key (
491 struct GNUNET_CRYPTO_SymmetricSessionKey *key); 509 struct GNUNET_CRYPTO_SymmetricSessionKey *key);
492 510
493 511
@@ -503,7 +521,7 @@ GNUNET_CRYPTO_symmetric_create_session_key(
503 * @return the size of the encrypted block, -1 for errors 521 * @return the size of the encrypted block, -1 for errors
504 */ 522 */
505ssize_t 523ssize_t
506GNUNET_CRYPTO_symmetric_encrypt( 524GNUNET_CRYPTO_symmetric_encrypt (
507 const void *block, 525 const void *block,
508 size_t size, 526 size_t size,
509 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, 527 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
@@ -523,7 +541,7 @@ GNUNET_CRYPTO_symmetric_encrypt(
523 * @return -1 on failure, size of decrypted block on success 541 * @return -1 on failure, size of decrypted block on success
524 */ 542 */
525ssize_t 543ssize_t
526GNUNET_CRYPTO_symmetric_decrypt( 544GNUNET_CRYPTO_symmetric_decrypt (
527 const void *block, 545 const void *block,
528 size_t size, 546 size_t size,
529 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, 547 const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
@@ -541,7 +559,7 @@ GNUNET_CRYPTO_symmetric_decrypt(
541 * @param ... pairs of void * & size_t for context chunks, terminated by NULL 559 * @param ... pairs of void * & size_t for context chunks, terminated by NULL
542 */ 560 */
543void 561void
544GNUNET_CRYPTO_symmetric_derive_iv( 562GNUNET_CRYPTO_symmetric_derive_iv (
545 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, 563 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
546 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, 564 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
547 const void *salt, 565 const void *salt,
@@ -558,7 +576,7 @@ GNUNET_CRYPTO_symmetric_derive_iv(
558 * @param argp pairs of void * & size_t for context chunks, terminated by NULL 576 * @param argp pairs of void * & size_t for context chunks, terminated by NULL
559 */ 577 */
560void 578void
561GNUNET_CRYPTO_symmetric_derive_iv_v( 579GNUNET_CRYPTO_symmetric_derive_iv_v (
562 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, 580 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv,
563 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey, 581 const struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
564 const void *salt, 582 const void *salt,
@@ -574,8 +592,8 @@ GNUNET_CRYPTO_symmetric_derive_iv_v(
574 * safely cast to char*, a '\\0' termination is set). 592 * safely cast to char*, a '\\0' termination is set).
575 */ 593 */
576void 594void
577GNUNET_CRYPTO_hash_to_enc(const struct GNUNET_HashCode *block, 595GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block,
578 struct GNUNET_CRYPTO_HashAsciiEncoded *result); 596 struct GNUNET_CRYPTO_HashAsciiEncoded *result);
579 597
580 598
581/** 599/**
@@ -588,9 +606,9 @@ GNUNET_CRYPTO_hash_to_enc(const struct GNUNET_HashCode *block,
588 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding 606 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding
589 */ 607 */
590int 608int
591GNUNET_CRYPTO_hash_from_string2(const char *enc, 609GNUNET_CRYPTO_hash_from_string2 (const char *enc,
592 size_t enclen, 610 size_t enclen,
593 struct GNUNET_HashCode *result); 611 struct GNUNET_HashCode *result);
594 612
595 613
596/** 614/**
@@ -602,7 +620,7 @@ GNUNET_CRYPTO_hash_from_string2(const char *enc,
602 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding 620 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding
603 */ 621 */
604#define GNUNET_CRYPTO_hash_from_string(enc, result) \ 622#define GNUNET_CRYPTO_hash_from_string(enc, result) \
605 GNUNET_CRYPTO_hash_from_string2(enc, strlen(enc), result) 623 GNUNET_CRYPTO_hash_from_string2 (enc, strlen (enc), result)
606 624
607 625
608/** 626/**
@@ -618,8 +636,8 @@ GNUNET_CRYPTO_hash_from_string2(const char *enc,
618 * @return number between 0 and UINT32_MAX 636 * @return number between 0 and UINT32_MAX
619 */ 637 */
620uint32_t 638uint32_t
621GNUNET_CRYPTO_hash_distance_u32(const struct GNUNET_HashCode *a, 639GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a,
622 const struct GNUNET_HashCode *b); 640 const struct GNUNET_HashCode *b);
623 641
624 642
625/** 643/**
@@ -631,9 +649,9 @@ GNUNET_CRYPTO_hash_distance_u32(const struct GNUNET_HashCode *a,
631 * @param ret pointer to where to write the hashcode 649 * @param ret pointer to where to write the hashcode
632 */ 650 */
633void 651void
634GNUNET_CRYPTO_hash(const void *block, 652GNUNET_CRYPTO_hash (const void *block,
635 size_t size, 653 size_t size,
636 struct GNUNET_HashCode *ret); 654 struct GNUNET_HashCode *ret);
637 655
638 656
639/** 657/**
@@ -648,7 +666,7 @@ struct GNUNET_HashContext;
648 * @return context for incremental hash computation 666 * @return context for incremental hash computation
649 */ 667 */
650struct GNUNET_HashContext * 668struct GNUNET_HashContext *
651GNUNET_CRYPTO_hash_context_start(void); 669GNUNET_CRYPTO_hash_context_start (void);
652 670
653 671
654/** 672/**
@@ -659,9 +677,9 @@ GNUNET_CRYPTO_hash_context_start(void);
659 * @param size number of bytes in @a buf 677 * @param size number of bytes in @a buf
660 */ 678 */
661void 679void
662GNUNET_CRYPTO_hash_context_read(struct GNUNET_HashContext *hc, 680GNUNET_CRYPTO_hash_context_read (struct GNUNET_HashContext *hc,
663 const void *buf, 681 const void *buf,
664 size_t size); 682 size_t size);
665 683
666 684
667/** 685/**
@@ -671,8 +689,8 @@ GNUNET_CRYPTO_hash_context_read(struct GNUNET_HashContext *hc,
671 * @param r_hash where to write the latest / final hash code 689 * @param r_hash where to write the latest / final hash code
672 */ 690 */
673void 691void
674GNUNET_CRYPTO_hash_context_finish(struct GNUNET_HashContext *hc, 692GNUNET_CRYPTO_hash_context_finish (struct GNUNET_HashContext *hc,
675 struct GNUNET_HashCode *r_hash); 693 struct GNUNET_HashCode *r_hash);
676 694
677 695
678/** 696/**
@@ -681,7 +699,7 @@ GNUNET_CRYPTO_hash_context_finish(struct GNUNET_HashContext *hc,
681 * @param hc hash context to destroy 699 * @param hc hash context to destroy
682 */ 700 */
683void 701void
684GNUNET_CRYPTO_hash_context_abort(struct GNUNET_HashContext *hc); 702GNUNET_CRYPTO_hash_context_abort (struct GNUNET_HashContext *hc);
685 703
686 704
687/** 705/**
@@ -696,11 +714,11 @@ GNUNET_CRYPTO_hash_context_abort(struct GNUNET_HashContext *hc);
696 * @param hmac where to store the hmac 714 * @param hmac where to store the hmac
697 */ 715 */
698void 716void
699GNUNET_CRYPTO_hmac_raw(const void *key, 717GNUNET_CRYPTO_hmac_raw (const void *key,
700 size_t key_len, 718 size_t key_len,
701 const void *plaintext, 719 const void *plaintext,
702 size_t plaintext_len, 720 size_t plaintext_len,
703 struct GNUNET_HashCode *hmac); 721 struct GNUNET_HashCode *hmac);
704 722
705 723
706/** 724/**
@@ -713,10 +731,10 @@ GNUNET_CRYPTO_hmac_raw(const void *key,
713 * @param hmac where to store the hmac 731 * @param hmac where to store the hmac
714 */ 732 */
715void 733void
716GNUNET_CRYPTO_hmac(const struct GNUNET_CRYPTO_AuthKey *key, 734GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
717 const void *plaintext, 735 const void *plaintext,
718 size_t plaintext_len, 736 size_t plaintext_len,
719 struct GNUNET_HashCode *hmac); 737 struct GNUNET_HashCode *hmac);
720 738
721 739
722/** 740/**
@@ -749,11 +767,11 @@ struct GNUNET_CRYPTO_FileHashContext;
749 * @return NULL on (immediate) errror 767 * @return NULL on (immediate) errror
750 */ 768 */
751struct GNUNET_CRYPTO_FileHashContext * 769struct GNUNET_CRYPTO_FileHashContext *
752GNUNET_CRYPTO_hash_file(enum GNUNET_SCHEDULER_Priority priority, 770GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority,
753 const char *filename, 771 const char *filename,
754 size_t blocksize, 772 size_t blocksize,
755 GNUNET_CRYPTO_HashCompletedCallback callback, 773 GNUNET_CRYPTO_HashCompletedCallback callback,
756 void *callback_cls); 774 void *callback_cls);
757 775
758 776
759/** 777/**
@@ -762,7 +780,7 @@ GNUNET_CRYPTO_hash_file(enum GNUNET_SCHEDULER_Priority priority,
762 * @param fhc operation to cancel (callback must not yet have been invoked) 780 * @param fhc operation to cancel (callback must not yet have been invoked)
763 */ 781 */
764void 782void
765GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc); 783GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc);
766 784
767 785
768/** 786/**
@@ -773,8 +791,8 @@ GNUNET_CRYPTO_hash_file_cancel(struct GNUNET_CRYPTO_FileHashContext *fhc);
773 * @param result hash code that is randomized 791 * @param result hash code that is randomized
774 */ 792 */
775void 793void
776GNUNET_CRYPTO_hash_create_random(enum GNUNET_CRYPTO_Quality mode, 794GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode,
777 struct GNUNET_HashCode *result); 795 struct GNUNET_HashCode *result);
778 796
779 797
780/** 798/**
@@ -786,9 +804,9 @@ GNUNET_CRYPTO_hash_create_random(enum GNUNET_CRYPTO_Quality mode,
786 * @param result set to @a b - @a a 804 * @param result set to @a b - @a a
787 */ 805 */
788void 806void
789GNUNET_CRYPTO_hash_difference(const struct GNUNET_HashCode *a, 807GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a,
790 const struct GNUNET_HashCode *b, 808 const struct GNUNET_HashCode *b,
791 struct GNUNET_HashCode *result); 809 struct GNUNET_HashCode *result);
792 810
793 811
794/** 812/**
@@ -800,9 +818,9 @@ GNUNET_CRYPTO_hash_difference(const struct GNUNET_HashCode *a,
800 * @param result set to @a a + @a delta 818 * @param result set to @a a + @a delta
801 */ 819 */
802void 820void
803GNUNET_CRYPTO_hash_sum(const struct GNUNET_HashCode *a, 821GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a,
804 const struct GNUNET_HashCode *delta, 822 const struct GNUNET_HashCode *delta,
805 struct GNUNET_HashCode *result); 823 struct GNUNET_HashCode *result);
806 824
807 825
808/** 826/**
@@ -814,9 +832,9 @@ GNUNET_CRYPTO_hash_sum(const struct GNUNET_HashCode *a,
814 * @param result set to @a a ^ @a b 832 * @param result set to @a a ^ @a b
815 */ 833 */
816void 834void
817GNUNET_CRYPTO_hash_xor(const struct GNUNET_HashCode *a, 835GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode *a,
818 const struct GNUNET_HashCode *b, 836 const struct GNUNET_HashCode *b,
819 struct GNUNET_HashCode *result); 837 struct GNUNET_HashCode *result);
820 838
821 839
822/** 840/**
@@ -828,7 +846,7 @@ GNUNET_CRYPTO_hash_xor(const struct GNUNET_HashCode *a,
828 * @param iv set to a valid initialization vector 846 * @param iv set to a valid initialization vector
829 */ 847 */
830void 848void
831GNUNET_CRYPTO_hash_to_aes_key( 849GNUNET_CRYPTO_hash_to_aes_key (
832 const struct GNUNET_HashCode *hc, 850 const struct GNUNET_HashCode *hc,
833 struct GNUNET_CRYPTO_SymmetricSessionKey *skey, 851 struct GNUNET_CRYPTO_SymmetricSessionKey *skey,
834 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv); 852 struct GNUNET_CRYPTO_SymmetricInitializationVector *iv);
@@ -843,8 +861,8 @@ GNUNET_CRYPTO_hash_to_aes_key(
843 * @return Bit \a bit from hashcode \a code, -1 for invalid index 861 * @return Bit \a bit from hashcode \a code, -1 for invalid index
844 */ 862 */
845int 863int
846GNUNET_CRYPTO_hash_get_bit(const struct GNUNET_HashCode *code, 864GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code,
847 unsigned int bit); 865 unsigned int bit);
848 866
849 867
850/** 868/**
@@ -860,8 +878,8 @@ GNUNET_CRYPTO_hash_get_bit(const struct GNUNET_HashCode *code,
860 * @return the number of bits that match 878 * @return the number of bits that match
861 */ 879 */
862unsigned int 880unsigned int
863GNUNET_CRYPTO_hash_matching_bits(const struct GNUNET_HashCode *first, 881GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode *first,
864 const struct GNUNET_HashCode *second); 882 const struct GNUNET_HashCode *second);
865 883
866 884
867/** 885/**
@@ -874,8 +892,8 @@ GNUNET_CRYPTO_hash_matching_bits(const struct GNUNET_HashCode *first,
874 * @return 1 if @a h1 > @a h2, -1 if @a h1 < @a h2 and 0 if @a h1 == @a h2. 892 * @return 1 if @a h1 > @a h2, -1 if @a h1 < @a h2 and 0 if @a h1 == @a h2.
875 */ 893 */
876int 894int
877GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1, 895GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1,
878 const struct GNUNET_HashCode *h2); 896 const struct GNUNET_HashCode *h2);
879 897
880 898
881/** 899/**
@@ -889,9 +907,9 @@ GNUNET_CRYPTO_hash_cmp(const struct GNUNET_HashCode *h1,
889 * @return -1 if @a h1 is closer, 1 if @a h2 is closer and 0 if @a h1== @a h2. 907 * @return -1 if @a h1 is closer, 1 if @a h2 is closer and 0 if @a h1== @a h2.
890 */ 908 */
891int 909int
892GNUNET_CRYPTO_hash_xorcmp(const struct GNUNET_HashCode *h1, 910GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1,
893 const struct GNUNET_HashCode *h2, 911 const struct GNUNET_HashCode *h2,
894 const struct GNUNET_HashCode *target); 912 const struct GNUNET_HashCode *target);
895 913
896 914
897/** 915/**
@@ -904,7 +922,7 @@ GNUNET_CRYPTO_hash_xorcmp(const struct GNUNET_HashCode *h1,
904 * @param argp pair of void * & size_t for context chunks, terminated by NULL 922 * @param argp pair of void * & size_t for context chunks, terminated by NULL
905 */ 923 */
906void 924void
907GNUNET_CRYPTO_hmac_derive_key_v( 925GNUNET_CRYPTO_hmac_derive_key_v (
908 struct GNUNET_CRYPTO_AuthKey *key, 926 struct GNUNET_CRYPTO_AuthKey *key,
909 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, 927 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
910 const void *salt, 928 const void *salt,
@@ -922,7 +940,7 @@ GNUNET_CRYPTO_hmac_derive_key_v(
922 * @param ... pair of void * & size_t for context chunks, terminated by NULL 940 * @param ... pair of void * & size_t for context chunks, terminated by NULL
923 */ 941 */
924void 942void
925GNUNET_CRYPTO_hmac_derive_key( 943GNUNET_CRYPTO_hmac_derive_key (
926 struct GNUNET_CRYPTO_AuthKey *key, 944 struct GNUNET_CRYPTO_AuthKey *key,
927 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey, 945 const struct GNUNET_CRYPTO_SymmetricSessionKey *rkey,
928 const void *salt, 946 const void *salt,
@@ -945,15 +963,15 @@ GNUNET_CRYPTO_hmac_derive_key(
945 * @return #GNUNET_YES on success 963 * @return #GNUNET_YES on success
946 */ 964 */
947int 965int
948GNUNET_CRYPTO_hkdf(void *result, 966GNUNET_CRYPTO_hkdf (void *result,
949 size_t out_len, 967 size_t out_len,
950 int xtr_algo, 968 int xtr_algo,
951 int prf_algo, 969 int prf_algo,
952 const void *xts, 970 const void *xts,
953 size_t xts_len, 971 size_t xts_len,
954 const void *skm, 972 const void *skm,
955 size_t skm_len, 973 size_t skm_len,
956 ...); 974 ...);
957 975
958 976
959/** 977/**
@@ -971,15 +989,15 @@ GNUNET_CRYPTO_hkdf(void *result,
971 * @return #GNUNET_YES on success 989 * @return #GNUNET_YES on success
972 */ 990 */
973int 991int
974GNUNET_CRYPTO_hkdf_v(void *result, 992GNUNET_CRYPTO_hkdf_v (void *result,
975 size_t out_len, 993 size_t out_len,
976 int xtr_algo, 994 int xtr_algo,
977 int prf_algo, 995 int prf_algo,
978 const void *xts, 996 const void *xts,
979 size_t xts_len, 997 size_t xts_len,
980 const void *skm, 998 const void *skm,
981 size_t skm_len, 999 size_t skm_len,
982 va_list argp); 1000 va_list argp);
983 1001
984 1002
985/** 1003/**
@@ -994,13 +1012,13 @@ GNUNET_CRYPTO_hkdf_v(void *result,
994 * @return #GNUNET_YES on success 1012 * @return #GNUNET_YES on success
995 */ 1013 */
996int 1014int
997GNUNET_CRYPTO_kdf_v(void *result, 1015GNUNET_CRYPTO_kdf_v (void *result,
998 size_t out_len, 1016 size_t out_len,
999 const void *xts, 1017 const void *xts,
1000 size_t xts_len, 1018 size_t xts_len,
1001 const void *skm, 1019 const void *skm,
1002 size_t skm_len, 1020 size_t skm_len,
1003 va_list argp); 1021 va_list argp);
1004 1022
1005 1023
1006/** 1024/**
@@ -1016,13 +1034,13 @@ GNUNET_CRYPTO_kdf_v(void *result,
1016 * @param ctx context string 1034 * @param ctx context string
1017 */ 1035 */
1018void 1036void
1019GNUNET_CRYPTO_kdf_mod_mpi(gcry_mpi_t *r, 1037GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r,
1020 gcry_mpi_t n, 1038 gcry_mpi_t n,
1021 const void *xts, 1039 const void *xts,
1022 size_t xts_len, 1040 size_t xts_len,
1023 const void *skm, 1041 const void *skm,
1024 size_t skm_len, 1042 size_t skm_len,
1025 const char *ctx); 1043 const char *ctx);
1026 1044
1027 1045
1028/** 1046/**
@@ -1038,13 +1056,13 @@ GNUNET_CRYPTO_kdf_mod_mpi(gcry_mpi_t *r,
1038 * @return #GNUNET_YES on success 1056 * @return #GNUNET_YES on success
1039 */ 1057 */
1040int 1058int
1041GNUNET_CRYPTO_kdf(void *result, 1059GNUNET_CRYPTO_kdf (void *result,
1042 size_t out_len, 1060 size_t out_len,
1043 const void *xts, 1061 const void *xts,
1044 size_t xts_len, 1062 size_t xts_len,
1045 const void *skm, 1063 const void *skm,
1046 size_t skm_len, 1064 size_t skm_len,
1047 ...); 1065 ...);
1048 1066
1049 1067
1050/** 1068/**
@@ -1055,7 +1073,7 @@ GNUNET_CRYPTO_kdf(void *result,
1055 * @param pub where to write the public key 1073 * @param pub where to write the public key
1056 */ 1074 */
1057void 1075void
1058GNUNET_CRYPTO_ecdsa_key_get_public( 1076GNUNET_CRYPTO_ecdsa_key_get_public (
1059 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, 1077 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1060 struct GNUNET_CRYPTO_EcdsaPublicKey *pub); 1078 struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
1061 1079
@@ -1067,7 +1085,7 @@ GNUNET_CRYPTO_ecdsa_key_get_public(
1067 * @param pub where to write the public key 1085 * @param pub where to write the public key
1068 */ 1086 */
1069void 1087void
1070GNUNET_CRYPTO_eddsa_key_get_public( 1088GNUNET_CRYPTO_eddsa_key_get_public (
1071 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, 1089 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1072 struct GNUNET_CRYPTO_EddsaPublicKey *pub); 1090 struct GNUNET_CRYPTO_EddsaPublicKey *pub);
1073 1091
@@ -1080,7 +1098,7 @@ GNUNET_CRYPTO_eddsa_key_get_public(
1080 * @param pub where to write the public key 1098 * @param pub where to write the public key
1081 */ 1099 */
1082void 1100void
1083GNUNET_CRYPTO_ecdhe_key_get_public( 1101GNUNET_CRYPTO_ecdhe_key_get_public (
1084 const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, 1102 const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1085 struct GNUNET_CRYPTO_EcdhePublicKey *pub); 1103 struct GNUNET_CRYPTO_EcdhePublicKey *pub);
1086 1104
@@ -1092,7 +1110,7 @@ GNUNET_CRYPTO_ecdhe_key_get_public(
1092 * @return string representing @a pub 1110 * @return string representing @a pub
1093 */ 1111 */
1094char * 1112char *
1095GNUNET_CRYPTO_ecdsa_public_key_to_string( 1113GNUNET_CRYPTO_ecdsa_public_key_to_string (
1096 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub); 1114 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
1097 1115
1098/** 1116/**
@@ -1102,7 +1120,7 @@ GNUNET_CRYPTO_ecdsa_public_key_to_string(
1102 * @return string representing @a priv 1120 * @return string representing @a priv
1103 */ 1121 */
1104char * 1122char *
1105GNUNET_CRYPTO_ecdsa_private_key_to_string( 1123GNUNET_CRYPTO_ecdsa_private_key_to_string (
1106 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv); 1124 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv);
1107 1125
1108 1126
@@ -1113,7 +1131,7 @@ GNUNET_CRYPTO_ecdsa_private_key_to_string(
1113 * @return string representing @a pub 1131 * @return string representing @a pub
1114 */ 1132 */
1115char * 1133char *
1116GNUNET_CRYPTO_eddsa_private_key_to_string( 1134GNUNET_CRYPTO_eddsa_private_key_to_string (
1117 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv); 1135 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv);
1118 1136
1119 1137
@@ -1124,7 +1142,7 @@ GNUNET_CRYPTO_eddsa_private_key_to_string(
1124 * @return string representing @a pub 1142 * @return string representing @a pub
1125 */ 1143 */
1126char * 1144char *
1127GNUNET_CRYPTO_eddsa_public_key_to_string( 1145GNUNET_CRYPTO_eddsa_public_key_to_string (
1128 const struct GNUNET_CRYPTO_EddsaPublicKey *pub); 1146 const struct GNUNET_CRYPTO_EddsaPublicKey *pub);
1129 1147
1130 1148
@@ -1137,7 +1155,7 @@ GNUNET_CRYPTO_eddsa_public_key_to_string(
1137 * @return #GNUNET_OK on success 1155 * @return #GNUNET_OK on success
1138 */ 1156 */
1139int 1157int
1140GNUNET_CRYPTO_ecdsa_public_key_from_string( 1158GNUNET_CRYPTO_ecdsa_public_key_from_string (
1141 const char *enc, 1159 const char *enc,
1142 size_t enclen, 1160 size_t enclen,
1143 struct GNUNET_CRYPTO_EcdsaPublicKey *pub); 1161 struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
@@ -1152,7 +1170,7 @@ GNUNET_CRYPTO_ecdsa_public_key_from_string(
1152 * @return #GNUNET_OK on success 1170 * @return #GNUNET_OK on success
1153 */ 1171 */
1154int 1172int
1155GNUNET_CRYPTO_eddsa_private_key_from_string( 1173GNUNET_CRYPTO_eddsa_private_key_from_string (
1156 const char *enc, 1174 const char *enc,
1157 size_t enclen, 1175 size_t enclen,
1158 struct GNUNET_CRYPTO_EddsaPrivateKey *pub); 1176 struct GNUNET_CRYPTO_EddsaPrivateKey *pub);
@@ -1167,7 +1185,7 @@ GNUNET_CRYPTO_eddsa_private_key_from_string(
1167 * @return #GNUNET_OK on success 1185 * @return #GNUNET_OK on success
1168 */ 1186 */
1169int 1187int
1170GNUNET_CRYPTO_eddsa_public_key_from_string( 1188GNUNET_CRYPTO_eddsa_public_key_from_string (
1171 const char *enc, 1189 const char *enc,
1172 size_t enclen, 1190 size_t enclen,
1173 struct GNUNET_CRYPTO_EddsaPublicKey *pub); 1191 struct GNUNET_CRYPTO_EddsaPublicKey *pub);
@@ -1189,7 +1207,7 @@ GNUNET_CRYPTO_eddsa_public_key_from_string(
1189 * permission denied); free using #GNUNET_free 1207 * permission denied); free using #GNUNET_free
1190 */ 1208 */
1191struct GNUNET_CRYPTO_EcdsaPrivateKey * 1209struct GNUNET_CRYPTO_EcdsaPrivateKey *
1192GNUNET_CRYPTO_ecdsa_key_create_from_file(const char *filename); 1210GNUNET_CRYPTO_ecdsa_key_create_from_file (const char *filename);
1193 1211
1194 1212
1195/** 1213/**
@@ -1208,7 +1226,7 @@ GNUNET_CRYPTO_ecdsa_key_create_from_file(const char *filename);
1208 * permission denied); free using #GNUNET_free 1226 * permission denied); free using #GNUNET_free
1209 */ 1227 */
1210struct GNUNET_CRYPTO_EddsaPrivateKey * 1228struct GNUNET_CRYPTO_EddsaPrivateKey *
1211GNUNET_CRYPTO_eddsa_key_create_from_file(const char *filename); 1229GNUNET_CRYPTO_eddsa_key_create_from_file (const char *filename);
1212 1230
1213 1231
1214/** 1232/**
@@ -1227,7 +1245,7 @@ struct GNUNET_CONFIGURATION_Handle;
1227 * permission denied); free using #GNUNET_free 1245 * permission denied); free using #GNUNET_free
1228 */ 1246 */
1229struct GNUNET_CRYPTO_EddsaPrivateKey * 1247struct GNUNET_CRYPTO_EddsaPrivateKey *
1230GNUNET_CRYPTO_eddsa_key_create_from_configuration( 1248GNUNET_CRYPTO_eddsa_key_create_from_configuration (
1231 const struct GNUNET_CONFIGURATION_Handle *cfg); 1249 const struct GNUNET_CONFIGURATION_Handle *cfg);
1232 1250
1233 1251
@@ -1238,7 +1256,7 @@ GNUNET_CRYPTO_eddsa_key_create_from_configuration(
1238 * @return fresh private key; free using #GNUNET_free 1256 * @return fresh private key; free using #GNUNET_free
1239 */ 1257 */
1240struct GNUNET_CRYPTO_EcdsaPrivateKey * 1258struct GNUNET_CRYPTO_EcdsaPrivateKey *
1241GNUNET_CRYPTO_ecdsa_key_create(void); 1259GNUNET_CRYPTO_ecdsa_key_create (void);
1242 1260
1243 1261
1244/** 1262/**
@@ -1248,7 +1266,7 @@ GNUNET_CRYPTO_ecdsa_key_create(void);
1248 * @return fresh private key; free using #GNUNET_free 1266 * @return fresh private key; free using #GNUNET_free
1249 */ 1267 */
1250struct GNUNET_CRYPTO_EddsaPrivateKey * 1268struct GNUNET_CRYPTO_EddsaPrivateKey *
1251GNUNET_CRYPTO_eddsa_key_create(void); 1269GNUNET_CRYPTO_eddsa_key_create (void);
1252 1270
1253 1271
1254/** 1272/**
@@ -1259,7 +1277,7 @@ GNUNET_CRYPTO_eddsa_key_create(void);
1259 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 1277 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
1260 */ 1278 */
1261int 1279int
1262GNUNET_CRYPTO_ecdhe_key_create2(struct GNUNET_CRYPTO_EcdhePrivateKey *pk); 1280GNUNET_CRYPTO_ecdhe_key_create2 (struct GNUNET_CRYPTO_EcdhePrivateKey *pk);
1263 1281
1264 1282
1265/** 1283/**
@@ -1269,7 +1287,7 @@ GNUNET_CRYPTO_ecdhe_key_create2(struct GNUNET_CRYPTO_EcdhePrivateKey *pk);
1269 * @return fresh private key; free using #GNUNET_free 1287 * @return fresh private key; free using #GNUNET_free
1270 */ 1288 */
1271struct GNUNET_CRYPTO_EcdhePrivateKey * 1289struct GNUNET_CRYPTO_EcdhePrivateKey *
1272GNUNET_CRYPTO_ecdhe_key_create(void); 1290GNUNET_CRYPTO_ecdhe_key_create (void);
1273 1291
1274 1292
1275/** 1293/**
@@ -1279,7 +1297,7 @@ GNUNET_CRYPTO_ecdhe_key_create(void);
1279 * @param pk location of the key 1297 * @param pk location of the key
1280 */ 1298 */
1281void 1299void
1282GNUNET_CRYPTO_eddsa_key_clear(struct GNUNET_CRYPTO_EddsaPrivateKey *pk); 1300GNUNET_CRYPTO_eddsa_key_clear (struct GNUNET_CRYPTO_EddsaPrivateKey *pk);
1283 1301
1284 1302
1285/** 1303/**
@@ -1289,7 +1307,7 @@ GNUNET_CRYPTO_eddsa_key_clear(struct GNUNET_CRYPTO_EddsaPrivateKey *pk);
1289 * @param pk location of the key 1307 * @param pk location of the key
1290 */ 1308 */
1291void 1309void
1292GNUNET_CRYPTO_ecdsa_key_clear(struct GNUNET_CRYPTO_EcdsaPrivateKey *pk); 1310GNUNET_CRYPTO_ecdsa_key_clear (struct GNUNET_CRYPTO_EcdsaPrivateKey *pk);
1293 1311
1294 1312
1295/** 1313/**
@@ -1299,7 +1317,7 @@ GNUNET_CRYPTO_ecdsa_key_clear(struct GNUNET_CRYPTO_EcdsaPrivateKey *pk);
1299 * @param pk location of the key 1317 * @param pk location of the key
1300 */ 1318 */
1301void 1319void
1302GNUNET_CRYPTO_ecdhe_key_clear(struct GNUNET_CRYPTO_EcdhePrivateKey *pk); 1320GNUNET_CRYPTO_ecdhe_key_clear (struct GNUNET_CRYPTO_EcdhePrivateKey *pk);
1303 1321
1304 1322
1305/** 1323/**
@@ -1309,7 +1327,7 @@ GNUNET_CRYPTO_ecdhe_key_clear(struct GNUNET_CRYPTO_EcdhePrivateKey *pk);
1309 * @return "anonymous" private key; do not free 1327 * @return "anonymous" private key; do not free
1310 */ 1328 */
1311const struct GNUNET_CRYPTO_EcdsaPrivateKey * 1329const struct GNUNET_CRYPTO_EcdsaPrivateKey *
1312GNUNET_CRYPTO_ecdsa_key_get_anonymous(void); 1330GNUNET_CRYPTO_ecdsa_key_get_anonymous (void);
1313 1331
1314 1332
1315/** 1333/**
@@ -1322,7 +1340,7 @@ GNUNET_CRYPTO_ecdsa_key_get_anonymous(void);
1322 * @param cfg_name name of the configuration file to use 1340 * @param cfg_name name of the configuration file to use
1323 */ 1341 */
1324void 1342void
1325GNUNET_CRYPTO_eddsa_setup_hostkey(const char *cfg_name); 1343GNUNET_CRYPTO_eddsa_setup_hostkey (const char *cfg_name);
1326 1344
1327 1345
1328/** 1346/**
@@ -1335,8 +1353,8 @@ GNUNET_CRYPTO_eddsa_setup_hostkey(const char *cfg_name);
1335 * could not be retrieved 1353 * could not be retrieved
1336 */ 1354 */
1337int 1355int
1338GNUNET_CRYPTO_get_peer_identity(const struct GNUNET_CONFIGURATION_Handle *cfg, 1356GNUNET_CRYPTO_get_peer_identity (const struct GNUNET_CONFIGURATION_Handle *cfg,
1339 struct GNUNET_PeerIdentity *dst); 1357 struct GNUNET_PeerIdentity *dst);
1340 1358
1341 1359
1342/** 1360/**
@@ -1349,7 +1367,8 @@ struct GNUNET_CRYPTO_EccDlogContext;
1349 * Point on a curve (always for Curve25519) encoded in a format suitable 1367 * Point on a curve (always for Curve25519) encoded in a format suitable
1350 * for network transmission (ECDH), see http://cr.yp.to/ecdh.html. 1368 * for network transmission (ECDH), see http://cr.yp.to/ecdh.html.
1351 */ 1369 */
1352struct GNUNET_CRYPTO_EccPoint { 1370struct GNUNET_CRYPTO_EccPoint
1371{
1353 /** 1372 /**
1354 * Q consists of an x- and a y-value, each mod p (256 bits), given 1373 * Q consists of an x- and a y-value, each mod p (256 bits), given
1355 * here in affine coordinates and Ed25519 standard compact format. 1374 * here in affine coordinates and Ed25519 standard compact format.
@@ -1366,7 +1385,7 @@ struct GNUNET_CRYPTO_EccPoint {
1366 * @return NULL on error 1385 * @return NULL on error
1367 */ 1386 */
1368struct GNUNET_CRYPTO_EccDlogContext * 1387struct GNUNET_CRYPTO_EccDlogContext *
1369GNUNET_CRYPTO_ecc_dlog_prepare(unsigned int max, unsigned int mem); 1388GNUNET_CRYPTO_ecc_dlog_prepare (unsigned int max, unsigned int mem);
1370 1389
1371 1390
1372/** 1391/**
@@ -1378,8 +1397,8 @@ GNUNET_CRYPTO_ecc_dlog_prepare(unsigned int max, unsigned int mem);
1378 * @return INT_MAX if dlog failed, otherwise the factor 1397 * @return INT_MAX if dlog failed, otherwise the factor
1379 */ 1398 */
1380int 1399int
1381GNUNET_CRYPTO_ecc_dlog(struct GNUNET_CRYPTO_EccDlogContext *edc, 1400GNUNET_CRYPTO_ecc_dlog (struct GNUNET_CRYPTO_EccDlogContext *edc,
1382 gcry_mpi_point_t input); 1401 gcry_mpi_point_t input);
1383 1402
1384 1403
1385/** 1404/**
@@ -1396,7 +1415,7 @@ GNUNET_CRYPTO_ecc_dlog(struct GNUNET_CRYPTO_EccDlogContext *edc,
1396 * must be freed using #GNUNET_CRYPTO_ecc_free() 1415 * must be freed using #GNUNET_CRYPTO_ecc_free()
1397 */ 1416 */
1398gcry_mpi_point_t 1417gcry_mpi_point_t
1399GNUNET_CRYPTO_ecc_dexp(struct GNUNET_CRYPTO_EccDlogContext *edc, int val); 1418GNUNET_CRYPTO_ecc_dexp (struct GNUNET_CRYPTO_EccDlogContext *edc, int val);
1400 1419
1401 1420
1402/** 1421/**
@@ -1409,8 +1428,8 @@ GNUNET_CRYPTO_ecc_dexp(struct GNUNET_CRYPTO_EccDlogContext *edc, int val);
1409 * must be freed using #GNUNET_CRYPTO_ecc_free() 1428 * must be freed using #GNUNET_CRYPTO_ecc_free()
1410 */ 1429 */
1411gcry_mpi_point_t 1430gcry_mpi_point_t
1412GNUNET_CRYPTO_ecc_dexp_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, 1431GNUNET_CRYPTO_ecc_dexp_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
1413 gcry_mpi_t val); 1432 gcry_mpi_t val);
1414 1433
1415 1434
1416/** 1435/**
@@ -1423,9 +1442,9 @@ GNUNET_CRYPTO_ecc_dexp_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc,
1423 * must be freed using #GNUNET_CRYPTO_ecc_free() 1442 * must be freed using #GNUNET_CRYPTO_ecc_free()
1424 */ 1443 */
1425gcry_mpi_point_t 1444gcry_mpi_point_t
1426GNUNET_CRYPTO_ecc_pmul_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, 1445GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
1427 gcry_mpi_point_t p, 1446 gcry_mpi_point_t p,
1428 gcry_mpi_t val); 1447 gcry_mpi_t val);
1429 1448
1430 1449
1431/** 1450/**
@@ -1436,9 +1455,9 @@ GNUNET_CRYPTO_ecc_pmul_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc,
1436 * @param[out] bin binary point representation 1455 * @param[out] bin binary point representation
1437 */ 1456 */
1438void 1457void
1439GNUNET_CRYPTO_ecc_point_to_bin(struct GNUNET_CRYPTO_EccDlogContext *edc, 1458GNUNET_CRYPTO_ecc_point_to_bin (struct GNUNET_CRYPTO_EccDlogContext *edc,
1440 gcry_mpi_point_t point, 1459 gcry_mpi_point_t point,
1441 struct GNUNET_CRYPTO_EccPoint *bin); 1460 struct GNUNET_CRYPTO_EccPoint *bin);
1442 1461
1443 1462
1444/** 1463/**
@@ -1449,8 +1468,8 @@ GNUNET_CRYPTO_ecc_point_to_bin(struct GNUNET_CRYPTO_EccDlogContext *edc,
1449 * @return computational representation 1468 * @return computational representation
1450 */ 1469 */
1451gcry_mpi_point_t 1470gcry_mpi_point_t
1452GNUNET_CRYPTO_ecc_bin_to_point(struct GNUNET_CRYPTO_EccDlogContext *edc, 1471GNUNET_CRYPTO_ecc_bin_to_point (struct GNUNET_CRYPTO_EccDlogContext *edc,
1453 const struct GNUNET_CRYPTO_EccPoint *bin); 1472 const struct GNUNET_CRYPTO_EccPoint *bin);
1454 1473
1455 1474
1456/** 1475/**
@@ -1462,9 +1481,9 @@ GNUNET_CRYPTO_ecc_bin_to_point(struct GNUNET_CRYPTO_EccDlogContext *edc,
1462 * @return @a a + @a b, must be freed using #GNUNET_CRYPTO_ecc_free() 1481 * @return @a a + @a b, must be freed using #GNUNET_CRYPTO_ecc_free()
1463 */ 1482 */
1464gcry_mpi_point_t 1483gcry_mpi_point_t
1465GNUNET_CRYPTO_ecc_add(struct GNUNET_CRYPTO_EccDlogContext *edc, 1484GNUNET_CRYPTO_ecc_add (struct GNUNET_CRYPTO_EccDlogContext *edc,
1466 gcry_mpi_point_t a, 1485 gcry_mpi_point_t a,
1467 gcry_mpi_point_t b); 1486 gcry_mpi_point_t b);
1468 1487
1469 1488
1470/** 1489/**
@@ -1477,9 +1496,9 @@ GNUNET_CRYPTO_ecc_add(struct GNUNET_CRYPTO_EccDlogContext *edc,
1477 * @param[out] r_inv set to the additive inverse of @a r 1496 * @param[out] r_inv set to the additive inverse of @a r
1478 */ 1497 */
1479void 1498void
1480GNUNET_CRYPTO_ecc_rnd(struct GNUNET_CRYPTO_EccDlogContext *edc, 1499GNUNET_CRYPTO_ecc_rnd (struct GNUNET_CRYPTO_EccDlogContext *edc,
1481 gcry_mpi_point_t *r, 1500 gcry_mpi_point_t *r,
1482 gcry_mpi_point_t *r_inv); 1501 gcry_mpi_point_t *r_inv);
1483 1502
1484 1503
1485/** 1504/**
@@ -1491,9 +1510,9 @@ GNUNET_CRYPTO_ecc_rnd(struct GNUNET_CRYPTO_EccDlogContext *edc,
1491 * @param[out] r_inv set to the multiplicative inverse of @a r 1510 * @param[out] r_inv set to the multiplicative inverse of @a r
1492 */ 1511 */
1493void 1512void
1494GNUNET_CRYPTO_ecc_rnd_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc, 1513GNUNET_CRYPTO_ecc_rnd_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
1495 gcry_mpi_t *r, 1514 gcry_mpi_t *r,
1496 gcry_mpi_t *r_inv); 1515 gcry_mpi_t *r_inv);
1497 1516
1498 1517
1499/** 1518/**
@@ -1503,7 +1522,7 @@ GNUNET_CRYPTO_ecc_rnd_mpi(struct GNUNET_CRYPTO_EccDlogContext *edc,
1503 * @return random value mod n. 1522 * @return random value mod n.
1504 */ 1523 */
1505gcry_mpi_t 1524gcry_mpi_t
1506GNUNET_CRYPTO_ecc_random_mod_n(struct GNUNET_CRYPTO_EccDlogContext *edc); 1525GNUNET_CRYPTO_ecc_random_mod_n (struct GNUNET_CRYPTO_EccDlogContext *edc);
1507 1526
1508 1527
1509/** 1528/**
@@ -1512,7 +1531,7 @@ GNUNET_CRYPTO_ecc_random_mod_n(struct GNUNET_CRYPTO_EccDlogContext *edc);
1512 * @param p point to free 1531 * @param p point to free
1513 */ 1532 */
1514void 1533void
1515GNUNET_CRYPTO_ecc_free(gcry_mpi_point_t p); 1534GNUNET_CRYPTO_ecc_free (gcry_mpi_point_t p);
1516 1535
1517 1536
1518/** 1537/**
@@ -1521,7 +1540,7 @@ GNUNET_CRYPTO_ecc_free(gcry_mpi_point_t p);
1521 * @param dlc dlog context 1540 * @param dlc dlog context
1522 */ 1541 */
1523void 1542void
1524GNUNET_CRYPTO_ecc_dlog_release(struct GNUNET_CRYPTO_EccDlogContext *dlc); 1543GNUNET_CRYPTO_ecc_dlog_release (struct GNUNET_CRYPTO_EccDlogContext *dlc);
1525 1544
1526 1545
1527/** 1546/**
@@ -1534,9 +1553,9 @@ GNUNET_CRYPTO_ecc_dlog_release(struct GNUNET_CRYPTO_EccDlogContext *dlc);
1534 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1553 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1535 */ 1554 */
1536int 1555int
1537GNUNET_CRYPTO_ecc_ecdh(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, 1556GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1538 const struct GNUNET_CRYPTO_EcdhePublicKey *pub, 1557 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1539 struct GNUNET_HashCode *key_material); 1558 struct GNUNET_HashCode *key_material);
1540 1559
1541 1560
1542/** 1561/**
@@ -1550,9 +1569,9 @@ GNUNET_CRYPTO_ecc_ecdh(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1550 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1569 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1551 */ 1570 */
1552int 1571int
1553GNUNET_CRYPTO_eddsa_ecdh(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, 1572GNUNET_CRYPTO_eddsa_ecdh (const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1554 const struct GNUNET_CRYPTO_EcdhePublicKey *pub, 1573 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1555 struct GNUNET_HashCode *key_material); 1574 struct GNUNET_HashCode *key_material);
1556 1575
1557/** 1576/**
1558 * @ingroup crypto 1577 * @ingroup crypto
@@ -1565,9 +1584,9 @@ GNUNET_CRYPTO_eddsa_ecdh(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1565 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1584 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1566 */ 1585 */
1567int 1586int
1568GNUNET_CRYPTO_ecdsa_ecdh(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, 1587GNUNET_CRYPTO_ecdsa_ecdh (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1569 const struct GNUNET_CRYPTO_EcdhePublicKey *pub, 1588 const struct GNUNET_CRYPTO_EcdhePublicKey *pub,
1570 struct GNUNET_HashCode *key_material); 1589 struct GNUNET_HashCode *key_material);
1571 1590
1572 1591
1573/** 1592/**
@@ -1581,9 +1600,9 @@ GNUNET_CRYPTO_ecdsa_ecdh(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1581 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1600 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1582 */ 1601 */
1583int 1602int
1584GNUNET_CRYPTO_ecdh_eddsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, 1603GNUNET_CRYPTO_ecdh_eddsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1585 const struct GNUNET_CRYPTO_EddsaPublicKey *pub, 1604 const struct GNUNET_CRYPTO_EddsaPublicKey *pub,
1586 struct GNUNET_HashCode *key_material); 1605 struct GNUNET_HashCode *key_material);
1587 1606
1588/** 1607/**
1589 * @ingroup crypto 1608 * @ingroup crypto
@@ -1596,9 +1615,9 @@ GNUNET_CRYPTO_ecdh_eddsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1596 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1615 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1597 */ 1616 */
1598int 1617int
1599GNUNET_CRYPTO_ecdh_ecdsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, 1618GNUNET_CRYPTO_ecdh_ecdsa (const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1600 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, 1619 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
1601 struct GNUNET_HashCode *key_material); 1620 struct GNUNET_HashCode *key_material);
1602 1621
1603 1622
1604/** 1623/**
@@ -1611,7 +1630,7 @@ GNUNET_CRYPTO_ecdh_ecdsa(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv,
1611 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1630 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1612 */ 1631 */
1613int 1632int
1614GNUNET_CRYPTO_eddsa_sign( 1633GNUNET_CRYPTO_eddsa_sign (
1615 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, 1634 const struct GNUNET_CRYPTO_EddsaPrivateKey *priv,
1616 const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, 1635 const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
1617 struct GNUNET_CRYPTO_EddsaSignature *sig); 1636 struct GNUNET_CRYPTO_EddsaSignature *sig);
@@ -1627,7 +1646,7 @@ GNUNET_CRYPTO_eddsa_sign(
1627 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1646 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1628 */ 1647 */
1629int 1648int
1630GNUNET_CRYPTO_ecdsa_sign( 1649GNUNET_CRYPTO_ecdsa_sign (
1631 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, 1650 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1632 const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, 1651 const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose,
1633 struct GNUNET_CRYPTO_EcdsaSignature *sig); 1652 struct GNUNET_CRYPTO_EcdsaSignature *sig);
@@ -1643,7 +1662,7 @@ GNUNET_CRYPTO_ecdsa_sign(
1643 * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid 1662 * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
1644 */ 1663 */
1645int 1664int
1646GNUNET_CRYPTO_eddsa_verify( 1665GNUNET_CRYPTO_eddsa_verify (
1647 uint32_t purpose, 1666 uint32_t purpose,
1648 const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, 1667 const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
1649 const struct GNUNET_CRYPTO_EddsaSignature *sig, 1668 const struct GNUNET_CRYPTO_EddsaSignature *sig,
@@ -1661,7 +1680,7 @@ GNUNET_CRYPTO_eddsa_verify(
1661 * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid 1680 * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid
1662 */ 1681 */
1663int 1682int
1664GNUNET_CRYPTO_ecdsa_verify( 1683GNUNET_CRYPTO_ecdsa_verify (
1665 uint32_t purpose, 1684 uint32_t purpose,
1666 const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, 1685 const struct GNUNET_CRYPTO_EccSignaturePurpose *validate,
1667 const struct GNUNET_CRYPTO_EcdsaSignature *sig, 1686 const struct GNUNET_CRYPTO_EcdsaSignature *sig,
@@ -1682,7 +1701,7 @@ GNUNET_CRYPTO_ecdsa_verify(
1682 * @return derived private key 1701 * @return derived private key
1683 */ 1702 */
1684struct GNUNET_CRYPTO_EcdsaPrivateKey * 1703struct GNUNET_CRYPTO_EcdsaPrivateKey *
1685GNUNET_CRYPTO_ecdsa_private_key_derive( 1704GNUNET_CRYPTO_ecdsa_private_key_derive (
1686 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, 1705 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv,
1687 const char *label, 1706 const char *label,
1688 const char *context); 1707 const char *context);
@@ -1700,7 +1719,7 @@ GNUNET_CRYPTO_ecdsa_private_key_derive(
1700 * @param result where to write the derived public key 1719 * @param result where to write the derived public key
1701 */ 1720 */
1702void 1721void
1703GNUNET_CRYPTO_ecdsa_public_key_derive( 1722GNUNET_CRYPTO_ecdsa_public_key_derive (
1704 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, 1723 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub,
1705 const char *label, 1724 const char *label,
1706 const char *context, 1725 const char *context,
@@ -1716,7 +1735,7 @@ GNUNET_CRYPTO_ecdsa_public_key_derive(
1716 * @param val value to write to @a buf 1735 * @param val value to write to @a buf
1717 */ 1736 */
1718void 1737void
1719GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val); 1738GNUNET_CRYPTO_mpi_print_unsigned (void *buf, size_t size, gcry_mpi_t val);
1720 1739
1721 1740
1722/** 1741/**
@@ -1729,9 +1748,9 @@ GNUNET_CRYPTO_mpi_print_unsigned(void *buf, size_t size, gcry_mpi_t val);
1729 * @param size number of bytes in @a data 1748 * @param size number of bytes in @a data
1730 */ 1749 */
1731void 1750void
1732GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result, 1751GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result,
1733 const void *data, 1752 const void *data,
1734 size_t size); 1753 size_t size);
1735 1754
1736 1755
1737/** 1756/**
@@ -1741,7 +1760,7 @@ GNUNET_CRYPTO_mpi_scan_unsigned(gcry_mpi_t *result,
1741 * @param[out] private_key Where to store the private key? 1760 * @param[out] private_key Where to store the private key?
1742 */ 1761 */
1743void 1762void
1744GNUNET_CRYPTO_paillier_create( 1763GNUNET_CRYPTO_paillier_create (
1745 struct GNUNET_CRYPTO_PaillierPublicKey *public_key, 1764 struct GNUNET_CRYPTO_PaillierPublicKey *public_key,
1746 struct GNUNET_CRYPTO_PaillierPrivateKey *private_key); 1765 struct GNUNET_CRYPTO_PaillierPrivateKey *private_key);
1747 1766
@@ -1758,7 +1777,7 @@ GNUNET_CRYPTO_paillier_create(
1758 * or -1 if less than one homomorphic operation is possible 1777 * or -1 if less than one homomorphic operation is possible
1759 */ 1778 */
1760int 1779int
1761GNUNET_CRYPTO_paillier_encrypt( 1780GNUNET_CRYPTO_paillier_encrypt (
1762 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, 1781 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key,
1763 const gcry_mpi_t m, 1782 const gcry_mpi_t m,
1764 int desired_ops, 1783 int desired_ops,
@@ -1774,7 +1793,7 @@ GNUNET_CRYPTO_paillier_encrypt(
1774 * @param[out] m Decryption of @a ciphertext with @private_key. 1793 * @param[out] m Decryption of @a ciphertext with @private_key.
1775 */ 1794 */
1776void 1795void
1777GNUNET_CRYPTO_paillier_decrypt( 1796GNUNET_CRYPTO_paillier_decrypt (
1778 const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key, 1797 const struct GNUNET_CRYPTO_PaillierPrivateKey *private_key,
1779 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, 1798 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key,
1780 const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext, 1799 const struct GNUNET_CRYPTO_PaillierCiphertext *ciphertext,
@@ -1795,7 +1814,7 @@ GNUNET_CRYPTO_paillier_decrypt(
1795 * #GNUNET_SYSERR if no more homomorphic operations are remaining. 1814 * #GNUNET_SYSERR if no more homomorphic operations are remaining.
1796 */ 1815 */
1797int 1816int
1798GNUNET_CRYPTO_paillier_hom_add( 1817GNUNET_CRYPTO_paillier_hom_add (
1799 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key, 1818 const struct GNUNET_CRYPTO_PaillierPublicKey *public_key,
1800 const struct GNUNET_CRYPTO_PaillierCiphertext *c1, 1819 const struct GNUNET_CRYPTO_PaillierCiphertext *c1,
1801 const struct GNUNET_CRYPTO_PaillierCiphertext *c2, 1820 const struct GNUNET_CRYPTO_PaillierCiphertext *c2,
@@ -1809,7 +1828,7 @@ GNUNET_CRYPTO_paillier_hom_add(
1809 * @return the number of remaining homomorphic operations 1828 * @return the number of remaining homomorphic operations
1810 */ 1829 */
1811int 1830int
1812GNUNET_CRYPTO_paillier_hom_get_remaining( 1831GNUNET_CRYPTO_paillier_hom_get_remaining (
1813 const struct GNUNET_CRYPTO_PaillierCiphertext *c); 1832 const struct GNUNET_CRYPTO_PaillierCiphertext *c);
1814 1833
1815 1834
@@ -1829,7 +1848,8 @@ struct GNUNET_CRYPTO_RsaPublicKey;
1829/** 1848/**
1830 * Constant-size pre-secret for blinding key generation. 1849 * Constant-size pre-secret for blinding key generation.
1831 */ 1850 */
1832struct GNUNET_CRYPTO_RsaBlindingKeySecret { 1851struct GNUNET_CRYPTO_RsaBlindingKeySecret
1852{
1833 /** 1853 /**
1834 * Bits used to generate the blinding key. 256 bits 1854 * Bits used to generate the blinding key. 256 bits
1835 * of entropy is enough. 1855 * of entropy is enough.
@@ -1850,7 +1870,7 @@ struct GNUNET_CRYPTO_RsaSignature;
1850 * @return fresh private key 1870 * @return fresh private key
1851 */ 1871 */
1852struct GNUNET_CRYPTO_RsaPrivateKey * 1872struct GNUNET_CRYPTO_RsaPrivateKey *
1853GNUNET_CRYPTO_rsa_private_key_create(unsigned int len); 1873GNUNET_CRYPTO_rsa_private_key_create (unsigned int len);
1854 1874
1855 1875
1856/** 1876/**
@@ -1859,7 +1879,7 @@ GNUNET_CRYPTO_rsa_private_key_create(unsigned int len);
1859 * @param key pointer to the memory to free 1879 * @param key pointer to the memory to free
1860 */ 1880 */
1861void 1881void
1862GNUNET_CRYPTO_rsa_private_key_free(struct GNUNET_CRYPTO_RsaPrivateKey *key); 1882GNUNET_CRYPTO_rsa_private_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *key);
1863 1883
1864 1884
1865/** 1885/**
@@ -1871,7 +1891,7 @@ GNUNET_CRYPTO_rsa_private_key_free(struct GNUNET_CRYPTO_RsaPrivateKey *key);
1871 * @return size of memory allocatedin @a buffer 1891 * @return size of memory allocatedin @a buffer
1872 */ 1892 */
1873size_t 1893size_t
1874GNUNET_CRYPTO_rsa_private_key_encode( 1894GNUNET_CRYPTO_rsa_private_key_encode (
1875 const struct GNUNET_CRYPTO_RsaPrivateKey *key, 1895 const struct GNUNET_CRYPTO_RsaPrivateKey *key,
1876 char **buffer); 1896 char **buffer);
1877 1897
@@ -1885,7 +1905,7 @@ GNUNET_CRYPTO_rsa_private_key_encode(
1885 * @return NULL on error 1905 * @return NULL on error
1886 */ 1906 */
1887struct GNUNET_CRYPTO_RsaPrivateKey * 1907struct GNUNET_CRYPTO_RsaPrivateKey *
1888GNUNET_CRYPTO_rsa_private_key_decode(const char *buf, size_t len); 1908GNUNET_CRYPTO_rsa_private_key_decode (const char *buf, size_t len);
1889 1909
1890 1910
1891/** 1911/**
@@ -1895,7 +1915,7 @@ GNUNET_CRYPTO_rsa_private_key_decode(const char *buf, size_t len);
1895 * @return the duplicate key; NULL upon error 1915 * @return the duplicate key; NULL upon error
1896 */ 1916 */
1897struct GNUNET_CRYPTO_RsaPrivateKey * 1917struct GNUNET_CRYPTO_RsaPrivateKey *
1898GNUNET_CRYPTO_rsa_private_key_dup( 1918GNUNET_CRYPTO_rsa_private_key_dup (
1899 const struct GNUNET_CRYPTO_RsaPrivateKey *key); 1919 const struct GNUNET_CRYPTO_RsaPrivateKey *key);
1900 1920
1901 1921
@@ -1906,7 +1926,7 @@ GNUNET_CRYPTO_rsa_private_key_dup(
1906 * @retur NULL on error, otherwise the public key 1926 * @retur NULL on error, otherwise the public key
1907 */ 1927 */
1908struct GNUNET_CRYPTO_RsaPublicKey * 1928struct GNUNET_CRYPTO_RsaPublicKey *
1909GNUNET_CRYPTO_rsa_private_key_get_public( 1929GNUNET_CRYPTO_rsa_private_key_get_public (
1910 const struct GNUNET_CRYPTO_RsaPrivateKey *priv); 1930 const struct GNUNET_CRYPTO_RsaPrivateKey *priv);
1911 1931
1912 1932
@@ -1917,8 +1937,8 @@ GNUNET_CRYPTO_rsa_private_key_get_public(
1917 * @param hc where to store the hash code 1937 * @param hc where to store the hash code
1918 */ 1938 */
1919void 1939void
1920GNUNET_CRYPTO_rsa_public_key_hash(const struct GNUNET_CRYPTO_RsaPublicKey *key, 1940GNUNET_CRYPTO_rsa_public_key_hash (const struct GNUNET_CRYPTO_RsaPublicKey *key,
1921 struct GNUNET_HashCode *hc); 1941 struct GNUNET_HashCode *hc);
1922 1942
1923 1943
1924/** 1944/**
@@ -1928,7 +1948,7 @@ GNUNET_CRYPTO_rsa_public_key_hash(const struct GNUNET_CRYPTO_RsaPublicKey *key,
1928 * @return length of the key in bits 1948 * @return length of the key in bits
1929 */ 1949 */
1930unsigned int 1950unsigned int
1931GNUNET_CRYPTO_rsa_public_key_len(const struct GNUNET_CRYPTO_RsaPublicKey *key); 1951GNUNET_CRYPTO_rsa_public_key_len (const struct GNUNET_CRYPTO_RsaPublicKey *key);
1932 1952
1933 1953
1934/** 1954/**
@@ -1937,7 +1957,7 @@ GNUNET_CRYPTO_rsa_public_key_len(const struct GNUNET_CRYPTO_RsaPublicKey *key);
1937 * @param key pointer to the memory to free 1957 * @param key pointer to the memory to free
1938 */ 1958 */
1939void 1959void
1940GNUNET_CRYPTO_rsa_public_key_free(struct GNUNET_CRYPTO_RsaPublicKey *key); 1960GNUNET_CRYPTO_rsa_public_key_free (struct GNUNET_CRYPTO_RsaPublicKey *key);
1941 1961
1942 1962
1943/** 1963/**
@@ -1949,7 +1969,7 @@ GNUNET_CRYPTO_rsa_public_key_free(struct GNUNET_CRYPTO_RsaPublicKey *key);
1949 * @return size of memory allocated in @a buffer 1969 * @return size of memory allocated in @a buffer
1950 */ 1970 */
1951size_t 1971size_t
1952GNUNET_CRYPTO_rsa_public_key_encode( 1972GNUNET_CRYPTO_rsa_public_key_encode (
1953 const struct GNUNET_CRYPTO_RsaPublicKey *key, 1973 const struct GNUNET_CRYPTO_RsaPublicKey *key,
1954 char **buffer); 1974 char **buffer);
1955 1975
@@ -1963,7 +1983,7 @@ GNUNET_CRYPTO_rsa_public_key_encode(
1963 * @return NULL on error 1983 * @return NULL on error
1964 */ 1984 */
1965struct GNUNET_CRYPTO_RsaPublicKey * 1985struct GNUNET_CRYPTO_RsaPublicKey *
1966GNUNET_CRYPTO_rsa_public_key_decode(const char *buf, size_t len); 1986GNUNET_CRYPTO_rsa_public_key_decode (const char *buf, size_t len);
1967 1987
1968 1988
1969/** 1989/**
@@ -1973,7 +1993,7 @@ GNUNET_CRYPTO_rsa_public_key_decode(const char *buf, size_t len);
1973 * @return the duplicate key; NULL upon error 1993 * @return the duplicate key; NULL upon error
1974 */ 1994 */
1975struct GNUNET_CRYPTO_RsaPublicKey * 1995struct GNUNET_CRYPTO_RsaPublicKey *
1976GNUNET_CRYPTO_rsa_public_key_dup(const struct GNUNET_CRYPTO_RsaPublicKey *key); 1996GNUNET_CRYPTO_rsa_public_key_dup (const struct GNUNET_CRYPTO_RsaPublicKey *key);
1977 1997
1978 1998
1979/** 1999/**
@@ -1984,8 +2004,8 @@ GNUNET_CRYPTO_rsa_public_key_dup(const struct GNUNET_CRYPTO_RsaPublicKey *key);
1984 * @return 0 if the two are equal 2004 * @return 0 if the two are equal
1985 */ 2005 */
1986int 2006int
1987GNUNET_CRYPTO_rsa_signature_cmp(struct GNUNET_CRYPTO_RsaSignature *s1, 2007GNUNET_CRYPTO_rsa_signature_cmp (struct GNUNET_CRYPTO_RsaSignature *s1,
1988 struct GNUNET_CRYPTO_RsaSignature *s2); 2008 struct GNUNET_CRYPTO_RsaSignature *s2);
1989 2009
1990/** 2010/**
1991 * Compare the values of two private keys. 2011 * Compare the values of two private keys.
@@ -1995,8 +2015,8 @@ GNUNET_CRYPTO_rsa_signature_cmp(struct GNUNET_CRYPTO_RsaSignature *s1,
1995 * @return 0 if the two are equal 2015 * @return 0 if the two are equal
1996 */ 2016 */
1997int 2017int
1998GNUNET_CRYPTO_rsa_private_key_cmp(struct GNUNET_CRYPTO_RsaPrivateKey *p1, 2018GNUNET_CRYPTO_rsa_private_key_cmp (struct GNUNET_CRYPTO_RsaPrivateKey *p1,
1999 struct GNUNET_CRYPTO_RsaPrivateKey *p2); 2019 struct GNUNET_CRYPTO_RsaPrivateKey *p2);
2000 2020
2001 2021
2002/** 2022/**
@@ -2007,8 +2027,8 @@ GNUNET_CRYPTO_rsa_private_key_cmp(struct GNUNET_CRYPTO_RsaPrivateKey *p1,
2007 * @return 0 if the two are equal 2027 * @return 0 if the two are equal
2008 */ 2028 */
2009int 2029int
2010GNUNET_CRYPTO_rsa_public_key_cmp(struct GNUNET_CRYPTO_RsaPublicKey *p1, 2030GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_RsaPublicKey *p1,
2011 struct GNUNET_CRYPTO_RsaPublicKey *p2); 2031 struct GNUNET_CRYPTO_RsaPublicKey *p2);
2012 2032
2013 2033
2014/** 2034/**
@@ -2022,11 +2042,11 @@ GNUNET_CRYPTO_rsa_public_key_cmp(struct GNUNET_CRYPTO_RsaPublicKey *p1,
2022 * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious 2042 * @return #GNUNET_YES if successful, #GNUNET_NO if RSA key is malicious
2023 */ 2043 */
2024int 2044int
2025GNUNET_CRYPTO_rsa_blind(const struct GNUNET_HashCode *hash, 2045GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash,
2026 const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, 2046 const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks,
2027 struct GNUNET_CRYPTO_RsaPublicKey *pkey, 2047 struct GNUNET_CRYPTO_RsaPublicKey *pkey,
2028 char **buf, 2048 char **buf,
2029 size_t *buf_size); 2049 size_t *buf_size);
2030 2050
2031 2051
2032/** 2052/**
@@ -2038,9 +2058,9 @@ GNUNET_CRYPTO_rsa_blind(const struct GNUNET_HashCode *hash,
2038 * @return NULL on error, signature on success 2058 * @return NULL on error, signature on success
2039 */ 2059 */
2040struct GNUNET_CRYPTO_RsaSignature * 2060struct GNUNET_CRYPTO_RsaSignature *
2041GNUNET_CRYPTO_rsa_sign_blinded(const struct GNUNET_CRYPTO_RsaPrivateKey *key, 2061GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
2042 const void *msg, 2062 const void *msg,
2043 size_t msg_len); 2063 size_t msg_len);
2044 2064
2045 2065
2046/** 2066/**
@@ -2051,8 +2071,8 @@ GNUNET_CRYPTO_rsa_sign_blinded(const struct GNUNET_CRYPTO_RsaPrivateKey *key,
2051 * @return NULL on error, including a malicious RSA key, signature on success 2071 * @return NULL on error, including a malicious RSA key, signature on success
2052 */ 2072 */
2053struct GNUNET_CRYPTO_RsaSignature * 2073struct GNUNET_CRYPTO_RsaSignature *
2054GNUNET_CRYPTO_rsa_sign_fdh(const struct GNUNET_CRYPTO_RsaPrivateKey *key, 2074GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
2055 const struct GNUNET_HashCode *hash); 2075 const struct GNUNET_HashCode *hash);
2056 2076
2057 2077
2058/** 2078/**
@@ -2061,7 +2081,7 @@ GNUNET_CRYPTO_rsa_sign_fdh(const struct GNUNET_CRYPTO_RsaPrivateKey *key,
2061 * @param sig memory to free 2081 * @param sig memory to free
2062 */ 2082 */
2063void 2083void
2064GNUNET_CRYPTO_rsa_signature_free(struct GNUNET_CRYPTO_RsaSignature *sig); 2084GNUNET_CRYPTO_rsa_signature_free (struct GNUNET_CRYPTO_RsaSignature *sig);
2065 2085
2066 2086
2067/** 2087/**
@@ -2072,7 +2092,7 @@ GNUNET_CRYPTO_rsa_signature_free(struct GNUNET_CRYPTO_RsaSignature *sig);
2072 * @return size of memory allocated in @a buffer 2092 * @return size of memory allocated in @a buffer
2073 */ 2093 */
2074size_t 2094size_t
2075GNUNET_CRYPTO_rsa_signature_encode( 2095GNUNET_CRYPTO_rsa_signature_encode (
2076 const struct GNUNET_CRYPTO_RsaSignature *sig, 2096 const struct GNUNET_CRYPTO_RsaSignature *sig,
2077 char **buffer); 2097 char **buffer);
2078 2098
@@ -2086,7 +2106,7 @@ GNUNET_CRYPTO_rsa_signature_encode(
2086 * @return NULL on error 2106 * @return NULL on error
2087 */ 2107 */
2088struct GNUNET_CRYPTO_RsaSignature * 2108struct GNUNET_CRYPTO_RsaSignature *
2089GNUNET_CRYPTO_rsa_signature_decode(const char *buf, size_t len); 2109GNUNET_CRYPTO_rsa_signature_decode (const char *buf, size_t len);
2090 2110
2091 2111
2092/** 2112/**
@@ -2096,7 +2116,7 @@ GNUNET_CRYPTO_rsa_signature_decode(const char *buf, size_t len);
2096 * @return the duplicate key; NULL upon error 2116 * @return the duplicate key; NULL upon error
2097 */ 2117 */
2098struct GNUNET_CRYPTO_RsaSignature * 2118struct GNUNET_CRYPTO_RsaSignature *
2099GNUNET_CRYPTO_rsa_signature_dup(const struct GNUNET_CRYPTO_RsaSignature *sig); 2119GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig);
2100 2120
2101 2121
2102/** 2122/**
@@ -2110,9 +2130,9 @@ GNUNET_CRYPTO_rsa_signature_dup(const struct GNUNET_CRYPTO_RsaSignature *sig);
2110 * @return unblinded signature on success, NULL if RSA key is bad or malicious. 2130 * @return unblinded signature on success, NULL if RSA key is bad or malicious.
2111 */ 2131 */
2112struct GNUNET_CRYPTO_RsaSignature * 2132struct GNUNET_CRYPTO_RsaSignature *
2113GNUNET_CRYPTO_rsa_unblind(const struct GNUNET_CRYPTO_RsaSignature *sig, 2133GNUNET_CRYPTO_rsa_unblind (const struct GNUNET_CRYPTO_RsaSignature *sig,
2114 const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, 2134 const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks,
2115 struct GNUNET_CRYPTO_RsaPublicKey *pkey); 2135 struct GNUNET_CRYPTO_RsaPublicKey *pkey);
2116 2136
2117 2137
2118/** 2138/**
@@ -2125,9 +2145,9 @@ GNUNET_CRYPTO_rsa_unblind(const struct GNUNET_CRYPTO_RsaSignature *sig,
2125 * @returns #GNUNET_YES if ok, #GNUNET_NO if RSA key is malicious, #GNUNET_SYSERR if signature 2145 * @returns #GNUNET_YES if ok, #GNUNET_NO if RSA key is malicious, #GNUNET_SYSERR if signature
2126 */ 2146 */
2127int 2147int
2128GNUNET_CRYPTO_rsa_verify(const struct GNUNET_HashCode *hash, 2148GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash,
2129 const struct GNUNET_CRYPTO_RsaSignature *sig, 2149 const struct GNUNET_CRYPTO_RsaSignature *sig,
2130 const struct GNUNET_CRYPTO_RsaPublicKey *public_key); 2150 const struct GNUNET_CRYPTO_RsaPublicKey *public_key);
2131 2151
2132 2152
2133#if 0 /* keep Emacsens' auto-indent happy */ 2153#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h
index af0e929a5..64b41ed83 100644
--- a/src/include/gnunet_curl_lib.h
+++ b/src/include/gnunet_curl_lib.h
@@ -54,7 +54,8 @@ typedef void
54 * @brief Buffer data structure we use to buffer the HTTP download 54 * @brief Buffer data structure we use to buffer the HTTP download
55 * before giving it to the JSON parser. 55 * before giving it to the JSON parser.
56 */ 56 */
57struct GNUNET_CURL_DownloadBuffer { 57struct GNUNET_CURL_DownloadBuffer
58{
58 /** 59 /**
59 * Download buffer 60 * Download buffer
60 */ 61 */
@@ -103,8 +104,8 @@ typedef void
103 * @return library context 104 * @return library context
104 */ 105 */
105struct GNUNET_CURL_Context * 106struct GNUNET_CURL_Context *
106GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb, 107GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
107 void *cb_cls); 108 void *cb_cls);
108 109
109 110
110/** 111/**
@@ -134,12 +135,12 @@ GNUNET_CURL_init(GNUNET_CURL_RescheduleCallback cb,
134 * proceed immediately with #GNUNET_CURL_perform(). 135 * proceed immediately with #GNUNET_CURL_perform().
135 */ 136 */
136void 137void
137GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx, 138GNUNET_CURL_get_select_info (struct GNUNET_CURL_Context *ctx,
138 fd_set *read_fd_set, 139 fd_set *read_fd_set,
139 fd_set *write_fd_set, 140 fd_set *write_fd_set,
140 fd_set *except_fd_set, 141 fd_set *except_fd_set,
141 int *max_fd, 142 int *max_fd,
142 long *timeout); 143 long *timeout);
143 144
144 145
145/** 146/**
@@ -150,8 +151,8 @@ GNUNET_CURL_get_select_info(struct GNUNET_CURL_Context *ctx,
150 * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise. 151 * @return #GNUNET_OK if no errors occurred, #GNUNET_SYSERR otherwise.
151 */ 152 */
152int 153int
153GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx, 154GNUNET_CURL_append_header (struct GNUNET_CURL_Context *ctx,
154 const char *header); 155 const char *header);
155 156
156/** 157/**
157 * Run the main event loop for the CURL interaction. 158 * Run the main event loop for the CURL interaction.
@@ -159,7 +160,7 @@ GNUNET_CURL_append_header(struct GNUNET_CURL_Context *ctx,
159 * @param ctx the library context 160 * @param ctx the library context
160 */ 161 */
161void 162void
162GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx); 163GNUNET_CURL_perform (struct GNUNET_CURL_Context *ctx);
163 164
164 165
165/** 166/**
@@ -171,9 +172,9 @@ GNUNET_CURL_perform(struct GNUNET_CURL_Context *ctx);
171 * @param rc cleans/frees the response 172 * @param rc cleans/frees the response
172 */ 173 */
173void 174void
174GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx, 175GNUNET_CURL_perform2 (struct GNUNET_CURL_Context *ctx,
175 GNUNET_CURL_RawParser rp, 176 GNUNET_CURL_RawParser rp,
176 GNUNET_CURL_ResponseCleaner rc); 177 GNUNET_CURL_ResponseCleaner rc);
177 178
178/** 179/**
179 * Cleanup library initialisation resources. This function should be called 180 * Cleanup library initialisation resources. This function should be called
@@ -183,7 +184,7 @@ GNUNET_CURL_perform2(struct GNUNET_CURL_Context *ctx,
183 * @param ctx the library context 184 * @param ctx the library context
184 */ 185 */
185void 186void
186GNUNET_CURL_fini(struct GNUNET_CURL_Context *ctx); 187GNUNET_CURL_fini (struct GNUNET_CURL_Context *ctx);
187 188
188 189
189/** 190/**
@@ -221,11 +222,11 @@ typedef void
221 * @return NULL on error (in this case, @eh is still released!) 222 * @return NULL on error (in this case, @eh is still released!)
222 */ 223 */
223struct GNUNET_CURL_Job * 224struct GNUNET_CURL_Job *
224GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx, 225GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx,
225 CURL *eh, 226 CURL *eh,
226 int add_json, 227 int add_json,
227 GNUNET_CURL_JobCompletionCallback jcc, 228 GNUNET_CURL_JobCompletionCallback jcc,
228 void *jcc_cls); 229 void *jcc_cls);
229 230
230 231
231/** 232/**
@@ -245,11 +246,11 @@ GNUNET_CURL_job_add(struct GNUNET_CURL_Context *ctx,
245 * @return NULL on error (in this case, @eh is still released!) 246 * @return NULL on error (in this case, @eh is still released!)
246 */ 247 */
247struct GNUNET_CURL_Job * 248struct GNUNET_CURL_Job *
248GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx, 249GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx,
249 CURL *eh, 250 CURL *eh,
250 const struct curl_slist *job_headers, 251 const struct curl_slist *job_headers,
251 GNUNET_CURL_JobCompletionCallback jcc, 252 GNUNET_CURL_JobCompletionCallback jcc,
252 void *jcc_cls); 253 void *jcc_cls);
253 254
254 255
255/** 256/**
@@ -259,7 +260,7 @@ GNUNET_CURL_job_add2(struct GNUNET_CURL_Context *ctx,
259 * @param job job to cancel 260 * @param job job to cancel
260 */ 261 */
261void 262void
262GNUNET_CURL_job_cancel(struct GNUNET_CURL_Job *job); 263GNUNET_CURL_job_cancel (struct GNUNET_CURL_Job *job);
263 264
264 265
265/* ******* GNUnet SCHEDULER integration ************ */ 266/* ******* GNUnet SCHEDULER integration ************ */
@@ -278,7 +279,7 @@ struct GNUNET_CURL_RescheduleContext;
278 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). 279 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
279 */ 280 */
280struct GNUNET_CURL_RescheduleContext * 281struct GNUNET_CURL_RescheduleContext *
281GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx); 282GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx);
282 283
283/** 284/**
284 * Initialize reschedule context; with custom response parser 285 * Initialize reschedule context; with custom response parser
@@ -287,9 +288,9 @@ GNUNET_CURL_gnunet_rc_create(struct GNUNET_CURL_Context *ctx);
287 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule(). 288 * @return closure for #GNUNET_CURL_gnunet_scheduler_reschedule().
288 */ 289 */
289struct GNUNET_CURL_RescheduleContext * 290struct GNUNET_CURL_RescheduleContext *
290GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx, 291GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx,
291 GNUNET_CURL_RawParser rp, 292 GNUNET_CURL_RawParser rp,
292 GNUNET_CURL_ResponseCleaner rc); 293 GNUNET_CURL_ResponseCleaner rc);
293 294
294 295
295/** 296/**
@@ -298,7 +299,7 @@ GNUNET_CURL_gnunet_rc_create_with_parser(struct GNUNET_CURL_Context *ctx,
298 * @param rc context to destroy 299 * @param rc context to destroy
299 */ 300 */
300void 301void
301GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc); 302GNUNET_CURL_gnunet_rc_destroy (struct GNUNET_CURL_RescheduleContext *rc);
302 303
303 304
304/** 305/**
@@ -311,7 +312,7 @@ GNUNET_CURL_gnunet_rc_destroy(struct GNUNET_CURL_RescheduleContext *rc);
311 * (pointer to a pointer!) 312 * (pointer to a pointer!)
312 */ 313 */
313void 314void
314GNUNET_CURL_gnunet_scheduler_reschedule(void *cls); 315GNUNET_CURL_gnunet_scheduler_reschedule (void *cls);
315 316
316 317
317/** 318/**
@@ -321,7 +322,8 @@ GNUNET_CURL_gnunet_scheduler_reschedule(void *cls);
321 * @param header_name name of the header to send. 322 * @param header_name name of the header to send.
322 */ 323 */
323void 324void
324GNUNET_CURL_enable_async_scope_header(struct GNUNET_CURL_Context *ctx, const char *header_name); 325GNUNET_CURL_enable_async_scope_header (struct GNUNET_CURL_Context *ctx, const
326 char *header_name);
325 327
326 328
327#endif 329#endif
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h
index 19de3ceea..40885803b 100644
--- a/src/include/gnunet_datacache_lib.h
+++ b/src/include/gnunet_datacache_lib.h
@@ -63,8 +63,8 @@ struct GNUNET_DATACACHE_Handle;
63 * @return handle to use to access the service 63 * @return handle to use to access the service
64 */ 64 */
65struct GNUNET_DATACACHE_Handle * 65struct GNUNET_DATACACHE_Handle *
66GNUNET_DATACACHE_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 66GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
67 const char *section); 67 const char *section);
68 68
69 69
70/** 70/**
@@ -73,7 +73,7 @@ GNUNET_DATACACHE_create(const struct GNUNET_CONFIGURATION_Handle *cfg,
73 * @param h handle to the datastore 73 * @param h handle to the datastore
74 */ 74 */
75void 75void
76GNUNET_DATACACHE_destroy(struct GNUNET_DATACACHE_Handle *h); 76GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h);
77 77
78 78
79/** 79/**
@@ -115,15 +115,15 @@ typedef int
115 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error, #GNUNET_NO if duplicate 115 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error, #GNUNET_NO if duplicate
116 */ 116 */
117int 117int
118GNUNET_DATACACHE_put(struct GNUNET_DATACACHE_Handle *h, 118GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
119 const struct GNUNET_HashCode *key, 119 const struct GNUNET_HashCode *key,
120 uint32_t xor_distance, 120 uint32_t xor_distance,
121 size_t data_size, 121 size_t data_size,
122 const char *data, 122 const char *data,
123 enum GNUNET_BLOCK_Type type, 123 enum GNUNET_BLOCK_Type type,
124 struct GNUNET_TIME_Absolute discard_time, 124 struct GNUNET_TIME_Absolute discard_time,
125 unsigned int path_info_len, 125 unsigned int path_info_len,
126 const struct GNUNET_PeerIdentity *path_info); 126 const struct GNUNET_PeerIdentity *path_info);
127 127
128 128
129/** 129/**
@@ -138,11 +138,11 @@ GNUNET_DATACACHE_put(struct GNUNET_DATACACHE_Handle *h,
138 * @return the number of results found 138 * @return the number of results found
139 */ 139 */
140unsigned int 140unsigned int
141GNUNET_DATACACHE_get(struct GNUNET_DATACACHE_Handle *h, 141GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
142 const struct GNUNET_HashCode *key, 142 const struct GNUNET_HashCode *key,
143 enum GNUNET_BLOCK_Type type, 143 enum GNUNET_BLOCK_Type type,
144 GNUNET_DATACACHE_Iterator iter, 144 GNUNET_DATACACHE_Iterator iter,
145 void *iter_cls); 145 void *iter_cls);
146 146
147 147
148/** 148/**
@@ -154,9 +154,9 @@ GNUNET_DATACACHE_get(struct GNUNET_DATACACHE_Handle *h,
154 * @return the number of results found (zero or 1) 154 * @return the number of results found (zero or 1)
155 */ 155 */
156unsigned int 156unsigned int
157GNUNET_DATACACHE_get_random(struct GNUNET_DATACACHE_Handle *h, 157GNUNET_DATACACHE_get_random (struct GNUNET_DATACACHE_Handle *h,
158 GNUNET_DATACACHE_Iterator iter, 158 GNUNET_DATACACHE_Iterator iter,
159 void *iter_cls); 159 void *iter_cls);
160 160
161 161
162/** 162/**
@@ -173,11 +173,11 @@ GNUNET_DATACACHE_get_random(struct GNUNET_DATACACHE_Handle *h,
173 * @return the number of results found 173 * @return the number of results found
174 */ 174 */
175unsigned int 175unsigned int
176GNUNET_DATACACHE_get_closest(struct GNUNET_DATACACHE_Handle *h, 176GNUNET_DATACACHE_get_closest (struct GNUNET_DATACACHE_Handle *h,
177 const struct GNUNET_HashCode *key, 177 const struct GNUNET_HashCode *key,
178 unsigned int num_results, 178 unsigned int num_results,
179 GNUNET_DATACACHE_Iterator iter, 179 GNUNET_DATACACHE_Iterator iter,
180 void *iter_cls); 180 void *iter_cls);
181 181
182 182
183#if 0 /* keep Emacsens' auto-indent happy */ 183#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h
index b4e6dbe8e..d7fa8fde0 100644
--- a/src/include/gnunet_datacache_plugin.h
+++ b/src/include/gnunet_datacache_plugin.h
@@ -61,7 +61,8 @@ typedef void
61 * of this type as the first and only argument to the 61 * of this type as the first and only argument to the
62 * entry point of each datastore plugin. 62 * entry point of each datastore plugin.
63 */ 63 */
64struct GNUNET_DATACACHE_PluginEnvironment { 64struct GNUNET_DATACACHE_PluginEnvironment
65{
65 /** 66 /**
66 * Configuration to use. 67 * Configuration to use.
67 */ 68 */
@@ -93,7 +94,8 @@ struct GNUNET_DATACACHE_PluginEnvironment {
93/** 94/**
94 * @brief struct returned by the initialization function of the plugin 95 * @brief struct returned by the initialization function of the plugin
95 */ 96 */
96struct GNUNET_DATACACHE_PluginFunctions { 97struct GNUNET_DATACACHE_PluginFunctions
98{
97 /** 99 /**
98 * Closure to pass to all plugin functions. 100 * Closure to pass to all plugin functions.
99 */ 101 */
diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h
index 95b12f7ad..113f6b2f2 100644
--- a/src/include/gnunet_datastore_plugin.h
+++ b/src/include/gnunet_datastore_plugin.h
@@ -63,7 +63,8 @@ typedef void
63 * of this type as the first and only argument to the 63 * of this type as the first and only argument to the
64 * entry point of each datastore plugin. 64 * entry point of each datastore plugin.
65 */ 65 */
66struct GNUNET_DATASTORE_PluginEnvironment { 66struct GNUNET_DATASTORE_PluginEnvironment
67{
67 /** 68 /**
68 * Configuration to use. 69 * Configuration to use.
69 */ 70 */
@@ -311,7 +312,8 @@ typedef void
311 * Each plugin is required to return a pointer to a struct of this 312 * Each plugin is required to return a pointer to a struct of this
312 * type as the return value from its entry point. 313 * type as the return value from its entry point.
313 */ 314 */
314struct GNUNET_DATASTORE_PluginFunctions { 315struct GNUNET_DATASTORE_PluginFunctions
316{
315 /** 317 /**
316 * Closure to use for all of the following callbacks 318 * Closure to use for all of the following callbacks
317 * (except "next_request"). 319 * (except "next_request").
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h
index e4cd4a915..57b813225 100644
--- a/src/include/gnunet_datastore_service.h
+++ b/src/include/gnunet_datastore_service.h
@@ -72,7 +72,7 @@ struct GNUNET_DATASTORE_Handle;
72 * @return handle to use to access the service 72 * @return handle to use to access the service
73 */ 73 */
74struct GNUNET_DATASTORE_Handle * 74struct GNUNET_DATASTORE_Handle *
75GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 75GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
76 76
77 77
78/** 78/**
@@ -83,8 +83,8 @@ GNUNET_DATASTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
83 * @param drop set to #GNUNET_YES to delete all data in datastore (!) 83 * @param drop set to #GNUNET_YES to delete all data in datastore (!)
84 */ 84 */
85void 85void
86GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h, 86GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
87 int drop); 87 int drop);
88 88
89 89
90/** 90/**
@@ -103,7 +103,8 @@ GNUNET_DATASTORE_disconnect(struct GNUNET_DATASTORE_Handle *h,
103typedef void 103typedef void
104(*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, 104(*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls,
105 int32_t success, 105 int32_t success,
106 struct GNUNET_TIME_Absolute min_expiration, 106 struct GNUNET_TIME_Absolute
107 min_expiration,
107 const char *msg); 108 const char *msg);
108 109
109 110
@@ -123,11 +124,11 @@ typedef void
123 * (or rather, will already have been invoked) 124 * (or rather, will already have been invoked)
124 */ 125 */
125struct GNUNET_DATASTORE_QueueEntry * 126struct GNUNET_DATASTORE_QueueEntry *
126GNUNET_DATASTORE_reserve(struct GNUNET_DATASTORE_Handle *h, 127GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h,
127 uint64_t amount, 128 uint64_t amount,
128 uint32_t entries, 129 uint32_t entries,
129 GNUNET_DATASTORE_ContinuationWithStatus cont, 130 GNUNET_DATASTORE_ContinuationWithStatus cont,
130 void *cont_cls); 131 void *cont_cls);
131 132
132 133
133/** 134/**
@@ -156,20 +157,20 @@ GNUNET_DATASTORE_reserve(struct GNUNET_DATASTORE_Handle *h,
156 * (or rather, will already have been invoked) 157 * (or rather, will already have been invoked)
157 */ 158 */
158struct GNUNET_DATASTORE_QueueEntry * 159struct GNUNET_DATASTORE_QueueEntry *
159GNUNET_DATASTORE_put(struct GNUNET_DATASTORE_Handle *h, 160GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h,
160 uint32_t rid, 161 uint32_t rid,
161 const struct GNUNET_HashCode *key, 162 const struct GNUNET_HashCode *key,
162 size_t size, 163 size_t size,
163 const void *data, 164 const void *data,
164 enum GNUNET_BLOCK_Type type, 165 enum GNUNET_BLOCK_Type type,
165 uint32_t priority, 166 uint32_t priority,
166 uint32_t anonymity, 167 uint32_t anonymity,
167 uint32_t replication, 168 uint32_t replication,
168 struct GNUNET_TIME_Absolute expiration, 169 struct GNUNET_TIME_Absolute expiration,
169 unsigned int queue_priority, 170 unsigned int queue_priority,
170 unsigned int max_queue_size, 171 unsigned int max_queue_size,
171 GNUNET_DATASTORE_ContinuationWithStatus cont, 172 GNUNET_DATASTORE_ContinuationWithStatus cont,
172 void *cont_cls); 173 void *cont_cls);
173 174
174 175
175/** 176/**
@@ -193,11 +194,11 @@ GNUNET_DATASTORE_put(struct GNUNET_DATASTORE_Handle *h,
193 * (or rather, will already have been invoked) 194 * (or rather, will already have been invoked)
194 */ 195 */
195struct GNUNET_DATASTORE_QueueEntry * 196struct GNUNET_DATASTORE_QueueEntry *
196GNUNET_DATASTORE_release_reserve(struct GNUNET_DATASTORE_Handle *h, 197GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h,
197 uint32_t rid, unsigned int queue_priority, 198 uint32_t rid, unsigned int queue_priority,
198 unsigned int max_queue_size, 199 unsigned int max_queue_size,
199 GNUNET_DATASTORE_ContinuationWithStatus cont, 200 GNUNET_DATASTORE_ContinuationWithStatus cont,
200 void *cont_cls); 201 void *cont_cls);
201 202
202 203
203/** 204/**
@@ -220,14 +221,14 @@ GNUNET_DATASTORE_release_reserve(struct GNUNET_DATASTORE_Handle *h,
220 * (or rather, will already have been invoked) 221 * (or rather, will already have been invoked)
221 */ 222 */
222struct GNUNET_DATASTORE_QueueEntry * 223struct GNUNET_DATASTORE_QueueEntry *
223GNUNET_DATASTORE_remove(struct GNUNET_DATASTORE_Handle *h, 224GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h,
224 const struct GNUNET_HashCode *key, 225 const struct GNUNET_HashCode *key,
225 size_t size, 226 size_t size,
226 const void *data, 227 const void *data,
227 unsigned int queue_priority, 228 unsigned int queue_priority,
228 unsigned int max_queue_size, 229 unsigned int max_queue_size,
229 GNUNET_DATASTORE_ContinuationWithStatus cont, 230 GNUNET_DATASTORE_ContinuationWithStatus cont,
230 void *cont_cls); 231 void *cont_cls);
231 232
232 233
233/** 234/**
@@ -277,15 +278,15 @@ typedef void
277 * cancel 278 * cancel
278 */ 279 */
279struct GNUNET_DATASTORE_QueueEntry * 280struct GNUNET_DATASTORE_QueueEntry *
280GNUNET_DATASTORE_get_key(struct GNUNET_DATASTORE_Handle *h, 281GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h,
281 uint64_t next_uid, 282 uint64_t next_uid,
282 bool random, 283 bool random,
283 const struct GNUNET_HashCode *key, 284 const struct GNUNET_HashCode *key,
284 enum GNUNET_BLOCK_Type type, 285 enum GNUNET_BLOCK_Type type,
285 unsigned int queue_priority, 286 unsigned int queue_priority,
286 unsigned int max_queue_size, 287 unsigned int max_queue_size,
287 GNUNET_DATASTORE_DatumProcessor proc, 288 GNUNET_DATASTORE_DatumProcessor proc,
288 void *proc_cls); 289 void *proc_cls);
289 290
290 291
291/** 292/**
@@ -305,13 +306,13 @@ GNUNET_DATASTORE_get_key(struct GNUNET_DATASTORE_Handle *h,
305 * cancel 306 * cancel
306 */ 307 */
307struct GNUNET_DATASTORE_QueueEntry * 308struct GNUNET_DATASTORE_QueueEntry *
308GNUNET_DATASTORE_get_zero_anonymity(struct GNUNET_DATASTORE_Handle *h, 309GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h,
309 uint64_t next_uid, 310 uint64_t next_uid,
310 unsigned int queue_priority, 311 unsigned int queue_priority,
311 unsigned int max_queue_size, 312 unsigned int max_queue_size,
312 enum GNUNET_BLOCK_Type type, 313 enum GNUNET_BLOCK_Type type,
313 GNUNET_DATASTORE_DatumProcessor proc, 314 GNUNET_DATASTORE_DatumProcessor proc,
314 void *proc_cls); 315 void *proc_cls);
315 316
316 317
317/** 318/**
@@ -333,11 +334,11 @@ GNUNET_DATASTORE_get_zero_anonymity(struct GNUNET_DATASTORE_Handle *h,
333 * cancel 334 * cancel
334 */ 335 */
335struct GNUNET_DATASTORE_QueueEntry * 336struct GNUNET_DATASTORE_QueueEntry *
336GNUNET_DATASTORE_get_for_replication(struct GNUNET_DATASTORE_Handle *h, 337GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h,
337 unsigned int queue_priority, 338 unsigned int queue_priority,
338 unsigned int max_queue_size, 339 unsigned int max_queue_size,
339 GNUNET_DATASTORE_DatumProcessor proc, 340 GNUNET_DATASTORE_DatumProcessor proc,
340 void *proc_cls); 341 void *proc_cls);
341 342
342 343
343 344
@@ -348,7 +349,7 @@ GNUNET_DATASTORE_get_for_replication(struct GNUNET_DATASTORE_Handle *h,
348 * @param qe operation to cancel 349 * @param qe operation to cancel
349 */ 350 */
350void 351void
351GNUNET_DATASTORE_cancel(struct GNUNET_DATASTORE_QueueEntry *qe); 352GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe);
352 353
353 354
354#if 0 /* keep Emacsens' auto-indent happy */ 355#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_db_lib.h b/src/include/gnunet_db_lib.h
index c7568c934..a3cd7684e 100644
--- a/src/include/gnunet_db_lib.h
+++ b/src/include/gnunet_db_lib.h
@@ -31,7 +31,8 @@
31 * Can be combined with a function that returns the number 31 * Can be combined with a function that returns the number
32 * of results, so all non-negative values indicate success. 32 * of results, so all non-negative values indicate success.
33 */ 33 */
34enum GNUNET_DB_QueryStatus { 34enum GNUNET_DB_QueryStatus
35{
35 /** 36 /**
36 * A hard error occurred, retrying will not help. 37 * A hard error occurred, retrying will not help.
37 */ 38 */
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index e22d2b5df..573a800e5 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -51,7 +51,8 @@ extern "C"
51/** 51/**
52 * Default republication frequency for stored data in the DHT. 52 * Default republication frequency for stored data in the DHT.
53 */ 53 */
54#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 60) 54#define GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY GNUNET_TIME_relative_multiply ( \
55 GNUNET_TIME_UNIT_MINUTES, 60)
55 56
56 57
57 58
@@ -74,7 +75,8 @@ struct GNUNET_DHT_FindPeerHandle;
74/** 75/**
75 * Options for routing. 76 * Options for routing.
76 */ 77 */
77enum GNUNET_DHT_RouteOption { 78enum GNUNET_DHT_RouteOption
79{
78 /** 80 /**
79 * Default. Do nothing special. 81 * Default. Do nothing special.
80 */ 82 */
@@ -118,8 +120,8 @@ enum GNUNET_DHT_RouteOption {
118 * @return NULL on error 120 * @return NULL on error
119 */ 121 */
120struct GNUNET_DHT_Handle * 122struct GNUNET_DHT_Handle *
121GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 123GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
122 unsigned int ht_len); 124 unsigned int ht_len);
123 125
124 126
125/** 127/**
@@ -128,7 +130,7 @@ GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
128 * @param handle connection to shut down 130 * @param handle connection to shut down
129 */ 131 */
130void 132void
131GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle); 133GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle);
132 134
133 135
134/* *************** Standard API: get and put ******************* */ 136/* *************** Standard API: get and put ******************* */
@@ -159,16 +161,16 @@ struct GNUNET_DHT_PutHandle;
159 * (size too big) 161 * (size too big)
160 */ 162 */
161struct GNUNET_DHT_PutHandle * 163struct GNUNET_DHT_PutHandle *
162GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle, 164GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
163 const struct GNUNET_HashCode *key, 165 const struct GNUNET_HashCode *key,
164 uint32_t desired_replication_level, 166 uint32_t desired_replication_level,
165 enum GNUNET_DHT_RouteOption options, 167 enum GNUNET_DHT_RouteOption options,
166 enum GNUNET_BLOCK_Type type, 168 enum GNUNET_BLOCK_Type type,
167 size_t size, 169 size_t size,
168 const void *data, 170 const void *data,
169 struct GNUNET_TIME_Absolute exp, 171 struct GNUNET_TIME_Absolute exp,
170 GNUNET_SCHEDULER_TaskCallback cont, 172 GNUNET_SCHEDULER_TaskCallback cont,
171 void *cont_cls); 173 void *cont_cls);
172 174
173 175
174/** 176/**
@@ -183,7 +185,7 @@ GNUNET_DHT_put(struct GNUNET_DHT_Handle *handle,
183 * @param ph put operation to cancel ('cont' will no longer be called) 185 * @param ph put operation to cancel ('cont' will no longer be called)
184 */ 186 */
185void 187void
186GNUNET_DHT_put_cancel(struct GNUNET_DHT_PutHandle *ph); 188GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph);
187 189
188 190
189/** 191/**
@@ -233,15 +235,15 @@ typedef void
233 * @return handle to stop the async get 235 * @return handle to stop the async get
234 */ 236 */
235struct GNUNET_DHT_GetHandle * 237struct GNUNET_DHT_GetHandle *
236GNUNET_DHT_get_start(struct GNUNET_DHT_Handle *handle, 238GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle,
237 enum GNUNET_BLOCK_Type type, 239 enum GNUNET_BLOCK_Type type,
238 const struct GNUNET_HashCode *key, 240 const struct GNUNET_HashCode *key,
239 uint32_t desired_replication_level, 241 uint32_t desired_replication_level,
240 enum GNUNET_DHT_RouteOption options, 242 enum GNUNET_DHT_RouteOption options,
241 const void *xquery, 243 const void *xquery,
242 size_t xquery_size, 244 size_t xquery_size,
243 GNUNET_DHT_GetIterator iter, 245 GNUNET_DHT_GetIterator iter,
244 void *iter_cls); 246 void *iter_cls);
245 247
246 248
247/** 249/**
@@ -255,9 +257,9 @@ GNUNET_DHT_get_start(struct GNUNET_DHT_Handle *handle,
255 * to be blocked 257 * to be blocked
256 */ 258 */
257void 259void
258GNUNET_DHT_get_filter_known_results(struct GNUNET_DHT_GetHandle *get_handle, 260GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle,
259 unsigned int num_results, 261 unsigned int num_results,
260 const struct GNUNET_HashCode *results); 262 const struct GNUNET_HashCode *results);
261 263
262/** 264/**
263 * Stop async DHT-get. Frees associated resources. 265 * Stop async DHT-get. Frees associated resources.
@@ -265,7 +267,7 @@ GNUNET_DHT_get_filter_known_results(struct GNUNET_DHT_GetHandle *get_handle,
265 * @param get_handle GET operation to stop. 267 * @param get_handle GET operation to stop.
266 */ 268 */
267void 269void
268GNUNET_DHT_get_stop(struct GNUNET_DHT_GetHandle *get_handle); 270GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle);
269 271
270 272
271/* *************** Extended API: monitor ******************* */ 273/* *************** Extended API: monitor ******************* */
@@ -368,13 +370,13 @@ typedef void
368 * @return Handle to stop monitoring. 370 * @return Handle to stop monitoring.
369 */ 371 */
370struct GNUNET_DHT_MonitorHandle * 372struct GNUNET_DHT_MonitorHandle *
371GNUNET_DHT_monitor_start(struct GNUNET_DHT_Handle *handle, 373GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle,
372 enum GNUNET_BLOCK_Type type, 374 enum GNUNET_BLOCK_Type type,
373 const struct GNUNET_HashCode *key, 375 const struct GNUNET_HashCode *key,
374 GNUNET_DHT_MonitorGetCB get_cb, 376 GNUNET_DHT_MonitorGetCB get_cb,
375 GNUNET_DHT_MonitorGetRespCB get_resp_cb, 377 GNUNET_DHT_MonitorGetRespCB get_resp_cb,
376 GNUNET_DHT_MonitorPutCB put_cb, 378 GNUNET_DHT_MonitorPutCB put_cb,
377 void *cb_cls); 379 void *cb_cls);
378 380
379 381
380/** 382/**
@@ -385,7 +387,7 @@ GNUNET_DHT_monitor_start(struct GNUNET_DHT_Handle *handle,
385 * #GNUNET_DHT_monitor_start(). 387 * #GNUNET_DHT_monitor_start().
386 */ 388 */
387void 389void
388GNUNET_DHT_monitor_stop(struct GNUNET_DHT_MonitorHandle *handle); 390GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle);
389 391
390 392
391#if 0 /* keep Emacsens' auto-indent happy */ 393#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_dns_service.h b/src/include/gnunet_dns_service.h
index e97429d1d..da2881e5b 100644
--- a/src/include/gnunet_dns_service.h
+++ b/src/include/gnunet_dns_service.h
@@ -49,7 +49,8 @@ struct GNUNET_DNS_RequestHandle;
49/** 49/**
50 * Flags that specify when to call the client's handler. 50 * Flags that specify when to call the client's handler.
51 */ 51 */
52enum GNUNET_DNS_Flags { 52enum GNUNET_DNS_Flags
53{
53 /** 54 /**
54 * Useless option: never call the client. 55 * Useless option: never call the client.
55 */ 56 */
@@ -134,7 +135,7 @@ typedef void
134 * @param rh request that should now be forwarded 135 * @param rh request that should now be forwarded
135 */ 136 */
136void 137void
137GNUNET_DNS_request_forward(struct GNUNET_DNS_RequestHandle *rh); 138GNUNET_DNS_request_forward (struct GNUNET_DNS_RequestHandle *rh);
138 139
139 140
140/** 141/**
@@ -144,7 +145,7 @@ GNUNET_DNS_request_forward(struct GNUNET_DNS_RequestHandle *rh);
144 * @param rh request that should now be dropped 145 * @param rh request that should now be dropped
145 */ 146 */
146void 147void
147GNUNET_DNS_request_drop(struct GNUNET_DNS_RequestHandle *rh); 148GNUNET_DNS_request_drop (struct GNUNET_DNS_RequestHandle *rh);
148 149
149 150
150/** 151/**
@@ -158,9 +159,9 @@ GNUNET_DNS_request_drop(struct GNUNET_DNS_RequestHandle *rh);
158 * @param reply reply data 159 * @param reply reply data
159 */ 160 */
160void 161void
161GNUNET_DNS_request_answer(struct GNUNET_DNS_RequestHandle *rh, 162GNUNET_DNS_request_answer (struct GNUNET_DNS_RequestHandle *rh,
162 uint16_t reply_length, 163 uint16_t reply_length,
163 const char *reply); 164 const char *reply);
164 165
165 166
166/** 167/**
@@ -173,10 +174,10 @@ GNUNET_DNS_request_answer(struct GNUNET_DNS_RequestHandle *rh,
173 * @return DNS handle 174 * @return DNS handle
174 */ 175 */
175struct GNUNET_DNS_Handle * 176struct GNUNET_DNS_Handle *
176GNUNET_DNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 177GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
177 enum GNUNET_DNS_Flags flags, 178 enum GNUNET_DNS_Flags flags,
178 GNUNET_DNS_RequestHandler rh, 179 GNUNET_DNS_RequestHandler rh,
179 void *rh_cls); 180 void *rh_cls);
180 181
181 182
182/** 183/**
@@ -185,7 +186,7 @@ GNUNET_DNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
185 * @param dh DNS handle 186 * @param dh DNS handle
186 */ 187 */
187void 188void
188GNUNET_DNS_disconnect(struct GNUNET_DNS_Handle *dh); 189GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh);
189 190
190 191
191#endif 192#endif
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h
index bf1869b91..cbb53e416 100644
--- a/src/include/gnunet_dnsparser_lib.h
+++ b/src/include/gnunet_dnsparser_lib.h
@@ -92,7 +92,8 @@
92/** 92/**
93 * A DNS query. 93 * A DNS query.
94 */ 94 */
95struct GNUNET_DNSPARSER_Query { 95struct GNUNET_DNSPARSER_Query
96{
96 /** 97 /**
97 * Name of the record that the query is for (0-terminated). 98 * Name of the record that the query is for (0-terminated).
98 * In UTF-8 format. The library will convert from and to DNS-IDNA 99 * In UTF-8 format. The library will convert from and to DNS-IDNA
@@ -117,7 +118,8 @@ struct GNUNET_DNSPARSER_Query {
117/** 118/**
118 * Information from MX records (RFC 1035). 119 * Information from MX records (RFC 1035).
119 */ 120 */
120struct GNUNET_DNSPARSER_MxRecord { 121struct GNUNET_DNSPARSER_MxRecord
122{
121 /** 123 /**
122 * Preference for this entry (lower value is higher preference). 124 * Preference for this entry (lower value is higher preference).
123 */ 125 */
@@ -137,7 +139,8 @@ struct GNUNET_DNSPARSER_MxRecord {
137/** 139/**
138 * Information from SRV records (RFC 2782). 140 * Information from SRV records (RFC 2782).
139 */ 141 */
140struct GNUNET_DNSPARSER_SrvRecord { 142struct GNUNET_DNSPARSER_SrvRecord
143{
141 /** 144 /**
142 * Hostname offering the service. 145 * Hostname offering the service.
143 * In UTF-8 format. The library will convert from and to DNS-IDNA 146 * In UTF-8 format. The library will convert from and to DNS-IDNA
@@ -171,7 +174,8 @@ struct GNUNET_DNSPARSER_SrvRecord {
171/** 174/**
172 * DNS CERT types as defined in RFC 4398. 175 * DNS CERT types as defined in RFC 4398.
173 */ 176 */
174enum GNUNET_DNSPARSER_CertType { 177enum GNUNET_DNSPARSER_CertType
178{
175 /** 179 /**
176 * Reserved value 180 * Reserved value
177 */ 181 */
@@ -223,7 +227,8 @@ enum GNUNET_DNSPARSER_CertType {
223 * DNSCERT algorithms as defined in http://www.iana.org/assignments/ 227 * DNSCERT algorithms as defined in http://www.iana.org/assignments/
224 * dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml, under dns-sec-alg-numbers-1 228 * dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml, under dns-sec-alg-numbers-1
225 */ 229 */
226enum GNUNET_DNSPARSER_CertAlgorithm { 230enum GNUNET_DNSPARSER_CertAlgorithm
231{
227 /** 232 /**
228 * No defined 233 * No defined
229 */ 234 */
@@ -299,7 +304,8 @@ enum GNUNET_DNSPARSER_CertAlgorithm {
299/** 304/**
300 * Information from CERT records (RFC 4034). 305 * Information from CERT records (RFC 4034).
301 */ 306 */
302struct GNUNET_DNSPARSER_CertRecord { 307struct GNUNET_DNSPARSER_CertRecord
308{
303 /** 309 /**
304 * Certificate type 310 * Certificate type
305 */ 311 */
@@ -330,7 +336,8 @@ struct GNUNET_DNSPARSER_CertRecord {
330/** 336/**
331 * Information from SOA records (RFC 1035). 337 * Information from SOA records (RFC 1035).
332 */ 338 */
333struct GNUNET_DNSPARSER_SoaRecord { 339struct GNUNET_DNSPARSER_SoaRecord
340{
334 /** 341 /**
335 * The domainname of the name server that was the 342 * The domainname of the name server that was the
336 * original or primary source of data for this zone. 343 * original or primary source of data for this zone.
@@ -386,7 +393,8 @@ struct GNUNET_DNSPARSER_SoaRecord {
386 * The tag is followed by the tag_len. 393 * The tag is followed by the tag_len.
387 * The value is followed by the tag for (d - tag_len - 2) bytes 394 * The value is followed by the tag for (d - tag_len - 2) bytes
388 */ 395 */
389struct GNUNET_DNSPARSER_CaaRecord { 396struct GNUNET_DNSPARSER_CaaRecord
397{
390 /** 398 /**
391 * The flags of the CAA record. 399 * The flags of the CAA record.
392 */ 400 */
@@ -403,7 +411,8 @@ struct GNUNET_DNSPARSER_CaaRecord {
403/** 411/**
404 * Binary record information (unparsed). 412 * Binary record information (unparsed).
405 */ 413 */
406struct GNUNET_DNSPARSER_RawRecord { 414struct GNUNET_DNSPARSER_RawRecord
415{
407 /** 416 /**
408 * Binary record data. 417 * Binary record data.
409 */ 418 */
@@ -419,7 +428,8 @@ struct GNUNET_DNSPARSER_RawRecord {
419/** 428/**
420 * A DNS response record. 429 * A DNS response record.
421 */ 430 */
422struct GNUNET_DNSPARSER_Record { 431struct GNUNET_DNSPARSER_Record
432{
423 /** 433 /**
424 * Name of the record that the query is for (0-terminated). 434 * Name of the record that the query is for (0-terminated).
425 * In UTF-8 format. The library will convert from and to DNS-IDNA 435 * In UTF-8 format. The library will convert from and to DNS-IDNA
@@ -432,7 +442,8 @@ struct GNUNET_DNSPARSER_Record {
432 /** 442 /**
433 * Payload of the record (which one of these is valid depends on the 'type'). 443 * Payload of the record (which one of these is valid depends on the 'type').
434 */ 444 */
435 union { 445 union
446 {
436 /** 447 /**
437 * For NS, CNAME and PTR records, this is the uncompressed 0-terminated hostname. 448 * For NS, CNAME and PTR records, this is the uncompressed 0-terminated hostname.
438 * In UTF-8 format. The library will convert from and to DNS-IDNA 449 * In UTF-8 format. The library will convert from and to DNS-IDNA
@@ -489,7 +500,8 @@ struct GNUNET_DNSPARSER_Record {
489/** 500/**
490 * Easy-to-process, parsed version of a DNS packet. 501 * Easy-to-process, parsed version of a DNS packet.
491 */ 502 */
492struct GNUNET_DNSPARSER_Packet { 503struct GNUNET_DNSPARSER_Packet
504{
493 /** 505 /**
494 * Array of all queries in the packet, must contain "num_queries" entries. 506 * Array of all queries in the packet, must contain "num_queries" entries.
495 */ 507 */
@@ -551,7 +563,7 @@ struct GNUNET_DNSPARSER_Packet {
551 * #GNUNET_SYSERR if the label is not valid for DNS names 563 * #GNUNET_SYSERR if the label is not valid for DNS names
552 */ 564 */
553int 565int
554GNUNET_DNSPARSER_check_label(const char *label); 566GNUNET_DNSPARSER_check_label (const char *label);
555 567
556 568
557/** 569/**
@@ -564,7 +576,7 @@ GNUNET_DNSPARSER_check_label(const char *label);
564 * #GNUNET_SYSERR if the label is not valid for DNS names 576 * #GNUNET_SYSERR if the label is not valid for DNS names
565 */ 577 */
566int 578int
567GNUNET_DNSPARSER_check_name(const char *name); 579GNUNET_DNSPARSER_check_name (const char *name);
568 580
569 581
570/** 582/**
@@ -576,8 +588,8 @@ GNUNET_DNSPARSER_check_name(const char *name);
576 * @return NULL on error, otherwise the parsed packet 588 * @return NULL on error, otherwise the parsed packet
577 */ 589 */
578struct GNUNET_DNSPARSER_Packet * 590struct GNUNET_DNSPARSER_Packet *
579GNUNET_DNSPARSER_parse(const char *udp_payload, 591GNUNET_DNSPARSER_parse (const char *udp_payload,
580 size_t udp_payload_length); 592 size_t udp_payload_length);
581 593
582 594
583/** 595/**
@@ -586,7 +598,7 @@ GNUNET_DNSPARSER_parse(const char *udp_payload,
586 * @param p packet to free 598 * @param p packet to free
587 */ 599 */
588void 600void
589GNUNET_DNSPARSER_free_packet(struct GNUNET_DNSPARSER_Packet *p); 601GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p);
590 602
591 603
592/** 604/**
@@ -604,10 +616,10 @@ GNUNET_DNSPARSER_free_packet(struct GNUNET_DNSPARSER_Packet *p);
604 * #GNUNET_OK if @a p was packed completely into @a buf 616 * #GNUNET_OK if @a p was packed completely into @a buf
605 */ 617 */
606int 618int
607GNUNET_DNSPARSER_pack(const struct GNUNET_DNSPARSER_Packet *p, 619GNUNET_DNSPARSER_pack (const struct GNUNET_DNSPARSER_Packet *p,
608 uint16_t max, 620 uint16_t max,
609 char **buf, 621 char **buf,
610 size_t *buf_length); 622 size_t *buf_length);
611 623
612/* ***************** low-level packing API ******************** */ 624/* ***************** low-level packing API ******************** */
613 625
@@ -625,10 +637,10 @@ GNUNET_DNSPARSER_pack(const struct GNUNET_DNSPARSER_Packet *p,
625 * #GNUNET_OK if @a name was added to @a dst 637 * #GNUNET_OK if @a name was added to @a dst
626 */ 638 */
627int 639int
628GNUNET_DNSPARSER_builder_add_name(char *dst, 640GNUNET_DNSPARSER_builder_add_name (char *dst,
629 size_t dst_len, 641 size_t dst_len,
630 size_t *off, 642 size_t *off,
631 const char *name); 643 const char *name);
632 644
633 645
634/** 646/**
@@ -644,10 +656,10 @@ GNUNET_DNSPARSER_builder_add_name(char *dst,
644 * #GNUNET_OK if @a query was added to @a dst 656 * #GNUNET_OK if @a query was added to @a dst
645 */ 657 */
646int 658int
647GNUNET_DNSPARSER_builder_add_query(char *dst, 659GNUNET_DNSPARSER_builder_add_query (char *dst,
648 size_t dst_len, 660 size_t dst_len,
649 size_t *off, 661 size_t *off,
650 const struct GNUNET_DNSPARSER_Query *query); 662 const struct GNUNET_DNSPARSER_Query *query);
651 663
652 664
653/** 665/**
@@ -663,10 +675,10 @@ GNUNET_DNSPARSER_builder_add_query(char *dst,
663 * #GNUNET_OK if @a mx was added to @a dst 675 * #GNUNET_OK if @a mx was added to @a dst
664 */ 676 */
665int 677int
666GNUNET_DNSPARSER_builder_add_mx(char *dst, 678GNUNET_DNSPARSER_builder_add_mx (char *dst,
667 size_t dst_len, 679 size_t dst_len,
668 size_t *off, 680 size_t *off,
669 const struct GNUNET_DNSPARSER_MxRecord *mx); 681 const struct GNUNET_DNSPARSER_MxRecord *mx);
670 682
671 683
672/** 684/**
@@ -682,10 +694,10 @@ GNUNET_DNSPARSER_builder_add_mx(char *dst,
682 * #GNUNET_OK if @a soa was added to @a dst 694 * #GNUNET_OK if @a soa was added to @a dst
683 */ 695 */
684int 696int
685GNUNET_DNSPARSER_builder_add_soa(char *dst, 697GNUNET_DNSPARSER_builder_add_soa (char *dst,
686 size_t dst_len, 698 size_t dst_len,
687 size_t *off, 699 size_t *off,
688 const struct GNUNET_DNSPARSER_SoaRecord *soa); 700 const struct GNUNET_DNSPARSER_SoaRecord *soa);
689 701
690 702
691/** 703/**
@@ -701,10 +713,11 @@ GNUNET_DNSPARSER_builder_add_soa(char *dst,
701 * #GNUNET_OK if @a soa was added to @a dst 713 * #GNUNET_OK if @a soa was added to @a dst
702 */ 714 */
703int 715int
704GNUNET_DNSPARSER_builder_add_cert(char *dst, 716GNUNET_DNSPARSER_builder_add_cert (char *dst,
705 size_t dst_len, 717 size_t dst_len,
706 size_t *off, 718 size_t *off,
707 const struct GNUNET_DNSPARSER_CertRecord *cert); 719 const struct
720 GNUNET_DNSPARSER_CertRecord *cert);
708 721
709 722
710/** 723/**
@@ -720,10 +733,10 @@ GNUNET_DNSPARSER_builder_add_cert(char *dst,
720 * #GNUNET_OK if @a srv was added to @a dst 733 * #GNUNET_OK if @a srv was added to @a dst
721 */ 734 */
722int 735int
723GNUNET_DNSPARSER_builder_add_srv(char *dst, 736GNUNET_DNSPARSER_builder_add_srv (char *dst,
724 size_t dst_len, 737 size_t dst_len,
725 size_t *off, 738 size_t *off,
726 const struct GNUNET_DNSPARSER_SrvRecord *srv); 739 const struct GNUNET_DNSPARSER_SrvRecord *srv);
727 740
728/* ***************** low-level parsing API ******************** */ 741/* ***************** low-level parsing API ******************** */
729 742
@@ -738,10 +751,10 @@ GNUNET_DNSPARSER_builder_add_srv(char *dst,
738 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the record is malformed 751 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the record is malformed
739 */ 752 */
740int 753int
741GNUNET_DNSPARSER_parse_record(const char *udp_payload, 754GNUNET_DNSPARSER_parse_record (const char *udp_payload,
742 size_t udp_payload_length, 755 size_t udp_payload_length,
743 size_t *off, 756 size_t *off,
744 struct GNUNET_DNSPARSER_Record *r); 757 struct GNUNET_DNSPARSER_Record *r);
745 758
746 759
747/** 760/**
@@ -754,9 +767,9 @@ GNUNET_DNSPARSER_parse_record(const char *udp_payload,
754 * @return name as 0-terminated C string on success, NULL if the payload is malformed 767 * @return name as 0-terminated C string on success, NULL if the payload is malformed
755 */ 768 */
756char * 769char *
757GNUNET_DNSPARSER_parse_name(const char *udp_payload, 770GNUNET_DNSPARSER_parse_name (const char *udp_payload,
758 size_t udp_payload_length, 771 size_t udp_payload_length,
759 size_t *off); 772 size_t *off);
760 773
761 774
762/** 775/**
@@ -770,10 +783,10 @@ GNUNET_DNSPARSER_parse_name(const char *udp_payload,
770 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the query is malformed 783 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the query is malformed
771 */ 784 */
772int 785int
773GNUNET_DNSPARSER_parse_query(const char *udp_payload, 786GNUNET_DNSPARSER_parse_query (const char *udp_payload,
774 size_t udp_payload_length, 787 size_t udp_payload_length,
775 size_t *off, 788 size_t *off,
776 struct GNUNET_DNSPARSER_Query *q); 789 struct GNUNET_DNSPARSER_Query *q);
777 790
778 791
779/** 792/**
@@ -786,9 +799,9 @@ GNUNET_DNSPARSER_parse_query(const char *udp_payload,
786 * @return the parsed SOA record, NULL on error 799 * @return the parsed SOA record, NULL on error
787 */ 800 */
788struct GNUNET_DNSPARSER_SoaRecord * 801struct GNUNET_DNSPARSER_SoaRecord *
789GNUNET_DNSPARSER_parse_soa(const char *udp_payload, 802GNUNET_DNSPARSER_parse_soa (const char *udp_payload,
790 size_t udp_payload_length, 803 size_t udp_payload_length,
791 size_t *off); 804 size_t *off);
792 805
793 806
794/** 807/**
@@ -801,9 +814,9 @@ GNUNET_DNSPARSER_parse_soa(const char *udp_payload,
801 * @return the parsed CERT record, NULL on error 814 * @return the parsed CERT record, NULL on error
802 */ 815 */
803struct GNUNET_DNSPARSER_CertRecord * 816struct GNUNET_DNSPARSER_CertRecord *
804GNUNET_DNSPARSER_parse_cert(const char *udp_payload, 817GNUNET_DNSPARSER_parse_cert (const char *udp_payload,
805 size_t udp_payload_length, 818 size_t udp_payload_length,
806 size_t *off); 819 size_t *off);
807 820
808 821
809/** 822/**
@@ -816,9 +829,9 @@ GNUNET_DNSPARSER_parse_cert(const char *udp_payload,
816 * @return the parsed MX record, NULL on error 829 * @return the parsed MX record, NULL on error
817 */ 830 */
818struct GNUNET_DNSPARSER_MxRecord * 831struct GNUNET_DNSPARSER_MxRecord *
819GNUNET_DNSPARSER_parse_mx(const char *udp_payload, 832GNUNET_DNSPARSER_parse_mx (const char *udp_payload,
820 size_t udp_payload_length, 833 size_t udp_payload_length,
821 size_t *off); 834 size_t *off);
822 835
823 836
824/** 837/**
@@ -831,9 +844,9 @@ GNUNET_DNSPARSER_parse_mx(const char *udp_payload,
831 * @return the parsed SRV record, NULL on error 844 * @return the parsed SRV record, NULL on error
832 */ 845 */
833struct GNUNET_DNSPARSER_SrvRecord * 846struct GNUNET_DNSPARSER_SrvRecord *
834GNUNET_DNSPARSER_parse_srv(const char *udp_payload, 847GNUNET_DNSPARSER_parse_srv (const char *udp_payload,
835 size_t udp_payload_length, 848 size_t udp_payload_length,
836 size_t *off); 849 size_t *off);
837 850
838/* ***************** low-level duplication API ******************** */ 851/* ***************** low-level duplication API ******************** */
839 852
@@ -844,7 +857,7 @@ GNUNET_DNSPARSER_parse_srv(const char *udp_payload,
844 * @return the newly allocated record 857 * @return the newly allocated record
845 */ 858 */
846struct GNUNET_DNSPARSER_Record * 859struct GNUNET_DNSPARSER_Record *
847GNUNET_DNSPARSER_duplicate_record(const struct GNUNET_DNSPARSER_Record *r); 860GNUNET_DNSPARSER_duplicate_record (const struct GNUNET_DNSPARSER_Record *r);
848 861
849 862
850/** 863/**
@@ -854,7 +867,8 @@ GNUNET_DNSPARSER_duplicate_record(const struct GNUNET_DNSPARSER_Record *r);
854 * @return the newly allocated record 867 * @return the newly allocated record
855 */ 868 */
856struct GNUNET_DNSPARSER_SoaRecord * 869struct GNUNET_DNSPARSER_SoaRecord *
857GNUNET_DNSPARSER_duplicate_soa_record(const struct GNUNET_DNSPARSER_SoaRecord *r); 870GNUNET_DNSPARSER_duplicate_soa_record (const struct
871 GNUNET_DNSPARSER_SoaRecord *r);
858 872
859 873
860/** 874/**
@@ -864,7 +878,8 @@ GNUNET_DNSPARSER_duplicate_soa_record(const struct GNUNET_DNSPARSER_SoaRecord *r
864 * @return the newly allocated record 878 * @return the newly allocated record
865 */ 879 */
866struct GNUNET_DNSPARSER_CertRecord * 880struct GNUNET_DNSPARSER_CertRecord *
867GNUNET_DNSPARSER_duplicate_cert_record(const struct GNUNET_DNSPARSER_CertRecord *r); 881GNUNET_DNSPARSER_duplicate_cert_record (const struct
882 GNUNET_DNSPARSER_CertRecord *r);
868 883
869 884
870/** 885/**
@@ -874,7 +889,8 @@ GNUNET_DNSPARSER_duplicate_cert_record(const struct GNUNET_DNSPARSER_CertRecord
874 * @return the newly allocated record 889 * @return the newly allocated record
875 */ 890 */
876struct GNUNET_DNSPARSER_MxRecord * 891struct GNUNET_DNSPARSER_MxRecord *
877GNUNET_DNSPARSER_duplicate_mx_record(const struct GNUNET_DNSPARSER_MxRecord *r); 892GNUNET_DNSPARSER_duplicate_mx_record (const struct
893 GNUNET_DNSPARSER_MxRecord *r);
878 894
879 895
880/** 896/**
@@ -884,7 +900,8 @@ GNUNET_DNSPARSER_duplicate_mx_record(const struct GNUNET_DNSPARSER_MxRecord *r);
884 * @return the newly allocated record 900 * @return the newly allocated record
885 */ 901 */
886struct GNUNET_DNSPARSER_SrvRecord * 902struct GNUNET_DNSPARSER_SrvRecord *
887GNUNET_DNSPARSER_duplicate_srv_record(const struct GNUNET_DNSPARSER_SrvRecord *r); 903GNUNET_DNSPARSER_duplicate_srv_record (const struct
904 GNUNET_DNSPARSER_SrvRecord *r);
888 905
889 906
890/* ***************** low-level deallocation API ******************** */ 907/* ***************** low-level deallocation API ******************** */
@@ -895,7 +912,7 @@ GNUNET_DNSPARSER_duplicate_srv_record(const struct GNUNET_DNSPARSER_SrvRecord *r
895 * @param r record to free 912 * @param r record to free
896 */ 913 */
897void 914void
898GNUNET_DNSPARSER_free_record(struct GNUNET_DNSPARSER_Record *r); 915GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r);
899 916
900 917
901/** 918/**
@@ -904,7 +921,7 @@ GNUNET_DNSPARSER_free_record(struct GNUNET_DNSPARSER_Record *r);
904 * @param mx record to free 921 * @param mx record to free
905 */ 922 */
906void 923void
907GNUNET_DNSPARSER_free_mx(struct GNUNET_DNSPARSER_MxRecord *mx); 924GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx);
908 925
909 926
910/** 927/**
@@ -913,7 +930,7 @@ GNUNET_DNSPARSER_free_mx(struct GNUNET_DNSPARSER_MxRecord *mx);
913 * @param srv record to free 930 * @param srv record to free
914 */ 931 */
915void 932void
916GNUNET_DNSPARSER_free_srv(struct GNUNET_DNSPARSER_SrvRecord *srv); 933GNUNET_DNSPARSER_free_srv (struct GNUNET_DNSPARSER_SrvRecord *srv);
917 934
918 935
919/** 936/**
@@ -922,7 +939,7 @@ GNUNET_DNSPARSER_free_srv(struct GNUNET_DNSPARSER_SrvRecord *srv);
922 * @param soa record to free 939 * @param soa record to free
923 */ 940 */
924void 941void
925GNUNET_DNSPARSER_free_soa(struct GNUNET_DNSPARSER_SoaRecord *soa); 942GNUNET_DNSPARSER_free_soa (struct GNUNET_DNSPARSER_SoaRecord *soa);
926 943
927 944
928/** 945/**
@@ -931,7 +948,7 @@ GNUNET_DNSPARSER_free_soa(struct GNUNET_DNSPARSER_SoaRecord *soa);
931 * @param cert record to free 948 * @param cert record to free
932 */ 949 */
933void 950void
934GNUNET_DNSPARSER_free_cert(struct GNUNET_DNSPARSER_CertRecord *cert); 951GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert);
935 952
936 953
937/** 954/**
@@ -942,8 +959,8 @@ GNUNET_DNSPARSER_free_cert(struct GNUNET_DNSPARSER_CertRecord *cert);
942 * @return HEX string (lower case) 959 * @return HEX string (lower case)
943 */ 960 */
944char * 961char *
945GNUNET_DNSPARSER_bin_to_hex(const void *data, 962GNUNET_DNSPARSER_bin_to_hex (const void *data,
946 size_t data_size); 963 size_t data_size);
947 964
948 965
949/** 966/**
@@ -955,8 +972,8 @@ GNUNET_DNSPARSER_bin_to_hex(const void *data,
955 * @return number of bytes written to data 972 * @return number of bytes written to data
956 */ 973 */
957size_t 974size_t
958GNUNET_DNSPARSER_hex_to_bin(const char *hex, 975GNUNET_DNSPARSER_hex_to_bin (const char *hex,
959 void *data); 976 void *data);
960 977
961 978
962#endif 979#endif
diff --git a/src/include/gnunet_dnsstub_lib.h b/src/include/gnunet_dnsstub_lib.h
index ff59e1292..4e93105bb 100644
--- a/src/include/gnunet_dnsstub_lib.h
+++ b/src/include/gnunet_dnsstub_lib.h
@@ -52,7 +52,7 @@ struct GNUNET_DNSSTUB_RequestSocket;
52 * @return NULL on error 52 * @return NULL on error
53 */ 53 */
54struct GNUNET_DNSSTUB_Context * 54struct GNUNET_DNSSTUB_Context *
55GNUNET_DNSSTUB_start(unsigned int num_sockets); 55GNUNET_DNSSTUB_start (unsigned int num_sockets);
56 56
57 57
58/** 58/**
@@ -64,8 +64,8 @@ GNUNET_DNSSTUB_start(unsigned int num_sockets);
64 * @return #GNUNET_OK on success 64 * @return #GNUNET_OK on success
65 */ 65 */
66int 66int
67GNUNET_DNSSTUB_add_dns_ip(struct GNUNET_DNSSTUB_Context *ctx, 67GNUNET_DNSSTUB_add_dns_ip (struct GNUNET_DNSSTUB_Context *ctx,
68 const char *dns_ip); 68 const char *dns_ip);
69 69
70 70
71/** 71/**
@@ -77,8 +77,8 @@ GNUNET_DNSSTUB_add_dns_ip(struct GNUNET_DNSSTUB_Context *ctx,
77 * @return #GNUNET_OK on success 77 * @return #GNUNET_OK on success
78 */ 78 */
79int 79int
80GNUNET_DNSSTUB_add_dns_sa(struct GNUNET_DNSSTUB_Context *ctx, 80GNUNET_DNSSTUB_add_dns_sa (struct GNUNET_DNSSTUB_Context *ctx,
81 const struct sockaddr *sa); 81 const struct sockaddr *sa);
82 82
83 83
84/** 84/**
@@ -89,8 +89,8 @@ GNUNET_DNSSTUB_add_dns_sa(struct GNUNET_DNSSTUB_Context *ctx,
89 * @param retry_frequ how long to wait between retries 89 * @param retry_frequ how long to wait between retries
90 */ 90 */
91void 91void
92GNUNET_DNSSTUB_set_retry(struct GNUNET_DNSSTUB_Context *ctx, 92GNUNET_DNSSTUB_set_retry (struct GNUNET_DNSSTUB_Context *ctx,
93 struct GNUNET_TIME_Relative retry_freq); 93 struct GNUNET_TIME_Relative retry_freq);
94 94
95/** 95/**
96 * Cleanup DNSSTUB resolver. 96 * Cleanup DNSSTUB resolver.
@@ -98,7 +98,7 @@ GNUNET_DNSSTUB_set_retry(struct GNUNET_DNSSTUB_Context *ctx,
98 * @param ctx stub resolver to clean up 98 * @param ctx stub resolver to clean up
99 */ 99 */
100void 100void
101GNUNET_DNSSTUB_stop(struct GNUNET_DNSSTUB_Context *ctx); 101GNUNET_DNSSTUB_stop (struct GNUNET_DNSSTUB_Context *ctx);
102 102
103 103
104/** 104/**
@@ -128,11 +128,11 @@ typedef void
128 * @return socket used for the request, NULL on error 128 * @return socket used for the request, NULL on error
129 */ 129 */
130struct GNUNET_DNSSTUB_RequestSocket * 130struct GNUNET_DNSSTUB_RequestSocket *
131GNUNET_DNSSTUB_resolve(struct GNUNET_DNSSTUB_Context *ctx, 131GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx,
132 const void *request, 132 const void *request,
133 size_t request_len, 133 size_t request_len,
134 GNUNET_DNSSTUB_ResultCallback rc, 134 GNUNET_DNSSTUB_ResultCallback rc,
135 void *rc_cls); 135 void *rc_cls);
136 136
137 137
138/** 138/**
@@ -141,7 +141,7 @@ GNUNET_DNSSTUB_resolve(struct GNUNET_DNSSTUB_Context *ctx,
141 * @param rs resolution to cancel 141 * @param rs resolution to cancel
142 */ 142 */
143void 143void
144GNUNET_DNSSTUB_resolve_cancel(struct GNUNET_DNSSTUB_RequestSocket *rs); 144GNUNET_DNSSTUB_resolve_cancel (struct GNUNET_DNSSTUB_RequestSocket *rs);
145 145
146 146
147#endif 147#endif
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h
index 3004c7a44..6683a08d7 100644
--- a/src/include/gnunet_fragmentation_lib.h
+++ b/src/include/gnunet_fragmentation_lib.h
@@ -88,14 +88,14 @@ typedef void
88 * @return the fragmentation context 88 * @return the fragmentation context
89 */ 89 */
90struct GNUNET_FRAGMENT_Context * 90struct GNUNET_FRAGMENT_Context *
91GNUNET_FRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, 91GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats,
92 uint16_t mtu, 92 uint16_t mtu,
93 struct GNUNET_BANDWIDTH_Tracker *tracker, 93 struct GNUNET_BANDWIDTH_Tracker *tracker,
94 struct GNUNET_TIME_Relative msg_delay, 94 struct GNUNET_TIME_Relative msg_delay,
95 struct GNUNET_TIME_Relative ack_delay, 95 struct GNUNET_TIME_Relative ack_delay,
96 const struct GNUNET_MessageHeader *msg, 96 const struct GNUNET_MessageHeader *msg,
97 GNUNET_FRAGMENT_MessageProcessor proc, 97 GNUNET_FRAGMENT_MessageProcessor proc,
98 void *proc_cls); 98 void *proc_cls);
99 99
100 100
101/** 101/**
@@ -106,7 +106,7 @@ GNUNET_FRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats,
106 * @param fc fragmentation context 106 * @param fc fragmentation context
107 */ 107 */
108void 108void
109GNUNET_FRAGMENT_context_transmission_done(struct GNUNET_FRAGMENT_Context *fc); 109GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc);
110 110
111 111
112/** 112/**
@@ -121,8 +121,8 @@ GNUNET_FRAGMENT_context_transmission_done(struct GNUNET_FRAGMENT_Context *fc);
121 * #GNUNET_SYSERR if this ack is not valid for this fc 121 * #GNUNET_SYSERR if this ack is not valid for this fc
122 */ 122 */
123int 123int
124GNUNET_FRAGMENT_process_ack(struct GNUNET_FRAGMENT_Context *fc, 124GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
125 const struct GNUNET_MessageHeader *msg); 125 const struct GNUNET_MessageHeader *msg);
126 126
127 127
128/** 128/**
@@ -136,9 +136,9 @@ GNUNET_FRAGMENT_process_ack(struct GNUNET_FRAGMENT_Context *fc,
136 * last message, set to FOREVER if the message was not fully transmitted (OUT only) 136 * last message, set to FOREVER if the message was not fully transmitted (OUT only)
137 */ 137 */
138void 138void
139GNUNET_FRAGMENT_context_destroy(struct GNUNET_FRAGMENT_Context *fc, 139GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc,
140 struct GNUNET_TIME_Relative *msg_delay, 140 struct GNUNET_TIME_Relative *msg_delay,
141 struct GNUNET_TIME_Relative *ack_delay); 141 struct GNUNET_TIME_Relative *ack_delay);
142 142
143 143
144/** 144/**
@@ -148,7 +148,7 @@ GNUNET_FRAGMENT_context_destroy(struct GNUNET_FRAGMENT_Context *fc,
148 * @return ack in human-readable format 148 * @return ack in human-readable format
149 */ 149 */
150const char * 150const char *
151GNUNET_FRAGMENT_print_ack(const struct GNUNET_MessageHeader *ack); 151GNUNET_FRAGMENT_print_ack (const struct GNUNET_MessageHeader *ack);
152 152
153 153
154/** 154/**
@@ -187,12 +187,12 @@ typedef void
187 * @return the defragmentation context 187 * @return the defragmentation context
188 */ 188 */
189struct GNUNET_DEFRAGMENT_Context * 189struct GNUNET_DEFRAGMENT_Context *
190GNUNET_DEFRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats, 190GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats,
191 uint16_t mtu, 191 uint16_t mtu,
192 unsigned int num_msgs, 192 unsigned int num_msgs,
193 void *cls, 193 void *cls,
194 GNUNET_FRAGMENT_MessageProcessor proc, 194 GNUNET_FRAGMENT_MessageProcessor proc,
195 GNUNET_DEFRAGMENT_AckProcessor ackp); 195 GNUNET_DEFRAGMENT_AckProcessor ackp);
196 196
197 197
198/** 198/**
@@ -201,7 +201,7 @@ GNUNET_DEFRAGMENT_context_create(struct GNUNET_STATISTICS_Handle *stats,
201 * @param dc defragmentation context 201 * @param dc defragmentation context
202 */ 202 */
203void 203void
204GNUNET_DEFRAGMENT_context_destroy(struct GNUNET_DEFRAGMENT_Context *dc); 204GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc);
205 205
206 206
207/** 207/**
@@ -214,8 +214,8 @@ GNUNET_DEFRAGMENT_context_destroy(struct GNUNET_DEFRAGMENT_Context *dc);
214 * #GNUNET_SYSERR on error 214 * #GNUNET_SYSERR on error
215 */ 215 */
216int 216int
217GNUNET_DEFRAGMENT_process_fragment(struct GNUNET_DEFRAGMENT_Context *dc, 217GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
218 const struct GNUNET_MessageHeader *msg); 218 const struct GNUNET_MessageHeader *msg);
219 219
220 220
221 221
diff --git a/src/include/gnunet_friends_lib.h b/src/include/gnunet_friends_lib.h
index 64e7f39d8..d591ea082 100644
--- a/src/include/gnunet_friends_lib.h
+++ b/src/include/gnunet_friends_lib.h
@@ -49,7 +49,8 @@ extern "C"
49 * @param friend_id peer identity of the friend 49 * @param friend_id peer identity of the friend
50 */ 50 */
51typedef void (*GNUNET_FRIENDS_Callback)(void *cls, 51typedef void (*GNUNET_FRIENDS_Callback)(void *cls,
52 const struct GNUNET_PeerIdentity *friend_id); 52 const struct
53 GNUNET_PeerIdentity *friend_id);
53 54
54 55
55/** 56/**
@@ -61,9 +62,9 @@ typedef void (*GNUNET_FRIENDS_Callback)(void *cls,
61 * @return #GNUNET_OK on success, #GNUNET_SYSERR on parsing errors 62 * @return #GNUNET_OK on success, #GNUNET_SYSERR on parsing errors
62 */ 63 */
63int 64int
64GNUNET_FRIENDS_parse(const struct GNUNET_CONFIGURATION_Handle *cfg, 65GNUNET_FRIENDS_parse (const struct GNUNET_CONFIGURATION_Handle *cfg,
65 GNUNET_FRIENDS_Callback cb, 66 GNUNET_FRIENDS_Callback cb,
66 void *cb_cls); 67 void *cb_cls);
67 68
68 69
69/** 70/**
@@ -80,7 +81,7 @@ struct GNUNET_FRIENDS_Writer;
80 * @return NULL on error 81 * @return NULL on error
81 */ 82 */
82struct GNUNET_FRIENDS_Writer * 83struct GNUNET_FRIENDS_Writer *
83GNUNET_FRIENDS_write_start(const struct GNUNET_CONFIGURATION_Handle *cfg); 84GNUNET_FRIENDS_write_start (const struct GNUNET_CONFIGURATION_Handle *cfg);
84 85
85 86
86/** 87/**
@@ -90,7 +91,7 @@ GNUNET_FRIENDS_write_start(const struct GNUNET_CONFIGURATION_Handle *cfg);
90 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 91 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
91 */ 92 */
92int 93int
93GNUNET_FRIENDS_write_stop(struct GNUNET_FRIENDS_Writer *w); 94GNUNET_FRIENDS_write_stop (struct GNUNET_FRIENDS_Writer *w);
94 95
95 96
96/** 97/**
@@ -101,8 +102,8 @@ GNUNET_FRIENDS_write_stop(struct GNUNET_FRIENDS_Writer *w);
101 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 102 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
102 */ 103 */
103int 104int
104GNUNET_FRIENDS_write(struct GNUNET_FRIENDS_Writer *w, 105GNUNET_FRIENDS_write (struct GNUNET_FRIENDS_Writer *w,
105 const struct GNUNET_PeerIdentity *friend_id); 106 const struct GNUNET_PeerIdentity *friend_id);
106 107
107 108
108#if 0 /* keep Emacsens' auto-indent happy */ 109#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 688c6d489..2b25b5c81 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -80,7 +80,8 @@ extern "C"
80 * How often do we signal applications that a probe for a particular 80 * How often do we signal applications that a probe for a particular
81 * search result is running? (used to visualize probes). 81 * search result is running? (used to visualize probes).
82 */ 82 */
83#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 250) 83#define GNUNET_FS_PROBE_UPDATE_FREQUENCY GNUNET_TIME_relative_multiply ( \
84 GNUNET_TIME_UNIT_MILLISECONDS, 250)
84 85
85/** 86/**
86 * A Universal Resource Identifier (URI), opaque. 87 * A Universal Resource Identifier (URI), opaque.
@@ -112,8 +113,8 @@ typedef int
112 * @return #GNUNET_OK on success 113 * @return #GNUNET_OK on success
113 */ 114 */
114int 115int
115GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri, 116GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri,
116 struct GNUNET_HashCode *key); 117 struct GNUNET_HashCode *key);
117 118
118 119
119/** 120/**
@@ -123,7 +124,7 @@ GNUNET_FS_uri_to_key(const struct GNUNET_FS_Uri *uri,
123 * @return the UTF-8 string 124 * @return the UTF-8 string
124 */ 125 */
125char * 126char *
126GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri); 127GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri);
127 128
128 129
129/** 130/**
@@ -134,7 +135,7 @@ GNUNET_FS_uri_to_string(const struct GNUNET_FS_Uri *uri);
134 * @return string with the keywords 135 * @return string with the keywords
135 */ 136 */
136char * 137char *
137GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri); 138GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri);
138 139
139 140
140/** 141/**
@@ -146,9 +147,9 @@ GNUNET_FS_uri_ksk_to_string_fancy(const struct GNUNET_FS_Uri *uri);
146 * @param is_mandatory is this keyword mandatory? 147 * @param is_mandatory is this keyword mandatory?
147 */ 148 */
148void 149void
149GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri, 150GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri,
150 const char *keyword, 151 const char *keyword,
151 int is_mandatory); 152 int is_mandatory);
152 153
153 154
154/** 155/**
@@ -159,8 +160,8 @@ GNUNET_FS_uri_ksk_add_keyword(struct GNUNET_FS_Uri *uri,
159 * @param keyword keyword to add 160 * @param keyword keyword to add
160 */ 161 */
161void 162void
162GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri, 163GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri,
163 const char *keyword); 164 const char *keyword);
164 165
165 166
166/** 167/**
@@ -171,8 +172,8 @@ GNUNET_FS_uri_ksk_remove_keyword(struct GNUNET_FS_Uri *uri,
171 * @return NULL on error 172 * @return NULL on error
172 */ 173 */
173struct GNUNET_FS_Uri * 174struct GNUNET_FS_Uri *
174GNUNET_FS_uri_parse(const char *uri, 175GNUNET_FS_uri_parse (const char *uri,
175 char **emsg); 176 char **emsg);
176 177
177 178
178/** 179/**
@@ -181,7 +182,7 @@ GNUNET_FS_uri_parse(const char *uri,
181 * @param uri uri to free 182 * @param uri uri to free
182 */ 183 */
183void 184void
184GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri); 185GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri);
185 186
186 187
187/** 188/**
@@ -191,7 +192,7 @@ GNUNET_FS_uri_destroy(struct GNUNET_FS_Uri *uri);
191 * @return 0 if this is not a keyword URI 192 * @return 0 if this is not a keyword URI
192 */ 193 */
193unsigned int 194unsigned int
194GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri); 195GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri);
195 196
196 197
197/** 198/**
@@ -204,9 +205,9 @@ GNUNET_FS_uri_ksk_get_keyword_count(const struct GNUNET_FS_Uri *uri);
204 * keywords iterated over until iterator aborted 205 * keywords iterated over until iterator aborted
205 */ 206 */
206int 207int
207GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri, 208GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri,
208 GNUNET_FS_KeywordIterator iterator, 209 GNUNET_FS_KeywordIterator iterator,
209 void *iterator_cls); 210 void *iterator_cls);
210 211
211 212
212/** 213/**
@@ -217,8 +218,8 @@ GNUNET_FS_uri_ksk_get_keywords(const struct GNUNET_FS_Uri *uri,
217 * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK 218 * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK
218 */ 219 */
219int 220int
220GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri, 221GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri,
221 struct GNUNET_PeerIdentity *peer); 222 struct GNUNET_PeerIdentity *peer);
222 223
223 224
224/** 225/**
@@ -228,7 +229,7 @@ GNUNET_FS_uri_loc_get_peer_identity(const struct GNUNET_FS_Uri *uri,
228 * @return NULL if argument is not a location URI 229 * @return NULL if argument is not a location URI
229 */ 230 */
230struct GNUNET_FS_Uri * 231struct GNUNET_FS_Uri *
231GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri); 232GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri);
232 233
233 234
234/** 235/**
@@ -238,7 +239,7 @@ GNUNET_FS_uri_loc_get_uri(const struct GNUNET_FS_Uri *uri);
238 * @return expiration time of the URI 239 * @return expiration time of the URI
239 */ 240 */
240struct GNUNET_TIME_Absolute 241struct GNUNET_TIME_Absolute
241GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri); 242GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
242 243
243 244
244/** 245/**
@@ -254,9 +255,9 @@ GNUNET_FS_uri_loc_get_expiration(const struct GNUNET_FS_Uri *uri);
254 * @return the location URI, NULL on error 255 * @return the location URI, NULL on error
255 */ 256 */
256struct GNUNET_FS_Uri * 257struct GNUNET_FS_Uri *
257GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri, 258GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *base_uri,
258 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key, 259 const struct GNUNET_CRYPTO_EddsaPrivateKey *sign_key,
259 struct GNUNET_TIME_Absolute expiration_time); 260 struct GNUNET_TIME_Absolute expiration_time);
260 261
261 262
262/** 263/**
@@ -267,8 +268,8 @@ GNUNET_FS_uri_loc_create(const struct GNUNET_FS_Uri *base_uri,
267 * @return merged URI, NULL on error 268 * @return merged URI, NULL on error
268 */ 269 */
269struct GNUNET_FS_Uri * 270struct GNUNET_FS_Uri *
270GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1, 271GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1,
271 const struct GNUNET_FS_Uri *u2); 272 const struct GNUNET_FS_Uri *u2);
272 273
273 274
274/** 275/**
@@ -278,7 +279,7 @@ GNUNET_FS_uri_ksk_merge(const struct GNUNET_FS_Uri *u1,
278 * @return copy of the URI 279 * @return copy of the URI
279 */ 280 */
280struct GNUNET_FS_Uri * 281struct GNUNET_FS_Uri *
281GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri); 282GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri);
282 283
283 284
284/** 285/**
@@ -299,8 +300,8 @@ GNUNET_FS_uri_dup(const struct GNUNET_FS_Uri *uri);
299 * if keywords is not legal (i.e. empty). 300 * if keywords is not legal (i.e. empty).
300 */ 301 */
301struct GNUNET_FS_Uri * 302struct GNUNET_FS_Uri *
302GNUNET_FS_uri_ksk_create(const char *keywords, 303GNUNET_FS_uri_ksk_create (const char *keywords,
303 char **emsg); 304 char **emsg);
304 305
305 306
306/** 307/**
@@ -321,8 +322,8 @@ GNUNET_FS_uri_ksk_create(const char *keywords,
321 * if keywords is not legal (i.e. empty). 322 * if keywords is not legal (i.e. empty).
322 */ 323 */
323struct GNUNET_FS_Uri * 324struct GNUNET_FS_Uri *
324GNUNET_FS_uri_ksk_create_from_args(unsigned int argc, 325GNUNET_FS_uri_ksk_create_from_args (unsigned int argc,
325 const char **argv); 326 const char **argv);
326 327
327 328
328/** 329/**
@@ -333,8 +334,8 @@ GNUNET_FS_uri_ksk_create_from_args(unsigned int argc,
333 * @return #GNUNET_YES if the URIs are equal 334 * @return #GNUNET_YES if the URIs are equal
334 */ 335 */
335int 336int
336GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1, 337GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1,
337 const struct GNUNET_FS_Uri *u2); 338 const struct GNUNET_FS_Uri *u2);
338 339
339 340
340/** 341/**
@@ -344,7 +345,7 @@ GNUNET_FS_uri_test_equal(const struct GNUNET_FS_Uri *u1,
344 * @return #GNUNET_YES if this is an SKS uri 345 * @return #GNUNET_YES if this is an SKS uri
345 */ 346 */
346int 347int
347GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri); 348GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri);
348 349
349 350
350/** 351/**
@@ -355,8 +356,8 @@ GNUNET_FS_uri_test_sks(const struct GNUNET_FS_Uri *uri);
355 * @return an FS URI for the given namespace and identifier 356 * @return an FS URI for the given namespace and identifier
356 */ 357 */
357struct GNUNET_FS_Uri * 358struct GNUNET_FS_Uri *
358GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns, 359GNUNET_FS_uri_sks_create (const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
359 const char *id); 360 const char *id);
360 361
361 362
362/** 363/**
@@ -368,8 +369,8 @@ GNUNET_FS_uri_sks_create(const struct GNUNET_CRYPTO_EcdsaPublicKey *ns,
368 * @return #GNUNET_OK on success 369 * @return #GNUNET_OK on success
369 */ 370 */
370int 371int
371GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri, 372GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri,
372 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym); 373 struct GNUNET_CRYPTO_EcdsaPublicKey *pseudonym);
373 374
374 375
375/** 376/**
@@ -379,7 +380,7 @@ GNUNET_FS_uri_sks_get_namespace(const struct GNUNET_FS_Uri *uri,
379 * @return NULL on error (not a valid SKS URI) 380 * @return NULL on error (not a valid SKS URI)
380 */ 381 */
381char * 382char *
382GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri); 383GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri);
383 384
384 385
385/** 386/**
@@ -389,7 +390,7 @@ GNUNET_FS_uri_sks_get_content_id(const struct GNUNET_FS_Uri *uri);
389 * @return #GNUNET_YES if this is a KSK uri 390 * @return #GNUNET_YES if this is a KSK uri
390 */ 391 */
391int 392int
392GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri); 393GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri);
393 394
394 395
395/** 396/**
@@ -399,7 +400,7 @@ GNUNET_FS_uri_test_ksk(const struct GNUNET_FS_Uri *uri);
399 * @return #GNUNET_YES if this is a CHK uri 400 * @return #GNUNET_YES if this is a CHK uri
400 */ 401 */
401int 402int
402GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri); 403GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri);
403 404
404 405
405/** 406/**
@@ -410,7 +411,7 @@ GNUNET_FS_uri_test_chk(const struct GNUNET_FS_Uri *uri);
410 * @return size of the file as specified in the CHK URI 411 * @return size of the file as specified in the CHK URI
411 */ 412 */
412uint64_t 413uint64_t
413GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri); 414GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri);
414 415
415 416
416/** 417/**
@@ -420,7 +421,7 @@ GNUNET_FS_uri_chk_get_file_size(const struct GNUNET_FS_Uri *uri);
420 * @return #GNUNET_YES if this is a LOC uri 421 * @return #GNUNET_YES if this is a LOC uri
421 */ 422 */
422int 423int
423GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri); 424GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri);
424 425
425 426
426/** 427/**
@@ -432,8 +433,8 @@ GNUNET_FS_uri_test_loc(const struct GNUNET_FS_Uri *uri);
432 * @return NULL on error, otherwise a KSK URI 433 * @return NULL on error, otherwise a KSK URI
433 */ 434 */
434struct GNUNET_FS_Uri * 435struct GNUNET_FS_Uri *
435GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData 436GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData
436 *md); 437 *md);
437 438
438 439
439/* ******************** command-line option parsing API *********************** */ 440/* ******************** command-line option parsing API *********************** */
@@ -448,11 +449,11 @@ GNUNET_FS_uri_ksk_create_from_meta_data(const struct GNUNET_CONTAINER_MetaData
448 * @param[out] topKeywords set to the desired value 449 * @param[out] topKeywords set to the desired value
449 */ 450 */
450struct GNUNET_GETOPT_CommandLineOption 451struct GNUNET_GETOPT_CommandLineOption
451GNUNET_FS_GETOPT_KEYWORDS(char shortName, 452GNUNET_FS_GETOPT_KEYWORDS (char shortName,
452 const char *name, 453 const char *name,
453 const char *argumentHelp, 454 const char *argumentHelp,
454 const char *description, 455 const char *description,
455 struct GNUNET_FS_Uri **topKeywords); 456 struct GNUNET_FS_Uri **topKeywords);
456 457
457/** 458/**
458 * Allow user to specify metadata. 459 * Allow user to specify metadata.
@@ -464,11 +465,11 @@ GNUNET_FS_GETOPT_KEYWORDS(char shortName,
464 * @param[out] metadata set to the desired value 465 * @param[out] metadata set to the desired value
465 */ 466 */
466struct GNUNET_GETOPT_CommandLineOption 467struct GNUNET_GETOPT_CommandLineOption
467GNUNET_FS_GETOPT_METADATA(char shortName, 468GNUNET_FS_GETOPT_METADATA (char shortName,
468 const char *name, 469 const char *name,
469 const char *argumentHelp, 470 const char *argumentHelp,
470 const char *description, 471 const char *description,
471 struct GNUNET_CONTAINER_MetaData **meta); 472 struct GNUNET_CONTAINER_MetaData **meta);
472 473
473/** 474/**
474 * Command-line option parser function that allows the user to specify 475 * Command-line option parser function that allows the user to specify
@@ -483,10 +484,11 @@ GNUNET_FS_GETOPT_METADATA(char shortName,
483 * @return #GNUNET_OK on success 484 * @return #GNUNET_OK on success
484 */ 485 */
485int 486int
486GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 487GNUNET_FS_getopt_set_metadata (struct
487 void *scls, 488 GNUNET_GETOPT_CommandLineProcessorContext *ctx,
488 const char *option, 489 void *scls,
489 const char *value); 490 const char *option,
491 const char *value);
490 492
491 493
492 494
@@ -504,7 +506,8 @@ GNUNET_FS_getopt_set_metadata(struct GNUNET_GETOPT_CommandLineProcessorContext *
504 * are typically generated either due to explicit client requests 506 * are typically generated either due to explicit client requests
505 * or because of suspend/resume operations. 507 * or because of suspend/resume operations.
506 */ 508 */
507enum GNUNET_FS_Status { 509enum GNUNET_FS_Status
510{
508 /** 511 /**
509 * Notification that we have started to publish a file structure. 512 * Notification that we have started to publish a file structure.
510 */ 513 */
@@ -770,15 +773,18 @@ struct GNUNET_FS_FileInformation;
770 * Argument given to the progress callback with 773 * Argument given to the progress callback with
771 * information about what is going on. 774 * information about what is going on.
772 */ 775 */
773struct GNUNET_FS_ProgressInfo { 776struct GNUNET_FS_ProgressInfo
777{
774 /** 778 /**
775 * Values that depend on the event type. 779 * Values that depend on the event type.
776 */ 780 */
777 union { 781 union
782 {
778 /** 783 /**
779 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. 784 * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events.
780 */ 785 */
781 struct { 786 struct
787 {
782 /** 788 /**
783 * Context for controlling the upload. 789 * Context for controlling the upload.
784 */ 790 */
@@ -840,12 +846,14 @@ struct GNUNET_FS_ProgressInfo {
840 /** 846 /**
841 * Additional values for specific events. 847 * Additional values for specific events.
842 */ 848 */
843 union { 849 union
850 {
844 /** 851 /**
845 * These values are only valid for 852 * These values are only valid for
846 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events. 853 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS events.
847 */ 854 */
848 struct { 855 struct
856 {
849 /** 857 /**
850 * Data block we just published. 858 * Data block we just published.
851 */ 859 */
@@ -872,7 +880,8 @@ struct GNUNET_FS_ProgressInfo {
872 * These values are only valid for 880 * These values are only valid for
873 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events. 881 * #GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY events.
874 */ 882 */
875 struct { 883 struct
884 {
876 /** 885 /**
877 * How far are we along in the overall directory? 886 * How far are we along in the overall directory?
878 */ 887 */
@@ -896,7 +905,8 @@ struct GNUNET_FS_ProgressInfo {
896 * These values are only valid for 905 * These values are only valid for
897 * #GNUNET_FS_STATUS_PUBLISH_RESUME events. 906 * #GNUNET_FS_STATUS_PUBLISH_RESUME events.
898 */ 907 */
899 struct { 908 struct
909 {
900 /** 910 /**
901 * Error message, NULL if no error was encountered so far. 911 * Error message, NULL if no error was encountered so far.
902 */ 912 */
@@ -917,7 +927,8 @@ struct GNUNET_FS_ProgressInfo {
917 * These values are only valid for 927 * These values are only valid for
918 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events. 928 * #GNUNET_FS_STATUS_PUBLISH_COMPLETED events.
919 */ 929 */
920 struct { 930 struct
931 {
921 /** 932 /**
922 * CHK URI of the file. 933 * CHK URI of the file.
923 */ 934 */
@@ -933,7 +944,8 @@ struct GNUNET_FS_ProgressInfo {
933 * These values are only valid for 944 * These values are only valid for
934 * #GNUNET_FS_STATUS_PUBLISH_ERROR events. 945 * #GNUNET_FS_STATUS_PUBLISH_ERROR events.
935 */ 946 */
936 struct { 947 struct
948 {
937 /** 949 /**
938 * Error message, never NULL. 950 * Error message, never NULL.
939 */ 951 */
@@ -946,7 +958,8 @@ struct GNUNET_FS_ProgressInfo {
946 /** 958 /**
947 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. 959 * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events.
948 */ 960 */
949 struct { 961 struct
962 {
950 /** 963 /**
951 * Context for controlling the download. 964 * Context for controlling the download.
952 */ 965 */
@@ -1020,12 +1033,14 @@ struct GNUNET_FS_ProgressInfo {
1020 /** 1033 /**
1021 * Additional values for specific events. 1034 * Additional values for specific events.
1022 */ 1035 */
1023 union { 1036 union
1037 {
1024 /** 1038 /**
1025 * These values are only valid for 1039 * These values are only valid for
1026 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. 1040 * #GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events.
1027 */ 1041 */
1028 struct { 1042 struct
1043 {
1029 /** 1044 /**
1030 * Data block we just obtained, can be NULL (even if 1045 * Data block we just obtained, can be NULL (even if
1031 * data_len > 0) if we found the entire block 'intact' on 1046 * data_len > 0) if we found the entire block 'intact' on
@@ -1077,7 +1092,8 @@ struct GNUNET_FS_ProgressInfo {
1077 * These values are only valid for 1092 * These values are only valid for
1078 * #GNUNET_FS_STATUS_DOWNLOAD_START events. 1093 * #GNUNET_FS_STATUS_DOWNLOAD_START events.
1079 */ 1094 */
1080 struct { 1095 struct
1096 {
1081 /** 1097 /**
1082 * Known metadata for the download. 1098 * Known metadata for the download.
1083 */ 1099 */
@@ -1088,7 +1104,8 @@ struct GNUNET_FS_ProgressInfo {
1088 * These values are only valid for 1104 * These values are only valid for
1089 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events. 1105 * #GNUNET_FS_STATUS_DOWNLOAD_RESUME events.
1090 */ 1106 */
1091 struct { 1107 struct
1108 {
1092 /** 1109 /**
1093 * Known metadata for the download. 1110 * Known metadata for the download.
1094 */ 1111 */
@@ -1104,7 +1121,8 @@ struct GNUNET_FS_ProgressInfo {
1104 * These values are only valid for 1121 * These values are only valid for
1105 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events. 1122 * #GNUNET_FS_STATUS_DOWNLOAD_ERROR events.
1106 */ 1123 */
1107 struct { 1124 struct
1125 {
1108 /** 1126 /**
1109 * Error message. 1127 * Error message.
1110 */ 1128 */
@@ -1116,7 +1134,8 @@ struct GNUNET_FS_ProgressInfo {
1116 /** 1134 /**
1117 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. 1135 * Values for all "GNUNET_FS_STATUS_SEARCH_*" events.
1118 */ 1136 */
1119 struct { 1137 struct
1138 {
1120 /** 1139 /**
1121 * Context for controlling the search, NULL for 1140 * Context for controlling the search, NULL for
1122 * searches that were not explicitly triggered 1141 * searches that were not explicitly triggered
@@ -1164,12 +1183,14 @@ struct GNUNET_FS_ProgressInfo {
1164 /** 1183 /**
1165 * Additional values for specific events. 1184 * Additional values for specific events.
1166 */ 1185 */
1167 union { 1186 union
1187 {
1168 /** 1188 /**
1169 * These values are only valid for 1189 * These values are only valid for
1170 * #GNUNET_FS_STATUS_SEARCH_RESULT events. 1190 * #GNUNET_FS_STATUS_SEARCH_RESULT events.
1171 */ 1191 */
1172 struct { 1192 struct
1193 {
1173 /** 1194 /**
1174 * Metadata for the search result. 1195 * Metadata for the search result.
1175 */ 1196 */
@@ -1196,7 +1217,8 @@ struct GNUNET_FS_ProgressInfo {
1196 * These values are only valid for 1217 * These values are only valid for
1197 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. 1218 * #GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events.
1198 */ 1219 */
1199 struct { 1220 struct
1221 {
1200 /** 1222 /**
1201 * Metadata for the search result. 1223 * Metadata for the search result.
1202 */ 1224 */
@@ -1236,7 +1258,8 @@ struct GNUNET_FS_ProgressInfo {
1236 * These values are only valid for 1258 * These values are only valid for
1237 * #GNUNET_FS_STATUS_SEARCH_UPDATE events. 1259 * #GNUNET_FS_STATUS_SEARCH_UPDATE events.
1238 */ 1260 */
1239 struct { 1261 struct
1262 {
1240 /** 1263 /**
1241 * Private context set for for this result 1264 * Private context set for for this result
1242 * during the "RESULT" event. 1265 * during the "RESULT" event.
@@ -1287,7 +1310,8 @@ struct GNUNET_FS_ProgressInfo {
1287 * happens primarily to give the client a chance 1310 * happens primarily to give the client a chance
1288 * to clean up the "cctx" (if needed). 1311 * to clean up the "cctx" (if needed).
1289 */ 1312 */
1290 struct { 1313 struct
1314 {
1291 /** 1315 /**
1292 * Private context set for for this result 1316 * Private context set for for this result
1293 * during the "RESULT" event. 1317 * during the "RESULT" event.
@@ -1314,7 +1338,8 @@ struct GNUNET_FS_ProgressInfo {
1314 * happens primarily to give the client a chance 1338 * happens primarily to give the client a chance
1315 * to clean up the "cctx" (if needed). 1339 * to clean up the "cctx" (if needed).
1316 */ 1340 */
1317 struct { 1341 struct
1342 {
1318 /** 1343 /**
1319 * Private context set for for this result 1344 * Private context set for for this result
1320 * during the "RESULT" event. 1345 * during the "RESULT" event.
@@ -1336,7 +1361,8 @@ struct GNUNET_FS_ProgressInfo {
1336 * These values are only valid for 1361 * These values are only valid for
1337 * #GNUNET_FS_STATUS_SEARCH_RESUME events. 1362 * #GNUNET_FS_STATUS_SEARCH_RESUME events.
1338 */ 1363 */
1339 struct { 1364 struct
1365 {
1340 /** 1366 /**
1341 * Error message, NULL if we have not encountered any error yet. 1367 * Error message, NULL if we have not encountered any error yet.
1342 */ 1368 */
@@ -1352,7 +1378,8 @@ struct GNUNET_FS_ProgressInfo {
1352 * These values are only valid for 1378 * These values are only valid for
1353 * #GNUNET_FS_STATUS_SEARCH_ERROR events. 1379 * #GNUNET_FS_STATUS_SEARCH_ERROR events.
1354 */ 1380 */
1355 struct { 1381 struct
1382 {
1356 /** 1383 /**
1357 * Error message. 1384 * Error message.
1358 */ 1385 */
@@ -1362,7 +1389,8 @@ struct GNUNET_FS_ProgressInfo {
1362 /** 1389 /**
1363 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events. 1390 * Values for #GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE events.
1364 */ 1391 */
1365 struct { 1392 struct
1393 {
1366 /** 1394 /**
1367 * Short, human-readable name of the namespace. 1395 * Short, human-readable name of the namespace.
1368 */ 1396 */
@@ -1389,7 +1417,8 @@ struct GNUNET_FS_ProgressInfo {
1389 /** 1417 /**
1390 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. 1418 * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events.
1391 */ 1419 */
1392 struct { 1420 struct
1421 {
1393 /** 1422 /**
1394 * Context for controlling the unindexing. 1423 * Context for controlling the unindexing.
1395 */ 1424 */
@@ -1433,12 +1462,14 @@ struct GNUNET_FS_ProgressInfo {
1433 /** 1462 /**
1434 * Additional values for specific events. 1463 * Additional values for specific events.
1435 */ 1464 */
1436 union { 1465 union
1466 {
1437 /** 1467 /**
1438 * These values are only valid for 1468 * These values are only valid for
1439 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events. 1469 * #GNUNET_FS_STATUS_UNINDEX_PROGRESS events.
1440 */ 1470 */
1441 struct { 1471 struct
1472 {
1442 /** 1473 /**
1443 * Data block we just unindexed. 1474 * Data block we just unindexed.
1444 */ 1475 */
@@ -1465,7 +1496,8 @@ struct GNUNET_FS_ProgressInfo {
1465 * These values are only valid for 1496 * These values are only valid for
1466 * #GNUNET_FS_STATUS_UNINDEX_RESUME events. 1497 * #GNUNET_FS_STATUS_UNINDEX_RESUME events.
1467 */ 1498 */
1468 struct { 1499 struct
1500 {
1469 /** 1501 /**
1470 * Error message, NULL if we have not encountered any error yet. 1502 * Error message, NULL if we have not encountered any error yet.
1471 */ 1503 */
@@ -1476,7 +1508,8 @@ struct GNUNET_FS_ProgressInfo {
1476 * These values are only valid for 1508 * These values are only valid for
1477 * #GNUNET_FS_STATUS_UNINDEX_ERROR events. 1509 * #GNUNET_FS_STATUS_UNINDEX_ERROR events.
1478 */ 1510 */
1479 struct { 1511 struct
1512 {
1480 /** 1513 /**
1481 * Error message. 1514 * Error message.
1482 */ 1515 */
@@ -1521,7 +1554,8 @@ typedef void *
1521/** 1554/**
1522 * General (global) option flags for file-sharing. 1555 * General (global) option flags for file-sharing.
1523 */ 1556 */
1524enum GNUNET_FS_Flags { 1557enum GNUNET_FS_Flags
1558{
1525 /** 1559 /**
1526 * No special flags set. 1560 * No special flags set.
1527 */ 1561 */
@@ -1545,7 +1579,8 @@ enum GNUNET_FS_Flags {
1545/** 1579/**
1546 * Options specified in the VARARGs portion of GNUNET_FS_start. 1580 * Options specified in the VARARGs portion of GNUNET_FS_start.
1547 */ 1581 */
1548enum GNUNET_FS_OPTIONS { 1582enum GNUNET_FS_OPTIONS
1583{
1549 /** 1584 /**
1550 * Last option in the VARARG list. 1585 * Last option in the VARARG list.
1551 */ 1586 */
@@ -1572,7 +1607,8 @@ enum GNUNET_FS_OPTIONS {
1572 * Settings for publishing a block (which may of course also 1607 * Settings for publishing a block (which may of course also
1573 * apply to an entire directory or file). 1608 * apply to an entire directory or file).
1574 */ 1609 */
1575struct GNUNET_FS_BlockOptions { 1610struct GNUNET_FS_BlockOptions
1611{
1576 /** 1612 /**
1577 * At what time should the block expire? Data blocks (DBLOCKS and 1613 * At what time should the block expire? Data blocks (DBLOCKS and
1578 * IBLOCKS) may still be used even if they are expired (however, 1614 * IBLOCKS) may still be used even if they are expired (however,
@@ -1628,12 +1664,12 @@ struct GNUNET_FS_Handle;
1628 * @return NULL on error 1664 * @return NULL on error
1629 */ 1665 */
1630struct GNUNET_FS_Handle * 1666struct GNUNET_FS_Handle *
1631GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 1667GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
1632 const char *client_name, 1668 const char *client_name,
1633 GNUNET_FS_ProgressCallback upcb, 1669 GNUNET_FS_ProgressCallback upcb,
1634 void *upcb_cls, 1670 void *upcb_cls,
1635 enum GNUNET_FS_Flags flags, 1671 enum GNUNET_FS_Flags flags,
1636 ...); 1672 ...);
1637 1673
1638 1674
1639/** 1675/**
@@ -1646,7 +1682,7 @@ GNUNET_FS_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
1646 * @param h handle that was returned from #GNUNET_FS_start() 1682 * @param h handle that was returned from #GNUNET_FS_start()
1647 */ 1683 */
1648void 1684void
1649GNUNET_FS_stop(struct GNUNET_FS_Handle *h); 1685GNUNET_FS_stop (struct GNUNET_FS_Handle *h);
1650 1686
1651 1687
1652/** 1688/**
@@ -1669,7 +1705,7 @@ typedef int
1669 struct GNUNET_FS_FileInformation *fi, 1705 struct GNUNET_FS_FileInformation *fi,
1670 uint64_t length, 1706 uint64_t length,
1671 struct GNUNET_CONTAINER_MetaData *meta, 1707 struct GNUNET_CONTAINER_MetaData *meta,
1672 struct GNUNET_FS_Uri ** uri, 1708 struct GNUNET_FS_Uri **uri,
1673 struct GNUNET_FS_BlockOptions *bo, 1709 struct GNUNET_FS_BlockOptions *bo,
1674 int *do_index, 1710 int *do_index,
1675 void **client_info); 1711 void **client_info);
@@ -1685,7 +1721,7 @@ typedef int
1685 * to read this fi-struct from disk. 1721 * to read this fi-struct from disk.
1686 */ 1722 */
1687const char * 1723const char *
1688GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s); 1724GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
1689 1725
1690 1726
1691/** 1727/**
@@ -1695,7 +1731,7 @@ GNUNET_FS_file_information_get_id(struct GNUNET_FS_FileInformation *s);
1695 * @return "filename" field of the structure (can be NULL) 1731 * @return "filename" field of the structure (can be NULL)
1696 */ 1732 */
1697const char * 1733const char *
1698GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s); 1734GNUNET_FS_file_information_get_filename (struct GNUNET_FS_FileInformation *s);
1699 1735
1700 1736
1701/** 1737/**
@@ -1707,8 +1743,8 @@ GNUNET_FS_file_information_get_filename(struct GNUNET_FS_FileInformation *s);
1707 * @param filename filename to set 1743 * @param filename filename to set
1708 */ 1744 */
1709void 1745void
1710GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s, 1746GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s,
1711 const char *filename); 1747 const char *filename);
1712 1748
1713 1749
1714/** 1750/**
@@ -1726,13 +1762,16 @@ GNUNET_FS_file_information_set_filename(struct GNUNET_FS_FileInformation *s,
1726 * @return publish structure entry for the file 1762 * @return publish structure entry for the file
1727 */ 1763 */
1728struct GNUNET_FS_FileInformation * 1764struct GNUNET_FS_FileInformation *
1729GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h, 1765GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
1730 void *client_info, 1766 void *client_info,
1731 const char *filename, 1767 const char *filename,
1732 const struct GNUNET_FS_Uri *keywords, 1768 const struct
1733 const struct GNUNET_CONTAINER_MetaData *meta, 1769 GNUNET_FS_Uri *keywords,
1734 int do_index, 1770 const struct
1735 const struct GNUNET_FS_BlockOptions *bo); 1771 GNUNET_CONTAINER_MetaData *meta,
1772 int do_index,
1773 const struct
1774 GNUNET_FS_BlockOptions *bo);
1736 1775
1737 1776
1738/** 1777/**
@@ -1752,14 +1791,17 @@ GNUNET_FS_file_information_create_from_file(struct GNUNET_FS_Handle *h,
1752 * @return publish structure entry for the file 1791 * @return publish structure entry for the file
1753 */ 1792 */
1754struct GNUNET_FS_FileInformation * 1793struct GNUNET_FS_FileInformation *
1755GNUNET_FS_file_information_create_from_data(struct GNUNET_FS_Handle *h, 1794GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h,
1756 void *client_info, 1795 void *client_info,
1757 uint64_t length, 1796 uint64_t length,
1758 void *data, 1797 void *data,
1759 const struct GNUNET_FS_Uri *keywords, 1798 const struct
1760 const struct GNUNET_CONTAINER_MetaData *meta, 1799 GNUNET_FS_Uri *keywords,
1761 int do_index, 1800 const struct
1762 const struct GNUNET_FS_BlockOptions *bo); 1801 GNUNET_CONTAINER_MetaData *meta,
1802 int do_index,
1803 const struct
1804 GNUNET_FS_BlockOptions *bo);
1763 1805
1764 1806
1765/** 1807/**
@@ -1807,18 +1849,18 @@ typedef size_t
1807 * @return publish structure entry for the file 1849 * @return publish structure entry for the file
1808 */ 1850 */
1809struct GNUNET_FS_FileInformation * 1851struct GNUNET_FS_FileInformation *
1810GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h, 1852GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h,
1811 void *client_info, 1853 void *client_info,
1812 uint64_t length, 1854 uint64_t length,
1813 GNUNET_FS_DataReader reader, 1855 GNUNET_FS_DataReader reader,
1814 void *reader_cls, 1856 void *reader_cls,
1815 const struct GNUNET_FS_Uri 1857 const struct GNUNET_FS_Uri
1816 *keywords, 1858 *keywords,
1817 const struct 1859 const struct
1818 GNUNET_CONTAINER_MetaData *meta, 1860 GNUNET_CONTAINER_MetaData *meta,
1819 int do_index, 1861 int do_index,
1820 const struct 1862 const struct
1821 GNUNET_FS_BlockOptions *bo); 1863 GNUNET_FS_BlockOptions *bo);
1822 1864
1823 1865
1824/** 1866/**
@@ -1834,16 +1876,16 @@ GNUNET_FS_file_information_create_from_reader(struct GNUNET_FS_Handle *h,
1834 * @return publish structure entry for the directory , NULL on error 1876 * @return publish structure entry for the directory , NULL on error
1835 */ 1877 */
1836struct GNUNET_FS_FileInformation * 1878struct GNUNET_FS_FileInformation *
1837GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h, 1879GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h,
1838 void *client_info, 1880 void *client_info,
1839 const struct GNUNET_FS_Uri 1881 const struct GNUNET_FS_Uri
1840 *keywords, 1882 *keywords,
1841 const struct 1883 const struct
1842 GNUNET_CONTAINER_MetaData 1884 GNUNET_CONTAINER_MetaData
1843 *meta, 1885 *meta,
1844 const struct 1886 const struct
1845 GNUNET_FS_BlockOptions *bo, 1887 GNUNET_FS_BlockOptions *bo,
1846 const char *filename); 1888 const char *filename);
1847 1889
1848 1890
1849/** 1891/**
@@ -1853,8 +1895,8 @@ GNUNET_FS_file_information_create_empty_directory(struct GNUNET_FS_Handle *h,
1853 * @return #GNUNET_YES if so, #GNUNET_NO if not 1895 * @return #GNUNET_YES if so, #GNUNET_NO if not
1854 */ 1896 */
1855int 1897int
1856GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation 1898GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation
1857 *ent); 1899 *ent);
1858 1900
1859 1901
1860/** 1902/**
@@ -1869,8 +1911,8 @@ GNUNET_FS_file_information_is_directory(const struct GNUNET_FS_FileInformation
1869 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1911 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1870 */ 1912 */
1871int 1913int
1872GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir, 1914GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
1873 struct GNUNET_FS_FileInformation *ent); 1915 struct GNUNET_FS_FileInformation *ent);
1874 1916
1875 1917
1876/** 1918/**
@@ -1888,9 +1930,9 @@ GNUNET_FS_file_information_add(struct GNUNET_FS_FileInformation *dir,
1888 * @param proc_cls closure for @a proc 1930 * @param proc_cls closure for @a proc
1889 */ 1931 */
1890void 1932void
1891GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir, 1933GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
1892 GNUNET_FS_FileInformationProcessor proc, 1934 GNUNET_FS_FileInformationProcessor proc,
1893 void *proc_cls); 1935 void *proc_cls);
1894 1936
1895 1937
1896/** 1938/**
@@ -1904,16 +1946,17 @@ GNUNET_FS_file_information_inspect(struct GNUNET_FS_FileInformation *dir,
1904 * @param cleaner_cls closure for @a cleaner 1946 * @param cleaner_cls closure for @a cleaner
1905 */ 1947 */
1906void 1948void
1907GNUNET_FS_file_information_destroy(struct GNUNET_FS_FileInformation *fi, 1949GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
1908 GNUNET_FS_FileInformationProcessor cleaner, 1950 GNUNET_FS_FileInformationProcessor cleaner,
1909 void *cleaner_cls); 1951 void *cleaner_cls);
1910 1952
1911 1953
1912/** 1954/**
1913 * Options for publishing. Compatible options 1955 * Options for publishing. Compatible options
1914 * can be OR'ed together. 1956 * can be OR'ed together.
1915 */ 1957 */
1916enum GNUNET_FS_PublishOptions { 1958enum GNUNET_FS_PublishOptions
1959{
1917 /** 1960 /**
1918 * No options (use defaults for everything). 1961 * No options (use defaults for everything).
1919 */ 1962 */
@@ -1941,12 +1984,12 @@ enum GNUNET_FS_PublishOptions {
1941 * @return context that can be used to control the publish operation 1984 * @return context that can be used to control the publish operation
1942 */ 1985 */
1943struct GNUNET_FS_PublishContext * 1986struct GNUNET_FS_PublishContext *
1944GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h, 1987GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1945 struct GNUNET_FS_FileInformation *fi, 1988 struct GNUNET_FS_FileInformation *fi,
1946 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 1989 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
1947 const char *nid, 1990 const char *nid,
1948 const char *nuid, 1991 const char *nuid,
1949 enum GNUNET_FS_PublishOptions options); 1992 enum GNUNET_FS_PublishOptions options);
1950 1993
1951 1994
1952/** 1995/**
@@ -1958,7 +2001,7 @@ GNUNET_FS_publish_start(struct GNUNET_FS_Handle *h,
1958 * @param pc context for the publication to stop 2001 * @param pc context for the publication to stop
1959 */ 2002 */
1960void 2003void
1961GNUNET_FS_publish_stop(struct GNUNET_FS_PublishContext *pc); 2004GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc);
1962 2005
1963 2006
1964/** 2007/**
@@ -1995,13 +2038,13 @@ struct GNUNET_FS_PublishKskContext;
1995 * @return NULL on error (@a cont will still be called) 2038 * @return NULL on error (@a cont will still be called)
1996 */ 2039 */
1997struct GNUNET_FS_PublishKskContext * 2040struct GNUNET_FS_PublishKskContext *
1998GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h, 2041GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1999 const struct GNUNET_FS_Uri *ksk_uri, 2042 const struct GNUNET_FS_Uri *ksk_uri,
2000 const struct GNUNET_CONTAINER_MetaData *meta, 2043 const struct GNUNET_CONTAINER_MetaData *meta,
2001 const struct GNUNET_FS_Uri *uri, 2044 const struct GNUNET_FS_Uri *uri,
2002 const struct GNUNET_FS_BlockOptions *bo, 2045 const struct GNUNET_FS_BlockOptions *bo,
2003 enum GNUNET_FS_PublishOptions options, 2046 enum GNUNET_FS_PublishOptions options,
2004 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2047 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2005 2048
2006 2049
2007/** 2050/**
@@ -2010,7 +2053,7 @@ GNUNET_FS_publish_ksk(struct GNUNET_FS_Handle *h,
2010 * @param pkc context of the operation to abort. 2053 * @param pkc context of the operation to abort.
2011 */ 2054 */
2012void 2055void
2013GNUNET_FS_publish_ksk_cancel(struct GNUNET_FS_PublishKskContext *pkc); 2056GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc);
2014 2057
2015 2058
2016/** 2059/**
@@ -2035,15 +2078,15 @@ struct GNUNET_FS_PublishSksContext;
2035 * @return NULL on error (@a cont will still be called) 2078 * @return NULL on error (@a cont will still be called)
2036 */ 2079 */
2037struct GNUNET_FS_PublishSksContext * 2080struct GNUNET_FS_PublishSksContext *
2038GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h, 2081GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
2039 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2082 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2040 const char *identifier, 2083 const char *identifier,
2041 const char *update, 2084 const char *update,
2042 const struct GNUNET_CONTAINER_MetaData *meta, 2085 const struct GNUNET_CONTAINER_MetaData *meta,
2043 const struct GNUNET_FS_Uri *uri, 2086 const struct GNUNET_FS_Uri *uri,
2044 const struct GNUNET_FS_BlockOptions *bo, 2087 const struct GNUNET_FS_BlockOptions *bo,
2045 enum GNUNET_FS_PublishOptions options, 2088 enum GNUNET_FS_PublishOptions options,
2046 GNUNET_FS_PublishContinuation cont, void *cont_cls); 2089 GNUNET_FS_PublishContinuation cont, void *cont_cls);
2047 2090
2048 2091
2049/** 2092/**
@@ -2052,7 +2095,7 @@ GNUNET_FS_publish_sks(struct GNUNET_FS_Handle *h,
2052 * @param psc context of the operation to abort. 2095 * @param psc context of the operation to abort.
2053 */ 2096 */
2054void 2097void
2055GNUNET_FS_publish_sks_cancel(struct GNUNET_FS_PublishSksContext *psc); 2098GNUNET_FS_publish_sks_cancel (struct GNUNET_FS_PublishSksContext *psc);
2056 2099
2057 2100
2058/** 2101/**
@@ -2084,9 +2127,9 @@ struct GNUNET_FS_GetIndexedContext;
2084 * @return NULL on error (@a iterator is not called) 2127 * @return NULL on error (@a iterator is not called)
2085 */ 2128 */
2086struct GNUNET_FS_GetIndexedContext * 2129struct GNUNET_FS_GetIndexedContext *
2087GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h, 2130GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h,
2088 GNUNET_FS_IndexedFileProcessor iterator, 2131 GNUNET_FS_IndexedFileProcessor iterator,
2089 void *iterator_cls); 2132 void *iterator_cls);
2090 2133
2091 2134
2092/** 2135/**
@@ -2095,7 +2138,7 @@ GNUNET_FS_get_indexed_files(struct GNUNET_FS_Handle *h,
2095 * @param gic operation to cancel 2138 * @param gic operation to cancel
2096 */ 2139 */
2097void 2140void
2098GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic); 2141GNUNET_FS_get_indexed_files_cancel (struct GNUNET_FS_GetIndexedContext *gic);
2099 2142
2100 2143
2101/** 2144/**
@@ -2107,9 +2150,9 @@ GNUNET_FS_get_indexed_files_cancel(struct GNUNET_FS_GetIndexedContext *gic);
2107 * @return NULL on error, otherwise handle 2150 * @return NULL on error, otherwise handle
2108 */ 2151 */
2109struct GNUNET_FS_UnindexContext * 2152struct GNUNET_FS_UnindexContext *
2110GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h, 2153GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h,
2111 const char *filename, 2154 const char *filename,
2112 void *cctx); 2155 void *cctx);
2113 2156
2114 2157
2115/** 2158/**
@@ -2118,7 +2161,7 @@ GNUNET_FS_unindex_start(struct GNUNET_FS_Handle *h,
2118 * @param uc handle 2161 * @param uc handle
2119 */ 2162 */
2120void 2163void
2121GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc); 2164GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc);
2122 2165
2123 2166
2124/** 2167/**
@@ -2132,8 +2175,11 @@ GNUNET_FS_unindex_stop(struct GNUNET_FS_UnindexContext *uc);
2132 */ 2175 */
2133typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, 2176typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2134 const char *last_id, 2177 const char *last_id,
2135 const struct GNUNET_FS_Uri *last_uri, 2178 const struct
2136 const struct GNUNET_CONTAINER_MetaData *last_meta, 2179 GNUNET_FS_Uri *last_uri,
2180 const struct
2181 GNUNET_CONTAINER_MetaData *
2182 last_meta,
2137 const char *next_id); 2183 const char *next_id);
2138 2184
2139 2185
@@ -2159,18 +2205,20 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls,
2159 * @param ip_cls closure for @a ip 2205 * @param ip_cls closure for @a ip
2160 */ 2206 */
2161void 2207void
2162GNUNET_FS_namespace_list_updateable(struct GNUNET_FS_Handle *h, 2208GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Handle *h,
2163 const struct GNUNET_CRYPTO_EcdsaPrivateKey *ns, 2209 const struct
2164 const char *next_id, 2210 GNUNET_CRYPTO_EcdsaPrivateKey *ns,
2165 GNUNET_FS_IdentifierProcessor ip, 2211 const char *next_id,
2166 void *ip_cls); 2212 GNUNET_FS_IdentifierProcessor ip,
2213 void *ip_cls);
2167 2214
2168 2215
2169/** 2216/**
2170 * Options for searching. Compatible options 2217 * Options for searching. Compatible options
2171 * can be OR'ed together. 2218 * can be OR'ed together.
2172 */ 2219 */
2173enum GNUNET_FS_SearchOptions { 2220enum GNUNET_FS_SearchOptions
2221{
2174 /** 2222 /**
2175 * No options (use defaults for everything). 2223 * No options (use defaults for everything).
2176 */ 2224 */
@@ -2195,9 +2243,9 @@ enum GNUNET_FS_SearchOptions {
2195 * @return context that can be used to control the search 2243 * @return context that can be used to control the search
2196 */ 2244 */
2197struct GNUNET_FS_SearchContext * 2245struct GNUNET_FS_SearchContext *
2198GNUNET_FS_search_start(struct GNUNET_FS_Handle *h, 2246GNUNET_FS_search_start (struct GNUNET_FS_Handle *h,
2199 const struct GNUNET_FS_Uri *uri, uint32_t anonymity, 2247 const struct GNUNET_FS_Uri *uri, uint32_t anonymity,
2200 enum GNUNET_FS_SearchOptions options, void *cctx); 2248 enum GNUNET_FS_SearchOptions options, void *cctx);
2201 2249
2202 2250
2203/** 2251/**
@@ -2206,7 +2254,7 @@ GNUNET_FS_search_start(struct GNUNET_FS_Handle *h,
2206 * @param sc context for the search that should be paused 2254 * @param sc context for the search that should be paused
2207 */ 2255 */
2208void 2256void
2209GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc); 2257GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc);
2210 2258
2211 2259
2212/** 2260/**
@@ -2215,7 +2263,7 @@ GNUNET_FS_search_pause(struct GNUNET_FS_SearchContext *sc);
2215 * @param sc context for the search that should be resumed 2263 * @param sc context for the search that should be resumed
2216 */ 2264 */
2217void 2265void
2218GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc); 2266GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc);
2219 2267
2220 2268
2221/** 2269/**
@@ -2224,7 +2272,7 @@ GNUNET_FS_search_continue(struct GNUNET_FS_SearchContext *sc);
2224 * @param sc context for the search that should be stopped 2272 * @param sc context for the search that should be stopped
2225 */ 2273 */
2226void 2274void
2227GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc); 2275GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc);
2228 2276
2229 2277
2230/** 2278/**
@@ -2238,11 +2286,11 @@ GNUNET_FS_search_stop(struct GNUNET_FS_SearchContext *sc);
2238 * @return the search result handle to access the probe activity 2286 * @return the search result handle to access the probe activity
2239 */ 2287 */
2240struct GNUNET_FS_SearchResult * 2288struct GNUNET_FS_SearchResult *
2241GNUNET_FS_probe(struct GNUNET_FS_Handle *h, 2289GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
2242 const struct GNUNET_FS_Uri *uri, 2290 const struct GNUNET_FS_Uri *uri,
2243 const struct GNUNET_CONTAINER_MetaData *meta, 2291 const struct GNUNET_CONTAINER_MetaData *meta,
2244 void *client_info, 2292 void *client_info,
2245 uint32_t anonymity); 2293 uint32_t anonymity);
2246 2294
2247 2295
2248/** 2296/**
@@ -2253,14 +2301,15 @@ GNUNET_FS_probe(struct GNUNET_FS_Handle *h,
2253 * @return the value of the 'client_info' pointer 2301 * @return the value of the 'client_info' pointer
2254 */ 2302 */
2255void * 2303void *
2256GNUNET_FS_probe_stop(struct GNUNET_FS_SearchResult *sr); 2304GNUNET_FS_probe_stop (struct GNUNET_FS_SearchResult *sr);
2257 2305
2258 2306
2259/** 2307/**
2260 * Options for downloading. Compatible options 2308 * Options for downloading. Compatible options
2261 * can be OR'ed together. 2309 * can be OR'ed together.
2262 */ 2310 */
2263enum GNUNET_FS_DownloadOptions { 2311enum GNUNET_FS_DownloadOptions
2312{
2264 /** 2313 /**
2265 * No options (use defaults for everything). 2314 * No options (use defaults for everything).
2266 */ 2315 */
@@ -2326,13 +2375,13 @@ enum GNUNET_FS_DownloadOptions {
2326 * @return context that can be used to control this download 2375 * @return context that can be used to control this download
2327 */ 2376 */
2328struct GNUNET_FS_DownloadContext * 2377struct GNUNET_FS_DownloadContext *
2329GNUNET_FS_download_start(struct GNUNET_FS_Handle *h, 2378GNUNET_FS_download_start (struct GNUNET_FS_Handle *h,
2330 const struct GNUNET_FS_Uri *uri, 2379 const struct GNUNET_FS_Uri *uri,
2331 const struct GNUNET_CONTAINER_MetaData *meta, 2380 const struct GNUNET_CONTAINER_MetaData *meta,
2332 const char *filename, const char *tempname, 2381 const char *filename, const char *tempname,
2333 uint64_t offset, uint64_t length, uint32_t anonymity, 2382 uint64_t offset, uint64_t length, uint32_t anonymity,
2334 enum GNUNET_FS_DownloadOptions options, void *cctx, 2383 enum GNUNET_FS_DownloadOptions options, void *cctx,
2335 struct GNUNET_FS_DownloadContext *parent); 2384 struct GNUNET_FS_DownloadContext *parent);
2336 2385
2337 2386
2338/** 2387/**
@@ -2370,13 +2419,13 @@ GNUNET_FS_download_start(struct GNUNET_FS_Handle *h,
2370 * @return context that can be used to control this download 2419 * @return context that can be used to control this download
2371 */ 2420 */
2372struct GNUNET_FS_DownloadContext * 2421struct GNUNET_FS_DownloadContext *
2373GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h, 2422GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h,
2374 struct GNUNET_FS_SearchResult *sr, 2423 struct GNUNET_FS_SearchResult *sr,
2375 const char *filename, 2424 const char *filename,
2376 const char *tempname, uint64_t offset, 2425 const char *tempname, uint64_t offset,
2377 uint64_t length, uint32_t anonymity, 2426 uint64_t length, uint32_t anonymity,
2378 enum GNUNET_FS_DownloadOptions options, 2427 enum GNUNET_FS_DownloadOptions options,
2379 void *cctx); 2428 void *cctx);
2380 2429
2381 2430
2382/** 2431/**
@@ -2386,7 +2435,7 @@ GNUNET_FS_download_start_from_search(struct GNUNET_FS_Handle *h,
2386 * @param do_delete delete files of incomplete downloads 2435 * @param do_delete delete files of incomplete downloads
2387 */ 2436 */
2388void 2437void
2389GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete); 2438GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete);
2390 2439
2391 2440
2392/** 2441/**
@@ -2395,7 +2444,7 @@ GNUNET_FS_download_stop(struct GNUNET_FS_DownloadContext *dc, int do_delete);
2395 * @param dc handle for the download 2444 * @param dc handle for the download
2396 */ 2445 */
2397void 2446void
2398GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc); 2447GNUNET_FS_download_suspend (struct GNUNET_FS_DownloadContext *dc);
2399 2448
2400 2449
2401/** 2450/**
@@ -2404,7 +2453,7 @@ GNUNET_FS_download_suspend(struct GNUNET_FS_DownloadContext *dc);
2404 * @param dc handle for the download 2453 * @param dc handle for the download
2405 */ 2454 */
2406void 2455void
2407GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc); 2456GNUNET_FS_download_resume (struct GNUNET_FS_DownloadContext *dc);
2408 2457
2409 2458
2410 2459
@@ -2423,8 +2472,8 @@ GNUNET_FS_download_resume(struct GNUNET_FS_DownloadContext *dc);
2423 * we have no mime-type information (treat as #GNUNET_NO) 2472 * we have no mime-type information (treat as #GNUNET_NO)
2424 */ 2473 */
2425int 2474int
2426GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData 2475GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData
2427 *md); 2476 *md);
2428 2477
2429 2478
2430/** 2479/**
@@ -2434,7 +2483,7 @@ GNUNET_FS_meta_data_test_for_directory(const struct GNUNET_CONTAINER_MetaData
2434 * @param md metadata to add mimetype to 2483 * @param md metadata to add mimetype to
2435 */ 2484 */
2436void 2485void
2437GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md); 2486GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md);
2438 2487
2439 2488
2440/** 2489/**
@@ -2444,7 +2493,8 @@ GNUNET_FS_meta_data_make_directory(struct GNUNET_CONTAINER_MetaData *md);
2444 * @return NULL if meta data is useless for suggesting a filename 2493 * @return NULL if meta data is useless for suggesting a filename
2445 */ 2494 */
2446char * 2495char *
2447GNUNET_FS_meta_data_suggest_filename(const struct GNUNET_CONTAINER_MetaData *md); 2496GNUNET_FS_meta_data_suggest_filename (const struct
2497 GNUNET_CONTAINER_MetaData *md);
2448 2498
2449 2499
2450/** 2500/**
@@ -2492,10 +2542,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls,
2492 * #GNUNET_SYSERR if 'data' does not represent a directory 2542 * #GNUNET_SYSERR if 'data' does not represent a directory
2493 */ 2543 */
2494int 2544int
2495GNUNET_FS_directory_list_contents(size_t size, const void *data, 2545GNUNET_FS_directory_list_contents (size_t size, const void *data,
2496 uint64_t offset, 2546 uint64_t offset,
2497 GNUNET_FS_DirectoryEntryProcessor dep, 2547 GNUNET_FS_DirectoryEntryProcessor dep,
2498 void *dep_cls); 2548 void *dep_cls);
2499 2549
2500 2550
2501/** 2551/**
@@ -2510,8 +2560,8 @@ struct GNUNET_FS_DirectoryBuilder;
2510 * @param mdir metadata for the directory 2560 * @param mdir metadata for the directory
2511 */ 2561 */
2512struct GNUNET_FS_DirectoryBuilder * 2562struct GNUNET_FS_DirectoryBuilder *
2513GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData 2563GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData
2514 *mdir); 2564 *mdir);
2515 2565
2516 2566
2517/** 2567/**
@@ -2525,10 +2575,10 @@ GNUNET_FS_directory_builder_create(const struct GNUNET_CONTAINER_MetaData
2525 * by the uri 2575 * by the uri
2526 */ 2576 */
2527void 2577void
2528GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld, 2578GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
2529 const struct GNUNET_FS_Uri *uri, 2579 const struct GNUNET_FS_Uri *uri,
2530 const struct GNUNET_CONTAINER_MetaData *md, 2580 const struct GNUNET_CONTAINER_MetaData *md,
2531 const void *data); 2581 const void *data);
2532 2582
2533 2583
2534/** 2584/**
@@ -2542,8 +2592,8 @@ GNUNET_FS_directory_builder_add(struct GNUNET_FS_DirectoryBuilder *bld,
2542 * @return #GNUNET_OK on success 2592 * @return #GNUNET_OK on success
2543 */ 2593 */
2544int 2594int
2545GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld, 2595GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
2546 size_t * rsize, void **rdata); 2596 size_t *rsize, void **rdata);
2547 2597
2548 2598
2549/* ******************** DirScanner API *********************** */ 2599/* ******************** DirScanner API *********************** */
@@ -2551,7 +2601,8 @@ GNUNET_FS_directory_builder_finish(struct GNUNET_FS_DirectoryBuilder *bld,
2551/** 2601/**
2552 * Progress reasons of the directory scanner. 2602 * Progress reasons of the directory scanner.
2553 */ 2603 */
2554enum GNUNET_FS_DirScannerProgressUpdateReason { 2604enum GNUNET_FS_DirScannerProgressUpdateReason
2605{
2555 /** 2606 /**
2556 * We've started processing a file or directory. 2607 * We've started processing a file or directory.
2557 */ 2608 */
@@ -2600,13 +2651,16 @@ enum GNUNET_FS_DirScannerProgressUpdateReason {
2600typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls, 2651typedef void (*GNUNET_FS_DirScannerProgressCallback) (void *cls,
2601 const char *filename, 2652 const char *filename,
2602 int is_directory, 2653 int is_directory,
2603 enum GNUNET_FS_DirScannerProgressUpdateReason reason); 2654 enum
2655 GNUNET_FS_DirScannerProgressUpdateReason
2656 reason);
2604 2657
2605 2658
2606/** 2659/**
2607 * A node of a directory tree (produced by dirscanner) 2660 * A node of a directory tree (produced by dirscanner)
2608 */ 2661 */
2609struct GNUNET_FS_ShareTreeItem { 2662struct GNUNET_FS_ShareTreeItem
2663{
2610 /** 2664 /**
2611 * This is a doubly-linked list 2665 * This is a doubly-linked list
2612 */ 2666 */
@@ -2680,11 +2734,11 @@ struct GNUNET_FS_DirScanner;
2680 * @return directory scanner object to be used for controlling the scanner 2734 * @return directory scanner object to be used for controlling the scanner
2681 */ 2735 */
2682struct GNUNET_FS_DirScanner * 2736struct GNUNET_FS_DirScanner *
2683GNUNET_FS_directory_scan_start(const char *filename, 2737GNUNET_FS_directory_scan_start (const char *filename,
2684 int disable_extractor, 2738 int disable_extractor,
2685 const char *ex, 2739 const char *ex,
2686 GNUNET_FS_DirScannerProgressCallback cb, 2740 GNUNET_FS_DirScannerProgressCallback cb,
2687 void *cb_cls); 2741 void *cb_cls);
2688 2742
2689 2743
2690/** 2744/**
@@ -2694,7 +2748,7 @@ GNUNET_FS_directory_scan_start(const char *filename,
2694 * @param ds directory scanner structure 2748 * @param ds directory scanner structure
2695 */ 2749 */
2696void 2750void
2697GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds); 2751GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds);
2698 2752
2699 2753
2700/** 2754/**
@@ -2706,7 +2760,7 @@ GNUNET_FS_directory_scan_abort(struct GNUNET_FS_DirScanner *ds);
2706 * @return the results of the scan (a directory tree) 2760 * @return the results of the scan (a directory tree)
2707 */ 2761 */
2708struct GNUNET_FS_ShareTreeItem * 2762struct GNUNET_FS_ShareTreeItem *
2709GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds); 2763GNUNET_FS_directory_scan_get_result (struct GNUNET_FS_DirScanner *ds);
2710 2764
2711 2765
2712/** 2766/**
@@ -2716,7 +2770,7 @@ GNUNET_FS_directory_scan_get_result(struct GNUNET_FS_DirScanner *ds);
2716 * @param toplevel toplevel directory in the tree, returned by the scanner 2770 * @param toplevel toplevel directory in the tree, returned by the scanner
2717 */ 2771 */
2718void 2772void
2719GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel); 2773GNUNET_FS_share_tree_trim (struct GNUNET_FS_ShareTreeItem *toplevel);
2720 2774
2721 2775
2722/** 2776/**
@@ -2725,7 +2779,7 @@ GNUNET_FS_share_tree_trim(struct GNUNET_FS_ShareTreeItem *toplevel);
2725 * @param toplevel toplevel of the tree to be freed 2779 * @param toplevel toplevel of the tree to be freed
2726 */ 2780 */
2727void 2781void
2728GNUNET_FS_share_tree_free(struct GNUNET_FS_ShareTreeItem *toplevel); 2782GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel);
2729 2783
2730 2784
2731#if 0 /* keep Emacsens' auto-indent happy */ 2785#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index ef744fbc9..0d6ed4fc7 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -44,7 +44,8 @@ extern "C" {
44/** 44/**
45 * @brief General context for command line processors. 45 * @brief General context for command line processors.
46 */ 46 */
47struct GNUNET_GETOPT_CommandLineProcessorContext { 47struct GNUNET_GETOPT_CommandLineProcessorContext
48{
48 /** 49 /**
49 * Name of the application 50 * Name of the application
50 */ 51 */
@@ -96,7 +97,8 @@ typedef int (*GNUNET_GETOPT_CommandLineOptionProcessor) (
96/** 97/**
97 * @brief Definition of a command line option. 98 * @brief Definition of a command line option.
98 */ 99 */
99struct GNUNET_GETOPT_CommandLineOption { 100struct GNUNET_GETOPT_CommandLineOption
101{
100 /** 102 /**
101 * Short name of the option. 103 * Short name of the option.
102 */ 104 */
@@ -158,7 +160,7 @@ struct GNUNET_GETOPT_CommandLineOption {
158 * @param about string with brief description of the application 160 * @param about string with brief description of the application
159 */ 161 */
160struct GNUNET_GETOPT_CommandLineOption 162struct GNUNET_GETOPT_CommandLineOption
161GNUNET_GETOPT_option_help(const char *about); 163GNUNET_GETOPT_option_help (const char *about);
162 164
163 165
164/** 166/**
@@ -168,7 +170,7 @@ GNUNET_GETOPT_option_help(const char *about);
168 * @param version string with the version number 170 * @param version string with the version number
169 */ 171 */
170struct GNUNET_GETOPT_CommandLineOption 172struct GNUNET_GETOPT_CommandLineOption
171GNUNET_GETOPT_option_version(const char *version); 173GNUNET_GETOPT_option_version (const char *version);
172 174
173 175
174/** 176/**
@@ -177,7 +179,7 @@ GNUNET_GETOPT_option_version(const char *version);
177 * @param[out] logfn set to the name of the logfile 179 * @param[out] logfn set to the name of the logfile
178 */ 180 */
179struct GNUNET_GETOPT_CommandLineOption 181struct GNUNET_GETOPT_CommandLineOption
180GNUNET_GETOPT_option_logfile(char **logfn); 182GNUNET_GETOPT_option_logfile (char **logfn);
181 183
182 184
183/** 185/**
@@ -190,11 +192,11 @@ GNUNET_GETOPT_option_logfile(char **logfn);
190 * @param[out] str set to the string 192 * @param[out] str set to the string
191 */ 193 */
192struct GNUNET_GETOPT_CommandLineOption 194struct GNUNET_GETOPT_CommandLineOption
193GNUNET_GETOPT_option_string(char shortName, 195GNUNET_GETOPT_option_string (char shortName,
194 const char *name, 196 const char *name,
195 const char *argumentHelp, 197 const char *argumentHelp,
196 const char *description, 198 const char *description,
197 char **str); 199 char **str);
198 200
199/** 201/**
200 * Allow user to specify a filename (automatically path expanded). 202 * Allow user to specify a filename (automatically path expanded).
@@ -206,11 +208,11 @@ GNUNET_GETOPT_option_string(char shortName,
206 * @param[out] str set to the string 208 * @param[out] str set to the string
207 */ 209 */
208struct GNUNET_GETOPT_CommandLineOption 210struct GNUNET_GETOPT_CommandLineOption
209GNUNET_GETOPT_option_filename(char shortName, 211GNUNET_GETOPT_option_filename (char shortName,
210 const char *name, 212 const char *name,
211 const char *argumentHelp, 213 const char *argumentHelp,
212 const char *description, 214 const char *description,
213 char **str); 215 char **str);
214 216
215 217
216/** 218/**
@@ -225,12 +227,12 @@ GNUNET_GETOPT_option_filename(char shortName,
225 * @param val_size size of @a val in bytes 227 * @param val_size size of @a val in bytes
226 */ 228 */
227struct GNUNET_GETOPT_CommandLineOption 229struct GNUNET_GETOPT_CommandLineOption
228GNUNET_GETOPT_option_base32_fixed_size(char shortName, 230GNUNET_GETOPT_option_base32_fixed_size (char shortName,
229 const char *name, 231 const char *name,
230 const char *argumentHelp, 232 const char *argumentHelp,
231 const char *description, 233 const char *description,
232 void *val, 234 void *val,
233 size_t val_size); 235 size_t val_size);
234 236
235 237
236/** 238/**
@@ -250,12 +252,12 @@ GNUNET_GETOPT_option_base32_fixed_size(char shortName,
250 argumentHelp, \ 252 argumentHelp, \
251 description, \ 253 description, \
252 val) \ 254 val) \
253 GNUNET_GETOPT_option_base32_fixed_size(shortName, \ 255 GNUNET_GETOPT_option_base32_fixed_size (shortName, \
254 name, \ 256 name, \
255 argumentHelp, \ 257 argumentHelp, \
256 description, \ 258 description, \
257 val, \ 259 val, \
258 sizeof(*val)) 260 sizeof(*val))
259 261
260 262
261/** 263/**
@@ -268,10 +270,10 @@ GNUNET_GETOPT_option_base32_fixed_size(char shortName,
268 * @param[out] val set to 1 if the option is present 270 * @param[out] val set to 1 if the option is present
269 */ 271 */
270struct GNUNET_GETOPT_CommandLineOption 272struct GNUNET_GETOPT_CommandLineOption
271GNUNET_GETOPT_option_flag(char shortName, 273GNUNET_GETOPT_option_flag (char shortName,
272 const char *name, 274 const char *name,
273 const char *description, 275 const char *description,
274 int *val); 276 int *val);
275 277
276 278
277/** 279/**
@@ -284,11 +286,11 @@ GNUNET_GETOPT_option_flag(char shortName,
284 * @param[out] val set to the value specified at the command line 286 * @param[out] val set to the value specified at the command line
285 */ 287 */
286struct GNUNET_GETOPT_CommandLineOption 288struct GNUNET_GETOPT_CommandLineOption
287GNUNET_GETOPT_option_uint(char shortName, 289GNUNET_GETOPT_option_uint (char shortName,
288 const char *name, 290 const char *name,
289 const char *argumentHelp, 291 const char *argumentHelp,
290 const char *description, 292 const char *description,
291 unsigned int *val); 293 unsigned int *val);
292 294
293 295
294/** 296/**
@@ -301,11 +303,11 @@ GNUNET_GETOPT_option_uint(char shortName,
301 * @param[out] val set to the value specified at the command line 303 * @param[out] val set to the value specified at the command line
302 */ 304 */
303struct GNUNET_GETOPT_CommandLineOption 305struct GNUNET_GETOPT_CommandLineOption
304GNUNET_GETOPT_option_uint16(char shortName, 306GNUNET_GETOPT_option_uint16 (char shortName,
305 const char *name, 307 const char *name,
306 const char *argumentHelp, 308 const char *argumentHelp,
307 const char *description, 309 const char *description,
308 uint16_t *val); 310 uint16_t *val);
309 311
310 312
311/** 313/**
@@ -318,11 +320,11 @@ GNUNET_GETOPT_option_uint16(char shortName,
318 * @param[out] val set to the value specified at the command line 320 * @param[out] val set to the value specified at the command line
319 */ 321 */
320struct GNUNET_GETOPT_CommandLineOption 322struct GNUNET_GETOPT_CommandLineOption
321GNUNET_GETOPT_option_ulong(char shortName, 323GNUNET_GETOPT_option_ulong (char shortName,
322 const char *name, 324 const char *name,
323 const char *argumentHelp, 325 const char *argumentHelp,
324 const char *description, 326 const char *description,
325 unsigned long long *val); 327 unsigned long long *val);
326 328
327 329
328/** 330/**
@@ -336,11 +338,11 @@ GNUNET_GETOPT_option_ulong(char shortName,
336 * @param[out] val set to the time specified at the command line 338 * @param[out] val set to the time specified at the command line
337 */ 339 */
338struct GNUNET_GETOPT_CommandLineOption 340struct GNUNET_GETOPT_CommandLineOption
339GNUNET_GETOPT_option_relative_time(char shortName, 341GNUNET_GETOPT_option_relative_time (char shortName,
340 const char *name, 342 const char *name,
341 const char *argumentHelp, 343 const char *argumentHelp,
342 const char *description, 344 const char *description,
343 struct GNUNET_TIME_Relative *val); 345 struct GNUNET_TIME_Relative *val);
344 346
345 347
346/** 348/**
@@ -354,11 +356,11 @@ GNUNET_GETOPT_option_relative_time(char shortName,
354 * @param[out] val set to the time specified at the command line 356 * @param[out] val set to the time specified at the command line
355 */ 357 */
356struct GNUNET_GETOPT_CommandLineOption 358struct GNUNET_GETOPT_CommandLineOption
357GNUNET_GETOPT_option_absolute_time(char shortName, 359GNUNET_GETOPT_option_absolute_time (char shortName,
358 const char *name, 360 const char *name,
359 const char *argumentHelp, 361 const char *argumentHelp,
360 const char *description, 362 const char *description,
361 struct GNUNET_TIME_Absolute *val); 363 struct GNUNET_TIME_Absolute *val);
362 364
363 365
364/** 366/**
@@ -371,10 +373,10 @@ GNUNET_GETOPT_option_absolute_time(char shortName,
371 * @param[out] val set to 1 if the option is present 373 * @param[out] val set to 1 if the option is present
372 */ 374 */
373struct GNUNET_GETOPT_CommandLineOption 375struct GNUNET_GETOPT_CommandLineOption
374GNUNET_GETOPT_option_increment_uint(char shortName, 376GNUNET_GETOPT_option_increment_uint (char shortName,
375 const char *name, 377 const char *name,
376 const char *description, 378 const char *description,
377 unsigned int *val); 379 unsigned int *val);
378 380
379 381
380/** 382/**
@@ -384,7 +386,7 @@ GNUNET_GETOPT_option_increment_uint(char shortName,
384 * @param[out] level set to the log level 386 * @param[out] level set to the log level
385 */ 387 */
386struct GNUNET_GETOPT_CommandLineOption 388struct GNUNET_GETOPT_CommandLineOption
387GNUNET_GETOPT_option_loglevel(char **level); 389GNUNET_GETOPT_option_loglevel (char **level);
388 390
389 391
390/** 392/**
@@ -394,7 +396,7 @@ GNUNET_GETOPT_option_loglevel(char **level);
394 * @param[out] level set to the verbosity level 396 * @param[out] level set to the verbosity level
395 */ 397 */
396struct GNUNET_GETOPT_CommandLineOption 398struct GNUNET_GETOPT_CommandLineOption
397GNUNET_GETOPT_option_verbose(unsigned int *level); 399GNUNET_GETOPT_option_verbose (unsigned int *level);
398 400
399 401
400/** 402/**
@@ -403,7 +405,7 @@ GNUNET_GETOPT_option_verbose(unsigned int *level);
403 * @param[out] logfn set to the name of the logfile 405 * @param[out] logfn set to the name of the logfile
404 */ 406 */
405struct GNUNET_GETOPT_CommandLineOption 407struct GNUNET_GETOPT_CommandLineOption
406GNUNET_GETOPT_option_logfile(char **logfn); 408GNUNET_GETOPT_option_logfile (char **logfn);
407 409
408 410
409/** 411/**
@@ -412,7 +414,7 @@ GNUNET_GETOPT_option_logfile(char **logfn);
412 * @param[out] fn set to the name of the configuration file 414 * @param[out] fn set to the name of the configuration file
413 */ 415 */
414struct GNUNET_GETOPT_CommandLineOption 416struct GNUNET_GETOPT_CommandLineOption
415GNUNET_GETOPT_option_cfgfile(char **fn); 417GNUNET_GETOPT_option_cfgfile (char **fn);
416 418
417 419
418/** 420/**
@@ -422,7 +424,7 @@ GNUNET_GETOPT_option_cfgfile(char **fn);
422 * @return @a opt with the mandatory flag set. 424 * @return @a opt with the mandatory flag set.
423 */ 425 */
424struct GNUNET_GETOPT_CommandLineOption 426struct GNUNET_GETOPT_CommandLineOption
425GNUNET_GETOPT_option_mandatory(struct GNUNET_GETOPT_CommandLineOption opt); 427GNUNET_GETOPT_option_mandatory (struct GNUNET_GETOPT_CommandLineOption opt);
426 428
427 429
428/** 430/**
@@ -432,7 +434,7 @@ GNUNET_GETOPT_option_mandatory(struct GNUNET_GETOPT_CommandLineOption opt);
432 * @return @a opt with the exclusive flag set. 434 * @return @a opt with the exclusive flag set.
433 */ 435 */
434struct GNUNET_GETOPT_CommandLineOption 436struct GNUNET_GETOPT_CommandLineOption
435GNUNET_GETOPT_option_exclusive(struct GNUNET_GETOPT_CommandLineOption opt); 437GNUNET_GETOPT_option_exclusive (struct GNUNET_GETOPT_CommandLineOption opt);
436 438
437 439
438/** 440/**
@@ -455,10 +457,10 @@ GNUNET_GETOPT_option_exclusive(struct GNUNET_GETOPT_CommandLineOption opt);
455 * argument, or #GNUNET_SYSERR on error 457 * argument, or #GNUNET_SYSERR on error
456 */ 458 */
457int 459int
458GNUNET_GETOPT_run(const char *binaryOptions, 460GNUNET_GETOPT_run (const char *binaryOptions,
459 const struct GNUNET_GETOPT_CommandLineOption *allOptions, 461 const struct GNUNET_GETOPT_CommandLineOption *allOptions,
460 unsigned int argc, 462 unsigned int argc,
461 char *const *argv); 463 char *const *argv);
462 464
463 465
464#if 0 /* keep Emacsens' auto-indent happy */ 466#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_gns_service.h b/src/include/gnunet_gns_service.h
index f66bec61e..9a8114e90 100644
--- a/src/include/gnunet_gns_service.h
+++ b/src/include/gnunet_gns_service.h
@@ -76,7 +76,7 @@ struct GNUNET_GNS_LookupWithTldRequest;
76 * @return handle to the GNS service, or NULL on error 76 * @return handle to the GNS service, or NULL on error
77 */ 77 */
78struct GNUNET_GNS_Handle * 78struct GNUNET_GNS_Handle *
79GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 79GNUNET_GNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
80 80
81 81
82/** 82/**
@@ -85,7 +85,7 @@ GNUNET_GNS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
85 * @param handle connection to shut down 85 * @param handle connection to shut down
86 */ 86 */
87void 87void
88GNUNET_GNS_disconnect(struct GNUNET_GNS_Handle *handle); 88GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle);
89 89
90 90
91/** 91/**
@@ -104,7 +104,8 @@ typedef void (*GNUNET_GNS_LookupResultProcessor) (
104/** 104/**
105 * Options for the GNS lookup. 105 * Options for the GNS lookup.
106 */ 106 */
107enum GNUNET_GNS_LocalOptions { 107enum GNUNET_GNS_LocalOptions
108{
108 /** 109 /**
109 * Defaults, look in cache, then in DHT. 110 * Defaults, look in cache, then in DHT.
110 */ 111 */
@@ -136,13 +137,13 @@ enum GNUNET_GNS_LocalOptions {
136 * @return handle to the queued request 137 * @return handle to the queued request
137 */ 138 */
138struct GNUNET_GNS_LookupRequest * 139struct GNUNET_GNS_LookupRequest *
139GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle, 140GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
140 const char *name, 141 const char *name,
141 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone, 142 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone,
142 uint32_t type, 143 uint32_t type,
143 enum GNUNET_GNS_LocalOptions options, 144 enum GNUNET_GNS_LocalOptions options,
144 GNUNET_GNS_LookupResultProcessor proc, 145 GNUNET_GNS_LookupResultProcessor proc,
145 void *proc_cls); 146 void *proc_cls);
146 147
147 148
148/** 149/**
@@ -152,7 +153,7 @@ GNUNET_GNS_lookup(struct GNUNET_GNS_Handle *handle,
152 * @return closure from the lookup result processor 153 * @return closure from the lookup result processor
153 */ 154 */
154void * 155void *
155GNUNET_GNS_lookup_cancel(struct GNUNET_GNS_LookupRequest *lr); 156GNUNET_GNS_lookup_cancel (struct GNUNET_GNS_LookupRequest *lr);
156 157
157 158
158/** 159/**
@@ -186,12 +187,12 @@ typedef void (*GNUNET_GNS_LookupResultProcessor2) (
186 * @return handle to the get request 187 * @return handle to the get request
187 */ 188 */
188struct GNUNET_GNS_LookupWithTldRequest * 189struct GNUNET_GNS_LookupWithTldRequest *
189GNUNET_GNS_lookup_with_tld(struct GNUNET_GNS_Handle *handle, 190GNUNET_GNS_lookup_with_tld (struct GNUNET_GNS_Handle *handle,
190 const char *name, 191 const char *name,
191 uint32_t type, 192 uint32_t type,
192 enum GNUNET_GNS_LocalOptions options, 193 enum GNUNET_GNS_LocalOptions options,
193 GNUNET_GNS_LookupResultProcessor2 proc, 194 GNUNET_GNS_LookupResultProcessor2 proc,
194 void *proc_cls); 195 void *proc_cls);
195 196
196 197
197/** 198/**
@@ -201,7 +202,7 @@ GNUNET_GNS_lookup_with_tld(struct GNUNET_GNS_Handle *handle,
201 * @return closure from the lookup result processor 202 * @return closure from the lookup result processor
202 */ 203 */
203void * 204void *
204GNUNET_GNS_lookup_with_tld_cancel(struct GNUNET_GNS_LookupWithTldRequest *ltr); 205GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr);
205 206
206 207
207#if 0 /* keep Emacsens' auto-indent happy */ 208#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h
index 5effa855f..f5b2f0dd1 100644
--- a/src/include/gnunet_gnsrecord_lib.h
+++ b/src/include/gnunet_gnsrecord_lib.h
@@ -144,7 +144,8 @@ extern "C" {
144/** 144/**
145 * Flags that can be set for a record. 145 * Flags that can be set for a record.
146 */ 146 */
147enum GNUNET_GNSRECORD_Flags { 147enum GNUNET_GNSRECORD_Flags
148{
148 /** 149 /**
149 * No special options. 150 * No special options.
150 */ 151 */
@@ -192,7 +193,8 @@ enum GNUNET_GNSRECORD_Flags {
192/** 193/**
193 * A GNS record. 194 * A GNS record.
194 */ 195 */
195struct GNUNET_GNSRECORD_Data { 196struct GNUNET_GNSRECORD_Data
197{
196 /** 198 /**
197 * Binary value stored in the DNS record. Note: "data" must never 199 * Binary value stored in the DNS record. Note: "data" must never
198 * be individually 'malloc'ed, but instead always points into some 200 * be individually 'malloc'ed, but instead always points into some
@@ -229,7 +231,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
229/** 231/**
230 * Data stored in a PLACE record. 232 * Data stored in a PLACE record.
231 */ 233 */
232struct GNUNET_GNSRECORD_PlaceData { 234struct GNUNET_GNSRECORD_PlaceData
235{
233 /** 236 /**
234 * Public key of the place. 237 * Public key of the place.
235 */ 238 */
@@ -252,7 +255,8 @@ struct GNUNET_GNSRECORD_PlaceData {
252/** 255/**
253 * Information we have in an encrypted block with record data (i.e. in the DHT). 256 * Information we have in an encrypted block with record data (i.e. in the DHT).
254 */ 257 */
255struct GNUNET_GNSRECORD_Block { 258struct GNUNET_GNSRECORD_Block
259{
256 /** 260 /**
257 * Signature of the block. 261 * Signature of the block.
258 */ 262 */
@@ -288,7 +292,8 @@ struct GNUNET_GNSRECORD_Block {
288 * records do not require a separate network request, thus making TLSA 292 * records do not require a separate network request, thus making TLSA
289 * records inseparable from the "main" A/AAAA/VPN/etc. records. 293 * records inseparable from the "main" A/AAAA/VPN/etc. records.
290 */ 294 */
291struct GNUNET_GNSRECORD_BoxRecord { 295struct GNUNET_GNSRECORD_BoxRecord
296{
292 /** 297 /**
293 * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.). 298 * Protocol of the boxed record (6 = TCP, 17 = UDP, etc.).
294 * Yes, in IP protocols are usually limited to 8 bits. In NBO. 299 * Yes, in IP protocols are usually limited to 8 bits. In NBO.
@@ -315,7 +320,8 @@ struct GNUNET_GNSRECORD_BoxRecord {
315 * the namespace the record belongs to. 320 * the namespace the record belongs to.
316 * It is exclusively found under the label ``+''. 321 * It is exclusively found under the label ``+''.
317 */ 322 */
318struct GNUNET_GNSRECORD_ReverseRecord { 323struct GNUNET_GNSRECORD_ReverseRecord
324{
319 /** 325 /**
320 * The public key of the namespace the is delegating to our namespace 326 * The public key of the namespace the is delegating to our namespace
321 */ 327 */
@@ -355,8 +361,8 @@ typedef void (*GNUNET_GNSRECORD_RecordCallback) (
355 * @return NULL on error, otherwise human-readable representation of the value 361 * @return NULL on error, otherwise human-readable representation of the value
356 */ 362 */
357char * 363char *
358GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data, 364GNUNET_GNSRECORD_value_to_string (uint32_t type, const void *data,
359 size_t data_size); 365 size_t data_size);
360 366
361 367
362/** 368/**
@@ -370,8 +376,8 @@ GNUNET_GNSRECORD_value_to_string(uint32_t type, const void *data,
370 * @return #GNUNET_OK on success 376 * @return #GNUNET_OK on success
371 */ 377 */
372int 378int
373GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, 379GNUNET_GNSRECORD_string_to_value (uint32_t type, const char *s, void **data,
374 size_t *data_size); 380 size_t *data_size);
375 381
376 382
377/** 383/**
@@ -381,7 +387,7 @@ GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data,
381 * @return corresponding number, UINT32_MAX on error 387 * @return corresponding number, UINT32_MAX on error
382 */ 388 */
383uint32_t 389uint32_t
384GNUNET_GNSRECORD_typename_to_number(const char *dns_typename); 390GNUNET_GNSRECORD_typename_to_number (const char *dns_typename);
385 391
386 392
387/** 393/**
@@ -391,7 +397,7 @@ GNUNET_GNSRECORD_typename_to_number(const char *dns_typename);
391 * @return corresponding typestring, NULL on error 397 * @return corresponding typestring, NULL on error
392 */ 398 */
393const char * 399const char *
394GNUNET_GNSRECORD_number_to_typename(uint32_t type); 400GNUNET_GNSRECORD_number_to_typename (uint32_t type);
395 401
396 402
397/* convenience APIs for serializing / deserializing GNS records */ 403/* convenience APIs for serializing / deserializing GNS records */
@@ -405,8 +411,8 @@ GNUNET_GNSRECORD_number_to_typename(uint32_t type);
405 * @return the required size to serialize, -1 on error 411 * @return the required size to serialize, -1 on error
406 */ 412 */
407ssize_t 413ssize_t
408GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, 414GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
409 const struct GNUNET_GNSRECORD_Data *rd); 415 const struct GNUNET_GNSRECORD_Data *rd);
410 416
411 417
412/** 418/**
@@ -419,9 +425,9 @@ GNUNET_GNSRECORD_records_get_size(unsigned int rd_count,
419 * @return the size of serialized records, -1 if records do not fit 425 * @return the size of serialized records, -1 if records do not fit
420 */ 426 */
421ssize_t 427ssize_t
422GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, 428GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
423 const struct GNUNET_GNSRECORD_Data *rd, 429 const struct GNUNET_GNSRECORD_Data *rd,
424 size_t dest_size, char *dest); 430 size_t dest_size, char *dest);
425 431
426 432
427/** 433/**
@@ -434,9 +440,9 @@ GNUNET_GNSRECORD_records_serialize(unsigned int rd_count,
434 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 440 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
435 */ 441 */
436int 442int
437GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src, 443GNUNET_GNSRECORD_records_deserialize (size_t len, const char *src,
438 unsigned int rd_count, 444 unsigned int rd_count,
439 struct GNUNET_GNSRECORD_Data *dest); 445 struct GNUNET_GNSRECORD_Data *dest);
440 446
441 447
442/* ******* general APIs relating to blocks, records and labels ******** */ 448/* ******* general APIs relating to blocks, records and labels ******** */
@@ -450,7 +456,7 @@ GNUNET_GNSRECORD_records_deserialize(size_t len, const char *src,
450 * #GNUNET_NO if not 456 * #GNUNET_NO if not
451 */ 457 */
452int 458int
453GNUNET_GNSRECORD_is_expired(const struct GNUNET_GNSRECORD_Data *rd); 459GNUNET_GNSRECORD_is_expired (const struct GNUNET_GNSRECORD_Data *rd);
454 460
455 461
456/** 462/**
@@ -459,7 +465,7 @@ GNUNET_GNSRECORD_is_expired(const struct GNUNET_GNSRECORD_Data *rd);
459 * @return converted result 465 * @return converted result
460 */ 466 */
461char * 467char *
462GNUNET_GNSRECORD_string_to_lowercase(const char *src); 468GNUNET_GNSRECORD_string_to_lowercase (const char *src);
463 469
464 470
465/** 471/**
@@ -472,7 +478,7 @@ GNUNET_GNSRECORD_string_to_lowercase(const char *src);
472 * #GNUNET_GNSRECORD_z2s. 478 * #GNUNET_GNSRECORD_z2s.
473 */ 479 */
474const char * 480const char *
475GNUNET_GNSRECORD_z2s(const struct GNUNET_CRYPTO_EcdsaPublicKey *z); 481GNUNET_GNSRECORD_z2s (const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
476 482
477 483
478/** 484/**
@@ -486,7 +492,7 @@ GNUNET_GNSRECORD_z2s(const struct GNUNET_CRYPTO_EcdsaPublicKey *z);
486 * key in an encoding suitable for DNS labels. 492 * key in an encoding suitable for DNS labels.
487 */ 493 */
488const char * 494const char *
489GNUNET_GNSRECORD_pkey_to_zkey(const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); 495GNUNET_GNSRECORD_pkey_to_zkey (const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
490 496
491 497
492/** 498/**
@@ -499,8 +505,8 @@ GNUNET_GNSRECORD_pkey_to_zkey(const struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
499 * @return #GNUNET_SYSERR if @a zkey has the wrong syntax 505 * @return #GNUNET_SYSERR if @a zkey has the wrong syntax
500 */ 506 */
501int 507int
502GNUNET_GNSRECORD_zkey_to_pkey(const char *zkey, 508GNUNET_GNSRECORD_zkey_to_pkey (const char *zkey,
503 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey); 509 struct GNUNET_CRYPTO_EcdsaPublicKey *pkey);
504 510
505 511
506/** 512/**
@@ -511,7 +517,7 @@ GNUNET_GNSRECORD_zkey_to_pkey(const char *zkey,
511 * @param query hash to use for the query 517 * @param query hash to use for the query
512 */ 518 */
513void 519void
514GNUNET_GNSRECORD_query_from_private_key( 520GNUNET_GNSRECORD_query_from_private_key (
515 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label, 521 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label,
516 struct GNUNET_HashCode *query); 522 struct GNUNET_HashCode *query);
517 523
@@ -524,7 +530,7 @@ GNUNET_GNSRECORD_query_from_private_key(
524 * @param query hash to use for the query 530 * @param query hash to use for the query
525 */ 531 */
526void 532void
527GNUNET_GNSRECORD_query_from_public_key( 533GNUNET_GNSRECORD_query_from_public_key (
528 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, 534 const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label,
529 struct GNUNET_HashCode *query); 535 struct GNUNET_HashCode *query);
530 536
@@ -539,11 +545,11 @@ GNUNET_GNSRECORD_query_from_public_key(
539 * @param rd_count number of records in @a rd 545 * @param rd_count number of records in @a rd
540 */ 546 */
541struct GNUNET_GNSRECORD_Block * 547struct GNUNET_GNSRECORD_Block *
542GNUNET_GNSRECORD_block_create(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, 548GNUNET_GNSRECORD_block_create (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
543 struct GNUNET_TIME_Absolute expire, 549 struct GNUNET_TIME_Absolute expire,
544 const char *label, 550 const char *label,
545 const struct GNUNET_GNSRECORD_Data *rd, 551 const struct GNUNET_GNSRECORD_Data *rd,
546 unsigned int rd_count); 552 unsigned int rd_count);
547 553
548 554
549/** 555/**
@@ -558,11 +564,11 @@ GNUNET_GNSRECORD_block_create(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
558 * @param rd_count number of records in @a rd 564 * @param rd_count number of records in @a rd
559 */ 565 */
560struct GNUNET_GNSRECORD_Block * 566struct GNUNET_GNSRECORD_Block *
561GNUNET_GNSRECORD_block_create2(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, 567GNUNET_GNSRECORD_block_create2 (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
562 struct GNUNET_TIME_Absolute expire, 568 struct GNUNET_TIME_Absolute expire,
563 const char *label, 569 const char *label,
564 const struct GNUNET_GNSRECORD_Data *rd, 570 const struct GNUNET_GNSRECORD_Data *rd,
565 unsigned int rd_count); 571 unsigned int rd_count);
566 572
567 573
568/** 574/**
@@ -573,7 +579,7 @@ GNUNET_GNSRECORD_block_create2(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
573 * @return #GNUNET_OK if the signature is valid 579 * @return #GNUNET_OK if the signature is valid
574 */ 580 */
575int 581int
576GNUNET_GNSRECORD_block_verify(const struct GNUNET_GNSRECORD_Block *block); 582GNUNET_GNSRECORD_block_verify (const struct GNUNET_GNSRECORD_Block *block);
577 583
578 584
579/** 585/**
@@ -588,7 +594,7 @@ GNUNET_GNSRECORD_block_verify(const struct GNUNET_GNSRECORD_Block *block);
588 * not well-formed 594 * not well-formed
589 */ 595 */
590int 596int
591GNUNET_GNSRECORD_block_decrypt( 597GNUNET_GNSRECORD_block_decrypt (
592 const struct GNUNET_GNSRECORD_Block *block, 598 const struct GNUNET_GNSRECORD_Block *block,
593 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label, 599 const struct GNUNET_CRYPTO_EcdsaPublicKey *zone_key, const char *label,
594 GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls); 600 GNUNET_GNSRECORD_RecordCallback proc, void *proc_cls);
@@ -602,8 +608,8 @@ GNUNET_GNSRECORD_block_decrypt(
602 * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not. 608 * @return #GNUNET_YES if the records are equal, or #GNUNET_NO if not.
603 */ 609 */
604int 610int
605GNUNET_GNSRECORD_records_cmp(const struct GNUNET_GNSRECORD_Data *a, 611GNUNET_GNSRECORD_records_cmp (const struct GNUNET_GNSRECORD_Data *a,
606 const struct GNUNET_GNSRECORD_Data *b); 612 const struct GNUNET_GNSRECORD_Data *b);
607 613
608 614
609/** 615/**
@@ -616,7 +622,7 @@ GNUNET_GNSRECORD_records_cmp(const struct GNUNET_GNSRECORD_Data *a,
616 * @return absolute expiration time 622 * @return absolute expiration time
617 */ 623 */
618struct GNUNET_TIME_Absolute 624struct GNUNET_TIME_Absolute
619GNUNET_GNSRECORD_record_get_expiration_time( 625GNUNET_GNSRECORD_record_get_expiration_time (
620 unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); 626 unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd);
621 627
622 628
diff --git a/src/include/gnunet_gnsrecord_plugin.h b/src/include/gnunet_gnsrecord_plugin.h
index 7ce1b22e6..1435bc4b3 100644
--- a/src/include/gnunet_gnsrecord_plugin.h
+++ b/src/include/gnunet_gnsrecord_plugin.h
@@ -110,7 +110,8 @@ typedef const char *
110 * Each plugin is required to return a pointer to a struct of this 110 * Each plugin is required to return a pointer to a struct of this
111 * type as the return value from its entry point. 111 * type as the return value from its entry point.
112 */ 112 */
113struct GNUNET_GNSRECORD_PluginFunctions { 113struct GNUNET_GNSRECORD_PluginFunctions
114{
114 /** 115 /**
115 * Closure for all of the callbacks. 116 * Closure for all of the callbacks.
116 */ 117 */
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h
index 9fe158852..fff0045aa 100644
--- a/src/include/gnunet_hello_lib.h
+++ b/src/include/gnunet_hello_lib.h
@@ -65,7 +65,8 @@ extern "C" {
65 * These information are only valid for the local peer and are not serialized 65 * These information are only valid for the local peer and are not serialized
66 * when a #GNUNET_HELLO_Message is created 66 * when a #GNUNET_HELLO_Message is created
67 */ 67 */
68enum GNUNET_HELLO_AddressInfo { 68enum GNUNET_HELLO_AddressInfo
69{
69 /** 70 /**
70 * No additional information 71 * No additional information
71 */ 72 */
@@ -85,7 +86,8 @@ enum GNUNET_HELLO_AddressInfo {
85 * separated. This is NOT the format that would be used 86 * separated. This is NOT the format that would be used
86 * on the wire. 87 * on the wire.
87 */ 88 */
88struct GNUNET_HELLO_Address { 89struct GNUNET_HELLO_Address
90{
89 /** 91 /**
90 * For which peer is this an address? 92 * For which peer is this an address?
91 */ 93 */
@@ -132,11 +134,11 @@ struct GNUNET_HELLO_Address {
132 * @return the address struct 134 * @return the address struct
133 */ 135 */
134struct GNUNET_HELLO_Address * 136struct GNUNET_HELLO_Address *
135GNUNET_HELLO_address_allocate(const struct GNUNET_PeerIdentity *peer, 137GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer,
136 const char *transport_name, 138 const char *transport_name,
137 const void *address, 139 const void *address,
138 size_t address_length, 140 size_t address_length,
139 enum GNUNET_HELLO_AddressInfo local_info); 141 enum GNUNET_HELLO_AddressInfo local_info);
140 142
141 143
142/** 144/**
@@ -146,7 +148,7 @@ GNUNET_HELLO_address_allocate(const struct GNUNET_PeerIdentity *peer,
146 * @return a copy of the address struct 148 * @return a copy of the address struct
147 */ 149 */
148struct GNUNET_HELLO_Address * 150struct GNUNET_HELLO_Address *
149GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address); 151GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address);
150 152
151 153
152/** 154/**
@@ -158,8 +160,8 @@ GNUNET_HELLO_address_copy(const struct GNUNET_HELLO_Address *address);
158 * @return 0 if the addresses are equal, -1 if @a a1< @a a2, 1 if @a a1> @a a2. 160 * @return 0 if the addresses are equal, -1 if @a a1< @a a2, 1 if @a a1> @a a2.
159 */ 161 */
160int 162int
161GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1, 163GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1,
162 const struct GNUNET_HELLO_Address *a2); 164 const struct GNUNET_HELLO_Address *a2);
163 165
164 166
165/** 167/**
@@ -169,7 +171,7 @@ GNUNET_HELLO_address_cmp(const struct GNUNET_HELLO_Address *a1,
169 * @return the size 171 * @return the size
170 */ 172 */
171size_t 173size_t
172GNUNET_HELLO_address_get_size(const struct GNUNET_HELLO_Address *address); 174GNUNET_HELLO_address_get_size (const struct GNUNET_HELLO_Address *address);
173 175
174 176
175/** 177/**
@@ -180,8 +182,8 @@ GNUNET_HELLO_address_get_size(const struct GNUNET_HELLO_Address *address);
180 * @return #GNUNET_YES or #GNUNET_NO 182 * @return #GNUNET_YES or #GNUNET_NO
181 */ 183 */
182int 184int
183GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address, 185GNUNET_HELLO_address_check_option (const struct GNUNET_HELLO_Address *address,
184 enum GNUNET_HELLO_AddressInfo option); 186 enum GNUNET_HELLO_AddressInfo option);
185 187
186 188
187/** 189/**
@@ -189,7 +191,7 @@ GNUNET_HELLO_address_check_option(const struct GNUNET_HELLO_Address *address,
189 * 191 *
190 * @param addr address to free 192 * @param addr address to free
191 */ 193 */
192#define GNUNET_HELLO_address_free(addr) GNUNET_free(addr) 194#define GNUNET_HELLO_address_free(addr) GNUNET_free (addr)
193 195
194 196
195GNUNET_NETWORK_STRUCT_BEGIN 197GNUNET_NETWORK_STRUCT_BEGIN
@@ -207,7 +209,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
207 * unaligned!) 209 * unaligned!)
208 * 4) address (address-length bytes; possibly unaligned!) 210 * 4) address (address-length bytes; possibly unaligned!)
209 */ 211 */
210struct GNUNET_HELLO_Message { 212struct GNUNET_HELLO_Message
213{
211 /** 214 /**
212 * Type will be #GNUNET_MESSAGE_TYPE_HELLO. 215 * Type will be #GNUNET_MESSAGE_TYPE_HELLO.
213 */ 216 */
@@ -233,7 +236,7 @@ GNUNET_NETWORK_STRUCT_END
233 * @return #GNUNET_YES for friend-only or #GNUNET_NO otherwise 236 * @return #GNUNET_YES for friend-only or #GNUNET_NO otherwise
234 */ 237 */
235int 238int
236GNUNET_HELLO_is_friend_only(const struct GNUNET_HELLO_Message *h); 239GNUNET_HELLO_is_friend_only (const struct GNUNET_HELLO_Message *h);
237 240
238 241
239/** 242/**
@@ -248,10 +251,10 @@ GNUNET_HELLO_is_friend_only(const struct GNUNET_HELLO_Message *h);
248 * the target buffer was not big enough. 251 * the target buffer was not big enough.
249 */ 252 */
250size_t 253size_t
251GNUNET_HELLO_add_address(const struct GNUNET_HELLO_Address *address, 254GNUNET_HELLO_add_address (const struct GNUNET_HELLO_Address *address,
252 struct GNUNET_TIME_Absolute expiration, 255 struct GNUNET_TIME_Absolute expiration,
253 char *target, 256 char *target,
254 size_t max); 257 size_t max);
255 258
256 259
257/** 260/**
@@ -285,10 +288,10 @@ typedef ssize_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls,
285 * @return the hello message 288 * @return the hello message
286 */ 289 */
287struct GNUNET_HELLO_Message * 290struct GNUNET_HELLO_Message *
288GNUNET_HELLO_create(const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, 291GNUNET_HELLO_create (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
289 GNUNET_HELLO_GenerateAddressListCallback addrgen, 292 GNUNET_HELLO_GenerateAddressListCallback addrgen,
290 void *addrgen_cls, 293 void *addrgen_cls,
291 int friend_only); 294 int friend_only);
292 295
293 296
294/** 297/**
@@ -298,7 +301,7 @@ GNUNET_HELLO_create(const struct GNUNET_CRYPTO_EddsaPublicKey *public_key,
298 * @return the size, 0 if HELLO is invalid 301 * @return the size, 0 if HELLO is invalid
299 */ 302 */
300uint16_t 303uint16_t
301GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello); 304GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello);
302 305
303 306
304/** 307/**
@@ -311,8 +314,8 @@ GNUNET_HELLO_size(const struct GNUNET_HELLO_Message *hello);
311 * @return the combined hello message 314 * @return the combined hello message
312 */ 315 */
313struct GNUNET_HELLO_Message * 316struct GNUNET_HELLO_Message *
314GNUNET_HELLO_merge(const struct GNUNET_HELLO_Message *h1, 317GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1,
315 const struct GNUNET_HELLO_Message *h2); 318 const struct GNUNET_HELLO_Message *h2);
316 319
317 320
318/** 321/**
@@ -332,9 +335,9 @@ GNUNET_HELLO_merge(const struct GNUNET_HELLO_Message *h1,
332 * do not match at all 335 * do not match at all
333 */ 336 */
334struct GNUNET_TIME_Absolute 337struct GNUNET_TIME_Absolute
335GNUNET_HELLO_equals(const struct GNUNET_HELLO_Message *h1, 338GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1,
336 const struct GNUNET_HELLO_Message *h2, 339 const struct GNUNET_HELLO_Message *h2,
337 struct GNUNET_TIME_Absolute now); 340 struct GNUNET_TIME_Absolute now);
338 341
339 342
340/** 343/**
@@ -360,7 +363,7 @@ typedef int (*GNUNET_HELLO_AddressIterator) (
360 * @return time the last address expires, 0 if there are no addresses in the HELLO 363 * @return time the last address expires, 0 if there are no addresses in the HELLO
361 */ 364 */
362struct GNUNET_TIME_Absolute 365struct GNUNET_TIME_Absolute
363GNUNET_HELLO_get_last_expiration(const struct GNUNET_HELLO_Message *msg); 366GNUNET_HELLO_get_last_expiration (const struct GNUNET_HELLO_Message *msg);
364 367
365 368
366/** 369/**
@@ -376,10 +379,10 @@ GNUNET_HELLO_get_last_expiration(const struct GNUNET_HELLO_Message *msg);
376 * @return the modified HELLO or NULL 379 * @return the modified HELLO or NULL
377 */ 380 */
378struct GNUNET_HELLO_Message * 381struct GNUNET_HELLO_Message *
379GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg, 382GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg,
380 int return_modified, 383 int return_modified,
381 GNUNET_HELLO_AddressIterator it, 384 GNUNET_HELLO_AddressIterator it,
382 void *it_cls); 385 void *it_cls);
383 386
384 387
385/** 388/**
@@ -396,7 +399,7 @@ GNUNET_HELLO_iterate_addresses(const struct GNUNET_HELLO_Message *msg,
396 * @param it_cls closure for @a it 399 * @param it_cls closure for @a it
397 */ 400 */
398void 401void
399GNUNET_HELLO_iterate_new_addresses( 402GNUNET_HELLO_iterate_new_addresses (
400 const struct GNUNET_HELLO_Message *new_hello, 403 const struct GNUNET_HELLO_Message *new_hello,
401 const struct GNUNET_HELLO_Message *old_hello, 404 const struct GNUNET_HELLO_Message *old_hello,
402 struct GNUNET_TIME_Absolute expiration_limit, 405 struct GNUNET_TIME_Absolute expiration_limit,
@@ -412,8 +415,8 @@ GNUNET_HELLO_iterate_new_addresses(
412 * @return #GNUNET_SYSERR if the HELLO was malformed 415 * @return #GNUNET_SYSERR if the HELLO was malformed
413 */ 416 */
414int 417int
415GNUNET_HELLO_get_id(const struct GNUNET_HELLO_Message *hello, 418GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello,
416 struct GNUNET_PeerIdentity *peer); 419 struct GNUNET_PeerIdentity *peer);
417 420
418 421
419/** 422/**
@@ -425,7 +428,7 @@ GNUNET_HELLO_get_id(const struct GNUNET_HELLO_Message *hello,
425 * @return header or NULL if the HELLO was malformed 428 * @return header or NULL if the HELLO was malformed
426 */ 429 */
427struct GNUNET_MessageHeader * 430struct GNUNET_MessageHeader *
428GNUNET_HELLO_get_header(struct GNUNET_HELLO_Message *hello); 431GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello);
429 432
430 433
431/** 434/**
@@ -447,8 +450,8 @@ typedef struct GNUNET_TRANSPORT_PluginFunctions *(
447 * @return Hello URI string 450 * @return Hello URI string
448 */ 451 */
449char * 452char *
450GNUNET_HELLO_compose_uri(const struct GNUNET_HELLO_Message *hello, 453GNUNET_HELLO_compose_uri (const struct GNUNET_HELLO_Message *hello,
451 GNUNET_HELLO_TransportPluginsFind plugins_find); 454 GNUNET_HELLO_TransportPluginsFind plugins_find);
452 455
453 456
454/** 457/**
@@ -461,10 +464,10 @@ GNUNET_HELLO_compose_uri(const struct GNUNET_HELLO_Message *hello,
461 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors 464 * @return #GNUNET_OK on success, #GNUNET_SYSERR if the URI was invalid, #GNUNET_NO on other errors
462 */ 465 */
463int 466int
464GNUNET_HELLO_parse_uri(const char *uri, 467GNUNET_HELLO_parse_uri (const char *uri,
465 struct GNUNET_CRYPTO_EddsaPublicKey *pubkey, 468 struct GNUNET_CRYPTO_EddsaPublicKey *pubkey,
466 struct GNUNET_HELLO_Message **hello, 469 struct GNUNET_HELLO_Message **hello,
467 GNUNET_HELLO_TransportPluginsFind plugins_find); 470 GNUNET_HELLO_TransportPluginsFind plugins_find);
468 471
469 472
470/* NG API */ 473/* NG API */
@@ -482,7 +485,7 @@ GNUNET_HELLO_parse_uri(const char *uri,
482 * @param result_size[out] set to size of @a result 485 * @param result_size[out] set to size of @a result
483 */ 486 */
484void 487void
485GNUNET_HELLO_sign_address( 488GNUNET_HELLO_sign_address (
486 const char *address, 489 const char *address,
487 enum GNUNET_NetworkType nt, 490 enum GNUNET_NetworkType nt,
488 struct GNUNET_TIME_Absolute mono_time, 491 struct GNUNET_TIME_Absolute mono_time,
@@ -502,11 +505,11 @@ GNUNET_HELLO_sign_address(
502 * @return NULL on error, otherwise the address 505 * @return NULL on error, otherwise the address
503 */ 506 */
504char * 507char *
505GNUNET_HELLO_extract_address(const void *raw, 508GNUNET_HELLO_extract_address (const void *raw,
506 size_t raw_size, 509 size_t raw_size,
507 const struct GNUNET_PeerIdentity *pid, 510 const struct GNUNET_PeerIdentity *pid,
508 enum GNUNET_NetworkType *nt, 511 enum GNUNET_NetworkType *nt,
509 struct GNUNET_TIME_Absolute *mono_time); 512 struct GNUNET_TIME_Absolute *mono_time);
510 513
511 514
512/** 515/**
@@ -517,7 +520,7 @@ GNUNET_HELLO_extract_address(const void *raw,
517 * @return NULL if the address is mal-formed, otherwise the prefix 520 * @return NULL if the address is mal-formed, otherwise the prefix
518 */ 521 */
519char * 522char *
520GNUNET_HELLO_address_to_prefix(const char *address); 523GNUNET_HELLO_address_to_prefix (const char *address);
521 524
522 525
523#if 0 /* keep Emacsens' auto-indent happy */ 526#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_helper_lib.h b/src/include/gnunet_helper_lib.h
index e6b3ae535..5e72cf76a 100644
--- a/src/include/gnunet_helper_lib.h
+++ b/src/include/gnunet_helper_lib.h
@@ -74,12 +74,12 @@ typedef void
74 * @return the new Handle, NULL on error 74 * @return the new Handle, NULL on error
75 */ 75 */
76struct GNUNET_HELPER_Handle * 76struct GNUNET_HELPER_Handle *
77GNUNET_HELPER_start(int with_control_pipe, 77GNUNET_HELPER_start (int with_control_pipe,
78 const char *binary_name, 78 const char *binary_name,
79 char *const binary_argv[], 79 char *const binary_argv[],
80 GNUNET_MessageTokenizerCallback cb, 80 GNUNET_MessageTokenizerCallback cb,
81 GNUNET_HELPER_ExceptionCallback exp_cb, 81 GNUNET_HELPER_ExceptionCallback exp_cb,
82 void *cb_cls); 82 void *cb_cls);
83 83
84 84
85/** 85/**
@@ -92,7 +92,7 @@ GNUNET_HELPER_start(int with_control_pipe,
92 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error 92 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error
93 */ 93 */
94int 94int
95GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill); 95GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, int soft_kill);
96 96
97 97
98/** 98/**
@@ -104,7 +104,7 @@ GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill);
104 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error 104 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error
105 */ 105 */
106int 106int
107GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h); 107GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h);
108 108
109 109
110/** 110/**
@@ -113,7 +113,7 @@ GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h);
113 * @param h the helper handle to free 113 * @param h the helper handle to free
114 */ 114 */
115void 115void
116GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h); 116GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h);
117 117
118 118
119/** 119/**
@@ -125,7 +125,7 @@ GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h);
125 * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper 125 * stdin; #GNUNET_NO to signal termination by sending SIGTERM to helper
126 */ 126 */
127void 127void
128GNUNET_HELPER_stop(struct GNUNET_HELPER_Handle *h, int soft_kill); 128GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h, int soft_kill);
129 129
130 130
131/** 131/**
@@ -160,11 +160,11 @@ struct GNUNET_HELPER_SendHandle;
160 * not be abortable) 160 * not be abortable)
161 */ 161 */
162struct GNUNET_HELPER_SendHandle * 162struct GNUNET_HELPER_SendHandle *
163GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, 163GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
164 const struct GNUNET_MessageHeader *msg, 164 const struct GNUNET_MessageHeader *msg,
165 int can_drop, 165 int can_drop,
166 GNUNET_HELPER_Continuation cont, 166 GNUNET_HELPER_Continuation cont,
167 void *cont_cls); 167 void *cont_cls);
168 168
169 169
170/** 170/**
@@ -174,7 +174,7 @@ GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h,
174 * @param sh operation to cancel 174 * @param sh operation to cancel
175 */ 175 */
176void 176void
177GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh); 177GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh);
178 178
179 179
180#endif 180#endif
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h
index 8a77e76e0..674176e0e 100644
--- a/src/include/gnunet_identity_service.h
+++ b/src/include/gnunet_identity_service.h
@@ -80,7 +80,7 @@ struct GNUNET_IDENTITY_Operation;
80 * @return associated ECC key, valid as long as the ego is valid 80 * @return associated ECC key, valid as long as the ego is valid
81 */ 81 */
82const struct GNUNET_CRYPTO_EcdsaPrivateKey * 82const struct GNUNET_CRYPTO_EcdsaPrivateKey *
83GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego); 83GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego);
84 84
85 85
86/** 86/**
@@ -89,7 +89,7 @@ GNUNET_IDENTITY_ego_get_private_key(const struct GNUNET_IDENTITY_Ego *ego);
89 * @return handle for the anonymous user, must not be freed 89 * @return handle for the anonymous user, must not be freed
90 */ 90 */
91const struct GNUNET_IDENTITY_Ego * 91const struct GNUNET_IDENTITY_Ego *
92GNUNET_IDENTITY_ego_get_anonymous(void); 92GNUNET_IDENTITY_ego_get_anonymous (void);
93 93
94 94
95/** 95/**
@@ -99,8 +99,8 @@ GNUNET_IDENTITY_ego_get_anonymous(void);
99 * @param pk set to ego's public key 99 * @param pk set to ego's public key
100 */ 100 */
101void 101void
102GNUNET_IDENTITY_ego_get_public_key(const struct GNUNET_IDENTITY_Ego *ego, 102GNUNET_IDENTITY_ego_get_public_key (const struct GNUNET_IDENTITY_Ego *ego,
103 struct GNUNET_CRYPTO_EcdsaPublicKey *pk); 103 struct GNUNET_CRYPTO_EcdsaPublicKey *pk);
104 104
105 105
106/** 106/**
@@ -152,9 +152,9 @@ typedef void (*GNUNET_IDENTITY_Callback) (void *cls,
152 * @return handle to communicate with identity service 152 * @return handle to communicate with identity service
153 */ 153 */
154struct GNUNET_IDENTITY_Handle * 154struct GNUNET_IDENTITY_Handle *
155GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 155GNUNET_IDENTITY_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
156 GNUNET_IDENTITY_Callback cb, 156 GNUNET_IDENTITY_Callback cb,
157 void *cb_cls); 157 void *cb_cls);
158 158
159 159
160/** 160/**
@@ -167,10 +167,10 @@ GNUNET_IDENTITY_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
167 * @return handle to abort the operation 167 * @return handle to abort the operation
168 */ 168 */
169struct GNUNET_IDENTITY_Operation * 169struct GNUNET_IDENTITY_Operation *
170GNUNET_IDENTITY_get(struct GNUNET_IDENTITY_Handle *id, 170GNUNET_IDENTITY_get (struct GNUNET_IDENTITY_Handle *id,
171 const char *service_name, 171 const char *service_name,
172 GNUNET_IDENTITY_Callback cb, 172 GNUNET_IDENTITY_Callback cb,
173 void *cb_cls); 173 void *cb_cls);
174 174
175 175
176/** 176/**
@@ -194,11 +194,11 @@ typedef void (*GNUNET_IDENTITY_Continuation) (void *cls, const char *emsg);
194 * @return handle to abort the operation 194 * @return handle to abort the operation
195 */ 195 */
196struct GNUNET_IDENTITY_Operation * 196struct GNUNET_IDENTITY_Operation *
197GNUNET_IDENTITY_set(struct GNUNET_IDENTITY_Handle *id, 197GNUNET_IDENTITY_set (struct GNUNET_IDENTITY_Handle *id,
198 const char *service_name, 198 const char *service_name,
199 struct GNUNET_IDENTITY_Ego *ego, 199 struct GNUNET_IDENTITY_Ego *ego,
200 GNUNET_IDENTITY_Continuation cont, 200 GNUNET_IDENTITY_Continuation cont,
201 void *cont_cls); 201 void *cont_cls);
202 202
203 203
204/** 204/**
@@ -207,7 +207,7 @@ GNUNET_IDENTITY_set(struct GNUNET_IDENTITY_Handle *id,
207 * @param h identity service to disconnect 207 * @param h identity service to disconnect
208 */ 208 */
209void 209void
210GNUNET_IDENTITY_disconnect(struct GNUNET_IDENTITY_Handle *h); 210GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h);
211 211
212 212
213/** 213/**
@@ -234,10 +234,10 @@ typedef void (*GNUNET_IDENTITY_CreateContinuation) (
234 * @return handle to abort the operation 234 * @return handle to abort the operation
235 */ 235 */
236struct GNUNET_IDENTITY_Operation * 236struct GNUNET_IDENTITY_Operation *
237GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *id, 237GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
238 const char *name, 238 const char *name,
239 GNUNET_IDENTITY_CreateContinuation cont, 239 GNUNET_IDENTITY_CreateContinuation cont,
240 void *cont_cls); 240 void *cont_cls);
241 241
242 242
243/** 243/**
@@ -251,11 +251,11 @@ GNUNET_IDENTITY_create(struct GNUNET_IDENTITY_Handle *id,
251 * @return handle to abort the operation 251 * @return handle to abort the operation
252 */ 252 */
253struct GNUNET_IDENTITY_Operation * 253struct GNUNET_IDENTITY_Operation *
254GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *id, 254GNUNET_IDENTITY_rename (struct GNUNET_IDENTITY_Handle *id,
255 const char *old_name, 255 const char *old_name,
256 const char *new_name, 256 const char *new_name,
257 GNUNET_IDENTITY_Continuation cb, 257 GNUNET_IDENTITY_Continuation cb,
258 void *cb_cls); 258 void *cb_cls);
259 259
260 260
261/** 261/**
@@ -268,10 +268,10 @@ GNUNET_IDENTITY_rename(struct GNUNET_IDENTITY_Handle *id,
268 * @return handle to abort the operation 268 * @return handle to abort the operation
269 */ 269 */
270struct GNUNET_IDENTITY_Operation * 270struct GNUNET_IDENTITY_Operation *
271GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *id, 271GNUNET_IDENTITY_delete (struct GNUNET_IDENTITY_Handle *id,
272 const char *name, 272 const char *name,
273 GNUNET_IDENTITY_Continuation cb, 273 GNUNET_IDENTITY_Continuation cb,
274 void *cb_cls); 274 void *cb_cls);
275 275
276 276
277/** 277/**
@@ -283,7 +283,7 @@ GNUNET_IDENTITY_delete(struct GNUNET_IDENTITY_Handle *id,
283 * @param op operation to cancel 283 * @param op operation to cancel
284 */ 284 */
285void 285void
286GNUNET_IDENTITY_cancel(struct GNUNET_IDENTITY_Operation *op); 286GNUNET_IDENTITY_cancel (struct GNUNET_IDENTITY_Operation *op);
287 287
288 288
289/* ************* convenience API to lookup an ego ***************** */ 289/* ************* convenience API to lookup an ego ***************** */
@@ -314,10 +314,10 @@ struct GNUNET_IDENTITY_EgoLookup;
314 * @return NULL on error 314 * @return NULL on error
315 */ 315 */
316struct GNUNET_IDENTITY_EgoLookup * 316struct GNUNET_IDENTITY_EgoLookup *
317GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg, 317GNUNET_IDENTITY_ego_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg,
318 const char *name, 318 const char *name,
319 GNUNET_IDENTITY_EgoCallback cb, 319 GNUNET_IDENTITY_EgoCallback cb,
320 void *cb_cls); 320 void *cb_cls);
321 321
322 322
323/** 323/**
@@ -326,7 +326,7 @@ GNUNET_IDENTITY_ego_lookup(const struct GNUNET_CONFIGURATION_Handle *cfg,
326 * @param el handle for lookup to abort 326 * @param el handle for lookup to abort
327 */ 327 */
328void 328void
329GNUNET_IDENTITY_ego_lookup_cancel(struct GNUNET_IDENTITY_EgoLookup *el); 329GNUNET_IDENTITY_ego_lookup_cancel (struct GNUNET_IDENTITY_EgoLookup *el);
330 330
331/** 331/**
332 * Function called with the result. 332 * Function called with the result.
@@ -360,10 +360,11 @@ struct GNUNET_IDENTITY_EgoSuffixLookup;
360 * @return handle to abort the operation 360 * @return handle to abort the operation
361 */ 361 */
362struct GNUNET_IDENTITY_EgoSuffixLookup * 362struct GNUNET_IDENTITY_EgoSuffixLookup *
363GNUNET_IDENTITY_ego_lookup_by_suffix(const struct GNUNET_CONFIGURATION_Handle *cfg, 363GNUNET_IDENTITY_ego_lookup_by_suffix (const struct
364 const char *suffix, 364 GNUNET_CONFIGURATION_Handle *cfg,
365 GNUNET_IDENTITY_EgoSuffixCallback cb, 365 const char *suffix,
366 void *cb_cls); 366 GNUNET_IDENTITY_EgoSuffixCallback cb,
367 void *cb_cls);
367 368
368 369
369/** 370/**
@@ -372,7 +373,8 @@ GNUNET_IDENTITY_ego_lookup_by_suffix(const struct GNUNET_CONFIGURATION_Handle *c
372 * @param el handle for lookup to abort 373 * @param el handle for lookup to abort
373 */ 374 */
374void 375void
375GNUNET_IDENTITY_ego_lookup_by_suffix_cancel(struct GNUNET_IDENTITY_EgoSuffixLookup *el); 376GNUNET_IDENTITY_ego_lookup_by_suffix_cancel (struct
377 GNUNET_IDENTITY_EgoSuffixLookup *el);
376 378
377#if 0 /* keep Emacsens' auto-indent happy */ 379#if 0 /* keep Emacsens' auto-indent happy */
378{ 380{
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h
index 3ca4bf729..064f38c9f 100644
--- a/src/include/gnunet_json_lib.h
+++ b/src/include/gnunet_json_lib.h
@@ -67,7 +67,8 @@ typedef void (*GNUNET_JSON_Cleaner) (void *cls,
67/** 67/**
68 * @brief Entry in parser specification for #GNUNET_JSON_parse(). 68 * @brief Entry in parser specification for #GNUNET_JSON_parse().
69 */ 69 */
70struct GNUNET_JSON_Specification { 70struct GNUNET_JSON_Specification
71{
71 /** 72 /**
72 * Function for how to parse this type of entry. 73 * Function for how to parse this type of entry.
73 */ 74 */
@@ -125,10 +126,10 @@ struct GNUNET_JSON_Specification {
125 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 126 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
126 */ 127 */
127int 128int
128GNUNET_JSON_parse(const json_t *root, 129GNUNET_JSON_parse (const json_t *root,
129 struct GNUNET_JSON_Specification *spec, 130 struct GNUNET_JSON_Specification *spec,
130 const char **error_json_name, 131 const char **error_json_name,
131 unsigned int *error_line); 132 unsigned int *error_line);
132 133
133 134
134/** 135/**
@@ -138,7 +139,7 @@ GNUNET_JSON_parse(const json_t *root,
138 * @param spec specification of the parse operation 139 * @param spec specification of the parse operation
139 */ 140 */
140void 141void
141GNUNET_JSON_parse_free(struct GNUNET_JSON_Specification *spec); 142GNUNET_JSON_parse_free (struct GNUNET_JSON_Specification *spec);
142 143
143 144
144/* ****************** Canonical parser specifications ******************* */ 145/* ****************** Canonical parser specifications ******************* */
@@ -148,7 +149,7 @@ GNUNET_JSON_parse_free(struct GNUNET_JSON_Specification *spec);
148 * End of a parser specification. 149 * End of a parser specification.
149 */ 150 */
150struct GNUNET_JSON_Specification 151struct GNUNET_JSON_Specification
151GNUNET_JSON_spec_end(void); 152GNUNET_JSON_spec_end (void);
152 153
153 154
154/** 155/**
@@ -158,7 +159,7 @@ GNUNET_JSON_spec_end(void);
158 * @return spec copy of @a spec with optional bit set 159 * @return spec copy of @a spec with optional bit set
159 */ 160 */
160struct GNUNET_JSON_Specification 161struct GNUNET_JSON_Specification
161GNUNET_JSON_spec_mark_optional(struct GNUNET_JSON_Specification spec); 162GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec);
162 163
163 164
164/** 165/**
@@ -170,7 +171,7 @@ GNUNET_JSON_spec_mark_optional(struct GNUNET_JSON_Specification spec);
170 * @param size number of bytes expected in @a obj 171 * @param size number of bytes expected in @a obj
171 */ 172 */
172struct GNUNET_JSON_Specification 173struct GNUNET_JSON_Specification
173GNUNET_JSON_spec_fixed(const char *name, void *obj, size_t size); 174GNUNET_JSON_spec_fixed (const char *name, void *obj, size_t size);
174 175
175 176
176/** 177/**
@@ -181,7 +182,7 @@ GNUNET_JSON_spec_fixed(const char *name, void *obj, size_t size);
181 * @param obj pointer where to write the data (type of `*obj` will determine size) 182 * @param obj pointer where to write the data (type of `*obj` will determine size)
182 */ 183 */
183#define GNUNET_JSON_spec_fixed_auto(name, obj) \ 184#define GNUNET_JSON_spec_fixed_auto(name, obj) \
184 GNUNET_JSON_spec_fixed(name, obj, sizeof(*obj)) 185 GNUNET_JSON_spec_fixed (name, obj, sizeof(*obj))
185 186
186 187
187/** 188/**
@@ -193,7 +194,7 @@ GNUNET_JSON_spec_fixed(const char *name, void *obj, size_t size);
193 * @param[out] size where to store the number of bytes allocated for @a obj 194 * @param[out] size where to store the number of bytes allocated for @a obj
194 */ 195 */
195struct GNUNET_JSON_Specification 196struct GNUNET_JSON_Specification
196GNUNET_JSON_spec_varsize(const char *name, void **obj, size_t *size); 197GNUNET_JSON_spec_varsize (const char *name, void **obj, size_t *size);
197 198
198 199
199/** 200/**
@@ -203,7 +204,7 @@ GNUNET_JSON_spec_varsize(const char *name, void **obj, size_t *size);
203 * @param strptr where to store a pointer to the field 204 * @param strptr where to store a pointer to the field
204 */ 205 */
205struct GNUNET_JSON_Specification 206struct GNUNET_JSON_Specification
206GNUNET_JSON_spec_string(const char *name, const char **strptr); 207GNUNET_JSON_spec_string (const char *name, const char **strptr);
207 208
208/** 209/**
209 * JSON object. 210 * JSON object.
@@ -212,7 +213,7 @@ GNUNET_JSON_spec_string(const char *name, const char **strptr);
212 * @param[out] jsonp where to store the JSON found under @a name 213 * @param[out] jsonp where to store the JSON found under @a name
213 */ 214 */
214struct GNUNET_JSON_Specification 215struct GNUNET_JSON_Specification
215GNUNET_JSON_spec_json(const char *name, json_t **jsonp); 216GNUNET_JSON_spec_json (const char *name, json_t **jsonp);
216 217
217 218
218/** 219/**
@@ -222,7 +223,7 @@ GNUNET_JSON_spec_json(const char *name, json_t **jsonp);
222 * @param[out] u8 where to store the integer found under @a name 223 * @param[out] u8 where to store the integer found under @a name
223 */ 224 */
224struct GNUNET_JSON_Specification 225struct GNUNET_JSON_Specification
225GNUNET_JSON_spec_uint8(const char *name, uint8_t *u8); 226GNUNET_JSON_spec_uint8 (const char *name, uint8_t *u8);
226 227
227 228
228/** 229/**
@@ -232,7 +233,7 @@ GNUNET_JSON_spec_uint8(const char *name, uint8_t *u8);
232 * @param[out] u16 where to store the integer found under @a name 233 * @param[out] u16 where to store the integer found under @a name
233 */ 234 */
234struct GNUNET_JSON_Specification 235struct GNUNET_JSON_Specification
235GNUNET_JSON_spec_uint16(const char *name, uint16_t *u16); 236GNUNET_JSON_spec_uint16 (const char *name, uint16_t *u16);
236 237
237 238
238/** 239/**
@@ -242,7 +243,7 @@ GNUNET_JSON_spec_uint16(const char *name, uint16_t *u16);
242 * @param[out] u32 where to store the integer found under @a name 243 * @param[out] u32 where to store the integer found under @a name
243 */ 244 */
244struct GNUNET_JSON_Specification 245struct GNUNET_JSON_Specification
245GNUNET_JSON_spec_uint32(const char *name, uint32_t *u32); 246GNUNET_JSON_spec_uint32 (const char *name, uint32_t *u32);
246 247
247 248
248/** 249/**
@@ -252,7 +253,7 @@ GNUNET_JSON_spec_uint32(const char *name, uint32_t *u32);
252 * @param[out] u64 where to store the integer found under @a name 253 * @param[out] u64 where to store the integer found under @a name
253 */ 254 */
254struct GNUNET_JSON_Specification 255struct GNUNET_JSON_Specification
255GNUNET_JSON_spec_uint64(const char *name, uint64_t *u64); 256GNUNET_JSON_spec_uint64 (const char *name, uint64_t *u64);
256 257
257 258
258/** 259/**
@@ -262,7 +263,7 @@ GNUNET_JSON_spec_uint64(const char *name, uint64_t *u64);
262 * @param[out] boolean where to store the boolean found under @a name 263 * @param[out] boolean where to store the boolean found under @a name
263 */ 264 */
264struct GNUNET_JSON_Specification 265struct GNUNET_JSON_Specification
265GNUNET_JSON_spec_boolean(const char *name, int *boolean); 266GNUNET_JSON_spec_boolean (const char *name, int *boolean);
266 267
267 268
268/* ************ GNUnet-specific parser specifications ******************* */ 269/* ************ GNUnet-specific parser specifications ******************* */
@@ -274,8 +275,8 @@ GNUNET_JSON_spec_boolean(const char *name, int *boolean);
274 * @param[out] at where to store the absolute time found under @a name 275 * @param[out] at where to store the absolute time found under @a name
275 */ 276 */
276struct GNUNET_JSON_Specification 277struct GNUNET_JSON_Specification
277GNUNET_JSON_spec_absolute_time(const char *name, 278GNUNET_JSON_spec_absolute_time (const char *name,
278 struct GNUNET_TIME_Absolute *at); 279 struct GNUNET_TIME_Absolute *at);
279 280
280 281
281/** 282/**
@@ -285,8 +286,8 @@ GNUNET_JSON_spec_absolute_time(const char *name,
285 * @param[out] at where to store the absolute time found under @a name 286 * @param[out] at where to store the absolute time found under @a name
286 */ 287 */
287struct GNUNET_JSON_Specification 288struct GNUNET_JSON_Specification
288GNUNET_JSON_spec_absolute_time_nbo(const char *name, 289GNUNET_JSON_spec_absolute_time_nbo (const char *name,
289 struct GNUNET_TIME_AbsoluteNBO *at); 290 struct GNUNET_TIME_AbsoluteNBO *at);
290 291
291 292
292/** 293/**
@@ -296,8 +297,8 @@ GNUNET_JSON_spec_absolute_time_nbo(const char *name,
296 * @param[out] rt where to store the relative time found under @a name 297 * @param[out] rt where to store the relative time found under @a name
297 */ 298 */
298struct GNUNET_JSON_Specification 299struct GNUNET_JSON_Specification
299GNUNET_JSON_spec_relative_time(const char *name, 300GNUNET_JSON_spec_relative_time (const char *name,
300 struct GNUNET_TIME_Relative *rt); 301 struct GNUNET_TIME_Relative *rt);
301 302
302 303
303/** 304/**
@@ -307,8 +308,8 @@ GNUNET_JSON_spec_relative_time(const char *name,
307 * @param pk where to store the RSA key found under @a name 308 * @param pk where to store the RSA key found under @a name
308 */ 309 */
309struct GNUNET_JSON_Specification 310struct GNUNET_JSON_Specification
310GNUNET_JSON_spec_rsa_public_key(const char *name, 311GNUNET_JSON_spec_rsa_public_key (const char *name,
311 struct GNUNET_CRYPTO_RsaPublicKey **pk); 312 struct GNUNET_CRYPTO_RsaPublicKey **pk);
312 313
313 314
314/** 315/**
@@ -318,8 +319,8 @@ GNUNET_JSON_spec_rsa_public_key(const char *name,
318 * @param sig where to store the RSA signature found under @a name 319 * @param sig where to store the RSA signature found under @a name
319 */ 320 */
320struct GNUNET_JSON_Specification 321struct GNUNET_JSON_Specification
321GNUNET_JSON_spec_rsa_signature(const char *name, 322GNUNET_JSON_spec_rsa_signature (const char *name,
322 struct GNUNET_CRYPTO_RsaSignature **sig); 323 struct GNUNET_CRYPTO_RsaSignature **sig);
323 324
324 325
325/** 326/**
@@ -329,9 +330,9 @@ GNUNET_JSON_spec_rsa_signature(const char *name,
329 * @return JSON Specification 330 * @return JSON Specification
330 */ 331 */
331struct GNUNET_JSON_Specification 332struct GNUNET_JSON_Specification
332GNUNET_JSON_spec_gnsrecord(struct GNUNET_GNSRECORD_Data **rd, 333GNUNET_JSON_spec_gnsrecord (struct GNUNET_GNSRECORD_Data **rd,
333 unsigned int *rd_count, 334 unsigned int *rd_count,
334 char **name); 335 char **name);
335 336
336 337
337/* ****************** Generic generator interface ******************* */ 338/* ****************** Generic generator interface ******************* */
@@ -346,7 +347,7 @@ GNUNET_JSON_spec_gnsrecord(struct GNUNET_GNSRECORD_Data **rd,
346 * @return json string that encodes @a data 347 * @return json string that encodes @a data
347 */ 348 */
348json_t * 349json_t *
349GNUNET_JSON_from_data(const void *data, size_t size); 350GNUNET_JSON_from_data (const void *data, size_t size);
350 351
351 352
352/** 353/**
@@ -357,7 +358,7 @@ GNUNET_JSON_from_data(const void *data, size_t size);
357 * @return json string that encodes @a data 358 * @return json string that encodes @a data
358 */ 359 */
359#define GNUNET_JSON_from_data_auto(ptr) \ 360#define GNUNET_JSON_from_data_auto(ptr) \
360 GNUNET_JSON_from_data(ptr, sizeof(*ptr)) 361 GNUNET_JSON_from_data (ptr, sizeof(*ptr))
361 362
362 363
363/** 364/**
@@ -367,7 +368,7 @@ GNUNET_JSON_from_data(const void *data, size_t size);
367 * @return a json string with the timestamp in @a stamp 368 * @return a json string with the timestamp in @a stamp
368 */ 369 */
369json_t * 370json_t *
370GNUNET_JSON_from_time_abs(struct GNUNET_TIME_Absolute stamp); 371GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute stamp);
371 372
372 373
373/** 374/**
@@ -377,7 +378,7 @@ GNUNET_JSON_from_time_abs(struct GNUNET_TIME_Absolute stamp);
377 * @return a json string with the timestamp in @a stamp 378 * @return a json string with the timestamp in @a stamp
378 */ 379 */
379json_t * 380json_t *
380GNUNET_JSON_from_time_abs_nbo(struct GNUNET_TIME_AbsoluteNBO stamp); 381GNUNET_JSON_from_time_abs_nbo (struct GNUNET_TIME_AbsoluteNBO stamp);
381 382
382 383
383/** 384/**
@@ -387,7 +388,7 @@ GNUNET_JSON_from_time_abs_nbo(struct GNUNET_TIME_AbsoluteNBO stamp);
387 * @return a json string with the timestamp in @a stamp 388 * @return a json string with the timestamp in @a stamp
388 */ 389 */
389json_t * 390json_t *
390GNUNET_JSON_from_time_rel(struct GNUNET_TIME_Relative stamp); 391GNUNET_JSON_from_time_rel (struct GNUNET_TIME_Relative stamp);
391 392
392 393
393/** 394/**
@@ -397,7 +398,7 @@ GNUNET_JSON_from_time_rel(struct GNUNET_TIME_Relative stamp);
397 * @return corresponding JSON encoding 398 * @return corresponding JSON encoding
398 */ 399 */
399json_t * 400json_t *
400GNUNET_JSON_from_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *pk); 401GNUNET_JSON_from_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *pk);
401 402
402 403
403/** 404/**
@@ -407,7 +408,7 @@ GNUNET_JSON_from_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *pk);
407 * @return corresponding JSON encoding 408 * @return corresponding JSON encoding
408 */ 409 */
409json_t * 410json_t *
410GNUNET_JSON_from_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *sig); 411GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig);
411 412
412/** 413/**
413 * Convert Gns record to JSON. 414 * Convert Gns record to JSON.
@@ -417,16 +418,17 @@ GNUNET_JSON_from_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *sig);
417 * @return corresponding JSON encoding 418 * @return corresponding JSON encoding
418 */ 419 */
419json_t * 420json_t *
420GNUNET_JSON_from_gnsrecord(const char *rname, 421GNUNET_JSON_from_gnsrecord (const char *rname,
421 const struct GNUNET_GNSRECORD_Data *rd, 422 const struct GNUNET_GNSRECORD_Data *rd,
422 unsigned int rd_count); 423 unsigned int rd_count);
423 424
424/* ******************* Helpers for MHD upload handling ******************* */ 425/* ******************* Helpers for MHD upload handling ******************* */
425 426
426/** 427/**
427 * Return codes from #GNUNET_JSON_post_parser(). 428 * Return codes from #GNUNET_JSON_post_parser().
428 */ 429 */
429enum GNUNET_JSON_PostResult { 430enum GNUNET_JSON_PostResult
431{
430 /** 432 /**
431 * Parsing successful, JSON result is in `*json`. 433 * Parsing successful, JSON result is in `*json`.
432 */ 434 */
@@ -470,12 +472,12 @@ enum GNUNET_JSON_PostResult {
470 * @return result code indicating the status of the operation 472 * @return result code indicating the status of the operation
471 */ 473 */
472enum GNUNET_JSON_PostResult 474enum GNUNET_JSON_PostResult
473GNUNET_JSON_post_parser(size_t buffer_max, 475GNUNET_JSON_post_parser (size_t buffer_max,
474 struct MHD_Connection *connection, 476 struct MHD_Connection *connection,
475 void **con_cls, 477 void **con_cls,
476 const char *upload_data, 478 const char *upload_data,
477 size_t *upload_data_size, 479 size_t *upload_data_size,
478 json_t **json); 480 json_t **json);
479 481
480 482
481/** 483/**
@@ -486,7 +488,7 @@ GNUNET_JSON_post_parser(size_t buffer_max,
486 * #GNUNET_JSON_post_parser(), to be cleaned up 488 * #GNUNET_JSON_post_parser(), to be cleaned up
487 */ 489 */
488void 490void
489GNUNET_JSON_post_parser_cleanup(void *con_cls); 491GNUNET_JSON_post_parser_cleanup (void *con_cls);
490 492
491 493
492/* ****************** GETOPT JSON helper ******************* */ 494/* ****************** GETOPT JSON helper ******************* */
@@ -502,11 +504,11 @@ GNUNET_JSON_post_parser_cleanup(void *con_cls);
502 * @param[out] val set to the JSON specified at the command line 504 * @param[out] val set to the JSON specified at the command line
503 */ 505 */
504struct GNUNET_GETOPT_CommandLineOption 506struct GNUNET_GETOPT_CommandLineOption
505GNUNET_JSON_getopt(char shortName, 507GNUNET_JSON_getopt (char shortName,
506 const char *name, 508 const char *name,
507 const char *argumentHelp, 509 const char *argumentHelp,
508 const char *description, 510 const char *description,
509 json_t **json); 511 json_t **json);
510 512
511#endif 513#endif
512 514
diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h
index 1e786181f..ef596807a 100644
--- a/src/include/gnunet_load_lib.h
+++ b/src/include/gnunet_load_lib.h
@@ -57,7 +57,7 @@ struct GNUNET_LOAD_Value;
57 * @return the new load value 57 * @return the new load value
58 */ 58 */
59struct GNUNET_LOAD_Value * 59struct GNUNET_LOAD_Value *
60GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline); 60GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline);
61 61
62 62
63/** 63/**
@@ -67,8 +67,8 @@ GNUNET_LOAD_value_init(struct GNUNET_TIME_Relative autodecline);
67 * @param autodecline frequency of load decline 67 * @param autodecline frequency of load decline
68 */ 68 */
69void 69void
70GNUNET_LOAD_value_set_decline(struct GNUNET_LOAD_Value *load, 70GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load,
71 struct GNUNET_TIME_Relative autodecline); 71 struct GNUNET_TIME_Relative autodecline);
72 72
73 73
74/** 74/**
@@ -76,7 +76,7 @@ GNUNET_LOAD_value_set_decline(struct GNUNET_LOAD_Value *load,
76 * 76 *
77 * @param lv value to free 77 * @param lv value to free
78 */ 78 */
79#define GNUNET_LOAD_value_free(lv) GNUNET_free(lv) 79#define GNUNET_LOAD_value_free(lv) GNUNET_free (lv)
80 80
81 81
82/** 82/**
@@ -89,7 +89,7 @@ GNUNET_LOAD_value_set_decline(struct GNUNET_LOAD_Value *load,
89 * that we could not do proper calculations 89 * that we could not do proper calculations
90 */ 90 */
91double 91double
92GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load); 92GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load);
93 93
94 94
95/** 95/**
@@ -99,7 +99,7 @@ GNUNET_LOAD_get_load(struct GNUNET_LOAD_Value *load);
99 * @return zero if update was never called 99 * @return zero if update was never called
100 */ 100 */
101double 101double
102GNUNET_LOAD_get_average(struct GNUNET_LOAD_Value *load); 102GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load);
103 103
104 104
105/** 105/**
@@ -109,7 +109,7 @@ GNUNET_LOAD_get_average(struct GNUNET_LOAD_Value *load);
109 * @param data latest measurement value (for example, delay) 109 * @param data latest measurement value (for example, delay)
110 */ 110 */
111void 111void
112GNUNET_LOAD_update(struct GNUNET_LOAD_Value *load, uint64_t data); 112GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data);
113 113
114 114
115#if 0 /* keep Emacsens' auto-indent happy */ 115#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_microphone_lib.h b/src/include/gnunet_microphone_lib.h
index f5cf4abc6..2b08bcd71 100644
--- a/src/include/gnunet_microphone_lib.h
+++ b/src/include/gnunet_microphone_lib.h
@@ -63,7 +63,8 @@ typedef void (*GNUNET_MICROPHONE_RecordedDataCallback)(void *cls,
63 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 63 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
64 */ 64 */
65typedef int (*GNUNET_MICROPHONE_EnableCallback)(void *cls, 65typedef int (*GNUNET_MICROPHONE_EnableCallback)(void *cls,
66 GNUNET_MICROPHONE_RecordedDataCallback rdc, 66 GNUNET_MICROPHONE_RecordedDataCallback
67 rdc,
67 void *rdc_cls); 68 void *rdc_cls);
68 69
69/** 70/**
@@ -84,7 +85,8 @@ typedef void (*GNUNET_MICROPHONE_DestroyCallback)(void *cls);
84/** 85/**
85 * A microphone is a device that can capture or otherwise produce audio data. 86 * A microphone is a device that can capture or otherwise produce audio data.
86 */ 87 */
87struct GNUNET_MICROPHONE_Handle { 88struct GNUNET_MICROPHONE_Handle
89{
88 /** 90 /**
89 * Turn on the microphone. 91 * Turn on the microphone.
90 */ 92 */
@@ -115,7 +117,8 @@ struct GNUNET_MICROPHONE_Handle {
115 * @return NULL on error 117 * @return NULL on error
116 */ 118 */
117struct GNUNET_MICROPHONE_Handle * 119struct GNUNET_MICROPHONE_Handle *
118GNUNET_MICROPHONE_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cfg); 120GNUNET_MICROPHONE_create_from_hardware (const struct
121 GNUNET_CONFIGURATION_Handle *cfg);
119 122
120 123
121/** 124/**
@@ -124,7 +127,7 @@ GNUNET_MICROPHONE_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle
124 * @param microphone microphone to destroy 127 * @param microphone microphone to destroy
125 */ 128 */
126void 129void
127GNUNET_MICROPHONE_destroy(struct GNUNET_MICROPHONE_Handle *microphone); 130GNUNET_MICROPHONE_destroy (struct GNUNET_MICROPHONE_Handle *microphone);
128 131
129 132
130#if 0 /* keep Emacsens' auto-indent happy */ 133#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 1839a68bd..37f21e5b1 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -50,9 +50,9 @@
50 * @return the MQ message 50 * @return the MQ message
51 */ 51 */
52#define GNUNET_MQ_msg_extra(mvar, esize, type) \ 52#define GNUNET_MQ_msg_extra(mvar, esize, type) \
53 GNUNET_MQ_msg_(((struct GNUNET_MessageHeader **)&(mvar)), \ 53 GNUNET_MQ_msg_ (((struct GNUNET_MessageHeader **) &(mvar)), \
54 (esize) + sizeof *(mvar), \ 54 (esize) + sizeof *(mvar), \
55 (type)) 55 (type))
56 56
57/** 57/**
58 * Allocate a GNUNET_MQ_Envelope. 58 * Allocate a GNUNET_MQ_Envelope.
@@ -64,7 +64,7 @@
64 * @param type type of the message 64 * @param type type of the message
65 * @return the allocated envelope 65 * @return the allocated envelope
66 */ 66 */
67#define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra(mvar, 0, type) 67#define GNUNET_MQ_msg(mvar, type) GNUNET_MQ_msg_extra (mvar, 0, type)
68 68
69 69
70/** 70/**
@@ -74,7 +74,7 @@
74 * @param type type of the message 74 * @param type type of the message
75 */ 75 */
76#define GNUNET_MQ_msg_header(type) \ 76#define GNUNET_MQ_msg_header(type) \
77 GNUNET_MQ_msg_(NULL, sizeof(struct GNUNET_MessageHeader), type) 77 GNUNET_MQ_msg_ (NULL, sizeof(struct GNUNET_MessageHeader), type)
78 78
79 79
80/** 80/**
@@ -86,7 +86,7 @@
86 * @param type type of the message 86 * @param type type of the message
87 */ 87 */
88#define GNUNET_MQ_msg_header_extra(mh, esize, type) \ 88#define GNUNET_MQ_msg_header_extra(mh, esize, type) \
89 GNUNET_MQ_msg_(&mh, (esize) + sizeof(struct GNUNET_MessageHeader), type) 89 GNUNET_MQ_msg_ (&mh, (esize) + sizeof(struct GNUNET_MessageHeader), type)
90 90
91 91
92/** 92/**
@@ -102,11 +102,11 @@
102#define GNUNET_MQ_msg_nested_mh(mvar, type, mh) \ 102#define GNUNET_MQ_msg_nested_mh(mvar, type, mh) \
103 ({ \ 103 ({ \
104 struct GNUNET_MQ_Envelope *_ev; \ 104 struct GNUNET_MQ_Envelope *_ev; \
105 _ev = GNUNET_MQ_msg_nested_mh_((struct GNUNET_MessageHeader **)&(mvar), \ 105 _ev = GNUNET_MQ_msg_nested_mh_ ((struct GNUNET_MessageHeader **) &(mvar), \
106 sizeof(*(mvar)), \ 106 sizeof(*(mvar)), \
107 (type), \ 107 (type), \
108 (mh)); \ 108 (mh)); \
109 (void)(mvar)->header; /* type check */ \ 109 (void) (mvar)->header; /* type check */ \
110 _ev; \ 110 _ev; \
111 }) 111 })
112 112
@@ -120,8 +120,8 @@
120 * or NULL if the given message in @a var does not have any space after the message struct 120 * or NULL if the given message in @a var does not have any space after the message struct
121 */ 121 */
122#define GNUNET_MQ_extract_nested_mh(var) \ 122#define GNUNET_MQ_extract_nested_mh(var) \
123 GNUNET_MQ_extract_nested_mh_((struct GNUNET_MessageHeader *)(var), \ 123 GNUNET_MQ_extract_nested_mh_ ((struct GNUNET_MessageHeader *) (var), \
124 sizeof(*(var))) 124 sizeof(*(var)))
125 125
126 126
127/** 127/**
@@ -133,8 +133,8 @@
133 * OR NULL in case of a malformed message. 133 * OR NULL in case of a malformed message.
134 */ 134 */
135const struct GNUNET_MessageHeader * 135const struct GNUNET_MessageHeader *
136GNUNET_MQ_extract_nested_mh_(const struct GNUNET_MessageHeader *mh, 136GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh,
137 uint16_t base_size); 137 uint16_t base_size);
138 138
139 139
140/** 140/**
@@ -150,7 +150,7 @@ struct GNUNET_MQ_Envelope;
150 * @return message contained in the envelope 150 * @return message contained in the envelope
151 */ 151 */
152const struct GNUNET_MessageHeader * 152const struct GNUNET_MessageHeader *
153GNUNET_MQ_env_get_msg(const struct GNUNET_MQ_Envelope *env); 153GNUNET_MQ_env_get_msg (const struct GNUNET_MQ_Envelope *env);
154 154
155 155
156/** 156/**
@@ -160,7 +160,7 @@ GNUNET_MQ_env_get_msg(const struct GNUNET_MQ_Envelope *env);
160 * @return next one, or NULL 160 * @return next one, or NULL
161 */ 161 */
162const struct GNUNET_MQ_Envelope * 162const struct GNUNET_MQ_Envelope *
163GNUNET_MQ_env_next(const struct GNUNET_MQ_Envelope *env); 163GNUNET_MQ_env_next (const struct GNUNET_MQ_Envelope *env);
164 164
165 165
166/** 166/**
@@ -173,10 +173,10 @@ GNUNET_MQ_env_next(const struct GNUNET_MQ_Envelope *env);
173 * @param nested_mh the message to append to the message after base_size 173 * @param nested_mh the message to append to the message after base_size
174 */ 174 */
175struct GNUNET_MQ_Envelope * 175struct GNUNET_MQ_Envelope *
176GNUNET_MQ_msg_nested_mh_(struct GNUNET_MessageHeader **mhp, 176GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp,
177 uint16_t base_size, 177 uint16_t base_size,
178 uint16_t type, 178 uint16_t type,
179 const struct GNUNET_MessageHeader *nested_mh); 179 const struct GNUNET_MessageHeader *nested_mh);
180 180
181 181
182/** 182/**
@@ -188,7 +188,8 @@ struct GNUNET_MQ_Handle;
188/** 188/**
189 * Error codes for the queue. 189 * Error codes for the queue.
190 */ 190 */
191enum GNUNET_MQ_Error { 191enum GNUNET_MQ_Error
192{
192 /** 193 /**
193 * Failed to read message from the network. 194 * Failed to read message from the network.
194 * FIXME: Likely not properly distinguished 195 * FIXME: Likely not properly distinguished
@@ -223,7 +224,8 @@ enum GNUNET_MQ_Error {
223/** 224/**
224 * Per envelope preferences and priorities. 225 * Per envelope preferences and priorities.
225 */ 226 */
226enum GNUNET_MQ_PriorityPreferences { 227enum GNUNET_MQ_PriorityPreferences
228{
227 /** 229 /**
228 * Lowest priority, i.e. background traffic (i.e. NSE, FS). 230 * Lowest priority, i.e. background traffic (i.e. NSE, FS).
229 * This is the default! 231 * This is the default!
@@ -382,9 +384,9 @@ typedef void (*GNUNET_MQ_ErrorHandler) (void *cls, enum GNUNET_MQ_Error error);
382 * @param[in|out] env element to insert at the tail 384 * @param[in|out] env element to insert at the tail
383 */ 385 */
384void 386void
385GNUNET_MQ_dll_insert_head(struct GNUNET_MQ_Envelope **env_head, 387GNUNET_MQ_dll_insert_head (struct GNUNET_MQ_Envelope **env_head,
386 struct GNUNET_MQ_Envelope **env_tail, 388 struct GNUNET_MQ_Envelope **env_tail,
387 struct GNUNET_MQ_Envelope *env); 389 struct GNUNET_MQ_Envelope *env);
388 390
389 391
390/** 392/**
@@ -400,9 +402,9 @@ GNUNET_MQ_dll_insert_head(struct GNUNET_MQ_Envelope **env_head,
400 * @param[in|out] env element to insert at the tail 402 * @param[in|out] env element to insert at the tail
401 */ 403 */
402void 404void
403GNUNET_MQ_dll_insert_tail(struct GNUNET_MQ_Envelope **env_head, 405GNUNET_MQ_dll_insert_tail (struct GNUNET_MQ_Envelope **env_head,
404 struct GNUNET_MQ_Envelope **env_tail, 406 struct GNUNET_MQ_Envelope **env_tail,
405 struct GNUNET_MQ_Envelope *env); 407 struct GNUNET_MQ_Envelope *env);
406 408
407 409
408/** 410/**
@@ -418,9 +420,9 @@ GNUNET_MQ_dll_insert_tail(struct GNUNET_MQ_Envelope **env_head,
418 * @param[in|out] env element to remove from the DLL 420 * @param[in|out] env element to remove from the DLL
419 */ 421 */
420void 422void
421GNUNET_MQ_dll_remove(struct GNUNET_MQ_Envelope **env_head, 423GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head,
422 struct GNUNET_MQ_Envelope **env_tail, 424 struct GNUNET_MQ_Envelope **env_tail,
423 struct GNUNET_MQ_Envelope *env); 425 struct GNUNET_MQ_Envelope *env);
424 426
425 427
426/** 428/**
@@ -434,7 +436,7 @@ GNUNET_MQ_dll_remove(struct GNUNET_MQ_Envelope **env_head,
434 * Needs to be freed with #GNUNET_free. 436 * Needs to be freed with #GNUNET_free.
435 */ 437 */
436struct GNUNET_MQ_MessageHandler * 438struct GNUNET_MQ_MessageHandler *
437GNUNET_MQ_copy_handlers(const struct GNUNET_MQ_MessageHandler *handlers); 439GNUNET_MQ_copy_handlers (const struct GNUNET_MQ_MessageHandler *handlers);
438 440
439 441
440/** 442/**
@@ -450,9 +452,9 @@ GNUNET_MQ_copy_handlers(const struct GNUNET_MQ_MessageHandler *handlers);
450 * Needs to be freed with #GNUNET_free. 452 * Needs to be freed with #GNUNET_free.
451 */ 453 */
452struct GNUNET_MQ_MessageHandler * 454struct GNUNET_MQ_MessageHandler *
453GNUNET_MQ_copy_handlers2(const struct GNUNET_MQ_MessageHandler *handlers, 455GNUNET_MQ_copy_handlers2 (const struct GNUNET_MQ_MessageHandler *handlers,
454 GNUNET_MQ_MessageCallback agpl_handler, 456 GNUNET_MQ_MessageCallback agpl_handler,
455 void *agpl_cls); 457 void *agpl_cls);
456 458
457 459
458/** 460/**
@@ -462,13 +464,14 @@ GNUNET_MQ_copy_handlers2(const struct GNUNET_MQ_MessageHandler *handlers,
462 * @return The number of handlers in the array. 464 * @return The number of handlers in the array.
463 */ 465 */
464unsigned int 466unsigned int
465GNUNET_MQ_count_handlers(const struct GNUNET_MQ_MessageHandler *handlers); 467GNUNET_MQ_count_handlers (const struct GNUNET_MQ_MessageHandler *handlers);
466 468
467 469
468/** 470/**
469 * Message handler for a specific message type. 471 * Message handler for a specific message type.
470 */ 472 */
471struct GNUNET_MQ_MessageHandler { 473struct GNUNET_MQ_MessageHandler
474{
472 /** 475 /**
473 * Callback to validate a message of the specified @e type. 476 * Callback to validate a message of the specified @e type.
474 * The closure given to @e mv will be this struct (not @e ctx). 477 * The closure given to @e mv will be this struct (not @e ctx).
@@ -546,7 +549,7 @@ struct GNUNET_MQ_MessageHandler {
546 ({ \ 549 ({ \
547 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ 550 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \
548 ((struct GNUNET_MQ_MessageHandler){ NULL, \ 551 ((struct GNUNET_MQ_MessageHandler){ NULL, \
549 (GNUNET_MQ_MessageCallback)_cb, \ 552 (GNUNET_MQ_MessageCallback) _cb, \
550 (ctx), \ 553 (ctx), \
551 (code), \ 554 (code), \
552 sizeof(str) }); \ 555 sizeof(str) }); \
@@ -594,12 +597,12 @@ struct GNUNET_MQ_MessageHandler {
594 * @param ctx context for the callbacks 597 * @param ctx context for the callbacks
595 */ 598 */
596#define GNUNET_MQ_hd_var_size(name, code, str, ctx) \ 599#define GNUNET_MQ_hd_var_size(name, code, str, ctx) \
597 __extension__({ \ 600 __extension__ ({ \
598 int (*_mv)(void *cls, const str *msg) = &check_ ## name; \ 601 int (*_mv)(void *cls, const str *msg) = &check_ ## name; \
599 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ 602 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \
600 ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \ 603 ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \
601 _mv, \ 604 _mv, \
602 (GNUNET_MQ_MessageCallback)_cb, \ 605 (GNUNET_MQ_MessageCallback) _cb, \
603 (ctx), \ 606 (ctx), \
604 (code), \ 607 (code), \
605 sizeof(str) }); \ 608 sizeof(str) }); \
@@ -618,15 +621,15 @@ struct GNUNET_MQ_MessageHandler {
618 */ 621 */
619#define GNUNET_MQ_check_zero_termination(m) \ 622#define GNUNET_MQ_check_zero_termination(m) \
620 { \ 623 { \
621 const char *str = (const char *)&m[1]; \ 624 const char *str = (const char *) &m[1]; \
622 const struct GNUNET_MessageHeader *hdr = \ 625 const struct GNUNET_MessageHeader *hdr = \
623 (const struct GNUNET_MessageHeader *)m; \ 626 (const struct GNUNET_MessageHeader *) m; \
624 uint16_t slen = ntohs(hdr->size) - sizeof(*m); \ 627 uint16_t slen = ntohs (hdr->size) - sizeof(*m); \
625 if ((0 == slen) || (memchr(str, 0, slen) != &str[slen - 1])) \ 628 if ((0 == slen) || (memchr (str, 0, slen) != &str[slen - 1])) \
626 { \ 629 { \
627 GNUNET_break(0); \ 630 GNUNET_break (0); \
628 return GNUNET_NO; \ 631 return GNUNET_NO; \
629 } \ 632 } \
630 } 633 }
631 634
632 635
@@ -645,16 +648,16 @@ struct GNUNET_MQ_MessageHandler {
645#define GNUNET_MQ_check_boxed_message(m) \ 648#define GNUNET_MQ_check_boxed_message(m) \
646 { \ 649 { \
647 const struct GNUNET_MessageHeader *inbox = \ 650 const struct GNUNET_MessageHeader *inbox = \
648 (const struct GNUNET_MessageHeader *)&m[1]; \ 651 (const struct GNUNET_MessageHeader *) &m[1]; \
649 const struct GNUNET_MessageHeader *hdr = \ 652 const struct GNUNET_MessageHeader *hdr = \
650 (const struct GNUNET_MessageHeader *)m; \ 653 (const struct GNUNET_MessageHeader *) m; \
651 uint16_t slen = ntohs(hdr->size) - sizeof(*m); \ 654 uint16_t slen = ntohs (hdr->size) - sizeof(*m); \
652 if ((slen < sizeof(struct GNUNET_MessageHeader)) || \ 655 if ((slen < sizeof(struct GNUNET_MessageHeader)) || \
653 (slen != ntohs(inbox->size))) \ 656 (slen != ntohs (inbox->size))) \
654 { \ 657 { \
655 GNUNET_break(0); \ 658 GNUNET_break (0); \
656 return GNUNET_NO; \ 659 return GNUNET_NO; \
657 } \ 660 } \
658 } 661 }
659 662
660 663
@@ -671,8 +674,8 @@ struct GNUNET_MQ_MessageHandler {
671 * #GNUNET_SYSERR if message was rejected by check function 674 * #GNUNET_SYSERR if message was rejected by check function
672 */ 675 */
673int 676int
674GNUNET_MQ_handle_message(const struct GNUNET_MQ_MessageHandler *handlers, 677GNUNET_MQ_handle_message (const struct GNUNET_MQ_MessageHandler *handlers,
675 const struct GNUNET_MessageHeader *mh); 678 const struct GNUNET_MessageHeader *mh);
676 679
677 680
678/** 681/**
@@ -684,9 +687,9 @@ GNUNET_MQ_handle_message(const struct GNUNET_MQ_MessageHandler *handlers,
684 * @return the allocated MQ message 687 * @return the allocated MQ message
685 */ 688 */
686struct GNUNET_MQ_Envelope * 689struct GNUNET_MQ_Envelope *
687GNUNET_MQ_msg_(struct GNUNET_MessageHeader **mhp, 690GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp,
688 uint16_t size, 691 uint16_t size,
689 uint16_t type); 692 uint16_t type);
690 693
691 694
692/** 695/**
@@ -696,7 +699,7 @@ GNUNET_MQ_msg_(struct GNUNET_MessageHeader **mhp,
696 * @return envelope containing @a hdr 699 * @return envelope containing @a hdr
697 */ 700 */
698struct GNUNET_MQ_Envelope * 701struct GNUNET_MQ_Envelope *
699GNUNET_MQ_msg_copy(const struct GNUNET_MessageHeader *hdr); 702GNUNET_MQ_msg_copy (const struct GNUNET_MessageHeader *hdr);
700 703
701 704
702/** 705/**
@@ -707,7 +710,7 @@ GNUNET_MQ_msg_copy(const struct GNUNET_MessageHeader *hdr);
707 * @param mqm the message to discard 710 * @param mqm the message to discard
708 */ 711 */
709void 712void
710GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm); 713GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm);
711 714
712 715
713/** 716/**
@@ -718,7 +721,7 @@ GNUNET_MQ_discard(struct GNUNET_MQ_Envelope *mqm);
718 * @return the current envelope 721 * @return the current envelope
719 */ 722 */
720struct GNUNET_MQ_Envelope * 723struct GNUNET_MQ_Envelope *
721GNUNET_MQ_get_current_envelope(struct GNUNET_MQ_Handle *mq); 724GNUNET_MQ_get_current_envelope (struct GNUNET_MQ_Handle *mq);
722 725
723 726
724/** 727/**
@@ -729,7 +732,7 @@ GNUNET_MQ_get_current_envelope(struct GNUNET_MQ_Handle *mq);
729 * @return copy of @a env 732 * @return copy of @a env
730 */ 733 */
731struct GNUNET_MQ_Envelope * 734struct GNUNET_MQ_Envelope *
732GNUNET_MQ_env_copy(struct GNUNET_MQ_Envelope *env); 735GNUNET_MQ_env_copy (struct GNUNET_MQ_Envelope *env);
733 736
734 737
735/** 738/**
@@ -739,7 +742,7 @@ GNUNET_MQ_env_copy(struct GNUNET_MQ_Envelope *env);
739 * @return the last envelope in the queue 742 * @return the last envelope in the queue
740 */ 743 */
741struct GNUNET_MQ_Envelope * 744struct GNUNET_MQ_Envelope *
742GNUNET_MQ_get_last_envelope(struct GNUNET_MQ_Handle *mq); 745GNUNET_MQ_get_last_envelope (struct GNUNET_MQ_Handle *mq);
743 746
744 747
745/** 748/**
@@ -751,8 +754,8 @@ GNUNET_MQ_get_last_envelope(struct GNUNET_MQ_Handle *mq);
751 * @param pp priority and preferences to set for @a env 754 * @param pp priority and preferences to set for @a env
752 */ 755 */
753void 756void
754GNUNET_MQ_env_set_options(struct GNUNET_MQ_Envelope *env, 757GNUNET_MQ_env_set_options (struct GNUNET_MQ_Envelope *env,
755 enum GNUNET_MQ_PriorityPreferences pp); 758 enum GNUNET_MQ_PriorityPreferences pp);
756 759
757 760
758/** 761/**
@@ -762,7 +765,7 @@ GNUNET_MQ_env_set_options(struct GNUNET_MQ_Envelope *env,
762 * @return priority and preferences to use 765 * @return priority and preferences to use
763 */ 766 */
764enum GNUNET_MQ_PriorityPreferences 767enum GNUNET_MQ_PriorityPreferences
765GNUNET_MQ_env_get_options(struct GNUNET_MQ_Envelope *env); 768GNUNET_MQ_env_get_options (struct GNUNET_MQ_Envelope *env);
766 769
767 770
768/** 771/**
@@ -774,8 +777,8 @@ GNUNET_MQ_env_get_options(struct GNUNET_MQ_Envelope *env);
774 * @return combined priority and preferences to use 777 * @return combined priority and preferences to use
775 */ 778 */
776enum GNUNET_MQ_PriorityPreferences 779enum GNUNET_MQ_PriorityPreferences
777GNUNET_MQ_env_combine_options(enum GNUNET_MQ_PriorityPreferences p1, 780GNUNET_MQ_env_combine_options (enum GNUNET_MQ_PriorityPreferences p1,
778 enum GNUNET_MQ_PriorityPreferences p2); 781 enum GNUNET_MQ_PriorityPreferences p2);
779 782
780 783
781/** 784/**
@@ -786,7 +789,7 @@ GNUNET_MQ_env_combine_options(enum GNUNET_MQ_PriorityPreferences p1,
786 * @return NULL if queue is empty (or has no envelope that is not under transmission) 789 * @return NULL if queue is empty (or has no envelope that is not under transmission)
787 */ 790 */
788struct GNUNET_MQ_Envelope * 791struct GNUNET_MQ_Envelope *
789GNUNET_MQ_unsent_head(struct GNUNET_MQ_Handle *mq); 792GNUNET_MQ_unsent_head (struct GNUNET_MQ_Handle *mq);
790 793
791 794
792/** 795/**
@@ -796,8 +799,8 @@ GNUNET_MQ_unsent_head(struct GNUNET_MQ_Handle *mq);
796 * @param pp priority and preferences to use by default 799 * @param pp priority and preferences to use by default
797 */ 800 */
798void 801void
799GNUNET_MQ_set_options(struct GNUNET_MQ_Handle *mq, 802GNUNET_MQ_set_options (struct GNUNET_MQ_Handle *mq,
800 enum GNUNET_MQ_PriorityPreferences pp); 803 enum GNUNET_MQ_PriorityPreferences pp);
801 804
802 805
803/** 806/**
@@ -807,7 +810,7 @@ GNUNET_MQ_set_options(struct GNUNET_MQ_Handle *mq,
807 * @return number of queued, non-transmitted messages 810 * @return number of queued, non-transmitted messages
808 */ 811 */
809unsigned int 812unsigned int
810GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq); 813GNUNET_MQ_get_length (struct GNUNET_MQ_Handle *mq);
811 814
812 815
813/** 816/**
@@ -818,7 +821,7 @@ GNUNET_MQ_get_length(struct GNUNET_MQ_Handle *mq);
818 * @param ev the envelope with the message to send. 821 * @param ev the envelope with the message to send.
819 */ 822 */
820void 823void
821GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); 824GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev);
822 825
823 826
824/** 827/**
@@ -829,8 +832,8 @@ GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev);
829 * @param ev the envelope with the message to send. 832 * @param ev the envelope with the message to send.
830 */ 833 */
831void 834void
832GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq, 835GNUNET_MQ_send_copy (struct GNUNET_MQ_Handle *mq,
833 const struct GNUNET_MQ_Envelope *ev); 836 const struct GNUNET_MQ_Envelope *ev);
834 837
835 838
836/** 839/**
@@ -841,7 +844,7 @@ GNUNET_MQ_send_copy(struct GNUNET_MQ_Handle *mq,
841 * @param ev queued envelope to cancel 844 * @param ev queued envelope to cancel
842 */ 845 */
843void 846void
844GNUNET_MQ_send_cancel(struct GNUNET_MQ_Envelope *ev); 847GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev);
845 848
846 849
847/** 850/**
@@ -851,7 +854,7 @@ GNUNET_MQ_send_cancel(struct GNUNET_MQ_Envelope *ev);
851 * @param assoc_data to associate 854 * @param assoc_data to associate
852 */ 855 */
853uint32_t 856uint32_t
854GNUNET_MQ_assoc_add(struct GNUNET_MQ_Handle *mq, void *assoc_data); 857GNUNET_MQ_assoc_add (struct GNUNET_MQ_Handle *mq, void *assoc_data);
855 858
856 859
857/** 860/**
@@ -862,7 +865,7 @@ GNUNET_MQ_assoc_add(struct GNUNET_MQ_Handle *mq, void *assoc_data);
862 * @return the associated data 865 * @return the associated data
863 */ 866 */
864void * 867void *
865GNUNET_MQ_assoc_get(struct GNUNET_MQ_Handle *mq, uint32_t request_id); 868GNUNET_MQ_assoc_get (struct GNUNET_MQ_Handle *mq, uint32_t request_id);
866 869
867 870
868/** 871/**
@@ -873,7 +876,7 @@ GNUNET_MQ_assoc_get(struct GNUNET_MQ_Handle *mq, uint32_t request_id);
873 * @return the associated data 876 * @return the associated data
874 */ 877 */
875void * 878void *
876GNUNET_MQ_assoc_remove(struct GNUNET_MQ_Handle *mq, uint32_t request_id); 879GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq, uint32_t request_id);
877 880
878 881
879/** 882/**
@@ -889,13 +892,13 @@ GNUNET_MQ_assoc_remove(struct GNUNET_MQ_Handle *mq, uint32_t request_id);
889 * @return a new message queue 892 * @return a new message queue
890 */ 893 */
891struct GNUNET_MQ_Handle * 894struct GNUNET_MQ_Handle *
892GNUNET_MQ_queue_for_callbacks(GNUNET_MQ_SendImpl send, 895GNUNET_MQ_queue_for_callbacks (GNUNET_MQ_SendImpl send,
893 GNUNET_MQ_DestroyImpl destroy, 896 GNUNET_MQ_DestroyImpl destroy,
894 GNUNET_MQ_CancelImpl cancel, 897 GNUNET_MQ_CancelImpl cancel,
895 void *impl_state, 898 void *impl_state,
896 const struct GNUNET_MQ_MessageHandler *handlers, 899 const struct GNUNET_MQ_MessageHandler *handlers,
897 GNUNET_MQ_ErrorHandler error_handler, 900 GNUNET_MQ_ErrorHandler error_handler,
898 void *cls); 901 void *cls);
899 902
900 903
901/** 904/**
@@ -906,8 +909,8 @@ GNUNET_MQ_queue_for_callbacks(GNUNET_MQ_SendImpl send,
906 * @param handlers_cls new closure to use 909 * @param handlers_cls new closure to use
907 */ 910 */
908void 911void
909GNUNET_MQ_set_handlers_closure(struct GNUNET_MQ_Handle *mq, 912GNUNET_MQ_set_handlers_closure (struct GNUNET_MQ_Handle *mq,
910 void *handlers_cls); 913 void *handlers_cls);
911 914
912 915
913/** 916/**
@@ -920,9 +923,9 @@ GNUNET_MQ_set_handlers_closure(struct GNUNET_MQ_Handle *mq,
920 * @param cb_cls closure for the callback 923 * @param cb_cls closure for the callback
921 */ 924 */
922void 925void
923GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, 926GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev,
924 GNUNET_SCHEDULER_TaskCallback cb, 927 GNUNET_SCHEDULER_TaskCallback cb,
925 void *cb_cls); 928 void *cb_cls);
926 929
927 930
928/** 931/**
@@ -931,7 +934,7 @@ GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev,
931 * @param mq message queue to destroy 934 * @param mq message queue to destroy
932 */ 935 */
933void 936void
934GNUNET_MQ_destroy(struct GNUNET_MQ_Handle *mq); 937GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq);
935 938
936 939
937/** 940/**
@@ -951,9 +954,9 @@ struct GNUNET_MQ_DestroyNotificationHandle;
951 * @return handle for #GNUNET_MQ_destroy_notify_cancel(). 954 * @return handle for #GNUNET_MQ_destroy_notify_cancel().
952 */ 955 */
953struct GNUNET_MQ_DestroyNotificationHandle * 956struct GNUNET_MQ_DestroyNotificationHandle *
954GNUNET_MQ_destroy_notify(struct GNUNET_MQ_Handle *mq, 957GNUNET_MQ_destroy_notify (struct GNUNET_MQ_Handle *mq,
955 GNUNET_SCHEDULER_TaskCallback cb, 958 GNUNET_SCHEDULER_TaskCallback cb,
956 void *cb_cls); 959 void *cb_cls);
957 960
958/** 961/**
959 * Cancel registration from #GNUNET_MQ_destroy_notify(). 962 * Cancel registration from #GNUNET_MQ_destroy_notify().
@@ -961,7 +964,7 @@ GNUNET_MQ_destroy_notify(struct GNUNET_MQ_Handle *mq,
961 * @param dnh handle for registration to cancel 964 * @param dnh handle for registration to cancel
962 */ 965 */
963void 966void
964GNUNET_MQ_destroy_notify_cancel( 967GNUNET_MQ_destroy_notify_cancel (
965 struct GNUNET_MQ_DestroyNotificationHandle *dnh); 968 struct GNUNET_MQ_DestroyNotificationHandle *dnh);
966 969
967 970
@@ -976,8 +979,8 @@ GNUNET_MQ_destroy_notify_cancel(
976 * @param mh message to dispatch 979 * @param mh message to dispatch
977 */ 980 */
978void 981void
979GNUNET_MQ_inject_message(struct GNUNET_MQ_Handle *mq, 982GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq,
980 const struct GNUNET_MessageHeader *mh); 983 const struct GNUNET_MessageHeader *mh);
981 984
982 985
983/** 986/**
@@ -991,8 +994,8 @@ GNUNET_MQ_inject_message(struct GNUNET_MQ_Handle *mq,
991 * @param error the error type 994 * @param error the error type
992 */ 995 */
993void 996void
994GNUNET_MQ_inject_error(struct GNUNET_MQ_Handle *mq, 997GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq,
995 enum GNUNET_MQ_Error error); 998 enum GNUNET_MQ_Error error);
996 999
997 1000
998/** 1001/**
@@ -1006,7 +1009,7 @@ GNUNET_MQ_inject_error(struct GNUNET_MQ_Handle *mq,
1006 * @param mq message queue to send the next message with 1009 * @param mq message queue to send the next message with
1007 */ 1010 */
1008void 1011void
1009GNUNET_MQ_impl_send_continue(struct GNUNET_MQ_Handle *mq); 1012GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq);
1010 1013
1011 1014
1012/** 1015/**
@@ -1020,7 +1023,7 @@ GNUNET_MQ_impl_send_continue(struct GNUNET_MQ_Handle *mq);
1020 * @param mq message queue to send the next message with 1023 * @param mq message queue to send the next message with
1021 */ 1024 */
1022void 1025void
1023GNUNET_MQ_impl_send_in_flight(struct GNUNET_MQ_Handle *mq); 1026GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq);
1024 1027
1025 1028
1026/** 1029/**
@@ -1038,7 +1041,7 @@ GNUNET_MQ_impl_send_in_flight(struct GNUNET_MQ_Handle *mq);
1038 * @return message to send, never NULL 1041 * @return message to send, never NULL
1039 */ 1042 */
1040void * 1043void *
1041GNUNET_MQ_impl_state(struct GNUNET_MQ_Handle *mq); 1044GNUNET_MQ_impl_state (struct GNUNET_MQ_Handle *mq);
1042 1045
1043 1046
1044/** 1047/**
@@ -1051,7 +1054,7 @@ GNUNET_MQ_impl_state(struct GNUNET_MQ_Handle *mq);
1051 * @return message to send, never NULL 1054 * @return message to send, never NULL
1052 */ 1055 */
1053const struct GNUNET_MessageHeader * 1056const struct GNUNET_MessageHeader *
1054GNUNET_MQ_impl_current(struct GNUNET_MQ_Handle *mq); 1057GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq);
1055 1058
1056 1059
1057/** 1060/**
@@ -1059,7 +1062,8 @@ GNUNET_MQ_impl_current(struct GNUNET_MQ_Handle *mq);
1059 * 1062 *
1060 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` 1063 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference`
1061 */ 1064 */
1062enum GNUNET_MQ_PreferenceKind { 1065enum GNUNET_MQ_PreferenceKind
1066{
1063 /** 1067 /**
1064 * No preference was expressed. 1068 * No preference was expressed.
1065 */ 1069 */
@@ -1099,7 +1103,7 @@ enum GNUNET_MQ_PreferenceKind {
1099 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference` 1103 * @deprecated will be replaced by `enum GNUNET_MQ_PriorityPreference`
1100 */ 1104 */
1101const char * 1105const char *
1102GNUNET_MQ_preference_to_string(enum GNUNET_MQ_PreferenceKind type); 1106GNUNET_MQ_preference_to_string (enum GNUNET_MQ_PreferenceKind type);
1103 1107
1104 1108
1105#endif 1109#endif
diff --git a/src/include/gnunet_mst_lib.h b/src/include/gnunet_mst_lib.h
index 2956ac24f..9f3431b98 100644
--- a/src/include/gnunet_mst_lib.h
+++ b/src/include/gnunet_mst_lib.h
@@ -78,8 +78,8 @@ typedef int
78 * @return handle to tokenizer 78 * @return handle to tokenizer
79 */ 79 */
80struct GNUNET_MessageStreamTokenizer * 80struct GNUNET_MessageStreamTokenizer *
81GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb, 81GNUNET_MST_create (GNUNET_MessageTokenizerCallback cb,
82 void *cb_cls); 82 void *cb_cls);
83 83
84 84
85/** 85/**
@@ -97,11 +97,11 @@ GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb,
97 * #GNUNET_SYSERR if the data stream is corrupt 97 * #GNUNET_SYSERR if the data stream is corrupt
98 */ 98 */
99int 99int
100GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst, 100GNUNET_MST_from_buffer (struct GNUNET_MessageStreamTokenizer *mst,
101 const char *buf, 101 const char *buf,
102 size_t size, 102 size_t size,
103 int purge, 103 int purge,
104 int one_shot); 104 int one_shot);
105 105
106 106
107/** 107/**
@@ -119,10 +119,10 @@ GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst,
119 * #GNUNET_SYSERR if the data stream is corrupt 119 * #GNUNET_SYSERR if the data stream is corrupt
120 */ 120 */
121int 121int
122GNUNET_MST_read(struct GNUNET_MessageStreamTokenizer *mst, 122GNUNET_MST_read (struct GNUNET_MessageStreamTokenizer *mst,
123 struct GNUNET_NETWORK_Handle *sock, 123 struct GNUNET_NETWORK_Handle *sock,
124 int purge, 124 int purge,
125 int one_shot); 125 int one_shot);
126 126
127 127
128/** 128/**
@@ -137,8 +137,8 @@ GNUNET_MST_read(struct GNUNET_MessageStreamTokenizer *mst,
137 * #GNUNET_SYSERR if the data stream is corrupt 137 * #GNUNET_SYSERR if the data stream is corrupt
138 */ 138 */
139int 139int
140GNUNET_MST_next(struct GNUNET_MessageStreamTokenizer *mst, 140GNUNET_MST_next (struct GNUNET_MessageStreamTokenizer *mst,
141 int one_shot); 141 int one_shot);
142 142
143 143
144/** 144/**
@@ -147,7 +147,7 @@ GNUNET_MST_next(struct GNUNET_MessageStreamTokenizer *mst,
147 * @param mst tokenizer to destroy 147 * @param mst tokenizer to destroy
148 */ 148 */
149void 149void
150GNUNET_MST_destroy(struct GNUNET_MessageStreamTokenizer *mst); 150GNUNET_MST_destroy (struct GNUNET_MessageStreamTokenizer *mst);
151 151
152 152
153#if 0 /* keep Emacsens' auto-indent happy */ 153#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h
index 1805c2795..04dddeb92 100644
--- a/src/include/gnunet_my_lib.h
+++ b/src/include/gnunet_my_lib.h
@@ -81,7 +81,8 @@ typedef void
81 */ 81 */
82 82
83 83
84struct GNUNET_MY_QueryParam { 84struct GNUNET_MY_QueryParam
85{
85 /** 86 /**
86 * Function to call for the type conversion. 87 * Function to call for the type conversion.
87 */ 88 */
@@ -129,8 +130,8 @@ struct GNUNET_MY_QueryParam {
129 * @oaran ptr_size number of bytes in @a ptr 130 * @oaran ptr_size number of bytes in @a ptr
130 */ 131 */
131struct GNUNET_MY_QueryParam 132struct GNUNET_MY_QueryParam
132GNUNET_MY_query_param_fixed_size(const void *ptr, 133GNUNET_MY_query_param_fixed_size (const void *ptr,
133 size_t ptr_size); 134 size_t ptr_size);
134 135
135 136
136/** 137/**
@@ -142,9 +143,9 @@ GNUNET_MY_query_param_fixed_size(const void *ptr,
142 * @return TBD 143 * @return TBD
143 */ 144 */
144int 145int
145GNUNET_MY_exec_prepared(struct GNUNET_MYSQL_Context *mc, 146GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc,
146 struct GNUNET_MYSQL_StatementHandle *sh, 147 struct GNUNET_MYSQL_StatementHandle *sh,
147 struct GNUNET_MY_QueryParam *params); 148 struct GNUNET_MY_QueryParam *params);
148 149
149 150
150/** 151/**
@@ -191,7 +192,8 @@ typedef void
191 * Information we pass to #GNUNET_MY_extract_result() to 192 * Information we pass to #GNUNET_MY_extract_result() to
192 * initialize the arguments of the prepared statement. 193 * initialize the arguments of the prepared statement.
193 */ 194 */
194struct GNUNET_MY_ResultSpec { 195struct GNUNET_MY_ResultSpec
196{
195 /** 197 /**
196 * Function to call to initialize the MYSQL_BIND array. 198 * Function to call to initialize the MYSQL_BIND array.
197 */ 199 */
@@ -265,8 +267,8 @@ struct GNUNET_MY_ResultSpec {
265 * @oaran ptr_size number of bytes available at @a ptr 267 * @oaran ptr_size number of bytes available at @a ptr
266 */ 268 */
267struct GNUNET_MY_ResultSpec 269struct GNUNET_MY_ResultSpec
268GNUNET_MY_result_spec_fixed_size(void *ptr, 270GNUNET_MY_result_spec_fixed_size (void *ptr,
269 size_t ptr_size); 271 size_t ptr_size);
270 272
271/** 273/**
272 * Generate query parameter for a string 274 * Generate query parameter for a string
@@ -274,7 +276,7 @@ GNUNET_MY_result_spec_fixed_size(void *ptr,
274 *@param ptr pointer to the string query parameter to pass 276 *@param ptr pointer to the string query parameter to pass
275 */ 277 */
276struct GNUNET_MY_QueryParam 278struct GNUNET_MY_QueryParam
277GNUNET_MY_query_param_string(const char *ptr); 279GNUNET_MY_query_param_string (const char *ptr);
278 280
279/** 281/**
280 * Generate fixed-size query parameter with size determined 282 * Generate fixed-size query parameter with size determined
@@ -282,7 +284,8 @@ GNUNET_MY_query_param_string(const char *ptr);
282 * 284 *
283 * @param x pointer to the query parameter to pass 285 * @param x pointer to the query parameter to pass
284 */ 286 */
285#define GNUNET_MY_query_param_auto_from_type(x) GNUNET_MY_query_param_fixed_size((x), sizeof(*(x))) 287#define GNUNET_MY_query_param_auto_from_type( \
288 x) GNUNET_MY_query_param_fixed_size ((x), sizeof(*(x)))
286 289
287/** 290/**
288 * Generate query parameter for an RSA public key. The 291 * Generate query parameter for an RSA public key. The
@@ -292,7 +295,8 @@ GNUNET_MY_query_param_string(const char *ptr);
292 * @return array entry for the query parameters to use 295 * @return array entry for the query parameters to use
293 */ 296 */
294struct GNUNET_MY_QueryParam 297struct GNUNET_MY_QueryParam
295GNUNET_MY_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x); 298GNUNET_MY_query_param_rsa_public_key (const struct
299 GNUNET_CRYPTO_RsaPublicKey *x);
296 300
297/** 301/**
298 * Generate query parameter for an RSA signature. The 302 * Generate query parameter for an RSA signature. The
@@ -302,7 +306,8 @@ GNUNET_MY_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x)
302 *@return array entry for the query parameters to use 306 *@return array entry for the query parameters to use
303 */ 307 */
304struct GNUNET_MY_QueryParam 308struct GNUNET_MY_QueryParam
305GNUNET_MY_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); 309GNUNET_MY_query_param_rsa_signature (const struct
310 GNUNET_CRYPTO_RsaSignature *x);
306 311
307/** 312/**
308 * Generate query parameter for an absolute time value. 313 * Generate query parameter for an absolute time value.
@@ -312,7 +317,7 @@ GNUNET_MY_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x);
312 *@return array entry for the query parameters to use 317 *@return array entry for the query parameters to use
313 */ 318 */
314struct GNUNET_MY_QueryParam 319struct GNUNET_MY_QueryParam
315GNUNET_MY_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); 320GNUNET_MY_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x);
316 321
317 322
318/** 323/**
@@ -322,7 +327,8 @@ GNUNET_MY_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x);
322 *@param x pointer to the query parameter to pass 327 *@param x pointer to the query parameter to pass
323 */ 328 */
324struct GNUNET_MY_QueryParam 329struct GNUNET_MY_QueryParam
325GNUNET_MY_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x); 330GNUNET_MY_query_param_absolute_time_nbo (const struct
331 GNUNET_TIME_AbsoluteNBO *x);
326 332
327/** 333/**
328 * Generate query parameter for an uint16_t in host byte order. 334 * Generate query parameter for an uint16_t in host byte order.
@@ -330,7 +336,7 @@ GNUNET_MY_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x)
330 * @param x pointer to the query parameter to pass 336 * @param x pointer to the query parameter to pass
331 */ 337 */
332struct GNUNET_MY_QueryParam 338struct GNUNET_MY_QueryParam
333GNUNET_MY_query_param_uint16(const uint16_t *x); 339GNUNET_MY_query_param_uint16 (const uint16_t *x);
334 340
335/** 341/**
336 * Generate query parameter for an uint32_t in host byte order 342 * Generate query parameter for an uint32_t in host byte order
@@ -338,7 +344,7 @@ GNUNET_MY_query_param_uint16(const uint16_t *x);
338 *@param x pointer to the query parameter to pass 344 *@param x pointer to the query parameter to pass
339 */ 345 */
340struct GNUNET_MY_QueryParam 346struct GNUNET_MY_QueryParam
341GNUNET_MY_query_param_uint32(const uint32_t *x); 347GNUNET_MY_query_param_uint32 (const uint32_t *x);
342 348
343/** 349/**
344 * Generate query parameter for an uint64_t in host byte order 350 * Generate query parameter for an uint64_t in host byte order
@@ -346,7 +352,7 @@ GNUNET_MY_query_param_uint32(const uint32_t *x);
346 *@param x pointer to the query parameter to pass 352 *@param x pointer to the query parameter to pass
347 */ 353 */
348struct GNUNET_MY_QueryParam 354struct GNUNET_MY_QueryParam
349GNUNET_MY_query_param_uint64(const uint64_t *x); 355GNUNET_MY_query_param_uint64 (const uint64_t *x);
350 356
351/** 357/**
352 * We expect a fixed-size result, with size determined by the type of `* dst` 358 * We expect a fixed-size result, with size determined by the type of `* dst`
@@ -355,7 +361,8 @@ GNUNET_MY_query_param_uint64(const uint64_t *x);
355 * @spec dst point to where to store the result, type fits expected result size 361 * @spec dst point to where to store the result, type fits expected result size
356 * @return array entry for the result specification to use 362 * @return array entry for the result specification to use
357 */ 363 */
358#define GNUNET_MY_result_spec_auto_from_type(dst) GNUNET_MY_result_spec_fixed_size((dst), sizeof(*(dst))) 364#define GNUNET_MY_result_spec_auto_from_type( \
365 dst) GNUNET_MY_result_spec_fixed_size ((dst), sizeof(*(dst)))
359 366
360 367
361/** 368/**
@@ -366,8 +373,8 @@ GNUNET_MY_query_param_uint64(const uint64_t *x);
366 * @return array entru for the result specification to use 373 * @return array entru for the result specification to use
367 */ 374 */
368struct GNUNET_MY_ResultSpec 375struct GNUNET_MY_ResultSpec
369GNUNET_MY_result_spec_variable_size(void **dst, 376GNUNET_MY_result_spec_variable_size (void **dst,
370 size_t *ptr_size); 377 size_t *ptr_size);
371 378
372/** 379/**
373 * RSA public key expected 380 * RSA public key expected
@@ -377,7 +384,7 @@ GNUNET_MY_result_spec_variable_size(void **dst,
377 * @return array entry for the result specification to use 384 * @return array entry for the result specification to use
378 */ 385 */
379struct GNUNET_MY_ResultSpec 386struct GNUNET_MY_ResultSpec
380GNUNET_MY_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); 387GNUNET_MY_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa);
381 388
382 389
383/** 390/**
@@ -387,7 +394,7 @@ GNUNET_MY_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa);
387 * @return array entry for the result specification to use 394 * @return array entry for the result specification to use
388 */ 395 */
389struct GNUNET_MY_ResultSpec 396struct GNUNET_MY_ResultSpec
390GNUNET_MY_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); 397GNUNET_MY_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig);
391 398
392/** 399/**
393 * 0- terminated string exprected. 400 * 0- terminated string exprected.
@@ -396,7 +403,7 @@ GNUNET_MY_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig);
396 * @return array entry for the result specification to use 403 * @return array entry for the result specification to use
397 */ 404 */
398struct GNUNET_MY_ResultSpec 405struct GNUNET_MY_ResultSpec
399GNUNET_MY_result_spec_string(char **dst); 406GNUNET_MY_result_spec_string (char **dst);
400 407
401/** 408/**
402 * Absolute time expected 409 * Absolute time expected
@@ -406,7 +413,7 @@ GNUNET_MY_result_spec_string(char **dst);
406 * @return array entry for the result specification to use 413 * @return array entry for the result specification to use
407 */ 414 */
408struct GNUNET_MY_ResultSpec 415struct GNUNET_MY_ResultSpec
409GNUNET_MY_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); 416GNUNET_MY_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at);
410 417
411/** 418/**
412 * Absolute time in network byte order expected 419 * Absolute time in network byte order expected
@@ -415,7 +422,7 @@ GNUNET_MY_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at);
415 * @return array entry for the result specification to use 422 * @return array entry for the result specification to use
416 */ 423 */
417struct GNUNET_MY_ResultSpec 424struct GNUNET_MY_ResultSpec
418GNUNET_MY_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); 425GNUNET_MY_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at);
419 426
420/** 427/**
421 * uint16_t expected 428 * uint16_t expected
@@ -424,7 +431,7 @@ GNUNET_MY_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at);
424 * @return array entry for the result specification to use 431 * @return array entry for the result specification to use
425 */ 432 */
426struct GNUNET_MY_ResultSpec 433struct GNUNET_MY_ResultSpec
427GNUNET_MY_result_spec_uint16(uint16_t *u16); 434GNUNET_MY_result_spec_uint16 (uint16_t *u16);
428 435
429/** 436/**
430 * uint32_t expected 437 * uint32_t expected
@@ -433,7 +440,7 @@ GNUNET_MY_result_spec_uint16(uint16_t *u16);
433 * @return array entry for the result specification to use 440 * @return array entry for the result specification to use
434 */ 441 */
435struct GNUNET_MY_ResultSpec 442struct GNUNET_MY_ResultSpec
436GNUNET_MY_result_spec_uint32(uint32_t *u32); 443GNUNET_MY_result_spec_uint32 (uint32_t *u32);
437 444
438/** 445/**
439 * uint64_t expected. 446 * uint64_t expected.
@@ -442,7 +449,7 @@ GNUNET_MY_result_spec_uint32(uint32_t *u32);
442 * @return array entry for the result specification to use 449 * @return array entry for the result specification to use
443 */ 450 */
444struct GNUNET_MY_ResultSpec 451struct GNUNET_MY_ResultSpec
445GNUNET_MY_result_spec_uint64(uint64_t *u64); 452GNUNET_MY_result_spec_uint64 (uint64_t *u64);
446 453
447 454
448/** 455/**
@@ -457,8 +464,8 @@ GNUNET_MY_result_spec_uint64(uint64_t *u64);
457 * #GNUNET_SYSERR if a result was invalid 464 * #GNUNET_SYSERR if a result was invalid
458 */ 465 */
459int 466int
460GNUNET_MY_extract_result(struct GNUNET_MYSQL_StatementHandle *sh, 467GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh,
461 struct GNUNET_MY_ResultSpec *specs); 468 struct GNUNET_MY_ResultSpec *specs);
462 469
463 470
464/** 471/**
@@ -469,8 +476,8 @@ GNUNET_MY_extract_result(struct GNUNET_MYSQL_StatementHandle *sh,
469 * @param qbind mysql query 476 * @param qbind mysql query
470 */ 477 */
471void 478void
472GNUNET_MY_cleanup_query(struct GNUNET_MY_QueryParam *qp, 479GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp,
473 MYSQL_BIND *qbind); 480 MYSQL_BIND *qbind);
474 481
475 482
476/** 483/**
@@ -480,7 +487,7 @@ GNUNET_MY_cleanup_query(struct GNUNET_MY_QueryParam *qp,
480 * @param rs reult specification to clean up 487 * @param rs reult specification to clean up
481 */ 488 */
482void 489void
483GNUNET_MY_cleanup_result(struct GNUNET_MY_ResultSpec *rs); 490GNUNET_MY_cleanup_result (struct GNUNET_MY_ResultSpec *rs);
484 491
485 492
486#if 0 /* keep Emacsens' auto-indent happy */ 493#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_mysql_lib.h b/src/include/gnunet_mysql_lib.h
index 0fef43a5a..964483024 100644
--- a/src/include/gnunet_mysql_lib.h
+++ b/src/include/gnunet_mysql_lib.h
@@ -66,7 +66,7 @@ struct GNUNET_MYSQL_StatementHandle;
66typedef int 66typedef int
67(*GNUNET_MYSQL_DataProcessor) (void *cls, 67(*GNUNET_MYSQL_DataProcessor) (void *cls,
68 unsigned int num_values, 68 unsigned int num_values,
69 MYSQL_BIND * values); 69 MYSQL_BIND *values);
70 70
71 71
72/** 72/**
@@ -77,8 +77,8 @@ typedef int
77 * @return the mysql context 77 * @return the mysql context
78 */ 78 */
79struct GNUNET_MYSQL_Context * 79struct GNUNET_MYSQL_Context *
80GNUNET_MYSQL_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 80GNUNET_MYSQL_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
81 const char *section); 81 const char *section);
82 82
83 83
84/** 84/**
@@ -87,7 +87,7 @@ GNUNET_MYSQL_context_create(const struct GNUNET_CONFIGURATION_Handle *cfg,
87 * @param mc context to destroy 87 * @param mc context to destroy
88 */ 88 */
89void 89void
90GNUNET_MYSQL_context_destroy(struct GNUNET_MYSQL_Context *mc); 90GNUNET_MYSQL_context_destroy (struct GNUNET_MYSQL_Context *mc);
91 91
92 92
93/** 93/**
@@ -98,7 +98,7 @@ GNUNET_MYSQL_context_destroy(struct GNUNET_MYSQL_Context *mc);
98 * @param mc mysql context 98 * @param mc mysql context
99 */ 99 */
100void 100void
101GNUNET_MYSQL_statements_invalidate(struct GNUNET_MYSQL_Context *mc); 101GNUNET_MYSQL_statements_invalidate (struct GNUNET_MYSQL_Context *mc);
102 102
103 103
104/** 104/**
@@ -110,7 +110,7 @@ GNUNET_MYSQL_statements_invalidate(struct GNUNET_MYSQL_Context *mc);
110 * @return MySQL statement handle, NULL on error 110 * @return MySQL statement handle, NULL on error
111 */ 111 */
112MYSQL_STMT * 112MYSQL_STMT *
113GNUNET_MYSQL_statement_get_stmt(struct GNUNET_MYSQL_StatementHandle *sh); 113GNUNET_MYSQL_statement_get_stmt (struct GNUNET_MYSQL_StatementHandle *sh);
114 114
115 115
116/** 116/**
@@ -122,8 +122,8 @@ GNUNET_MYSQL_statement_get_stmt(struct GNUNET_MYSQL_StatementHandle *sh);
122 * @return prepared statement, NULL on error 122 * @return prepared statement, NULL on error
123 */ 123 */
124struct GNUNET_MYSQL_StatementHandle * 124struct GNUNET_MYSQL_StatementHandle *
125GNUNET_MYSQL_statement_prepare(struct GNUNET_MYSQL_Context *mc, 125GNUNET_MYSQL_statement_prepare (struct GNUNET_MYSQL_Context *mc,
126 const char *query); 126 const char *query);
127 127
128 128
129/** 129/**
@@ -135,8 +135,8 @@ GNUNET_MYSQL_statement_prepare(struct GNUNET_MYSQL_Context *mc,
135 * #GNUNET_SYSERR if there was a problem 135 * #GNUNET_SYSERR if there was a problem
136 */ 136 */
137int 137int
138GNUNET_MYSQL_statement_run(struct GNUNET_MYSQL_Context *mc, 138GNUNET_MYSQL_statement_run (struct GNUNET_MYSQL_Context *mc,
139 const char *sql); 139 const char *sql);
140 140
141 141
142#if 0 /* keep Emacsens' auto-indent happy */ 142#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_namecache_plugin.h b/src/include/gnunet_namecache_plugin.h
index 8d3c4fb61..7c218fbeb 100644
--- a/src/include/gnunet_namecache_plugin.h
+++ b/src/include/gnunet_namecache_plugin.h
@@ -54,13 +54,15 @@ extern "C"
54 * @param block lookup result 54 * @param block lookup result
55 */ 55 */
56typedef void (*GNUNET_NAMECACHE_BlockCallback) (void *cls, 56typedef void (*GNUNET_NAMECACHE_BlockCallback) (void *cls,
57 const struct GNUNET_GNSRECORD_Block *block); 57 const struct
58 GNUNET_GNSRECORD_Block *block);
58 59
59 60
60/** 61/**
61 * @brief struct returned by the initialization function of the plugin 62 * @brief struct returned by the initialization function of the plugin
62 */ 63 */
63struct GNUNET_NAMECACHE_PluginFunctions { 64struct GNUNET_NAMECACHE_PluginFunctions
65{
64 /** 66 /**
65 * Closure to pass to all plugin functions. 67 * Closure to pass to all plugin functions.
66 */ 68 */
diff --git a/src/include/gnunet_namecache_service.h b/src/include/gnunet_namecache_service.h
index 271d16d19..da2121d31 100644
--- a/src/include/gnunet_namecache_service.h
+++ b/src/include/gnunet_namecache_service.h
@@ -74,7 +74,7 @@ struct GNUNET_NAMECACHE_Handle;
74 * @return handle to use to access the service 74 * @return handle to use to access the service
75 */ 75 */
76struct GNUNET_NAMECACHE_Handle * 76struct GNUNET_NAMECACHE_Handle *
77GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 77GNUNET_NAMECACHE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
78 78
79 79
80/** 80/**
@@ -85,7 +85,7 @@ GNUNET_NAMECACHE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
85 * @param h handle to the namecache 85 * @param h handle to the namecache
86 */ 86 */
87void 87void
88GNUNET_NAMECACHE_disconnect(struct GNUNET_NAMECACHE_Handle *h); 88GNUNET_NAMECACHE_disconnect (struct GNUNET_NAMECACHE_Handle *h);
89 89
90 90
91/** 91/**
@@ -116,10 +116,10 @@ typedef void
116 * @return handle to abort the request, NULL on error 116 * @return handle to abort the request, NULL on error
117 */ 117 */
118struct GNUNET_NAMECACHE_QueueEntry * 118struct GNUNET_NAMECACHE_QueueEntry *
119GNUNET_NAMECACHE_block_cache(struct GNUNET_NAMECACHE_Handle *h, 119GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h,
120 const struct GNUNET_GNSRECORD_Block *block, 120 const struct GNUNET_GNSRECORD_Block *block,
121 GNUNET_NAMECACHE_ContinuationWithStatus cont, 121 GNUNET_NAMECACHE_ContinuationWithStatus cont,
122 void *cont_cls); 122 void *cont_cls);
123 123
124 124
125/** 125/**
@@ -146,10 +146,10 @@ typedef void
146 * @return a handle that can be used to cancel, NULL on error 146 * @return a handle that can be used to cancel, NULL on error
147 */ 147 */
148struct GNUNET_NAMECACHE_QueueEntry * 148struct GNUNET_NAMECACHE_QueueEntry *
149GNUNET_NAMECACHE_lookup_block(struct GNUNET_NAMECACHE_Handle *h, 149GNUNET_NAMECACHE_lookup_block (struct GNUNET_NAMECACHE_Handle *h,
150 const struct GNUNET_HashCode *derived_hash, 150 const struct GNUNET_HashCode *derived_hash,
151 GNUNET_NAMECACHE_BlockProcessor proc, 151 GNUNET_NAMECACHE_BlockProcessor proc,
152 void *proc_cls); 152 void *proc_cls);
153 153
154 154
155/** 155/**
@@ -161,7 +161,7 @@ GNUNET_NAMECACHE_lookup_block(struct GNUNET_NAMECACHE_Handle *h,
161 * @param qe operation to cancel 161 * @param qe operation to cancel
162 */ 162 */
163void 163void
164GNUNET_NAMECACHE_cancel(struct GNUNET_NAMECACHE_QueueEntry *qe); 164GNUNET_NAMECACHE_cancel (struct GNUNET_NAMECACHE_QueueEntry *qe);
165 165
166 166
167#if 0 /* keep Emacsens' auto-indent happy */ 167#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h
index b942bb592..443c9e451 100644
--- a/src/include/gnunet_namestore_plugin.h
+++ b/src/include/gnunet_namestore_plugin.h
@@ -57,7 +57,8 @@ extern "C"
57typedef void 57typedef void
58(*GNUNET_NAMESTORE_RecordIterator) (void *cls, 58(*GNUNET_NAMESTORE_RecordIterator) (void *cls,
59 uint64_t serial, 59 uint64_t serial,
60 const struct GNUNET_CRYPTO_EcdsaPrivateKey *private_key, 60 const struct
61 GNUNET_CRYPTO_EcdsaPrivateKey *private_key,
61 const char *label, 62 const char *label,
62 unsigned int rd_count, 63 unsigned int rd_count,
63 const struct GNUNET_GNSRECORD_Data *rd); 64 const struct GNUNET_GNSRECORD_Data *rd);
@@ -66,7 +67,8 @@ typedef void
66/** 67/**
67 * @brief struct returned by the initialization function of the plugin 68 * @brief struct returned by the initialization function of the plugin
68 */ 69 */
69struct GNUNET_NAMESTORE_PluginFunctions { 70struct GNUNET_NAMESTORE_PluginFunctions
71{
70 /** 72 /**
71 * Closure to pass to all plugin functions. 73 * Closure to pass to all plugin functions.
72 */ 74 */
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h
index 36221f195..a7b7c57b1 100644
--- a/src/include/gnunet_namestore_service.h
+++ b/src/include/gnunet_namestore_service.h
@@ -74,7 +74,7 @@ struct GNUNET_NAMESTORE_ZoneIterator;
74 * @return handle to use to access the service 74 * @return handle to use to access the service
75 */ 75 */
76struct GNUNET_NAMESTORE_Handle * 76struct GNUNET_NAMESTORE_Handle *
77GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 77GNUNET_NAMESTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
78 78
79 79
80/** 80/**
@@ -85,7 +85,7 @@ GNUNET_NAMESTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
85 * @param h handle to the namestore 85 * @param h handle to the namestore
86 */ 86 */
87void 87void
88GNUNET_NAMESTORE_disconnect(struct GNUNET_NAMESTORE_Handle *h); 88GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h);
89 89
90 90
91/** 91/**
@@ -125,13 +125,14 @@ typedef void
125 * @return handle to abort the request 125 * @return handle to abort the request
126 */ 126 */
127struct GNUNET_NAMESTORE_QueueEntry * 127struct GNUNET_NAMESTORE_QueueEntry *
128GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h, 128GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h,
129 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 129 const struct
130 const char *label, 130 GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
131 unsigned int rd_count, 131 const char *label,
132 const struct GNUNET_GNSRECORD_Data *rd, 132 unsigned int rd_count,
133 GNUNET_NAMESTORE_ContinuationWithStatus cont, 133 const struct GNUNET_GNSRECORD_Data *rd,
134 void *cont_cls); 134 GNUNET_NAMESTORE_ContinuationWithStatus cont,
135 void *cont_cls);
135 136
136 137
137/** 138/**
@@ -145,7 +146,8 @@ GNUNET_NAMESTORE_records_store(struct GNUNET_NAMESTORE_Handle *h,
145 */ 146 */
146typedef void 147typedef void
147(*GNUNET_NAMESTORE_RecordMonitor) (void *cls, 148(*GNUNET_NAMESTORE_RecordMonitor) (void *cls,
148 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 149 const struct
150 GNUNET_CRYPTO_EcdsaPrivateKey *zone,
149 const char *label, 151 const char *label,
150 unsigned int rd_count, 152 unsigned int rd_count,
151 const struct GNUNET_GNSRECORD_Data *rd); 153 const struct GNUNET_GNSRECORD_Data *rd);
@@ -162,11 +164,11 @@ typedef void
162 * @return handle to abort the request 164 * @return handle to abort the request
163 */ 165 */
164struct GNUNET_NAMESTORE_QueueEntry * 166struct GNUNET_NAMESTORE_QueueEntry *
165GNUNET_NAMESTORE_set_nick(struct GNUNET_NAMESTORE_Handle *h, 167GNUNET_NAMESTORE_set_nick (struct GNUNET_NAMESTORE_Handle *h,
166 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 168 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
167 const char *nick, 169 const char *nick,
168 GNUNET_NAMESTORE_ContinuationWithStatus cont, 170 GNUNET_NAMESTORE_ContinuationWithStatus cont,
169 void *cont_cls); 171 void *cont_cls);
170 172
171 173
172/** 174/**
@@ -184,13 +186,14 @@ GNUNET_NAMESTORE_set_nick(struct GNUNET_NAMESTORE_Handle *h,
184 * @return handle to abort the request 186 * @return handle to abort the request
185 */ 187 */
186struct GNUNET_NAMESTORE_QueueEntry * 188struct GNUNET_NAMESTORE_QueueEntry *
187GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h, 189GNUNET_NAMESTORE_records_lookup (struct GNUNET_NAMESTORE_Handle *h,
188 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 190 const struct
189 const char *label, 191 GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
190 GNUNET_SCHEDULER_TaskCallback error_cb, 192 const char *label,
191 void *error_cb_cls, 193 GNUNET_SCHEDULER_TaskCallback error_cb,
192 GNUNET_NAMESTORE_RecordMonitor rm, 194 void *error_cb_cls,
193 void *rm_cls); 195 GNUNET_NAMESTORE_RecordMonitor rm,
196 void *rm_cls);
194 197
195 198
196/** 199/**
@@ -211,13 +214,14 @@ GNUNET_NAMESTORE_records_lookup(struct GNUNET_NAMESTORE_Handle *h,
211 * cancel 214 * cancel
212 */ 215 */
213struct GNUNET_NAMESTORE_QueueEntry * 216struct GNUNET_NAMESTORE_QueueEntry *
214GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h, 217GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h,
215 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 218 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
216 const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, 219 const struct
217 GNUNET_SCHEDULER_TaskCallback error_cb, 220 GNUNET_CRYPTO_EcdsaPublicKey *value_zone,
218 void *error_cb_cls, 221 GNUNET_SCHEDULER_TaskCallback error_cb,
219 GNUNET_NAMESTORE_RecordMonitor proc, 222 void *error_cb_cls,
220 void *proc_cls); 223 GNUNET_NAMESTORE_RecordMonitor proc,
224 void *proc_cls);
221 225
222 226
223/** 227/**
@@ -229,7 +233,7 @@ GNUNET_NAMESTORE_zone_to_name(struct GNUNET_NAMESTORE_Handle *h,
229 * @param qe operation to cancel 233 * @param qe operation to cancel
230 */ 234 */
231void 235void
232GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe); 236GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
233 237
234 238
235/** 239/**
@@ -258,14 +262,15 @@ GNUNET_NAMESTORE_cancel(struct GNUNET_NAMESTORE_QueueEntry *qe);
258 * @return an iterator handle to use for iteration 262 * @return an iterator handle to use for iteration
259 */ 263 */
260struct GNUNET_NAMESTORE_ZoneIterator * 264struct GNUNET_NAMESTORE_ZoneIterator *
261GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h, 265GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h,
262 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 266 const struct
263 GNUNET_SCHEDULER_TaskCallback error_cb, 267 GNUNET_CRYPTO_EcdsaPrivateKey *zone,
264 void *error_cb_cls, 268 GNUNET_SCHEDULER_TaskCallback error_cb,
265 GNUNET_NAMESTORE_RecordMonitor proc, 269 void *error_cb_cls,
266 void *proc_cls, 270 GNUNET_NAMESTORE_RecordMonitor proc,
267 GNUNET_SCHEDULER_TaskCallback finish_cb, 271 void *proc_cls,
268 void *finish_cb_cls); 272 GNUNET_SCHEDULER_TaskCallback finish_cb,
273 void *finish_cb_cls);
269 274
270 275
271/** 276/**
@@ -277,8 +282,8 @@ GNUNET_NAMESTORE_zone_iteration_start(struct GNUNET_NAMESTORE_Handle *h,
277 * (before #GNUNET_NAMESTORE_zone_iterator_next is to be called again) 282 * (before #GNUNET_NAMESTORE_zone_iterator_next is to be called again)
278 */ 283 */
279void 284void
280GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it, 285GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it,
281 uint64_t limit); 286 uint64_t limit);
282 287
283 288
284/** 289/**
@@ -289,7 +294,7 @@ GNUNET_NAMESTORE_zone_iterator_next(struct GNUNET_NAMESTORE_ZoneIterator *it,
289 * @param it the iterator 294 * @param it the iterator
290 */ 295 */
291void 296void
292GNUNET_NAMESTORE_zone_iteration_stop(struct GNUNET_NAMESTORE_ZoneIterator *it); 297GNUNET_NAMESTORE_zone_iteration_stop (struct GNUNET_NAMESTORE_ZoneIterator *it);
293 298
294 299
295/** 300/**
@@ -326,15 +331,17 @@ struct GNUNET_NAMESTORE_ZoneMonitor;
326 * @return handle to stop monitoring 331 * @return handle to stop monitoring
327 */ 332 */
328struct GNUNET_NAMESTORE_ZoneMonitor * 333struct GNUNET_NAMESTORE_ZoneMonitor *
329GNUNET_NAMESTORE_zone_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 334GNUNET_NAMESTORE_zone_monitor_start (const struct
330 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 335 GNUNET_CONFIGURATION_Handle *cfg,
331 int iterate_first, 336 const struct
332 GNUNET_SCHEDULER_TaskCallback error_cb, 337 GNUNET_CRYPTO_EcdsaPrivateKey *zone,
333 void *error_cb_cls, 338 int iterate_first,
334 GNUNET_NAMESTORE_RecordMonitor monitor, 339 GNUNET_SCHEDULER_TaskCallback error_cb,
335 void *monitor_cls, 340 void *error_cb_cls,
336 GNUNET_SCHEDULER_TaskCallback sync_cb, 341 GNUNET_NAMESTORE_RecordMonitor monitor,
337 void *sync_cb_cls); 342 void *monitor_cls,
343 GNUNET_SCHEDULER_TaskCallback sync_cb,
344 void *sync_cb_cls);
338 345
339 346
340/** 347/**
@@ -359,8 +366,8 @@ GNUNET_NAMESTORE_zone_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cf
359 * (before #GNUNET_NAMESTORE_zone_monitor_next is to be called again) 366 * (before #GNUNET_NAMESTORE_zone_monitor_next is to be called again)
360 */ 367 */
361void 368void
362GNUNET_NAMESTORE_zone_monitor_next(struct GNUNET_NAMESTORE_ZoneMonitor *zm, 369GNUNET_NAMESTORE_zone_monitor_next (struct GNUNET_NAMESTORE_ZoneMonitor *zm,
363 uint64_t limit); 370 uint64_t limit);
364 371
365 372
366/** 373/**
@@ -369,7 +376,7 @@ GNUNET_NAMESTORE_zone_monitor_next(struct GNUNET_NAMESTORE_ZoneMonitor *zm,
369 * @param zm handle to the monitor activity to stop 376 * @param zm handle to the monitor activity to stop
370 */ 377 */
371void 378void
372GNUNET_NAMESTORE_zone_monitor_stop(struct GNUNET_NAMESTORE_ZoneMonitor *zm); 379GNUNET_NAMESTORE_zone_monitor_stop (struct GNUNET_NAMESTORE_ZoneMonitor *zm);
373 380
374 381
375#if 0 /* keep Emacsens' auto-indent happy */ 382#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_nat_auto_service.h b/src/include/gnunet_nat_auto_service.h
index b40c515a5..78284dc01 100644
--- a/src/include/gnunet_nat_auto_service.h
+++ b/src/include/gnunet_nat_auto_service.h
@@ -56,11 +56,11 @@ struct GNUNET_NAT_AUTO_Test;
56 * @return handle to cancel NAT test 56 * @return handle to cancel NAT test
57 */ 57 */
58struct GNUNET_NAT_AUTO_Test * 58struct GNUNET_NAT_AUTO_Test *
59GNUNET_NAT_AUTO_test_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 59GNUNET_NAT_AUTO_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
60 uint8_t proto, 60 uint8_t proto,
61 const char *section_name, 61 const char *section_name,
62 GNUNET_NAT_TestCallback report, 62 GNUNET_NAT_TestCallback report,
63 void *report_cls); 63 void *report_cls);
64 64
65 65
66/** 66/**
@@ -69,7 +69,7 @@ GNUNET_NAT_AUTO_test_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
69 * @param tst test to stop. 69 * @param tst test to stop.
70 */ 70 */
71void 71void
72GNUNET_NAT_AUTO_test_stop(struct GNUNET_NAT_AUTO_Test *tst); 72GNUNET_NAT_AUTO_test_stop (struct GNUNET_NAT_AUTO_Test *tst);
73 73
74 74
75/** 75/**
@@ -85,7 +85,7 @@ struct GNUNET_NAT_AUTO_AutoHandle;
85 * @return point to a static string containing the error code 85 * @return point to a static string containing the error code
86 */ 86 */
87const char * 87const char *
88GNUNET_NAT_AUTO_status2string(enum GNUNET_NAT_StatusCode err); 88GNUNET_NAT_AUTO_status2string (enum GNUNET_NAT_StatusCode err);
89 89
90 90
91/** 91/**
@@ -99,7 +99,8 @@ GNUNET_NAT_AUTO_status2string(enum GNUNET_NAT_StatusCode err);
99 */ 99 */
100typedef void 100typedef void
101(*GNUNET_NAT_AUTO_AutoResultCallback)(void *cls, 101(*GNUNET_NAT_AUTO_AutoResultCallback)(void *cls,
102 const struct GNUNET_CONFIGURATION_Handle *diff, 102 const struct
103 GNUNET_CONFIGURATION_Handle *diff,
103 enum GNUNET_NAT_StatusCode result, 104 enum GNUNET_NAT_StatusCode result,
104 enum GNUNET_NAT_Type type); 105 enum GNUNET_NAT_Type type);
105 106
@@ -114,9 +115,9 @@ typedef void
114 * @return handle to cancel operation 115 * @return handle to cancel operation
115 */ 116 */
116struct GNUNET_NAT_AUTO_AutoHandle * 117struct GNUNET_NAT_AUTO_AutoHandle *
117GNUNET_NAT_AUTO_autoconfig_start(const struct GNUNET_CONFIGURATION_Handle *cfg, 118GNUNET_NAT_AUTO_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
118 GNUNET_NAT_AUTO_AutoResultCallback cb, 119 GNUNET_NAT_AUTO_AutoResultCallback cb,
119 void *cb_cls); 120 void *cb_cls);
120 121
121 122
122/** 123/**
@@ -125,7 +126,7 @@ GNUNET_NAT_AUTO_autoconfig_start(const struct GNUNET_CONFIGURATION_Handle *cfg,
125 * @param ah handle for operation to abort 126 * @param ah handle for operation to abort
126 */ 127 */
127void 128void
128GNUNET_NAT_AUTO_autoconfig_cancel(struct GNUNET_NAT_AUTO_AutoHandle *ah); 129GNUNET_NAT_AUTO_autoconfig_cancel (struct GNUNET_NAT_AUTO_AutoHandle *ah);
129 130
130 131
131#endif 132#endif
diff --git a/src/include/gnunet_nat_service.h b/src/include/gnunet_nat_service.h
index 7f0e9764b..4273b5ad1 100644
--- a/src/include/gnunet_nat_service.h
+++ b/src/include/gnunet_nat_service.h
@@ -49,7 +49,8 @@
49 * an equivalent enum in gnunet_transport_hello_service.h; 49 * an equivalent enum in gnunet_transport_hello_service.h;
50 * might ultimately belong with the new HELLO definition. 50 * might ultimately belong with the new HELLO definition.
51 */ 51 */
52enum GNUNET_NAT_AddressClass { 52enum GNUNET_NAT_AddressClass
53{
53 /** 54 /**
54 * No address. 55 * No address.
55 */ 56 */
@@ -136,7 +137,8 @@ enum GNUNET_NAT_AddressClass {
136/** 137/**
137 * Error Types for the NAT subsystem (which can then later be converted/resolved to a string) 138 * Error Types for the NAT subsystem (which can then later be converted/resolved to a string)
138 */ 139 */
139enum GNUNET_NAT_StatusCode { 140enum GNUNET_NAT_StatusCode
141{
140 /** 142 /**
141 * Just the default 143 * Just the default
142 */ 144 */
@@ -238,7 +240,8 @@ enum GNUNET_NAT_StatusCode {
238/** 240/**
239 * What the situation of the NAT connectivity 241 * What the situation of the NAT connectivity
240 */ 242 */
241enum GNUNET_NAT_Type { 243enum GNUNET_NAT_Type
244{
242 /** 245 /**
243 * We have a direct connection 246 * We have a direct connection
244 */ 247 */
@@ -331,15 +334,15 @@ struct GNUNET_NAT_Handle;
331 * @return NULL on error, otherwise handle that can be used to unregister 334 * @return NULL on error, otherwise handle that can be used to unregister
332 */ 335 */
333struct GNUNET_NAT_Handle * 336struct GNUNET_NAT_Handle *
334GNUNET_NAT_register(const struct GNUNET_CONFIGURATION_Handle *cfg, 337GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
335 const char *config_section, 338 const char *config_section,
336 uint8_t proto, 339 uint8_t proto,
337 unsigned int num_addrs, 340 unsigned int num_addrs,
338 const struct sockaddr **addrs, 341 const struct sockaddr **addrs,
339 const socklen_t *addrlens, 342 const socklen_t *addrlens,
340 GNUNET_NAT_AddressCallback address_callback, 343 GNUNET_NAT_AddressCallback address_callback,
341 GNUNET_NAT_ReversalCallback reversal_callback, 344 GNUNET_NAT_ReversalCallback reversal_callback,
342 void *callback_cls); 345 void *callback_cls);
343 346
344 347
345/** 348/**
@@ -356,9 +359,9 @@ GNUNET_NAT_register(const struct GNUNET_CONFIGURATION_Handle *cfg,
356 * #GNUNET_SYSERR if the address is malformed 359 * #GNUNET_SYSERR if the address is malformed
357 */ 360 */
358int 361int
359GNUNET_NAT_test_address(struct GNUNET_NAT_Handle *nh, 362GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *nh,
360 const void *addr, 363 const void *addr,
361 socklen_t addrlen); 364 socklen_t addrlen);
362 365
363 366
364/** 367/**
@@ -374,9 +377,9 @@ GNUNET_NAT_test_address(struct GNUNET_NAT_Handle *nh,
374 * #GNUNET_OK otherwise (presumably in progress) 377 * #GNUNET_OK otherwise (presumably in progress)
375 */ 378 */
376int 379int
377GNUNET_NAT_request_reversal(struct GNUNET_NAT_Handle *nh, 380GNUNET_NAT_request_reversal (struct GNUNET_NAT_Handle *nh,
378 const struct sockaddr_in *local_sa, 381 const struct sockaddr_in *local_sa,
379 const struct sockaddr_in *remote_sa); 382 const struct sockaddr_in *remote_sa);
380 383
381 384
382/** 385/**
@@ -387,7 +390,7 @@ GNUNET_NAT_request_reversal(struct GNUNET_NAT_Handle *nh,
387 * @param nh the handle to unregister 390 * @param nh the handle to unregister
388 */ 391 */
389void 392void
390GNUNET_NAT_unregister(struct GNUNET_NAT_Handle *nh); 393GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh);
391 394
392 395
393/** 396/**
@@ -414,11 +417,11 @@ GNUNET_NAT_unregister(struct GNUNET_NAT_Handle *nh);
414 * #GNUNET_SYSERR on internal error handling the packet 417 * #GNUNET_SYSERR on internal error handling the packet
415 */ 418 */
416int 419int
417GNUNET_NAT_stun_handle_packet(struct GNUNET_NAT_Handle *nh, 420GNUNET_NAT_stun_handle_packet (struct GNUNET_NAT_Handle *nh,
418 const struct sockaddr *sender_addr, 421 const struct sockaddr *sender_addr,
419 size_t sender_addr_len, 422 size_t sender_addr_len,
420 const void *data, 423 const void *data,
421 size_t data_size); 424 size_t data_size);
422 425
423 426
424/** 427/**
@@ -456,11 +459,11 @@ typedef void
456 * @return NULL on error 459 * @return NULL on error
457 */ 460 */
458struct GNUNET_NAT_STUN_Handle * 461struct GNUNET_NAT_STUN_Handle *
459GNUNET_NAT_stun_make_request(const char *server, 462GNUNET_NAT_stun_make_request (const char *server,
460 uint16_t port, 463 uint16_t port,
461 struct GNUNET_NETWORK_Handle *sock, 464 struct GNUNET_NETWORK_Handle *sock,
462 GNUNET_NAT_TestCallback cb, 465 GNUNET_NAT_TestCallback cb,
463 void *cb_cls); 466 void *cb_cls);
464 467
465 468
466/** 469/**
@@ -470,7 +473,7 @@ GNUNET_NAT_stun_make_request(const char *server,
470 * @param rh request to cancel 473 * @param rh request to cancel
471 */ 474 */
472void 475void
473GNUNET_NAT_stun_make_request_cancel(struct GNUNET_NAT_STUN_Handle *rh); 476GNUNET_NAT_stun_make_request_cancel (struct GNUNET_NAT_STUN_Handle *rh);
474 477
475 478
476#endif 479#endif
diff --git a/src/include/gnunet_nc_lib.h b/src/include/gnunet_nc_lib.h
index 1bdb474ea..bd22fd6e2 100644
--- a/src/include/gnunet_nc_lib.h
+++ b/src/include/gnunet_nc_lib.h
@@ -54,7 +54,7 @@ struct GNUNET_NotificationContext;
54 * @return handle to the notification context 54 * @return handle to the notification context
55 */ 55 */
56struct GNUNET_NotificationContext * 56struct GNUNET_NotificationContext *
57GNUNET_notification_context_create(unsigned int queue_length); 57GNUNET_notification_context_create (unsigned int queue_length);
58 58
59 59
60/** 60/**
@@ -63,7 +63,7 @@ GNUNET_notification_context_create(unsigned int queue_length);
63 * @param nc context to destroy. 63 * @param nc context to destroy.
64 */ 64 */
65void 65void
66GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc); 66GNUNET_notification_context_destroy (struct GNUNET_NotificationContext *nc);
67 67
68 68
69/** 69/**
@@ -73,8 +73,8 @@ GNUNET_notification_context_destroy(struct GNUNET_NotificationContext *nc);
73 * @param mq message queue add 73 * @param mq message queue add
74 */ 74 */
75void 75void
76GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc, 76GNUNET_notification_context_add (struct GNUNET_NotificationContext *nc,
77 struct GNUNET_MQ_Handle *mq); 77 struct GNUNET_MQ_Handle *mq);
78 78
79 79
80/** 80/**
@@ -85,9 +85,9 @@ GNUNET_notification_context_add(struct GNUNET_NotificationContext *nc,
85 * @param can_drop can this message be dropped due to queue length limitations 85 * @param can_drop can this message be dropped due to queue length limitations
86 */ 86 */
87void 87void
88GNUNET_notification_context_broadcast(struct GNUNET_NotificationContext *nc, 88GNUNET_notification_context_broadcast (struct GNUNET_NotificationContext *nc,
89 const struct GNUNET_MessageHeader *msg, 89 const struct GNUNET_MessageHeader *msg,
90 int can_drop); 90 int can_drop);
91 91
92/** 92/**
93 * Return active number of subscribers in this context. 93 * Return active number of subscribers in this context.
@@ -96,6 +96,6 @@ GNUNET_notification_context_broadcast(struct GNUNET_NotificationContext *nc,
96 * @return number of current subscribers 96 * @return number of current subscribers
97 */ 97 */
98unsigned int 98unsigned int
99GNUNET_notification_context_get_size(struct GNUNET_NotificationContext *nc); 99GNUNET_notification_context_get_size (struct GNUNET_NotificationContext *nc);
100 100
101#endif 101#endif
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index bdf568385..15d4a8ada 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -49,7 +49,8 @@ struct GNUNET_NETWORK_Handle;
49/** 49/**
50 * @brief collection of IO descriptors 50 * @brief collection of IO descriptors
51 */ 51 */
52struct GNUNET_NETWORK_FDSet { 52struct GNUNET_NETWORK_FDSet
53{
53 /** 54 /**
54 * Maximum number of any socket descriptor in the set (plus one) 55 * Maximum number of any socket descriptor in the set (plus one)
55 */ 56 */
@@ -72,7 +73,7 @@ struct GNUNET_NETWORK_FDSet {
72 * @return #GNUNET_OK if the PF is supported 73 * @return #GNUNET_OK if the PF is supported
73 */ 74 */
74int 75int
75GNUNET_NETWORK_test_pf(int pf); 76GNUNET_NETWORK_test_pf (int pf);
76 77
77 78
78/** 79/**
@@ -85,7 +86,7 @@ GNUNET_NETWORK_test_pf(int pf);
85 * @return shortened unixpath, NULL on error 86 * @return shortened unixpath, NULL on error
86 */ 87 */
87char * 88char *
88GNUNET_NETWORK_shorten_unixpath(char *unixpath); 89GNUNET_NETWORK_shorten_unixpath (char *unixpath);
89 90
90 91
91/** 92/**
@@ -98,7 +99,7 @@ GNUNET_NETWORK_shorten_unixpath(char *unixpath);
98 * @param un unix domain socket address to check 99 * @param un unix domain socket address to check
99 */ 100 */
100void 101void
101GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un); 102GNUNET_NETWORK_unix_precheck (const struct sockaddr_un *un);
102 103
103 104
104/** 105/**
@@ -112,9 +113,9 @@ GNUNET_NETWORK_unix_precheck(const struct sockaddr_un *un);
112 * @return client socket 113 * @return client socket
113 */ 114 */
114struct GNUNET_NETWORK_Handle * 115struct GNUNET_NETWORK_Handle *
115GNUNET_NETWORK_socket_accept(const struct GNUNET_NETWORK_Handle *desc, 116GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc,
116 struct sockaddr *address, 117 struct sockaddr *address,
117 socklen_t *address_len); 118 socklen_t *address_len);
118 119
119 120
120/** 121/**
@@ -124,7 +125,7 @@ GNUNET_NETWORK_socket_accept(const struct GNUNET_NETWORK_Handle *desc,
124 * @return NULL on error (including not supported on target platform) 125 * @return NULL on error (including not supported on target platform)
125 */ 126 */
126struct GNUNET_NETWORK_Handle * 127struct GNUNET_NETWORK_Handle *
127GNUNET_NETWORK_socket_box_native(SOCKTYPE fd); 128GNUNET_NETWORK_socket_box_native (SOCKTYPE fd);
128 129
129 130
130/** 131/**
@@ -135,8 +136,8 @@ GNUNET_NETWORK_socket_box_native(SOCKTYPE fd);
135 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 136 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
136 */ 137 */
137int 138int
138GNUNET_NETWORK_socket_set_blocking(struct GNUNET_NETWORK_Handle *fd, 139GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd,
139 int doBlock); 140 int doBlock);
140 141
141 142
142/** 143/**
@@ -148,9 +149,9 @@ GNUNET_NETWORK_socket_set_blocking(struct GNUNET_NETWORK_Handle *fd,
148 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 149 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
149 */ 150 */
150int 151int
151GNUNET_NETWORK_socket_bind(struct GNUNET_NETWORK_Handle *desc, 152GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc,
152 const struct sockaddr *address, 153 const struct sockaddr *address,
153 socklen_t address_len); 154 socklen_t address_len);
154 155
155/** 156/**
156 * Close a socket. 157 * Close a socket.
@@ -159,7 +160,7 @@ GNUNET_NETWORK_socket_bind(struct GNUNET_NETWORK_Handle *desc,
159 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 160 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
160 */ 161 */
161int 162int
162GNUNET_NETWORK_socket_close(struct GNUNET_NETWORK_Handle *desc); 163GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
163 164
164 165
165/** 166/**
@@ -168,7 +169,7 @@ GNUNET_NETWORK_socket_close(struct GNUNET_NETWORK_Handle *desc);
168 * @param desc socket 169 * @param desc socket
169 */ 170 */
170void 171void
171GNUNET_NETWORK_socket_free_memory_only_(struct GNUNET_NETWORK_Handle *desc); 172GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc);
172 173
173 174
174/** 175/**
@@ -180,9 +181,9 @@ GNUNET_NETWORK_socket_free_memory_only_(struct GNUNET_NETWORK_Handle *desc);
180 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 181 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
181 */ 182 */
182int 183int
183GNUNET_NETWORK_socket_connect(const struct GNUNET_NETWORK_Handle *desc, 184GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
184 const struct sockaddr *address, 185 const struct sockaddr *address,
185 socklen_t address_len); 186 socklen_t address_len);
186 187
187 188
188/** 189/**
@@ -196,11 +197,11 @@ GNUNET_NETWORK_socket_connect(const struct GNUNET_NETWORK_Handle *desc,
196 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 197 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
197 */ 198 */
198int 199int
199GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, 200GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc,
200 int level, 201 int level,
201 int optname, 202 int optname,
202 void *optval, 203 void *optval,
203 socklen_t *optlen); 204 socklen_t *optlen);
204 205
205 206
206/** 207/**
@@ -211,8 +212,8 @@ GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc,
211 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 212 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
212 */ 213 */
213int 214int
214GNUNET_NETWORK_socket_listen(const struct GNUNET_NETWORK_Handle *desc, 215GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
215 int backlog); 216 int backlog);
216 217
217 218
218/** 219/**
@@ -222,7 +223,8 @@ GNUNET_NETWORK_socket_listen(const struct GNUNET_NETWORK_Handle *desc,
222 * @returns #GNUNET_SYSERR if no data is available, or on error! 223 * @returns #GNUNET_SYSERR if no data is available, or on error!
223 */ 224 */
224ssize_t 225ssize_t
225GNUNET_NETWORK_socket_recvfrom_amount(const struct GNUNET_NETWORK_Handle *desc); 226GNUNET_NETWORK_socket_recvfrom_amount (const struct
227 GNUNET_NETWORK_Handle *desc);
226 228
227 229
228/** 230/**
@@ -236,11 +238,11 @@ GNUNET_NETWORK_socket_recvfrom_amount(const struct GNUNET_NETWORK_Handle *desc);
236 * @param addrlen length of the addr 238 * @param addrlen length of the addr
237 */ 239 */
238ssize_t 240ssize_t
239GNUNET_NETWORK_socket_recvfrom(const struct GNUNET_NETWORK_Handle *desc, 241GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc,
240 void *buffer, 242 void *buffer,
241 size_t length, 243 size_t length,
242 struct sockaddr *src_addr, 244 struct sockaddr *src_addr,
243 socklen_t *addrlen); 245 socklen_t *addrlen);
244 246
245 247
246/** 248/**
@@ -252,9 +254,9 @@ GNUNET_NETWORK_socket_recvfrom(const struct GNUNET_NETWORK_Handle *desc,
252 * @return number of bytes read 254 * @return number of bytes read
253 */ 255 */
254ssize_t 256ssize_t
255GNUNET_NETWORK_socket_recv(const struct GNUNET_NETWORK_Handle *desc, 257GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
256 void *buffer, 258 void *buffer,
257 size_t length); 259 size_t length);
258 260
259 261
260/** 262/**
@@ -267,10 +269,10 @@ GNUNET_NETWORK_socket_recv(const struct GNUNET_NETWORK_Handle *desc,
267 * @return number of selected sockets, #GNUNET_SYSERR on error 269 * @return number of selected sockets, #GNUNET_SYSERR on error
268 */ 270 */
269int 271int
270GNUNET_NETWORK_socket_select(struct GNUNET_NETWORK_FDSet *rfds, 272GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
271 struct GNUNET_NETWORK_FDSet *wfds, 273 struct GNUNET_NETWORK_FDSet *wfds,
272 struct GNUNET_NETWORK_FDSet *efds, 274 struct GNUNET_NETWORK_FDSet *efds,
273 struct GNUNET_TIME_Relative timeout); 275 struct GNUNET_TIME_Relative timeout);
274 276
275 277
276/** 278/**
@@ -282,9 +284,9 @@ GNUNET_NETWORK_socket_select(struct GNUNET_NETWORK_FDSet *rfds,
282 * @return number of bytes sent, #GNUNET_SYSERR on error 284 * @return number of bytes sent, #GNUNET_SYSERR on error
283 */ 285 */
284ssize_t 286ssize_t
285GNUNET_NETWORK_socket_send(const struct GNUNET_NETWORK_Handle *desc, 287GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc,
286 const void *buffer, 288 const void *buffer,
287 size_t length); 289 size_t length);
288 290
289 291
290/** 292/**
@@ -299,11 +301,11 @@ GNUNET_NETWORK_socket_send(const struct GNUNET_NETWORK_Handle *desc,
299 * @return number of bytes sent, #GNUNET_SYSERR on error 301 * @return number of bytes sent, #GNUNET_SYSERR on error
300 */ 302 */
301ssize_t 303ssize_t
302GNUNET_NETWORK_socket_sendto(const struct GNUNET_NETWORK_Handle *desc, 304GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc,
303 const void *message, 305 const void *message,
304 size_t length, 306 size_t length,
305 const struct sockaddr *dest_addr, 307 const struct sockaddr *dest_addr,
306 socklen_t dest_len); 308 socklen_t dest_len);
307 309
308 310
309/** 311/**
@@ -317,11 +319,11 @@ GNUNET_NETWORK_socket_sendto(const struct GNUNET_NETWORK_Handle *desc,
317 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 319 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
318 */ 320 */
319int 321int
320GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd, 322GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd,
321 int level, 323 int level,
322 int option_name, 324 int option_name,
323 const void *option_value, 325 const void *option_value,
324 socklen_t option_len); 326 socklen_t option_len);
325 327
326 328
327/** 329/**
@@ -332,8 +334,8 @@ GNUNET_NETWORK_socket_setsockopt(struct GNUNET_NETWORK_Handle *fd,
332 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 334 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
333 */ 335 */
334int 336int
335GNUNET_NETWORK_socket_shutdown(struct GNUNET_NETWORK_Handle *desc, 337GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
336 int how); 338 int how);
337 339
338 340
339/** 341/**
@@ -346,7 +348,7 @@ GNUNET_NETWORK_socket_shutdown(struct GNUNET_NETWORK_Handle *desc,
346 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise 348 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
347 */ 349 */
348int 350int
349GNUNET_NETWORK_socket_disable_corking(struct GNUNET_NETWORK_Handle *desc); 351GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc);
350 352
351 353
352/** 354/**
@@ -360,9 +362,9 @@ GNUNET_NETWORK_socket_disable_corking(struct GNUNET_NETWORK_Handle *desc);
360 * @return new socket, NULL on error 362 * @return new socket, NULL on error
361 */ 363 */
362struct GNUNET_NETWORK_Handle * 364struct GNUNET_NETWORK_Handle *
363GNUNET_NETWORK_socket_create(int domain, 365GNUNET_NETWORK_socket_create (int domain,
364 int type, 366 int type,
365 int protocol); 367 int protocol);
366 368
367 369
368/** 370/**
@@ -371,7 +373,7 @@ GNUNET_NETWORK_socket_create(int domain,
371 * @param fds fd set to clear 373 * @param fds fd set to clear
372 */ 374 */
373void 375void
374GNUNET_NETWORK_fdset_zero(struct GNUNET_NETWORK_FDSet *fds); 376GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds);
375 377
376 378
377/** 379/**
@@ -381,8 +383,8 @@ GNUNET_NETWORK_fdset_zero(struct GNUNET_NETWORK_FDSet *fds);
381 * @param desc socket to add 383 * @param desc socket to add
382 */ 384 */
383void 385void
384GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds, 386GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds,
385 const struct GNUNET_NETWORK_Handle *desc); 387 const struct GNUNET_NETWORK_Handle *desc);
386 388
387 389
388/** 390/**
@@ -393,8 +395,8 @@ GNUNET_NETWORK_fdset_set(struct GNUNET_NETWORK_FDSet *fds,
393 * @return #GNUNET_YES if the socket is in the set 395 * @return #GNUNET_YES if the socket is in the set
394 */ 396 */
395int 397int
396GNUNET_NETWORK_fdset_isset(const struct GNUNET_NETWORK_FDSet *fds, 398GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds,
397 const struct GNUNET_NETWORK_Handle *desc); 399 const struct GNUNET_NETWORK_Handle *desc);
398 400
399 401
400/** 402/**
@@ -404,8 +406,8 @@ GNUNET_NETWORK_fdset_isset(const struct GNUNET_NETWORK_FDSet *fds,
404 * @param src the fd set to add from 406 * @param src the fd set to add from
405 */ 407 */
406void 408void
407GNUNET_NETWORK_fdset_add(struct GNUNET_NETWORK_FDSet *dst, 409GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
408 const struct GNUNET_NETWORK_FDSet *src); 410 const struct GNUNET_NETWORK_FDSet *src);
409 411
410 412
411/** 413/**
@@ -415,8 +417,8 @@ GNUNET_NETWORK_fdset_add(struct GNUNET_NETWORK_FDSet *dst,
415 * @param from source 417 * @param from source
416 */ 418 */
417void 419void
418GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to, 420GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to,
419 const struct GNUNET_NETWORK_FDSet *from); 421 const struct GNUNET_NETWORK_FDSet *from);
420 422
421 423
422/** 424/**
@@ -426,7 +428,7 @@ GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to,
426 * @return POSIX file descriptor 428 * @return POSIX file descriptor
427 */ 429 */
428int 430int
429GNUNET_NETWORK_get_fd(const struct GNUNET_NETWORK_Handle *desc); 431GNUNET_NETWORK_get_fd (const struct GNUNET_NETWORK_Handle *desc);
430 432
431 433
432/** 434/**
@@ -436,7 +438,7 @@ GNUNET_NETWORK_get_fd(const struct GNUNET_NETWORK_Handle *desc);
436 * @return POSIX file descriptor 438 * @return POSIX file descriptor
437 */ 439 */
438struct sockaddr* 440struct sockaddr*
439GNUNET_NETWORK_get_addr(const struct GNUNET_NETWORK_Handle *desc); 441GNUNET_NETWORK_get_addr (const struct GNUNET_NETWORK_Handle *desc);
440 442
441 443
442/** 444/**
@@ -446,7 +448,7 @@ GNUNET_NETWORK_get_addr(const struct GNUNET_NETWORK_Handle *desc);
446 * @return socklen_t for sockaddr 448 * @return socklen_t for sockaddr
447 */ 449 */
448socklen_t 450socklen_t
449GNUNET_NETWORK_get_addrlen(const struct GNUNET_NETWORK_Handle *desc); 451GNUNET_NETWORK_get_addrlen (const struct GNUNET_NETWORK_Handle *desc);
450 452
451 453
452/** 454/**
@@ -457,9 +459,9 @@ GNUNET_NETWORK_get_addrlen(const struct GNUNET_NETWORK_Handle *desc);
457 * @param nfds the biggest socket number in from + 1 459 * @param nfds the biggest socket number in from + 1
458 */ 460 */
459void 461void
460GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to, 462GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
461 const fd_set *from, 463 const fd_set *from,
462 int nfds); 464 int nfds);
463 465
464 466
465/** 467/**
@@ -469,8 +471,8 @@ GNUNET_NETWORK_fdset_copy_native(struct GNUNET_NETWORK_FDSet *to,
469 * @param nfd native FD to set 471 * @param nfd native FD to set
470 */ 472 */
471void 473void
472GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to, 474GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to,
473 int nfd); 475 int nfd);
474 476
475 477
476/** 478/**
@@ -481,8 +483,8 @@ GNUNET_NETWORK_fdset_set_native(struct GNUNET_NETWORK_FDSet *to,
481 * @return #GNUNET_YES if to contains nfd 483 * @return #GNUNET_YES if to contains nfd
482 */ 484 */
483int 485int
484GNUNET_NETWORK_fdset_test_native(const struct GNUNET_NETWORK_FDSet *to, 486GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to,
485 int nfd); 487 int nfd);
486 488
487 489
488/** 490/**
@@ -492,8 +494,8 @@ GNUNET_NETWORK_fdset_test_native(const struct GNUNET_NETWORK_FDSet *to,
492 * @param h the file handle to add 494 * @param h the file handle to add
493 */ 495 */
494void 496void
495GNUNET_NETWORK_fdset_handle_set(struct GNUNET_NETWORK_FDSet *fds, 497GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
496 const struct GNUNET_DISK_FileHandle *h); 498 const struct GNUNET_DISK_FileHandle *h);
497 499
498 500
499/** 501/**
@@ -504,8 +506,8 @@ GNUNET_NETWORK_fdset_handle_set(struct GNUNET_NETWORK_FDSet *fds,
504 * @param h the file handle to add 506 * @param h the file handle to add
505 */ 507 */
506void 508void
507GNUNET_NETWORK_fdset_handle_set_first(struct GNUNET_NETWORK_FDSet *fds, 509GNUNET_NETWORK_fdset_handle_set_first (struct GNUNET_NETWORK_FDSet *fds,
508 const struct GNUNET_DISK_FileHandle *h); 510 const struct GNUNET_DISK_FileHandle *h);
509 511
510 512
511/** 513/**
@@ -516,8 +518,8 @@ GNUNET_NETWORK_fdset_handle_set_first(struct GNUNET_NETWORK_FDSet *fds,
516 * @return #GNUNET_YES if the file handle is part of the set 518 * @return #GNUNET_YES if the file handle is part of the set
517 */ 519 */
518int 520int
519GNUNET_NETWORK_fdset_handle_isset(const struct GNUNET_NETWORK_FDSet *fds, 521GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds,
520 const struct GNUNET_DISK_FileHandle *h); 522 const struct GNUNET_DISK_FileHandle *h);
521 523
522 524
523/** 525/**
@@ -528,8 +530,8 @@ GNUNET_NETWORK_fdset_handle_isset(const struct GNUNET_NETWORK_FDSet *fds,
528 * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise 530 * @return #GNUNET_YES if they do overlap, #GNUNET_NO otherwise
529 */ 531 */
530int 532int
531GNUNET_NETWORK_fdset_overlap(const struct GNUNET_NETWORK_FDSet *fds1, 533GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
532 const struct GNUNET_NETWORK_FDSet *fds2); 534 const struct GNUNET_NETWORK_FDSet *fds2);
533 535
534 536
535/** 537/**
@@ -538,7 +540,7 @@ GNUNET_NETWORK_fdset_overlap(const struct GNUNET_NETWORK_FDSet *fds1,
538 * @return a new fd set 540 * @return a new fd set
539 */ 541 */
540struct GNUNET_NETWORK_FDSet * 542struct GNUNET_NETWORK_FDSet *
541GNUNET_NETWORK_fdset_create(void); 543GNUNET_NETWORK_fdset_create (void);
542 544
543 545
544/** 546/**
@@ -547,7 +549,7 @@ GNUNET_NETWORK_fdset_create(void);
547 * @param fds fd set 549 * @param fds fd set
548 */ 550 */
549void 551void
550GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds); 552GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds);
551 553
552 554
553/** 555/**
@@ -558,8 +560,8 @@ GNUNET_NETWORK_fdset_destroy(struct GNUNET_NETWORK_FDSet *fds);
558 * @return #GNUNET_OK if the port is available, #GNUNET_NO if not 560 * @return #GNUNET_OK if the port is available, #GNUNET_NO if not
559 */ 561 */
560int 562int
561GNUNET_NETWORK_test_port_free(int ipproto, 563GNUNET_NETWORK_test_port_free (int ipproto,
562 uint16_t port); 564 uint16_t port);
563 565
564 566
565#if 0 /* keep Emacsens' auto-indent happy */ 567#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h
index 31b128533..73a70ea24 100644
--- a/src/include/gnunet_nse_service.h
+++ b/src/include/gnunet_nse_service.h
@@ -80,7 +80,7 @@ typedef void (*GNUNET_NSE_Callback) (void *cls,
80 * @param loge logarithmic estimate 80 * @param loge logarithmic estimate
81 * @return absolute number of peers in the network (estimated) 81 * @return absolute number of peers in the network (estimated)
82 */ 82 */
83#define GNUNET_NSE_log_estimate_to_n(loge) pow(2.0, (loge)) 83#define GNUNET_NSE_log_estimate_to_n(loge) pow (2.0, (loge))
84 84
85 85
86/** 86/**
@@ -92,8 +92,8 @@ typedef void (*GNUNET_NSE_Callback) (void *cls,
92 * @return handle to use in #GNUNET_NSE_disconnect to stop NSE from invoking the callbacks 92 * @return handle to use in #GNUNET_NSE_disconnect to stop NSE from invoking the callbacks
93 */ 93 */
94struct GNUNET_NSE_Handle * 94struct GNUNET_NSE_Handle *
95GNUNET_NSE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 95GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
96 GNUNET_NSE_Callback func, void *func_cls); 96 GNUNET_NSE_Callback func, void *func_cls);
97 97
98 98
99/** 99/**
@@ -102,7 +102,7 @@ GNUNET_NSE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
102 * @param h handle to destroy 102 * @param h handle to destroy
103 */ 103 */
104void 104void
105GNUNET_NSE_disconnect(struct GNUNET_NSE_Handle *h); 105GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h);
106 106
107 107
108#if 0 /* keep Emacsens' auto-indent happy */ 108#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_nt_lib.h b/src/include/gnunet_nt_lib.h
index 48f3d7352..18419a7b8 100644
--- a/src/include/gnunet_nt_lib.h
+++ b/src/include/gnunet_nt_lib.h
@@ -32,7 +32,8 @@
32/** 32/**
33 * Types of networks (with separate quotas) we support. 33 * Types of networks (with separate quotas) we support.
34 */ 34 */
35enum GNUNET_NetworkType { 35enum GNUNET_NetworkType
36{
36 /** 37 /**
37 * Category of last resort. 38 * Category of last resort.
38 */ 39 */
@@ -77,7 +78,7 @@ enum GNUNET_NetworkType {
77 * @return a string or NULL if invalid 78 * @return a string or NULL if invalid
78 */ 79 */
79const char * 80const char *
80GNUNET_NT_to_string(enum GNUNET_NetworkType net); 81GNUNET_NT_to_string (enum GNUNET_NetworkType net);
81 82
82 83
83/** 84/**
@@ -95,9 +96,9 @@ struct GNUNET_NT_InterfaceScanner;
95 * @return type of the network the address belongs to 96 * @return type of the network the address belongs to
96 */ 97 */
97enum GNUNET_NetworkType 98enum GNUNET_NetworkType
98GNUNET_NT_scanner_get_type(struct GNUNET_NT_InterfaceScanner *is, 99GNUNET_NT_scanner_get_type (struct GNUNET_NT_InterfaceScanner *is,
99 const struct sockaddr *addr, 100 const struct sockaddr *addr,
100 socklen_t addrlen); 101 socklen_t addrlen);
101 102
102 103
103/** 104/**
@@ -106,7 +107,7 @@ GNUNET_NT_scanner_get_type(struct GNUNET_NT_InterfaceScanner *is,
106 * @return scanner handle, NULL on error 107 * @return scanner handle, NULL on error
107 */ 108 */
108struct GNUNET_NT_InterfaceScanner * 109struct GNUNET_NT_InterfaceScanner *
109GNUNET_NT_scanner_init(void); 110GNUNET_NT_scanner_init (void);
110 111
111 112
112/** 113/**
@@ -115,7 +116,7 @@ GNUNET_NT_scanner_init(void);
115 * @param is scanner we are done with 116 * @param is scanner we are done with
116 */ 117 */
117void 118void
118GNUNET_NT_scanner_done(struct GNUNET_NT_InterfaceScanner *is); 119GNUNET_NT_scanner_done (struct GNUNET_NT_InterfaceScanner *is);
119 120
120 121
121#endif 122#endif
diff --git a/src/include/gnunet_op_lib.h b/src/include/gnunet_op_lib.h
index c96db354d..77fa7f955 100644
--- a/src/include/gnunet_op_lib.h
+++ b/src/include/gnunet_op_lib.h
@@ -40,14 +40,14 @@ struct GNUNET_OP_Handle;
40 * Create new operations handle. 40 * Create new operations handle.
41 */ 41 */
42struct GNUNET_OP_Handle * 42struct GNUNET_OP_Handle *
43GNUNET_OP_create(); 43GNUNET_OP_create ();
44 44
45 45
46/** 46/**
47 * Destroy operations handle. 47 * Destroy operations handle.
48 */ 48 */
49void 49void
50GNUNET_OP_destroy(struct GNUNET_OP_Handle *h); 50GNUNET_OP_destroy (struct GNUNET_OP_Handle *h);
51 51
52 52
53/** 53/**
@@ -59,7 +59,7 @@ GNUNET_OP_destroy(struct GNUNET_OP_Handle *h);
59 * @return Operation ID to use. 59 * @return Operation ID to use.
60 */ 60 */
61uint64_t 61uint64_t
62GNUNET_OP_get_next_id(struct GNUNET_OP_Handle *h); 62GNUNET_OP_get_next_id (struct GNUNET_OP_Handle *h);
63 63
64 64
65/** 65/**
@@ -80,11 +80,11 @@ GNUNET_OP_get_next_id(struct GNUNET_OP_Handle *h);
80 * #GNUNET_NO if not found. 80 * #GNUNET_NO if not found.
81 */ 81 */
82int 82int
83GNUNET_OP_get(struct GNUNET_OP_Handle *h, 83GNUNET_OP_get (struct GNUNET_OP_Handle *h,
84 uint64_t op_id, 84 uint64_t op_id,
85 GNUNET_ResultCallback *result_cb, 85 GNUNET_ResultCallback *result_cb,
86 void **cls, 86 void **cls,
87 void **ctx); 87 void **ctx);
88 88
89 89
90/** 90/**
@@ -102,10 +102,10 @@ GNUNET_OP_get(struct GNUNET_OP_Handle *h,
102 * @return ID of the new operation. 102 * @return ID of the new operation.
103 */ 103 */
104uint64_t 104uint64_t
105GNUNET_OP_add(struct GNUNET_OP_Handle *h, 105GNUNET_OP_add (struct GNUNET_OP_Handle *h,
106 GNUNET_ResultCallback result_cb, 106 GNUNET_ResultCallback result_cb,
107 void *cls, 107 void *cls,
108 void *ctx); 108 void *ctx);
109 109
110 110
111/** 111/**
@@ -128,12 +128,12 @@ GNUNET_OP_add(struct GNUNET_OP_Handle *h,
128 * #GNUNET_NO if the operation was not found. 128 * #GNUNET_NO if the operation was not found.
129 */ 129 */
130int 130int
131GNUNET_OP_result(struct GNUNET_OP_Handle *h, 131GNUNET_OP_result (struct GNUNET_OP_Handle *h,
132 uint64_t op_id, 132 uint64_t op_id,
133 int64_t result_code, 133 int64_t result_code,
134 const void *data, 134 const void *data,
135 uint16_t data_size, 135 uint16_t data_size,
136 void **ctx); 136 void **ctx);
137 137
138 138
139/** 139/**
@@ -148,8 +148,8 @@ GNUNET_OP_result(struct GNUNET_OP_Handle *h,
148 * #GNUNET_NO if the operation was not found. 148 * #GNUNET_NO if the operation was not found.
149 */ 149 */
150int 150int
151GNUNET_OP_remove(struct GNUNET_OP_Handle *h, 151GNUNET_OP_remove (struct GNUNET_OP_Handle *h,
152 uint64_t op_id); 152 uint64_t op_id);
153 153
154 154
155#endif // GNUNET_OP_H 155#endif // GNUNET_OP_H
diff --git a/src/include/gnunet_peer_lib.h b/src/include/gnunet_peer_lib.h
index e7caa1062..f94b883f8 100644
--- a/src/include/gnunet_peer_lib.h
+++ b/src/include/gnunet_peer_lib.h
@@ -58,7 +58,7 @@ typedef unsigned int GNUNET_PEER_Id;
58 * @return the interned identity or 0. 58 * @return the interned identity or 0.
59 */ 59 */
60GNUNET_PEER_Id 60GNUNET_PEER_Id
61GNUNET_PEER_search(const struct GNUNET_PeerIdentity *pid); 61GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid);
62 62
63 63
64/** 64/**
@@ -69,7 +69,7 @@ GNUNET_PEER_search(const struct GNUNET_PeerIdentity *pid);
69 * @return the interned identity. 69 * @return the interned identity.
70 */ 70 */
71GNUNET_PEER_Id 71GNUNET_PEER_Id
72GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid); 72GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid);
73 73
74 74
75/** 75/**
@@ -79,7 +79,7 @@ GNUNET_PEER_intern(const struct GNUNET_PeerIdentity *pid);
79 * @param delta how much to change the RC 79 * @param delta how much to change the RC
80 */ 80 */
81void 81void
82GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta); 82GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta);
83 83
84 84
85/** 85/**
@@ -89,8 +89,8 @@ GNUNET_PEER_change_rc(GNUNET_PEER_Id id, int delta);
89 * @param count size of the @a ids array 89 * @param count size of the @a ids array
90 */ 90 */
91void 91void
92GNUNET_PEER_decrement_rcs(const GNUNET_PEER_Id *ids, 92GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids,
93 unsigned int count); 93 unsigned int count);
94 94
95 95
96/** 96/**
@@ -100,8 +100,8 @@ GNUNET_PEER_decrement_rcs(const GNUNET_PEER_Id *ids,
100 * @param pid where to write the normal peer identity 100 * @param pid where to write the normal peer identity
101 */ 101 */
102void 102void
103GNUNET_PEER_resolve(GNUNET_PEER_Id id, 103GNUNET_PEER_resolve (GNUNET_PEER_Id id,
104 struct GNUNET_PeerIdentity *pid); 104 struct GNUNET_PeerIdentity *pid);
105 105
106 106
107/** 107/**
@@ -111,7 +111,7 @@ GNUNET_PEER_resolve(GNUNET_PEER_Id id,
111 * @return pointer to peer identity, valid as long @a id is valid 111 * @return pointer to peer identity, valid as long @a id is valid
112 */ 112 */
113const struct GNUNET_PeerIdentity * 113const struct GNUNET_PeerIdentity *
114GNUNET_PEER_resolve2(GNUNET_PEER_Id id); 114GNUNET_PEER_resolve2 (GNUNET_PEER_Id id);
115 115
116 116
117#if 0 /* keep Emacsens' auto-indent happy */ 117#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h
index f7663c43e..cdea1a95f 100644
--- a/src/include/gnunet_peerinfo_service.h
+++ b/src/include/gnunet_peerinfo_service.h
@@ -64,7 +64,7 @@ struct GNUNET_PEERINFO_Handle;
64 * etablishment may happen asynchronously). 64 * etablishment may happen asynchronously).
65 */ 65 */
66struct GNUNET_PEERINFO_Handle * 66struct GNUNET_PEERINFO_Handle *
67GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 67GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
68 68
69 69
70/** 70/**
@@ -77,7 +77,7 @@ GNUNET_PEERINFO_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
77 * @param h handle to disconnect 77 * @param h handle to disconnect
78 */ 78 */
79void 79void
80GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h); 80GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h);
81 81
82 82
83/** 83/**
@@ -99,10 +99,10 @@ GNUNET_PEERINFO_disconnect(struct GNUNET_PEERINFO_Handle *h);
99 * calling @a cont must be prevented) 99 * calling @a cont must be prevented)
100 */ 100 */
101struct GNUNET_MQ_Envelope * 101struct GNUNET_MQ_Envelope *
102GNUNET_PEERINFO_add_peer(struct GNUNET_PEERINFO_Handle *h, 102GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
103 const struct GNUNET_HELLO_Message *hello, 103 const struct GNUNET_HELLO_Message *hello,
104 GNUNET_SCHEDULER_TaskCallback cont, 104 GNUNET_SCHEDULER_TaskCallback cont,
105 void *cont_cls); 105 void *cont_cls);
106 106
107 107
108/** 108/**
@@ -145,11 +145,11 @@ struct GNUNET_PEERINFO_IteratorContext;
145 * @return iterator context 145 * @return iterator context
146 */ 146 */
147struct GNUNET_PEERINFO_IteratorContext * 147struct GNUNET_PEERINFO_IteratorContext *
148GNUNET_PEERINFO_iterate(struct GNUNET_PEERINFO_Handle *h, 148GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h,
149 int include_friend_only, 149 int include_friend_only,
150 const struct GNUNET_PeerIdentity *peer, 150 const struct GNUNET_PeerIdentity *peer,
151 GNUNET_PEERINFO_Processor callback, 151 GNUNET_PEERINFO_Processor callback,
152 void *callback_cls); 152 void *callback_cls);
153 153
154 154
155/** 155/**
@@ -158,7 +158,7 @@ GNUNET_PEERINFO_iterate(struct GNUNET_PEERINFO_Handle *h,
158 * @param ic context of the iterator to cancel 158 * @param ic context of the iterator to cancel
159 */ 159 */
160void 160void
161GNUNET_PEERINFO_iterate_cancel(struct GNUNET_PEERINFO_IteratorContext *ic); 161GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic);
162 162
163 163
164/** 164/**
@@ -183,10 +183,10 @@ struct GNUNET_PEERINFO_NotifyContext;
183 * @return NULL on error 183 * @return NULL on error
184 */ 184 */
185struct GNUNET_PEERINFO_NotifyContext * 185struct GNUNET_PEERINFO_NotifyContext *
186GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg, 186GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg,
187 int include_friend_only, 187 int include_friend_only,
188 GNUNET_PEERINFO_Processor callback, 188 GNUNET_PEERINFO_Processor callback,
189 void *callback_cls); 189 void *callback_cls);
190 190
191 191
192/** 192/**
@@ -195,7 +195,7 @@ GNUNET_PEERINFO_notify(const struct GNUNET_CONFIGURATION_Handle *cfg,
195 * @param nc context to stop notifying 195 * @param nc context to stop notifying
196 */ 196 */
197void 197void
198GNUNET_PEERINFO_notify_cancel(struct GNUNET_PEERINFO_NotifyContext *nc); 198GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc);
199 199
200 200
201#if 0 /* keep Emacsens' auto-indent happy */ 201#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_peerstore_plugin.h b/src/include/gnunet_peerstore_plugin.h
index 20130dec2..90190e5b5 100644
--- a/src/include/gnunet_peerstore_plugin.h
+++ b/src/include/gnunet_peerstore_plugin.h
@@ -46,7 +46,8 @@ extern "C"
46/** 46/**
47 * @brief struct returned by the initialization function of the plugin 47 * @brief struct returned by the initialization function of the plugin
48 */ 48 */
49struct GNUNET_PEERSTORE_PluginFunctions { 49struct GNUNET_PEERSTORE_PluginFunctions
50{
50 /** 51 /**
51 * Closure to pass to all plugin functions. 52 * Closure to pass to all plugin functions.
52 */ 53 */
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h
index ac390ada2..cd68dad66 100644
--- a/src/include/gnunet_peerstore_service.h
+++ b/src/include/gnunet_peerstore_service.h
@@ -71,7 +71,8 @@ extern "C" {
71/** 71/**
72 * Options for storing values in PEERSTORE 72 * Options for storing values in PEERSTORE
73 */ 73 */
74enum GNUNET_PEERSTORE_StoreOption { 74enum GNUNET_PEERSTORE_StoreOption
75{
75 /** 76 /**
76 * Possibly store multiple values under given key. 77 * Possibly store multiple values under given key.
77 */ 78 */
@@ -97,7 +98,8 @@ struct GNUNET_PEERSTORE_StoreContext;
97/** 98/**
98 * Single PEERSTORE record 99 * Single PEERSTORE record
99 */ 100 */
100struct GNUNET_PEERSTORE_Record { 101struct GNUNET_PEERSTORE_Record
102{
101 /** 103 /**
102 * Responsible sub system string 104 * Responsible sub system string
103 */ 105 */
@@ -164,7 +166,7 @@ typedef void (*GNUNET_PEERSTORE_Processor) (
164 * @return NULL on error 166 * @return NULL on error
165 */ 167 */
166struct GNUNET_PEERSTORE_Handle * 168struct GNUNET_PEERSTORE_Handle *
167GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 169GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
168 170
169 171
170/** 172/**
@@ -176,7 +178,7 @@ GNUNET_PEERSTORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
176 * @param sync_first send any pending STORE requests before disconnecting 178 * @param sync_first send any pending STORE requests before disconnecting
177 */ 179 */
178void 180void
179GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h, int sync_first); 181GNUNET_PEERSTORE_disconnect (struct GNUNET_PEERSTORE_Handle *h, int sync_first);
180 182
181 183
182/** 184/**
@@ -196,16 +198,16 @@ GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h, int sync_first);
196 * @param cont_cls Closure for @a cont 198 * @param cont_cls Closure for @a cont
197 */ 199 */
198struct GNUNET_PEERSTORE_StoreContext * 200struct GNUNET_PEERSTORE_StoreContext *
199GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h, 201GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
200 const char *sub_system, 202 const char *sub_system,
201 const struct GNUNET_PeerIdentity *peer, 203 const struct GNUNET_PeerIdentity *peer,
202 const char *key, 204 const char *key,
203 const void *value, 205 const void *value,
204 size_t size, 206 size_t size,
205 struct GNUNET_TIME_Absolute expiry, 207 struct GNUNET_TIME_Absolute expiry,
206 enum GNUNET_PEERSTORE_StoreOption options, 208 enum GNUNET_PEERSTORE_StoreOption options,
207 GNUNET_PEERSTORE_Continuation cont, 209 GNUNET_PEERSTORE_Continuation cont,
208 void *cont_cls); 210 void *cont_cls);
209 211
210 212
211/** 213/**
@@ -214,7 +216,7 @@ GNUNET_PEERSTORE_store(struct GNUNET_PEERSTORE_Handle *h,
214 * @param sc Store request context 216 * @param sc Store request context
215 */ 217 */
216void 218void
217GNUNET_PEERSTORE_store_cancel(struct GNUNET_PEERSTORE_StoreContext *sc); 219GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc);
218 220
219 221
220/** 222/**
@@ -228,12 +230,12 @@ GNUNET_PEERSTORE_store_cancel(struct GNUNET_PEERSTORE_StoreContext *sc);
228 * @param callback_cls closure for @a callback 230 * @param callback_cls closure for @a callback
229 */ 231 */
230struct GNUNET_PEERSTORE_IterateContext * 232struct GNUNET_PEERSTORE_IterateContext *
231GNUNET_PEERSTORE_iterate(struct GNUNET_PEERSTORE_Handle *h, 233GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
232 const char *sub_system, 234 const char *sub_system,
233 const struct GNUNET_PeerIdentity *peer, 235 const struct GNUNET_PeerIdentity *peer,
234 const char *key, 236 const char *key,
235 GNUNET_PEERSTORE_Processor callback, 237 GNUNET_PEERSTORE_Processor callback,
236 void *callback_cls); 238 void *callback_cls);
237 239
238 240
239/** 241/**
@@ -243,7 +245,7 @@ GNUNET_PEERSTORE_iterate(struct GNUNET_PEERSTORE_Handle *h,
243 * @param ic Iterate request context as returned by GNUNET_PEERSTORE_iterate() 245 * @param ic Iterate request context as returned by GNUNET_PEERSTORE_iterate()
244 */ 246 */
245void 247void
246GNUNET_PEERSTORE_iterate_cancel(struct GNUNET_PEERSTORE_IterateContext *ic); 248GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic);
247 249
248 250
249/** 251/**
@@ -259,12 +261,12 @@ GNUNET_PEERSTORE_iterate_cancel(struct GNUNET_PEERSTORE_IterateContext *ic);
259 * @return Handle to watch request 261 * @return Handle to watch request
260 */ 262 */
261struct GNUNET_PEERSTORE_WatchContext * 263struct GNUNET_PEERSTORE_WatchContext *
262GNUNET_PEERSTORE_watch(struct GNUNET_PEERSTORE_Handle *h, 264GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
263 const char *sub_system, 265 const char *sub_system,
264 const struct GNUNET_PeerIdentity *peer, 266 const struct GNUNET_PeerIdentity *peer,
265 const char *key, 267 const char *key,
266 GNUNET_PEERSTORE_Processor callback, 268 GNUNET_PEERSTORE_Processor callback,
267 void *callback_cls); 269 void *callback_cls);
268 270
269 271
270/** 272/**
@@ -273,7 +275,7 @@ GNUNET_PEERSTORE_watch(struct GNUNET_PEERSTORE_Handle *h,
273 * @param wc handle to the watch request 275 * @param wc handle to the watch request
274 */ 276 */
275void 277void
276GNUNET_PEERSTORE_watch_cancel(struct GNUNET_PEERSTORE_WatchContext *wc); 278GNUNET_PEERSTORE_watch_cancel (struct GNUNET_PEERSTORE_WatchContext *wc);
277 279
278 280
279#if 0 /* keep Emacsens' auto-indent happy */ 281#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h
index 67e6b5131..ffffcab8b 100644
--- a/src/include/gnunet_plugin_lib.h
+++ b/src/include/gnunet_plugin_lib.h
@@ -66,7 +66,7 @@ typedef void *
66 * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not 66 * @return #GNUNET_YES if the plugin exists, #GNUNET_NO if not
67 */ 67 */
68int 68int
69GNUNET_PLUGIN_test(const char *library_name); 69GNUNET_PLUGIN_test (const char *library_name);
70 70
71 71
72/** 72/**
@@ -82,8 +82,8 @@ GNUNET_PLUGIN_test(const char *library_name);
82 * @return whatever the initialization function returned, NULL on error 82 * @return whatever the initialization function returned, NULL on error
83 */ 83 */
84void * 84void *
85GNUNET_PLUGIN_load(const char *library_name, 85GNUNET_PLUGIN_load (const char *library_name,
86 void *arg); 86 void *arg);
87 87
88 88
89/** 89/**
@@ -115,10 +115,10 @@ typedef void
115 * @param cb_cls closure for @a cb 115 * @param cb_cls closure for @a cb
116 */ 116 */
117void 117void
118GNUNET_PLUGIN_load_all(const char *basename, 118GNUNET_PLUGIN_load_all (const char *basename,
119 void *arg, 119 void *arg,
120 GNUNET_PLUGIN_LoaderCallback cb, 120 GNUNET_PLUGIN_LoaderCallback cb,
121 void *cb_cls); 121 void *cb_cls);
122 122
123 123
124/** 124/**
@@ -131,8 +131,8 @@ GNUNET_PLUGIN_load_all(const char *basename,
131 * or a "char *" representing the error message 131 * or a "char *" representing the error message
132 */ 132 */
133void * 133void *
134GNUNET_PLUGIN_unload(const char *library_name, 134GNUNET_PLUGIN_unload (const char *library_name,
135 void *arg); 135 void *arg);
136 136
137 137
138#if 0 /* keep Emacsens' auto-indent happy */ 138#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index fcd886521..6c576c8ab 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -60,7 +60,8 @@ typedef int (*GNUNET_PQ_QueryConverter) (void *cls,
60/** 60/**
61 * @brief Description of a DB query parameter. 61 * @brief Description of a DB query parameter.
62 */ 62 */
63struct GNUNET_PQ_QueryParam { 63struct GNUNET_PQ_QueryParam
64{
64 /** 65 /**
65 * Function for how to handle this type of entry. 66 * Function for how to handle this type of entry.
66 */ 67 */
@@ -105,7 +106,7 @@ struct GNUNET_PQ_QueryParam {
105 * @oaran ptr_size number of bytes in @a ptr 106 * @oaran ptr_size number of bytes in @a ptr
106 */ 107 */
107struct GNUNET_PQ_QueryParam 108struct GNUNET_PQ_QueryParam
108GNUNET_PQ_query_param_fixed_size(const void *ptr, size_t ptr_size); 109GNUNET_PQ_query_param_fixed_size (const void *ptr, size_t ptr_size);
109 110
110 111
111/** 112/**
@@ -114,7 +115,7 @@ GNUNET_PQ_query_param_fixed_size(const void *ptr, size_t ptr_size);
114 * @param ptr pointer to the string query parameter to pass 115 * @param ptr pointer to the string query parameter to pass
115 */ 116 */
116struct GNUNET_PQ_QueryParam 117struct GNUNET_PQ_QueryParam
117GNUNET_PQ_query_param_string(const char *ptr); 118GNUNET_PQ_query_param_string (const char *ptr);
118 119
119 120
120/** 121/**
@@ -124,7 +125,7 @@ GNUNET_PQ_query_param_string(const char *ptr);
124 * @param x pointer to the query parameter to pass. 125 * @param x pointer to the query parameter to pass.
125 */ 126 */
126#define GNUNET_PQ_query_param_auto_from_type(x) \ 127#define GNUNET_PQ_query_param_auto_from_type(x) \
127 GNUNET_PQ_query_param_fixed_size((x), sizeof(*(x))) 128 GNUNET_PQ_query_param_fixed_size ((x), sizeof(*(x)))
128 129
129 130
130/** 131/**
@@ -134,7 +135,7 @@ GNUNET_PQ_query_param_string(const char *ptr);
134 * @param x the query parameter to pass. 135 * @param x the query parameter to pass.
135 */ 136 */
136struct GNUNET_PQ_QueryParam 137struct GNUNET_PQ_QueryParam
137GNUNET_PQ_query_param_rsa_public_key( 138GNUNET_PQ_query_param_rsa_public_key (
138 const struct GNUNET_CRYPTO_RsaPublicKey *x); 139 const struct GNUNET_CRYPTO_RsaPublicKey *x);
139 140
140 141
@@ -145,7 +146,7 @@ GNUNET_PQ_query_param_rsa_public_key(
145 * @param x the query parameter to pass 146 * @param x the query parameter to pass
146 */ 147 */
147struct GNUNET_PQ_QueryParam 148struct GNUNET_PQ_QueryParam
148GNUNET_PQ_query_param_rsa_signature( 149GNUNET_PQ_query_param_rsa_signature (
149 const struct GNUNET_CRYPTO_RsaSignature *x); 150 const struct GNUNET_CRYPTO_RsaSignature *x);
150 151
151 152
@@ -156,7 +157,7 @@ GNUNET_PQ_query_param_rsa_signature(
156 * @param x pointer to the query parameter to pass 157 * @param x pointer to the query parameter to pass
157 */ 158 */
158struct GNUNET_PQ_QueryParam 159struct GNUNET_PQ_QueryParam
159GNUNET_PQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); 160GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x);
160 161
161 162
162/** 163/**
@@ -166,7 +167,7 @@ GNUNET_PQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x);
166 * @param x pointer to the query parameter to pass 167 * @param x pointer to the query parameter to pass
167 */ 168 */
168struct GNUNET_PQ_QueryParam 169struct GNUNET_PQ_QueryParam
169GNUNET_PQ_query_param_absolute_time_nbo( 170GNUNET_PQ_query_param_absolute_time_nbo (
170 const struct GNUNET_TIME_AbsoluteNBO *x); 171 const struct GNUNET_TIME_AbsoluteNBO *x);
171 172
172 173
@@ -176,7 +177,7 @@ GNUNET_PQ_query_param_absolute_time_nbo(
176 * @param x pointer to the query parameter to pass 177 * @param x pointer to the query parameter to pass
177 */ 178 */
178struct GNUNET_PQ_QueryParam 179struct GNUNET_PQ_QueryParam
179GNUNET_PQ_query_param_uint16(const uint16_t *x); 180GNUNET_PQ_query_param_uint16 (const uint16_t *x);
180 181
181 182
182/** 183/**
@@ -185,7 +186,7 @@ GNUNET_PQ_query_param_uint16(const uint16_t *x);
185 * @param x pointer to the query parameter to pass 186 * @param x pointer to the query parameter to pass
186 */ 187 */
187struct GNUNET_PQ_QueryParam 188struct GNUNET_PQ_QueryParam
188GNUNET_PQ_query_param_uint32(const uint32_t *x); 189GNUNET_PQ_query_param_uint32 (const uint32_t *x);
189 190
190 191
191/** 192/**
@@ -194,7 +195,7 @@ GNUNET_PQ_query_param_uint32(const uint32_t *x);
194 * @param x pointer to the query parameter to pass 195 * @param x pointer to the query parameter to pass
195 */ 196 */
196struct GNUNET_PQ_QueryParam 197struct GNUNET_PQ_QueryParam
197GNUNET_PQ_query_param_uint64(const uint64_t *x); 198GNUNET_PQ_query_param_uint64 (const uint64_t *x);
198 199
199 200
200/* ************************* pq_result_helper.c functions ************************ */ 201/* ************************* pq_result_helper.c functions ************************ */
@@ -234,7 +235,8 @@ typedef void (*GNUNET_PQ_ResultCleanup) (void *cls, void *rd);
234/** 235/**
235 * @brief Description of a DB result cell. 236 * @brief Description of a DB result cell.
236 */ 237 */
237struct GNUNET_PQ_ResultSpec { 238struct GNUNET_PQ_ResultSpec
239{
238 /** 240 /**
239 * What is the format of the result? 241 * What is the format of the result?
240 */ 242 */
@@ -295,9 +297,9 @@ struct GNUNET_PQ_ResultSpec {
295 * @return array entry for the result specification to use 297 * @return array entry for the result specification to use
296 */ 298 */
297struct GNUNET_PQ_ResultSpec 299struct GNUNET_PQ_ResultSpec
298GNUNET_PQ_result_spec_variable_size(const char *name, 300GNUNET_PQ_result_spec_variable_size (const char *name,
299 void **dst, 301 void **dst,
300 size_t *sptr); 302 size_t *sptr);
301 303
302 304
303/** 305/**
@@ -309,7 +311,7 @@ GNUNET_PQ_result_spec_variable_size(const char *name,
309 * @return array entry for the result specification to use 311 * @return array entry for the result specification to use
310 */ 312 */
311struct GNUNET_PQ_ResultSpec 313struct GNUNET_PQ_ResultSpec
312GNUNET_PQ_result_spec_fixed_size(const char *name, void *dst, size_t dst_size); 314GNUNET_PQ_result_spec_fixed_size (const char *name, void *dst, size_t dst_size);
313 315
314 316
315/** 317/**
@@ -320,7 +322,7 @@ GNUNET_PQ_result_spec_fixed_size(const char *name, void *dst, size_t dst_size);
320 * @return array entry for the result specification to use 322 * @return array entry for the result specification to use
321 */ 323 */
322#define GNUNET_PQ_result_spec_auto_from_type(name, dst) \ 324#define GNUNET_PQ_result_spec_auto_from_type(name, dst) \
323 GNUNET_PQ_result_spec_fixed_size(name, (dst), sizeof(*(dst))) 325 GNUNET_PQ_result_spec_fixed_size (name, (dst), sizeof(*(dst)))
324 326
325 327
326/** 328/**
@@ -331,7 +333,7 @@ GNUNET_PQ_result_spec_fixed_size(const char *name, void *dst, size_t dst_size);
331 * @return array entry for the result specification to use 333 * @return array entry for the result specification to use
332 */ 334 */
333struct GNUNET_PQ_ResultSpec 335struct GNUNET_PQ_ResultSpec
334GNUNET_PQ_result_spec_string(const char *name, char **dst); 336GNUNET_PQ_result_spec_string (const char *name, char **dst);
335 337
336 338
337/** 339/**
@@ -342,8 +344,8 @@ GNUNET_PQ_result_spec_string(const char *name, char **dst);
342 * @return array entry for the result specification to use 344 * @return array entry for the result specification to use
343 */ 345 */
344struct GNUNET_PQ_ResultSpec 346struct GNUNET_PQ_ResultSpec
345GNUNET_PQ_result_spec_rsa_public_key(const char *name, 347GNUNET_PQ_result_spec_rsa_public_key (const char *name,
346 struct GNUNET_CRYPTO_RsaPublicKey **rsa); 348 struct GNUNET_CRYPTO_RsaPublicKey **rsa);
347 349
348 350
349/** 351/**
@@ -354,8 +356,8 @@ GNUNET_PQ_result_spec_rsa_public_key(const char *name,
354 * @return array entry for the result specification to use 356 * @return array entry for the result specification to use
355 */ 357 */
356struct GNUNET_PQ_ResultSpec 358struct GNUNET_PQ_ResultSpec
357GNUNET_PQ_result_spec_rsa_signature(const char *name, 359GNUNET_PQ_result_spec_rsa_signature (const char *name,
358 struct GNUNET_CRYPTO_RsaSignature **sig); 360 struct GNUNET_CRYPTO_RsaSignature **sig);
359 361
360 362
361/** 363/**
@@ -366,8 +368,8 @@ GNUNET_PQ_result_spec_rsa_signature(const char *name,
366 * @return array entry for the result specification to use 368 * @return array entry for the result specification to use
367 */ 369 */
368struct GNUNET_PQ_ResultSpec 370struct GNUNET_PQ_ResultSpec
369GNUNET_PQ_result_spec_absolute_time(const char *name, 371GNUNET_PQ_result_spec_absolute_time (const char *name,
370 struct GNUNET_TIME_Absolute *at); 372 struct GNUNET_TIME_Absolute *at);
371 373
372 374
373/** 375/**
@@ -378,8 +380,8 @@ GNUNET_PQ_result_spec_absolute_time(const char *name,
378 * @return array entry for the result specification to use 380 * @return array entry for the result specification to use
379 */ 381 */
380struct GNUNET_PQ_ResultSpec 382struct GNUNET_PQ_ResultSpec
381GNUNET_PQ_result_spec_absolute_time_nbo(const char *name, 383GNUNET_PQ_result_spec_absolute_time_nbo (const char *name,
382 struct GNUNET_TIME_AbsoluteNBO *at); 384 struct GNUNET_TIME_AbsoluteNBO *at);
383 385
384 386
385/** 387/**
@@ -390,7 +392,7 @@ GNUNET_PQ_result_spec_absolute_time_nbo(const char *name,
390 * @return array entry for the result specification to use 392 * @return array entry for the result specification to use
391 */ 393 */
392struct GNUNET_PQ_ResultSpec 394struct GNUNET_PQ_ResultSpec
393GNUNET_PQ_result_spec_uint16(const char *name, uint16_t *u16); 395GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t *u16);
394 396
395 397
396/** 398/**
@@ -401,7 +403,7 @@ GNUNET_PQ_result_spec_uint16(const char *name, uint16_t *u16);
401 * @return array entry for the result specification to use 403 * @return array entry for the result specification to use
402 */ 404 */
403struct GNUNET_PQ_ResultSpec 405struct GNUNET_PQ_ResultSpec
404GNUNET_PQ_result_spec_uint32(const char *name, uint32_t *u32); 406GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t *u32);
405 407
406 408
407/** 409/**
@@ -412,7 +414,7 @@ GNUNET_PQ_result_spec_uint32(const char *name, uint32_t *u32);
412 * @return array entry for the result specification to use 414 * @return array entry for the result specification to use
413 */ 415 */
414struct GNUNET_PQ_ResultSpec 416struct GNUNET_PQ_ResultSpec
415GNUNET_PQ_result_spec_uint64(const char *name, uint64_t *u64); 417GNUNET_PQ_result_spec_uint64 (const char *name, uint64_t *u64);
416 418
417 419
418/* ************************* pq.c functions ************************ */ 420/* ************************* pq.c functions ************************ */
@@ -427,9 +429,9 @@ GNUNET_PQ_result_spec_uint64(const char *name, uint64_t *u64);
427 * @deprecated (should become an internal API) 429 * @deprecated (should become an internal API)
428 */ 430 */
429PGresult * 431PGresult *
430GNUNET_PQ_exec_prepared(PGconn *db_conn, 432GNUNET_PQ_exec_prepared (PGconn *db_conn,
431 const char *name, 433 const char *name,
432 const struct GNUNET_PQ_QueryParam *params); 434 const struct GNUNET_PQ_QueryParam *params);
433 435
434 436
435/** 437/**
@@ -444,9 +446,9 @@ GNUNET_PQ_exec_prepared(PGconn *db_conn,
444 * @deprecated (should become an internal API) 446 * @deprecated (should become an internal API)
445 */ 447 */
446int 448int
447GNUNET_PQ_extract_result(PGresult *result, 449GNUNET_PQ_extract_result (PGresult *result,
448 struct GNUNET_PQ_ResultSpec *rs, 450 struct GNUNET_PQ_ResultSpec *rs,
449 int row); 451 int row);
450 452
451 453
452/** 454/**
@@ -456,7 +458,7 @@ GNUNET_PQ_extract_result(PGresult *result,
456 * @param rs reult specification to clean up 458 * @param rs reult specification to clean up
457 */ 459 */
458void 460void
459GNUNET_PQ_cleanup_result(struct GNUNET_PQ_ResultSpec *rs); 461GNUNET_PQ_cleanup_result (struct GNUNET_PQ_ResultSpec *rs);
460 462
461 463
462/* ******************** pq_eval.c functions ************** */ 464/* ******************** pq_eval.c functions ************** */
@@ -476,9 +478,9 @@ GNUNET_PQ_cleanup_result(struct GNUNET_PQ_ResultSpec *rs);
476 * @deprecated (low level, let's see if we can do with just the high-level functions) 478 * @deprecated (low level, let's see if we can do with just the high-level functions)
477 */ 479 */
478enum GNUNET_DB_QueryStatus 480enum GNUNET_DB_QueryStatus
479GNUNET_PQ_eval_result(PGconn *connection, 481GNUNET_PQ_eval_result (PGconn *connection,
480 const char *statement_name, 482 const char *statement_name,
481 PGresult *result); 483 PGresult *result);
482 484
483 485
484/** 486/**
@@ -498,9 +500,9 @@ GNUNET_PQ_eval_result(PGconn *connection,
498 * zero; if INSERT was successful, we return one. 500 * zero; if INSERT was successful, we return one.
499 */ 501 */
500enum GNUNET_DB_QueryStatus 502enum GNUNET_DB_QueryStatus
501GNUNET_PQ_eval_prepared_non_select(PGconn *connection, 503GNUNET_PQ_eval_prepared_non_select (PGconn *connection,
502 const char *statement_name, 504 const char *statement_name,
503 const struct GNUNET_PQ_QueryParam *params); 505 const struct GNUNET_PQ_QueryParam *params);
504 506
505 507
506/** 508/**
@@ -532,11 +534,11 @@ typedef void (*GNUNET_PQ_PostgresResultHandler) (void *cls,
532 * codes to `enum GNUNET_DB_QueryStatus`. 534 * codes to `enum GNUNET_DB_QueryStatus`.
533 */ 535 */
534enum GNUNET_DB_QueryStatus 536enum GNUNET_DB_QueryStatus
535GNUNET_PQ_eval_prepared_multi_select(PGconn *connection, 537GNUNET_PQ_eval_prepared_multi_select (PGconn *connection,
536 const char *statement_name, 538 const char *statement_name,
537 const struct GNUNET_PQ_QueryParam *params, 539 const struct GNUNET_PQ_QueryParam *params,
538 GNUNET_PQ_PostgresResultHandler rh, 540 GNUNET_PQ_PostgresResultHandler rh,
539 void *rh_cls); 541 void *rh_cls);
540 542
541 543
542/** 544/**
@@ -555,7 +557,7 @@ GNUNET_PQ_eval_prepared_multi_select(PGconn *connection,
555 * codes to `enum GNUNET_DB_QueryStatus`. 557 * codes to `enum GNUNET_DB_QueryStatus`.
556 */ 558 */
557enum GNUNET_DB_QueryStatus 559enum GNUNET_DB_QueryStatus
558GNUNET_PQ_eval_prepared_singleton_select( 560GNUNET_PQ_eval_prepared_singleton_select (
559 PGconn *connection, 561 PGconn *connection,
560 const char *statement_name, 562 const char *statement_name,
561 const struct GNUNET_PQ_QueryParam *params, 563 const struct GNUNET_PQ_QueryParam *params,
@@ -569,7 +571,8 @@ GNUNET_PQ_eval_prepared_singleton_select(
569 * Information needed to prepare a list of SQL statements using 571 * Information needed to prepare a list of SQL statements using
570 * #GNUNET_PQ_prepare_statements(). 572 * #GNUNET_PQ_prepare_statements().
571 */ 573 */
572struct GNUNET_PQ_PreparedStatement { 574struct GNUNET_PQ_PreparedStatement
575{
573 /** 576 /**
574 * Name of the statement. 577 * Name of the statement.
575 */ 578 */
@@ -605,9 +608,9 @@ struct GNUNET_PQ_PreparedStatement {
605 * @return initialized struct 608 * @return initialized struct
606 */ 609 */
607struct GNUNET_PQ_PreparedStatement 610struct GNUNET_PQ_PreparedStatement
608GNUNET_PQ_make_prepare(const char *name, 611GNUNET_PQ_make_prepare (const char *name,
609 const char *sql, 612 const char *sql,
610 unsigned int num_args); 613 unsigned int num_args);
611 614
612 615
613/** 616/**
@@ -620,8 +623,8 @@ GNUNET_PQ_make_prepare(const char *name,
620 * #GNUNET_SYSERR on error 623 * #GNUNET_SYSERR on error
621 */ 624 */
622int 625int
623GNUNET_PQ_prepare_statements(PGconn *connection, 626GNUNET_PQ_prepare_statements (PGconn *connection,
624 const struct GNUNET_PQ_PreparedStatement *ps); 627 const struct GNUNET_PQ_PreparedStatement *ps);
625 628
626 629
627/* ******************** pq_exec.c functions ************** */ 630/* ******************** pq_exec.c functions ************** */
@@ -631,7 +634,8 @@ GNUNET_PQ_prepare_statements(PGconn *connection,
631 * Information needed to run a list of SQL statements using 634 * Information needed to run a list of SQL statements using
632 * #GNUNET_PQ_exec_statements(). 635 * #GNUNET_PQ_exec_statements().
633 */ 636 */
634struct GNUNET_PQ_ExecuteStatement { 637struct GNUNET_PQ_ExecuteStatement
638{
635 /** 639 /**
636 * Actual SQL statement. 640 * Actual SQL statement.
637 */ 641 */
@@ -660,7 +664,7 @@ struct GNUNET_PQ_ExecuteStatement {
660 * @return initialized struct 664 * @return initialized struct
661 */ 665 */
662struct GNUNET_PQ_ExecuteStatement 666struct GNUNET_PQ_ExecuteStatement
663GNUNET_PQ_make_execute(const char *sql); 667GNUNET_PQ_make_execute (const char *sql);
664 668
665 669
666/** 670/**
@@ -671,7 +675,7 @@ GNUNET_PQ_make_execute(const char *sql);
671 * @return initialized struct 675 * @return initialized struct
672 */ 676 */
673struct GNUNET_PQ_ExecuteStatement 677struct GNUNET_PQ_ExecuteStatement
674GNUNET_PQ_make_try_execute(const char *sql); 678GNUNET_PQ_make_try_execute (const char *sql);
675 679
676 680
677/** 681/**
@@ -684,8 +688,8 @@ GNUNET_PQ_make_try_execute(const char *sql);
684 * #GNUNET_SYSERR on error 688 * #GNUNET_SYSERR on error
685 */ 689 */
686int 690int
687GNUNET_PQ_exec_statements(PGconn *connection, 691GNUNET_PQ_exec_statements (PGconn *connection,
688 const struct GNUNET_PQ_ExecuteStatement *es); 692 const struct GNUNET_PQ_ExecuteStatement *es);
689 693
690 694
691/* ******************** pq_connect.c functions ************** */ 695/* ******************** pq_connect.c functions ************** */
@@ -700,7 +704,7 @@ GNUNET_PQ_exec_statements(PGconn *connection,
700 * @return NULL on error 704 * @return NULL on error
701 */ 705 */
702PGconn * 706PGconn *
703GNUNET_PQ_connect(const char *config_str); 707GNUNET_PQ_connect (const char *config_str);
704 708
705 709
706/** 710/**
@@ -712,8 +716,8 @@ GNUNET_PQ_connect(const char *config_str);
712 * @return the postgres handle, NULL on error 716 * @return the postgres handle, NULL on error
713 */ 717 */
714PGconn * 718PGconn *
715GNUNET_PQ_connect_with_cfg(const struct GNUNET_CONFIGURATION_Handle *cfg, 719GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg,
716 const char *section); 720 const char *section);
717 721
718 722
719#endif /* GNUNET_PQ_LIB_H_ */ 723#endif /* GNUNET_PQ_LIB_H_ */
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h
index a65a7510d..adb159e55 100644
--- a/src/include/gnunet_program_lib.h
+++ b/src/include/gnunet_program_lib.h
@@ -75,14 +75,14 @@ typedef void
75 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 75 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
76 */ 76 */
77int 77int
78GNUNET_PROGRAM_run2(int argc, 78GNUNET_PROGRAM_run2 (int argc,
79 char *const *argv, 79 char *const *argv,
80 const char *binaryName, 80 const char *binaryName,
81 const char *binaryHelp, 81 const char *binaryHelp,
82 const struct GNUNET_GETOPT_CommandLineOption *options, 82 const struct GNUNET_GETOPT_CommandLineOption *options,
83 GNUNET_PROGRAM_Main task, 83 GNUNET_PROGRAM_Main task,
84 void *task_cls, 84 void *task_cls,
85 int run_without_scheduler); 85 int run_without_scheduler);
86 86
87 87
88/** 88/**
@@ -99,13 +99,13 @@ GNUNET_PROGRAM_run2(int argc,
99 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 99 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
100 */ 100 */
101int 101int
102GNUNET_PROGRAM_run(int argc, 102GNUNET_PROGRAM_run (int argc,
103 char *const *argv, 103 char *const *argv,
104 const char *binaryName, 104 const char *binaryName,
105 const char *binaryHelp, 105 const char *binaryHelp,
106 const struct GNUNET_GETOPT_CommandLineOption *options, 106 const struct GNUNET_GETOPT_CommandLineOption *options,
107 GNUNET_PROGRAM_Main task, 107 GNUNET_PROGRAM_Main task,
108 void *task_cls); 108 void *task_cls);
109 109
110 110
111#if 0 /* keep Emacsens' auto-indent happy */ 111#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h
index 527a3977e..4563a5f67 100644
--- a/src/include/gnunet_reclaim_attribute_lib.h
+++ b/src/include/gnunet_reclaim_attribute_lib.h
@@ -54,7 +54,8 @@ extern "C" {
54/** 54/**
55 * An attribute. 55 * An attribute.
56 */ 56 */
57struct GNUNET_RECLAIM_ATTRIBUTE_Claim { 57struct GNUNET_RECLAIM_ATTRIBUTE_Claim
58{
58 /** 59 /**
59 * ID 60 * ID
60 */ 61 */
@@ -92,7 +93,8 @@ struct GNUNET_RECLAIM_ATTRIBUTE_Claim {
92/** 93/**
93 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures. 94 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures.
94 */ 95 */
95struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList { 96struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList
97{
96 /** 98 /**
97 * List head 99 * List head
98 */ 100 */
@@ -105,7 +107,8 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList {
105}; 107};
106 108
107 109
108struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry { 110struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry
111{
109 /** 112 /**
110 * DLL 113 * DLL
111 */ 114 */
@@ -133,10 +136,10 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry {
133 * @return the new attribute 136 * @return the new attribute
134 */ 137 */
135struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 138struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
136GNUNET_RECLAIM_ATTRIBUTE_claim_new(const char *attr_name, 139GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char *attr_name,
137 uint32_t type, 140 uint32_t type,
138 const void *data, 141 const void *data,
139 size_t data_size); 142 size_t data_size);
140 143
141 144
142/** 145/**
@@ -146,7 +149,7 @@ GNUNET_RECLAIM_ATTRIBUTE_claim_new(const char *attr_name,
146 * @return the required buffer size 149 * @return the required buffer size
147 */ 150 */
148size_t 151size_t
149GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size( 152GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (
150 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 153 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
151 154
152 155
@@ -156,7 +159,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size(
156 * @param attrs list to destroy 159 * @param attrs list to destroy
157 */ 160 */
158void 161void
159GNUNET_RECLAIM_ATTRIBUTE_list_destroy( 162GNUNET_RECLAIM_ATTRIBUTE_list_destroy (
160 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 163 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
161 164
162 165
@@ -169,7 +172,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_destroy(
169 * @param data_size claim payload size 172 * @param data_size claim payload size
170 */ 173 */
171void 174void
172GNUNET_RECLAIM_ATTRIBUTE_list_add( 175GNUNET_RECLAIM_ATTRIBUTE_list_add (
173 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 176 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
174 const char *attr_name, 177 const char *attr_name,
175 uint32_t type, 178 uint32_t type,
@@ -185,7 +188,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_add(
185 * @return length of serialized data 188 * @return length of serialized data
186 */ 189 */
187size_t 190size_t
188GNUNET_RECLAIM_ATTRIBUTE_list_serialize( 191GNUNET_RECLAIM_ATTRIBUTE_list_serialize (
189 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 192 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
190 char *result); 193 char *result);
191 194
@@ -198,7 +201,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize(
198 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller 201 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller
199 */ 202 */
200struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * 203struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
201GNUNET_RECLAIM_ATTRIBUTE_list_deserialize(const char *data, size_t data_size); 204GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char *data, size_t data_size);
202 205
203 206
204/** 207/**
@@ -208,7 +211,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_deserialize(const char *data, size_t data_size);
208 * @return the required buffer size 211 * @return the required buffer size
209 */ 212 */
210size_t 213size_t
211GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size( 214GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (
212 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); 215 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr);
213 216
214 217
@@ -220,7 +223,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(
220 * @return length of serialized data 223 * @return length of serialized data
221 */ 224 */
222size_t 225size_t
223GNUNET_RECLAIM_ATTRIBUTE_serialize( 226GNUNET_RECLAIM_ATTRIBUTE_serialize (
224 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 227 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
225 char *result); 228 char *result);
226 229
@@ -234,7 +237,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize(
234 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller 237 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller
235 */ 238 */
236struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 239struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
237GNUNET_RECLAIM_ATTRIBUTE_deserialize(const char *data, size_t data_size); 240GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size);
238 241
239 242
240/** 243/**
@@ -243,7 +246,7 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize(const char *data, size_t data_size);
243 * @return copied claim list 246 * @return copied claim list
244 */ 247 */
245struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * 248struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
246GNUNET_RECLAIM_ATTRIBUTE_list_dup( 249GNUNET_RECLAIM_ATTRIBUTE_list_dup (
247 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 250 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
248 251
249 252
@@ -254,7 +257,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_dup(
254 * @return corresponding number, UINT32_MAX on error 257 * @return corresponding number, UINT32_MAX on error
255 */ 258 */
256uint32_t 259uint32_t
257GNUNET_RECLAIM_ATTRIBUTE_typename_to_number(const char *typename); 260GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename);
258 261
259/** 262/**
260 * Convert human-readable version of a 'claim' of an attribute to the binary 263 * Convert human-readable version of a 'claim' of an attribute to the binary
@@ -267,10 +270,10 @@ GNUNET_RECLAIM_ATTRIBUTE_typename_to_number(const char *typename);
267 * @return #GNUNET_OK on success 270 * @return #GNUNET_OK on success
268 */ 271 */
269int 272int
270GNUNET_RECLAIM_ATTRIBUTE_string_to_value(uint32_t type, 273GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
271 const char *s, 274 const char *s,
272 void **data, 275 void **data,
273 size_t *data_size); 276 size_t *data_size);
274 277
275 278
276/** 279/**
@@ -282,9 +285,9 @@ GNUNET_RECLAIM_ATTRIBUTE_string_to_value(uint32_t type,
282 * @return NULL on error, otherwise human-readable representation of the claim 285 * @return NULL on error, otherwise human-readable representation of the claim
283 */ 286 */
284char * 287char *
285GNUNET_RECLAIM_ATTRIBUTE_value_to_string(uint32_t type, 288GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type,
286 const void *data, 289 const void *data,
287 size_t data_size); 290 size_t data_size);
288 291
289 292
290/** 293/**
@@ -294,7 +297,7 @@ GNUNET_RECLAIM_ATTRIBUTE_value_to_string(uint32_t type,
294 * @return corresponding typestring, NULL on error 297 * @return corresponding typestring, NULL on error
295 */ 298 */
296const char * 299const char *
297GNUNET_RECLAIM_ATTRIBUTE_number_to_typename(uint32_t type); 300GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (uint32_t type);
298 301
299 302
300#if 0 /* keep Emacsens' auto-indent happy */ 303#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_reclaim_attribute_plugin.h b/src/include/gnunet_reclaim_attribute_plugin.h
index d35916379..26a4bb4f2 100644
--- a/src/include/gnunet_reclaim_attribute_plugin.h
+++ b/src/include/gnunet_reclaim_attribute_plugin.h
@@ -108,7 +108,8 @@ typedef const char *(*GNUNET_RECLAIM_ATTRIBUTE_NumberToTypenameFunction) (
108 * Each plugin is required to return a pointer to a struct of this 108 * Each plugin is required to return a pointer to a struct of this
109 * type as the return value from its entry point. 109 * type as the return value from its entry point.
110 */ 110 */
111struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions { 111struct GNUNET_RECLAIM_ATTRIBUTE_PluginFunctions
112{
112 /** 113 /**
113 * Closure for all of the callbacks. 114 * Closure for all of the callbacks.
114 */ 115 */
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h
index 9f0a141c9..237d791d9 100644
--- a/src/include/gnunet_reclaim_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -64,7 +64,8 @@ struct GNUNET_RECLAIM_Operation;
64 * The contents of a ticket must be protected and should be treated as a 64 * The contents of a ticket must be protected and should be treated as a
65 * shared secret between user and relying party. 65 * shared secret between user and relying party.
66 */ 66 */
67struct GNUNET_RECLAIM_Ticket { 67struct GNUNET_RECLAIM_Ticket
68{
68 /** 69 /**
69 * The ticket issuer (= the user) 70 * The ticket issuer (= the user)
70 */ 71 */
@@ -126,7 +127,7 @@ typedef void (*GNUNET_RECLAIM_AttributeResult) (
126 * @return handle to communicate with the service 127 * @return handle to communicate with the service
127 */ 128 */
128struct GNUNET_RECLAIM_Handle * 129struct GNUNET_RECLAIM_Handle *
129GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 130GNUNET_RECLAIM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
130 131
131 132
132/** 133/**
@@ -142,7 +143,7 @@ GNUNET_RECLAIM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
142 * @return handle Used to to abort the request 143 * @return handle Used to to abort the request
143 */ 144 */
144struct GNUNET_RECLAIM_Operation * 145struct GNUNET_RECLAIM_Operation *
145GNUNET_RECLAIM_attribute_store( 146GNUNET_RECLAIM_attribute_store (
146 struct GNUNET_RECLAIM_Handle *h, 147 struct GNUNET_RECLAIM_Handle *h,
147 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 148 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
148 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 149 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
@@ -162,7 +163,7 @@ GNUNET_RECLAIM_attribute_store(
162 * @return handle Used to to abort the request 163 * @return handle Used to to abort the request
163 */ 164 */
164struct GNUNET_RECLAIM_Operation * 165struct GNUNET_RECLAIM_Operation *
165GNUNET_RECLAIM_attribute_delete( 166GNUNET_RECLAIM_attribute_delete (
166 struct GNUNET_RECLAIM_Handle *h, 167 struct GNUNET_RECLAIM_Handle *h,
167 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 168 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
168 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 169 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
@@ -194,7 +195,7 @@ GNUNET_RECLAIM_attribute_delete(
194 * @return an iterator Handle to use for iteration 195 * @return an iterator Handle to use for iteration
195 */ 196 */
196struct GNUNET_RECLAIM_AttributeIterator * 197struct GNUNET_RECLAIM_AttributeIterator *
197GNUNET_RECLAIM_get_attributes_start( 198GNUNET_RECLAIM_get_attributes_start (
198 struct GNUNET_RECLAIM_Handle *h, 199 struct GNUNET_RECLAIM_Handle *h,
199 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 200 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
200 GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, 201 GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls,
@@ -209,7 +210,7 @@ GNUNET_RECLAIM_get_attributes_start(
209 * @param it The iterator 210 * @param it The iterator
210 */ 211 */
211void 212void
212GNUNET_RECLAIM_get_attributes_next( 213GNUNET_RECLAIM_get_attributes_next (
213 struct GNUNET_RECLAIM_AttributeIterator *it); 214 struct GNUNET_RECLAIM_AttributeIterator *it);
214 215
215 216
@@ -221,7 +222,7 @@ GNUNET_RECLAIM_get_attributes_next(
221 * @param it the iterator 222 * @param it the iterator
222 */ 223 */
223void 224void
224GNUNET_RECLAIM_get_attributes_stop( 225GNUNET_RECLAIM_get_attributes_stop (
225 struct GNUNET_RECLAIM_AttributeIterator *it); 226 struct GNUNET_RECLAIM_AttributeIterator *it);
226 227
227 228
@@ -239,7 +240,7 @@ GNUNET_RECLAIM_get_attributes_stop(
239 * @return handle to abort the operation 240 * @return handle to abort the operation
240 */ 241 */
241struct GNUNET_RECLAIM_Operation * 242struct GNUNET_RECLAIM_Operation *
242GNUNET_RECLAIM_ticket_issue( 243GNUNET_RECLAIM_ticket_issue (
243 struct GNUNET_RECLAIM_Handle *h, 244 struct GNUNET_RECLAIM_Handle *h,
244 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 245 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
245 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 246 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
@@ -261,7 +262,7 @@ GNUNET_RECLAIM_ticket_issue(
261 * @return handle to abort the operation 262 * @return handle to abort the operation
262 */ 263 */
263struct GNUNET_RECLAIM_Operation * 264struct GNUNET_RECLAIM_Operation *
264GNUNET_RECLAIM_ticket_revoke( 265GNUNET_RECLAIM_ticket_revoke (
265 struct GNUNET_RECLAIM_Handle *h, 266 struct GNUNET_RECLAIM_Handle *h,
266 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 267 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
267 const struct GNUNET_RECLAIM_Ticket *ticket, 268 const struct GNUNET_RECLAIM_Ticket *ticket,
@@ -281,7 +282,7 @@ GNUNET_RECLAIM_ticket_revoke(
281 * @return handle to abort the operation 282 * @return handle to abort the operation
282 */ 283 */
283struct GNUNET_RECLAIM_Operation * 284struct GNUNET_RECLAIM_Operation *
284GNUNET_RECLAIM_ticket_consume( 285GNUNET_RECLAIM_ticket_consume (
285 struct GNUNET_RECLAIM_Handle *h, 286 struct GNUNET_RECLAIM_Handle *h,
286 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 287 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
287 const struct GNUNET_RECLAIM_Ticket *ticket, 288 const struct GNUNET_RECLAIM_Ticket *ticket,
@@ -306,7 +307,7 @@ GNUNET_RECLAIM_ticket_consume(
306 * @return an iterator handle to use for iteration 307 * @return an iterator handle to use for iteration
307 */ 308 */
308struct GNUNET_RECLAIM_TicketIterator * 309struct GNUNET_RECLAIM_TicketIterator *
309GNUNET_RECLAIM_ticket_iteration_start( 310GNUNET_RECLAIM_ticket_iteration_start (
310 struct GNUNET_RECLAIM_Handle *h, 311 struct GNUNET_RECLAIM_Handle *h,
311 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 312 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
312 GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls, 313 GNUNET_SCHEDULER_TaskCallback error_cb, void *error_cb_cls,
@@ -321,7 +322,7 @@ GNUNET_RECLAIM_ticket_iteration_start(
321 * @param it the iterator 322 * @param it the iterator
322 */ 323 */
323void 324void
324GNUNET_RECLAIM_ticket_iteration_next(struct GNUNET_RECLAIM_TicketIterator *it); 325GNUNET_RECLAIM_ticket_iteration_next (struct GNUNET_RECLAIM_TicketIterator *it);
325 326
326 327
327/** 328/**
@@ -332,7 +333,7 @@ GNUNET_RECLAIM_ticket_iteration_next(struct GNUNET_RECLAIM_TicketIterator *it);
332 * @param it the iterator 333 * @param it the iterator
333 */ 334 */
334void 335void
335GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it); 336GNUNET_RECLAIM_ticket_iteration_stop (struct GNUNET_RECLAIM_TicketIterator *it);
336 337
337 338
338/** 339/**
@@ -341,7 +342,7 @@ GNUNET_RECLAIM_ticket_iteration_stop(struct GNUNET_RECLAIM_TicketIterator *it);
341 * @param h identity provider service to disconnect 342 * @param h identity provider service to disconnect
342 */ 343 */
343void 344void
344GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h); 345GNUNET_RECLAIM_disconnect (struct GNUNET_RECLAIM_Handle *h);
345 346
346 347
347/** 348/**
@@ -353,7 +354,7 @@ GNUNET_RECLAIM_disconnect(struct GNUNET_RECLAIM_Handle *h);
353 * @param op operation to cancel 354 * @param op operation to cancel
354 */ 355 */
355void 356void
356GNUNET_RECLAIM_cancel(struct GNUNET_RECLAIM_Operation *op); 357GNUNET_RECLAIM_cancel (struct GNUNET_RECLAIM_Operation *op);
357 358
358 359
359#if 0 /* keep Emacsens' auto-indent happy */ 360#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_regex_service.h b/src/include/gnunet_regex_service.h
index 19cead5d4..854241ac0 100644
--- a/src/include/gnunet_regex_service.h
+++ b/src/include/gnunet_regex_service.h
@@ -77,10 +77,10 @@ struct GNUNET_REGEX_Search;
77 * Must be freed by calling #GNUNET_REGEX_announce_cancel. 77 * Must be freed by calling #GNUNET_REGEX_announce_cancel.
78 */ 78 */
79struct GNUNET_REGEX_Announcement * 79struct GNUNET_REGEX_Announcement *
80GNUNET_REGEX_announce(const struct GNUNET_CONFIGURATION_Handle *cfg, 80GNUNET_REGEX_announce (const struct GNUNET_CONFIGURATION_Handle *cfg,
81 const char *regex, 81 const char *regex,
82 struct GNUNET_TIME_Relative refresh_delay, 82 struct GNUNET_TIME_Relative refresh_delay,
83 uint16_t compression); 83 uint16_t compression);
84 84
85 85
86/** 86/**
@@ -89,7 +89,7 @@ GNUNET_REGEX_announce(const struct GNUNET_CONFIGURATION_Handle *cfg,
89 * @param a handle returned by a previous #GNUNET_REGEX_announce call. 89 * @param a handle returned by a previous #GNUNET_REGEX_announce call.
90 */ 90 */
91void 91void
92GNUNET_REGEX_announce_cancel(struct GNUNET_REGEX_Announcement *a); 92GNUNET_REGEX_announce_cancel (struct GNUNET_REGEX_Announcement *a);
93 93
94 94
95/** 95/**
@@ -124,10 +124,10 @@ typedef void
124 * Must be freed by calling #GNUNET_REGEX_search_cancel. 124 * Must be freed by calling #GNUNET_REGEX_search_cancel.
125 */ 125 */
126struct GNUNET_REGEX_Search * 126struct GNUNET_REGEX_Search *
127GNUNET_REGEX_search(const struct GNUNET_CONFIGURATION_Handle *cfg, 127GNUNET_REGEX_search (const struct GNUNET_CONFIGURATION_Handle *cfg,
128 const char *string, 128 const char *string,
129 GNUNET_REGEX_Found callback, 129 GNUNET_REGEX_Found callback,
130 void *callback_cls); 130 void *callback_cls);
131 131
132 132
133/** 133/**
@@ -136,7 +136,7 @@ GNUNET_REGEX_search(const struct GNUNET_CONFIGURATION_Handle *cfg,
136 * @param s Handle returned by a previous #GNUNET_REGEX_search call. 136 * @param s Handle returned by a previous #GNUNET_REGEX_search call.
137 */ 137 */
138void 138void
139GNUNET_REGEX_search_cancel(struct GNUNET_REGEX_Search *s); 139GNUNET_REGEX_search_cancel (struct GNUNET_REGEX_Search *s);
140 140
141 141
142#if 0 /* keep Emacsens' auto-indent happy */ 142#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h
index 1536a93ca..956e4d67e 100644
--- a/src/include/gnunet_resolver_service.h
+++ b/src/include/gnunet_resolver_service.h
@@ -70,14 +70,14 @@ struct GNUNET_RESOLVER_RequestHandle;
70 * @param cfg configuration to use 70 * @param cfg configuration to use
71 */ 71 */
72void 72void
73GNUNET_RESOLVER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 73GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
74 74
75 75
76/** 76/**
77 * Destroy the connection to the resolver service. 77 * Destroy the connection to the resolver service.
78 */ 78 */
79void 79void
80GNUNET_RESOLVER_disconnect(void); 80GNUNET_RESOLVER_disconnect (void);
81 81
82 82
83/** 83/**
@@ -91,11 +91,11 @@ GNUNET_RESOLVER_disconnect(void);
91 * @return handle that can be used to cancel the request, NULL on error 91 * @return handle that can be used to cancel the request, NULL on error
92 */ 92 */
93struct GNUNET_RESOLVER_RequestHandle * 93struct GNUNET_RESOLVER_RequestHandle *
94GNUNET_RESOLVER_ip_get(const char *hostname, 94GNUNET_RESOLVER_ip_get (const char *hostname,
95 int af, 95 int af,
96 struct GNUNET_TIME_Relative timeout, 96 struct GNUNET_TIME_Relative timeout,
97 GNUNET_RESOLVER_AddressCallback callback, 97 GNUNET_RESOLVER_AddressCallback callback,
98 void *callback_cls); 98 void *callback_cls);
99 99
100 100
101/** 101/**
@@ -108,10 +108,10 @@ GNUNET_RESOLVER_ip_get(const char *hostname,
108 * @return handle that can be used to cancel the request, NULL on error 108 * @return handle that can be used to cancel the request, NULL on error
109 */ 109 */
110struct GNUNET_RESOLVER_RequestHandle * 110struct GNUNET_RESOLVER_RequestHandle *
111GNUNET_RESOLVER_hostname_resolve(int af, 111GNUNET_RESOLVER_hostname_resolve (int af,
112 struct GNUNET_TIME_Relative timeout, 112 struct GNUNET_TIME_Relative timeout,
113 GNUNET_RESOLVER_AddressCallback callback, 113 GNUNET_RESOLVER_AddressCallback callback,
114 void *cls); 114 void *cls);
115 115
116 116
117/** 117/**
@@ -131,7 +131,7 @@ typedef void
131 * @return local hostname, caller must free 131 * @return local hostname, caller must free
132 */ 132 */
133char * 133char *
134GNUNET_RESOLVER_local_fqdn_get(void); 134GNUNET_RESOLVER_local_fqdn_get (void);
135 135
136 136
137/** 137/**
@@ -146,12 +146,12 @@ GNUNET_RESOLVER_local_fqdn_get(void);
146 * @return handle that can be used to cancel the request, NULL on error 146 * @return handle that can be used to cancel the request, NULL on error
147 */ 147 */
148struct GNUNET_RESOLVER_RequestHandle * 148struct GNUNET_RESOLVER_RequestHandle *
149GNUNET_RESOLVER_hostname_get(const struct sockaddr *sa, 149GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
150 socklen_t salen, 150 socklen_t salen,
151 int do_resolve, 151 int do_resolve,
152 struct GNUNET_TIME_Relative timeout, 152 struct GNUNET_TIME_Relative timeout,
153 GNUNET_RESOLVER_HostnameCallback callback, 153 GNUNET_RESOLVER_HostnameCallback callback,
154 void *cls); 154 void *cls);
155 155
156 156
157/** 157/**
@@ -163,7 +163,7 @@ GNUNET_RESOLVER_hostname_get(const struct sockaddr *sa,
163 * @param rh handle of request to cancel 163 * @param rh handle of request to cancel
164 */ 164 */
165void 165void
166GNUNET_RESOLVER_request_cancel(struct GNUNET_RESOLVER_RequestHandle *rh); 166GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh);
167 167
168 168
169#if 0 /* keep Emacsens' auto-indent happy */ 169#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h
index e70759590..7e74bee76 100644
--- a/src/include/gnunet_rest_lib.h
+++ b/src/include/gnunet_rest_lib.h
@@ -36,7 +36,8 @@
36 36
37#define GNUNET_REST_HANDLER_END { NULL, NULL, NULL } 37#define GNUNET_REST_HANDLER_END { NULL, NULL, NULL }
38 38
39struct GNUNET_REST_RequestHandle { 39struct GNUNET_REST_RequestHandle
40{
40 /** 41 /**
41 * Map of url parameters 42 * Map of url parameters
42 */ 43 */
@@ -68,12 +69,14 @@ struct GNUNET_REST_RequestHandle {
68 size_t data_size; 69 size_t data_size;
69}; 70};
70 71
71struct GNUNET_REST_RequestHandlerError { 72struct GNUNET_REST_RequestHandlerError
73{
72 int error_code; 74 int error_code;
73 char* error_text; 75 char*error_text;
74}; 76};
75 77
76struct GNUNET_REST_RequestHandler { 78struct GNUNET_REST_RequestHandler
79{
77 /** 80 /**
78 * Http method to handle 81 * Http method to handle
79 */ 82 */
@@ -112,7 +115,7 @@ typedef void (*GNUNET_REST_ResultProcessor) (void *cls,
112 * @return GNUNET_YES if namespace matches 115 * @return GNUNET_YES if namespace matches
113 */ 116 */
114int 117int
115GNUNET_REST_namespace_match(const char *url, const char *namespace); 118GNUNET_REST_namespace_match (const char *url, const char *namespace);
116 119
117/** 120/**
118 * Create REST MHD response 121 * Create REST MHD response
@@ -121,14 +124,14 @@ GNUNET_REST_namespace_match(const char *url, const char *namespace);
121 * @return MHD response 124 * @return MHD response
122 */ 125 */
123struct MHD_Response* 126struct MHD_Response*
124GNUNET_REST_create_response(const char *data); 127GNUNET_REST_create_response (const char *data);
125 128
126 129
127int 130int
128GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn, 131GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
129 const struct GNUNET_REST_RequestHandler *handlers, 132 const struct GNUNET_REST_RequestHandler *handlers,
130 struct GNUNET_REST_RequestHandlerError *err, 133 struct GNUNET_REST_RequestHandlerError *err,
131 void *cls); 134 void *cls);
132 135
133 136
134#endif 137#endif
diff --git a/src/include/gnunet_rest_plugin.h b/src/include/gnunet_rest_plugin.h
index 596f9937a..770ba66f2 100644
--- a/src/include/gnunet_rest_plugin.h
+++ b/src/include/gnunet_rest_plugin.h
@@ -45,7 +45,8 @@ extern "C"
45/** 45/**
46 * @brief struct returned by the initialization function of the plugin 46 * @brief struct returned by the initialization function of the plugin
47 */ 47 */
48struct GNUNET_REST_Plugin { 48struct GNUNET_REST_Plugin
49{
49 /** 50 /**
50 * 51 *
51 * The closure of the plugin 52 * The closure of the plugin
diff --git a/src/include/gnunet_revocation_service.h b/src/include/gnunet_revocation_service.h
index 2acbe89d8..7222cedc1 100644
--- a/src/include/gnunet_revocation_service.h
+++ b/src/include/gnunet_revocation_service.h
@@ -78,9 +78,9 @@ typedef void (*GNUNET_REVOCATION_Callback) (void *cls,
78 * @return handle to use in #GNUNET_REVOCATION_query_cancel to stop REVOCATION from invoking the callback 78 * @return handle to use in #GNUNET_REVOCATION_query_cancel to stop REVOCATION from invoking the callback
79 */ 79 */
80struct GNUNET_REVOCATION_Query * 80struct GNUNET_REVOCATION_Query *
81GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg, 81GNUNET_REVOCATION_query (const struct GNUNET_CONFIGURATION_Handle *cfg,
82 const struct GNUNET_CRYPTO_EcdsaPublicKey *key, 82 const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
83 GNUNET_REVOCATION_Callback func, void *func_cls); 83 GNUNET_REVOCATION_Callback func, void *func_cls);
84 84
85 85
86/** 86/**
@@ -89,7 +89,7 @@ GNUNET_REVOCATION_query(const struct GNUNET_CONFIGURATION_Handle *cfg,
89 * @param q query to cancel 89 * @param q query to cancel
90 */ 90 */
91void 91void
92GNUNET_REVOCATION_query_cancel(struct GNUNET_REVOCATION_Query *q); 92GNUNET_REVOCATION_query_cancel (struct GNUNET_REVOCATION_Query *q);
93 93
94 94
95/** 95/**
@@ -114,11 +114,11 @@ struct GNUNET_REVOCATION_Handle;
114 * @return handle to use in #GNUNET_REVOCATION_revoke_cancel to stop REVOCATION from invoking the callback 114 * @return handle to use in #GNUNET_REVOCATION_revoke_cancel to stop REVOCATION from invoking the callback
115 */ 115 */
116struct GNUNET_REVOCATION_Handle * 116struct GNUNET_REVOCATION_Handle *
117GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg, 117GNUNET_REVOCATION_revoke (const struct GNUNET_CONFIGURATION_Handle *cfg,
118 const struct GNUNET_CRYPTO_EcdsaPublicKey *key, 118 const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
119 const struct GNUNET_CRYPTO_EcdsaSignature *sig, 119 const struct GNUNET_CRYPTO_EcdsaSignature *sig,
120 uint64_t pow, 120 uint64_t pow,
121 GNUNET_REVOCATION_Callback func, void *func_cls); 121 GNUNET_REVOCATION_Callback func, void *func_cls);
122 122
123 123
124/** 124/**
@@ -127,7 +127,7 @@ GNUNET_REVOCATION_revoke(const struct GNUNET_CONFIGURATION_Handle *cfg,
127 * @param h operation to cancel 127 * @param h operation to cancel
128 */ 128 */
129void 129void
130GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h); 130GNUNET_REVOCATION_revoke_cancel (struct GNUNET_REVOCATION_Handle *h);
131 131
132 132
133/** 133/**
@@ -140,9 +140,9 @@ GNUNET_REVOCATION_revoke_cancel(struct GNUNET_REVOCATION_Handle *h);
140 * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not 140 * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not
141 */ 141 */
142int 142int
143GNUNET_REVOCATION_check_pow(const struct GNUNET_CRYPTO_EcdsaPublicKey *key, 143GNUNET_REVOCATION_check_pow (const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
144 uint64_t pow, 144 uint64_t pow,
145 unsigned int matching_bits); 145 unsigned int matching_bits);
146 146
147 147
148/** 148/**
@@ -152,8 +152,9 @@ GNUNET_REVOCATION_check_pow(const struct GNUNET_CRYPTO_EcdsaPublicKey *key,
152 * @param sig where to write the revocation signature 152 * @param sig where to write the revocation signature
153 */ 153 */
154void 154void
155GNUNET_REVOCATION_sign_revocation(const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, 155GNUNET_REVOCATION_sign_revocation (const struct
156 struct GNUNET_CRYPTO_EcdsaSignature *sig); 156 GNUNET_CRYPTO_EcdsaPrivateKey *key,
157 struct GNUNET_CRYPTO_EcdsaSignature *sig);
157 158
158 159
159#if 0 /* keep Emacsens' auto-indent happy */ 160#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_rps_service.h b/src/include/gnunet_rps_service.h
index a580d1cc2..b6f2e2456 100644
--- a/src/include/gnunet_rps_service.h
+++ b/src/include/gnunet_rps_service.h
@@ -61,9 +61,10 @@ struct GNUNET_RPS_Request_Handle;
61 * @param num_peers the number of peers returned 61 * @param num_peers the number of peers returned
62 * @param peers array with num_peers PeerIDs 62 * @param peers array with num_peers PeerIDs
63 */ 63 */
64typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls, 64typedef void (*GNUNET_RPS_NotifyReadyCB) (void *cls,
65 uint64_t num_peers, 65 uint64_t num_peers,
66 const struct GNUNET_PeerIdentity *peers); 66 const struct
67 GNUNET_PeerIdentity *peers);
67 68
68 69
69/** 70/**
@@ -75,10 +76,11 @@ typedef void (* GNUNET_RPS_NotifyReadyCB) (void *cls,
75 * @param probability The probability with which all elements have been observed 76 * @param probability The probability with which all elements have been observed
76 * @param num_observed Number of IDs this sampler has observed 77 * @param num_observed Number of IDs this sampler has observed
77 */ 78 */
78typedef void (* GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls, 79typedef void (*GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls,
79 const struct GNUNET_PeerIdentity *peer, 80 const struct
80 double probability, 81 GNUNET_PeerIdentity *peer,
81 uint32_t num_observed); 82 double probability,
83 uint32_t num_observed);
82 84
83 85
84/** 86/**
@@ -88,7 +90,7 @@ typedef void (* GNUNET_RPS_NotifyReadySingleInfoCB) (void *cls,
88 * @return handle to the rps service 90 * @return handle to the rps service
89 */ 91 */
90struct GNUNET_RPS_Handle * 92struct GNUNET_RPS_Handle *
91GNUNET_RPS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 93GNUNET_RPS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
92 94
93 95
94/** 96/**
@@ -98,8 +100,8 @@ GNUNET_RPS_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
98 * @param shared_value The shared value that defines the members of the sub (-group) 100 * @param shared_value The shared value that defines the members of the sub (-group)
99 */ 101 */
100void 102void
101GNUNET_RPS_sub_start(struct GNUNET_RPS_Handle *h, 103GNUNET_RPS_sub_start (struct GNUNET_RPS_Handle *h,
102 const char *shared_value); 104 const char *shared_value);
103 105
104 106
105/** 107/**
@@ -109,8 +111,8 @@ GNUNET_RPS_sub_start(struct GNUNET_RPS_Handle *h,
109 * @param shared_value The shared value that defines the members of the sub (-group) 111 * @param shared_value The shared value that defines the members of the sub (-group)
110 */ 112 */
111void 113void
112GNUNET_RPS_sub_stop(struct GNUNET_RPS_Handle *h, 114GNUNET_RPS_sub_stop (struct GNUNET_RPS_Handle *h,
113 const char *shared_value); 115 const char *shared_value);
114 116
115 117
116/** 118/**
@@ -128,9 +130,9 @@ GNUNET_RPS_sub_stop(struct GNUNET_RPS_Handle *h,
128 * @return handle to this request 130 * @return handle to this request
129 */ 131 */
130struct GNUNET_RPS_Request_Handle * 132struct GNUNET_RPS_Request_Handle *
131GNUNET_RPS_request_peers(struct GNUNET_RPS_Handle *h, uint32_t n, 133GNUNET_RPS_request_peers (struct GNUNET_RPS_Handle *h, uint32_t n,
132 GNUNET_RPS_NotifyReadyCB ready_cb, 134 GNUNET_RPS_NotifyReadyCB ready_cb,
133 void *cls); 135 void *cls);
134 136
135 137
136/** 138/**
@@ -142,9 +144,9 @@ GNUNET_RPS_request_peers(struct GNUNET_RPS_Handle *h, uint32_t n,
142 * @return a handle to cancel this request 144 * @return a handle to cancel this request
143 */ 145 */
144struct GNUNET_RPS_Request_Handle_Single_Info * 146struct GNUNET_RPS_Request_Handle_Single_Info *
145GNUNET_RPS_request_peer_info(struct GNUNET_RPS_Handle *rps_handle, 147GNUNET_RPS_request_peer_info (struct GNUNET_RPS_Handle *rps_handle,
146 GNUNET_RPS_NotifyReadySingleInfoCB ready_cb, 148 GNUNET_RPS_NotifyReadySingleInfoCB ready_cb,
147 void *cls); 149 void *cls);
148 150
149 151
150/** 152/**
@@ -155,8 +157,8 @@ GNUNET_RPS_request_peer_info(struct GNUNET_RPS_Handle *rps_handle,
155 * @param ids the ids of the peers seeded 157 * @param ids the ids of the peers seeded
156 */ 158 */
157void 159void
158GNUNET_RPS_seed_ids(struct GNUNET_RPS_Handle *h, uint32_t n, 160GNUNET_RPS_seed_ids (struct GNUNET_RPS_Handle *h, uint32_t n,
159 const struct GNUNET_PeerIdentity * ids); 161 const struct GNUNET_PeerIdentity *ids);
160 162
161/** 163/**
162 * Cancle an issued request. 164 * Cancle an issued request.
@@ -164,7 +166,7 @@ GNUNET_RPS_seed_ids(struct GNUNET_RPS_Handle *h, uint32_t n,
164 * @param rh handle of the pending request to be canceled 166 * @param rh handle of the pending request to be canceled
165 */ 167 */
166void 168void
167GNUNET_RPS_request_cancel(struct GNUNET_RPS_Request_Handle *rh); 169GNUNET_RPS_request_cancel (struct GNUNET_RPS_Request_Handle *rh);
168 170
169 171
170/** 172/**
@@ -173,7 +175,7 @@ GNUNET_RPS_request_cancel(struct GNUNET_RPS_Request_Handle *rh);
173 * @param rhs request handle of request to cancle 175 * @param rhs request handle of request to cancle
174 */ 176 */
175void 177void
176GNUNET_RPS_request_single_info_cancel( 178GNUNET_RPS_request_single_info_cancel (
177 struct GNUNET_RPS_Request_Handle_Single_Info *rhs); 179 struct GNUNET_RPS_Request_Handle_Single_Info *rhs);
178 180
179 181
@@ -193,11 +195,11 @@ GNUNET_RPS_request_single_info_cancel(
193 * peer to be isolated from the rest 195 * peer to be isolated from the rest
194 */ 196 */
195void 197void
196GNUNET_RPS_act_malicious(struct GNUNET_RPS_Handle *h, 198GNUNET_RPS_act_malicious (struct GNUNET_RPS_Handle *h,
197 uint32_t type, 199 uint32_t type,
198 uint32_t num_peers, 200 uint32_t num_peers,
199 const struct GNUNET_PeerIdentity *ids, 201 const struct GNUNET_PeerIdentity *ids,
200 const struct GNUNET_PeerIdentity *target_peer); 202 const struct GNUNET_PeerIdentity *target_peer);
201#endif /* ENABLE_MALICIOUS */ 203#endif /* ENABLE_MALICIOUS */
202 204
203/* Get internals for debugging/profiling purposes */ 205/* Get internals for debugging/profiling purposes */
@@ -212,10 +214,10 @@ GNUNET_RPS_act_malicious(struct GNUNET_RPS_Handle *h,
212 * @param ready_cb the callback called when the peers are available 214 * @param ready_cb the callback called when the peers are available
213 */ 215 */
214void 216void
215GNUNET_RPS_view_request(struct GNUNET_RPS_Handle *rps_handle, 217GNUNET_RPS_view_request (struct GNUNET_RPS_Handle *rps_handle,
216 uint32_t num_updates, 218 uint32_t num_updates,
217 GNUNET_RPS_NotifyReadyCB view_update_cb, 219 GNUNET_RPS_NotifyReadyCB view_update_cb,
218 void *cls); 220 void *cls);
219 221
220 222
221/** 223/**
@@ -226,9 +228,9 @@ GNUNET_RPS_view_request(struct GNUNET_RPS_Handle *rps_handle,
226 * @param ready_cb the callback called when the peers are available 228 * @param ready_cb the callback called when the peers are available
227 */ 229 */
228struct GNUNET_RPS_StreamRequestHandle * 230struct GNUNET_RPS_StreamRequestHandle *
229GNUNET_RPS_stream_request(struct GNUNET_RPS_Handle *rps_handle, 231GNUNET_RPS_stream_request (struct GNUNET_RPS_Handle *rps_handle,
230 GNUNET_RPS_NotifyReadyCB stream_input_cb, 232 GNUNET_RPS_NotifyReadyCB stream_input_cb,
231 void *cls); 233 void *cls);
232 234
233 235
234/** 236/**
@@ -237,7 +239,7 @@ GNUNET_RPS_stream_request(struct GNUNET_RPS_Handle *rps_handle,
237 * @param srh The request handle to cancel 239 * @param srh The request handle to cancel
238 */ 240 */
239void 241void
240GNUNET_RPS_stream_cancel(struct GNUNET_RPS_StreamRequestHandle *srh); 242GNUNET_RPS_stream_cancel (struct GNUNET_RPS_StreamRequestHandle *srh);
241 243
242 244
243/** 245/**
@@ -246,7 +248,7 @@ GNUNET_RPS_stream_cancel(struct GNUNET_RPS_StreamRequestHandle *srh);
246 * @param h the handle to the rps service 248 * @param h the handle to the rps service
247 */ 249 */
248void 250void
249GNUNET_RPS_disconnect(struct GNUNET_RPS_Handle *h); 251GNUNET_RPS_disconnect (struct GNUNET_RPS_Handle *h);
250 252
251 253
252#if 0 /* keep Emacsens' auto-indent happy */ 254#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_scalarproduct_service.h b/src/include/gnunet_scalarproduct_service.h
index 512d72260..b12a19a2f 100644
--- a/src/include/gnunet_scalarproduct_service.h
+++ b/src/include/gnunet_scalarproduct_service.h
@@ -49,7 +49,8 @@ extern "C" {
49/** 49/**
50 * Result status values for the computation. 50 * Result status values for the computation.
51 */ 51 */
52enum GNUNET_SCALARPRODUCT_ResponseStatus { 52enum GNUNET_SCALARPRODUCT_ResponseStatus
53{
53 /** 54 /**
54 * Operation is still active (never returned, used internally). 55 * Operation is still active (never returned, used internally).
55 */ 56 */
@@ -93,7 +94,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
93/** 94/**
94 * An element key-value pair for scalarproduct 95 * An element key-value pair for scalarproduct
95 */ 96 */
96struct GNUNET_SCALARPRODUCT_Element { 97struct GNUNET_SCALARPRODUCT_Element
98{
97 /** 99 /**
98 * Key used to identify matching pairs of values to multiply. 100 * Key used to identify matching pairs of values to multiply.
99 */ 101 */
@@ -117,7 +119,9 @@ GNUNET_NETWORK_STRUCT_END
117 */ 119 */
118typedef void 120typedef void
119(*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, 121(*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls,
120 enum GNUNET_SCALARPRODUCT_ResponseStatus status); 122 enum
123 GNUNET_SCALARPRODUCT_ResponseStatus
124 status);
121 125
122 126
123/** 127/**
@@ -129,7 +133,8 @@ typedef void
129 */ 133 */
130typedef void 134typedef void
131(*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls, 135(*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls,
132 enum GNUNET_SCALARPRODUCT_ResponseStatus status, 136 enum GNUNET_SCALARPRODUCT_ResponseStatus
137 status,
133 gcry_mpi_t result); 138 gcry_mpi_t result);
134 139
135 140
@@ -152,13 +157,16 @@ struct GNUNET_SCALARPRODUCT_ComputationHandle;
152 * @return a new handle for this computation 157 * @return a new handle for this computation
153 */ 158 */
154struct GNUNET_SCALARPRODUCT_ComputationHandle * 159struct GNUNET_SCALARPRODUCT_ComputationHandle *
155GNUNET_SCALARPRODUCT_start_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, 160GNUNET_SCALARPRODUCT_start_computation (const struct
156 const struct GNUNET_HashCode *session_key, 161 GNUNET_CONFIGURATION_Handle *cfg,
157 const struct GNUNET_PeerIdentity *peer, 162 const struct
158 const struct GNUNET_SCALARPRODUCT_Element *elements, 163 GNUNET_HashCode *session_key,
159 uint32_t element_count, 164 const struct GNUNET_PeerIdentity *peer,
160 GNUNET_SCALARPRODUCT_DatumProcessor cont, 165 const struct
161 void *cont_cls); 166 GNUNET_SCALARPRODUCT_Element *elements,
167 uint32_t element_count,
168 GNUNET_SCALARPRODUCT_DatumProcessor cont,
169 void *cont_cls);
162 170
163 171
164/** 172/**
@@ -173,12 +181,15 @@ GNUNET_SCALARPRODUCT_start_computation(const struct GNUNET_CONFIGURATION_Handle
173 * @return a new handle for this computation 181 * @return a new handle for this computation
174 */ 182 */
175struct GNUNET_SCALARPRODUCT_ComputationHandle * 183struct GNUNET_SCALARPRODUCT_ComputationHandle *
176GNUNET_SCALARPRODUCT_accept_computation(const struct GNUNET_CONFIGURATION_Handle *cfg, 184GNUNET_SCALARPRODUCT_accept_computation (const struct
177 const struct GNUNET_HashCode *key, 185 GNUNET_CONFIGURATION_Handle *cfg,
178 const struct GNUNET_SCALARPRODUCT_Element *elements, 186 const struct GNUNET_HashCode *key,
179 uint32_t element_count, 187 const struct
180 GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, 188 GNUNET_SCALARPRODUCT_Element *elements,
181 void *cont_cls); 189 uint32_t element_count,
190 GNUNET_SCALARPRODUCT_ContinuationWithStatus
191 cont,
192 void *cont_cls);
182 193
183 194
184/** 195/**
@@ -188,7 +199,7 @@ GNUNET_SCALARPRODUCT_accept_computation(const struct GNUNET_CONFIGURATION_Handle
188 * @param h computation handle to terminate 199 * @param h computation handle to terminate
189 */ 200 */
190void 201void
191GNUNET_SCALARPRODUCT_cancel(struct GNUNET_SCALARPRODUCT_ComputationHandle *h); 202GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle *h);
192 203
193 204
194#if 0 /* keep Emacsens' auto-indent happy */ 205#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_secretsharing_service.h b/src/include/gnunet_secretsharing_service.h
index 40c98b857..9bacee06e 100644
--- a/src/include/gnunet_secretsharing_service.h
+++ b/src/include/gnunet_secretsharing_service.h
@@ -119,7 +119,8 @@ struct GNUNET_SECRETSHARING_DecryptionHandle;
119/** 119/**
120 * Public key of a group sharing a secret. 120 * Public key of a group sharing a secret.
121 */ 121 */
122struct GNUNET_SECRETSHARING_PublicKey { 122struct GNUNET_SECRETSHARING_PublicKey
123{
123 uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; 124 uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
124}; 125};
125 126
@@ -127,7 +128,8 @@ struct GNUNET_SECRETSHARING_PublicKey {
127/** 128/**
128 * Encrypted field element. 129 * Encrypted field element.
129 */ 130 */
130struct GNUNET_SECRETSHARING_Ciphertext { 131struct GNUNET_SECRETSHARING_Ciphertext
132{
131 uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; 133 uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
132 uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)]; 134 uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
133}; 135};
@@ -139,7 +141,8 @@ struct GNUNET_SECRETSHARING_Ciphertext {
139 * Note that we are not operating in GF(2^n), thus not every 141 * Note that we are not operating in GF(2^n), thus not every
140 * bit pattern is a valid plain text. 142 * bit pattern is a valid plain text.
141 */ 143 */
142struct GNUNET_SECRETSHARING_Plaintext { 144struct GNUNET_SECRETSHARING_Plaintext
145{
143 /** 146 /**
144 * Value of the message. 147 * Value of the message.
145 */ 148 */
@@ -167,10 +170,14 @@ struct GNUNET_SECRETSHARING_Plaintext {
167 */ 170 */
168typedef void 171typedef void
169(*GNUNET_SECRETSHARING_SecretReadyCallback) (void *cls, 172(*GNUNET_SECRETSHARING_SecretReadyCallback) (void *cls,
170 struct GNUNET_SECRETSHARING_Share *my_share, 173 struct GNUNET_SECRETSHARING_Share *
171 struct GNUNET_SECRETSHARING_PublicKey *public_key, 174 my_share,
175 struct
176 GNUNET_SECRETSHARING_PublicKey *
177 public_key,
172 unsigned int num_ready_peers, 178 unsigned int num_ready_peers,
173 const struct GNUNET_PeerIdentity *ready_peers); 179 const struct
180 GNUNET_PeerIdentity *ready_peers);
174 181
175 182
176/** 183/**
@@ -182,7 +189,9 @@ typedef void
182 */ 189 */
183typedef void 190typedef void
184(*GNUNET_SECRETSHARING_DecryptCallback) (void *cls, 191(*GNUNET_SECRETSHARING_DecryptCallback) (void *cls,
185 const struct GNUNET_SECRETSHARING_Plaintext *plaintext); 192 const struct
193 GNUNET_SECRETSHARING_Plaintext *
194 plaintext);
186 195
187 196
188/** 197/**
@@ -202,15 +211,16 @@ typedef void
202 * @param cls closure for @a cb 211 * @param cls closure for @a cb
203 */ 212 */
204struct GNUNET_SECRETSHARING_Session * 213struct GNUNET_SECRETSHARING_Session *
205GNUNET_SECRETSHARING_create_session(const struct GNUNET_CONFIGURATION_Handle *cfg, 214GNUNET_SECRETSHARING_create_session (const struct
206 unsigned int num_peers, 215 GNUNET_CONFIGURATION_Handle *cfg,
207 const struct GNUNET_PeerIdentity *peers, 216 unsigned int num_peers,
208 const struct GNUNET_HashCode *session_id, 217 const struct GNUNET_PeerIdentity *peers,
209 struct GNUNET_TIME_Absolute start, 218 const struct GNUNET_HashCode *session_id,
210 struct GNUNET_TIME_Absolute deadline, 219 struct GNUNET_TIME_Absolute start,
211 unsigned int threshold, 220 struct GNUNET_TIME_Absolute deadline,
212 GNUNET_SECRETSHARING_SecretReadyCallback cb, 221 unsigned int threshold,
213 void *cls); 222 GNUNET_SECRETSHARING_SecretReadyCallback cb,
223 void *cls);
214 224
215 225
216/** 226/**
@@ -220,7 +230,7 @@ GNUNET_SECRETSHARING_create_session(const struct GNUNET_CONFIGURATION_Handle *cf
220 * @param s session to destroy 230 * @param s session to destroy
221 */ 231 */
222void 232void
223GNUNET_SECRETSHARING_session_destroy(struct GNUNET_SECRETSHARING_Session *s); 233GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s);
224 234
225 235
226/** 236/**
@@ -237,9 +247,12 @@ GNUNET_SECRETSHARING_session_destroy(struct GNUNET_SECRETSHARING_Session *s);
237 * @return #GNUNET_YES on succes, #GNUNET_SYSERR if the message is invalid (invalid range) 247 * @return #GNUNET_YES on succes, #GNUNET_SYSERR if the message is invalid (invalid range)
238 */ 248 */
239int 249int
240GNUNET_SECRETSHARING_encrypt(const struct GNUNET_SECRETSHARING_PublicKey *public_key, 250GNUNET_SECRETSHARING_encrypt (const struct
241 const struct GNUNET_SECRETSHARING_Plaintext *plaintext, 251 GNUNET_SECRETSHARING_PublicKey *public_key,
242 struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext); 252 const struct
253 GNUNET_SECRETSHARING_Plaintext *plaintext,
254 struct GNUNET_SECRETSHARING_Ciphertext *
255 result_ciphertext);
243 256
244 257
245/** 258/**
@@ -259,13 +272,14 @@ GNUNET_SECRETSHARING_encrypt(const struct GNUNET_SECRETSHARING_PublicKey *public
259 * @return handle to cancel the operation 272 * @return handle to cancel the operation
260 */ 273 */
261struct GNUNET_SECRETSHARING_DecryptionHandle * 274struct GNUNET_SECRETSHARING_DecryptionHandle *
262GNUNET_SECRETSHARING_decrypt(const struct GNUNET_CONFIGURATION_Handle *cfg, 275GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg,
263 struct GNUNET_SECRETSHARING_Share *share, 276 struct GNUNET_SECRETSHARING_Share *share,
264 const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext, 277 const struct
265 struct GNUNET_TIME_Absolute start, 278 GNUNET_SECRETSHARING_Ciphertext *ciphertext,
266 struct GNUNET_TIME_Absolute deadline, 279 struct GNUNET_TIME_Absolute start,
267 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb, 280 struct GNUNET_TIME_Absolute deadline,
268 void *decrypt_cb_cls); 281 GNUNET_SECRETSHARING_DecryptCallback decrypt_cb,
282 void *decrypt_cb_cls);
269 283
270 284
271/** 285/**
@@ -277,7 +291,8 @@ GNUNET_SECRETSHARING_decrypt(const struct GNUNET_CONFIGURATION_Handle *cfg,
277 * @param dh to cancel 291 * @param dh to cancel
278 */ 292 */
279void 293void
280GNUNET_SECRETSHARING_decrypt_cancel(struct GNUNET_SECRETSHARING_DecryptionHandle *dh); 294GNUNET_SECRETSHARING_decrypt_cancel (struct
295 GNUNET_SECRETSHARING_DecryptionHandle *dh);
281 296
282 297
283/** 298/**
@@ -290,7 +305,7 @@ GNUNET_SECRETSHARING_decrypt_cancel(struct GNUNET_SECRETSHARING_DecryptionHandle
290 * @return The share, or NULL on error. 305 * @return The share, or NULL on error.
291 */ 306 */
292struct GNUNET_SECRETSHARING_Share * 307struct GNUNET_SECRETSHARING_Share *
293GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen); 308GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen);
294 309
295 310
296/** 311/**
@@ -305,21 +320,26 @@ GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen);
305 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure. 320 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure.
306 */ 321 */
307int 322int
308GNUNET_SECRETSHARING_share_write(const struct GNUNET_SECRETSHARING_Share *share, 323GNUNET_SECRETSHARING_share_write (const struct
309 void *buf, size_t buflen, size_t *writelen); 324 GNUNET_SECRETSHARING_Share *share,
325 void *buf, size_t buflen, size_t *writelen);
310 326
311 327
312void 328void
313GNUNET_SECRETSHARING_share_destroy(struct GNUNET_SECRETSHARING_Share *share); 329GNUNET_SECRETSHARING_share_destroy (struct GNUNET_SECRETSHARING_Share *share);
314 330
315 331
316int 332int
317GNUNET_SECRETSHARING_plaintext_generate(struct GNUNET_SECRETSHARING_Plaintext *plaintext, 333GNUNET_SECRETSHARING_plaintext_generate (struct
318 gcry_mpi_t exponent); 334 GNUNET_SECRETSHARING_Plaintext *
335 plaintext,
336 gcry_mpi_t exponent);
319 337
320int 338int
321GNUNET_SECRETSHARING_plaintext_generate_i(struct GNUNET_SECRETSHARING_Plaintext *plaintext, 339GNUNET_SECRETSHARING_plaintext_generate_i (struct
322 int64_t exponent); 340 GNUNET_SECRETSHARING_Plaintext *
341 plaintext,
342 int64_t exponent);
323 343
324 344
325#if 0 /* keep Emacsens' auto-indent happy */ 345#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h
index 4016fc362..13f761d7d 100644
--- a/src/include/gnunet_set_service.h
+++ b/src/include/gnunet_set_service.h
@@ -79,7 +79,8 @@ struct GNUNET_SET_OperationHandle;
79/** 79/**
80 * The operation that a set set supports. 80 * The operation that a set set supports.
81 */ 81 */
82enum GNUNET_SET_OperationType { 82enum GNUNET_SET_OperationType
83{
83 /** 84 /**
84 * A purely local set that does not support any operation. 85 * A purely local set that does not support any operation.
85 */ 86 */
@@ -100,7 +101,8 @@ enum GNUNET_SET_OperationType {
100/** 101/**
101 * Status for the result callback 102 * Status for the result callback
102 */ 103 */
103enum GNUNET_SET_Status { 104enum GNUNET_SET_Status
105{
104 /** 106 /**
105 * Everything went ok, we are transmitting an element of the 107 * Everything went ok, we are transmitting an element of the
106 * result (in set, or to be removed from set, depending on 108 * result (in set, or to be removed from set, depending on
@@ -155,7 +157,8 @@ enum GNUNET_SET_Status {
155/** 157/**
156 * The way results are given to the client. 158 * The way results are given to the client.
157 */ 159 */
158enum GNUNET_SET_ResultMode { 160enum GNUNET_SET_ResultMode
161{
159 /** 162 /**
160 * Client gets every element in the resulting set. 163 * Client gets every element in the resulting set.
161 * 164 *
@@ -190,7 +193,8 @@ enum GNUNET_SET_ResultMode {
190/** 193/**
191 * Element stored in a set. 194 * Element stored in a set.
192 */ 195 */
193struct GNUNET_SET_Element { 196struct GNUNET_SET_Element
197{
194 /** 198 /**
195 * Number of bytes in the buffer pointed to by data. 199 * Number of bytes in the buffer pointed to by data.
196 */ 200 */
@@ -213,7 +217,8 @@ struct GNUNET_SET_Element {
213 * 217 *
214 * Used as tag for struct #GNUNET_SET_Option. 218 * Used as tag for struct #GNUNET_SET_Option.
215 */ 219 */
216enum GNUNET_SET_OptionType { 220enum GNUNET_SET_OptionType
221{
217 /** 222 /**
218 * List terminator. 223 * List terminator.
219 */ 224 */
@@ -243,7 +248,8 @@ enum GNUNET_SET_OptionType {
243/** 248/**
244 * Option for set operations. 249 * Option for set operations.
245 */ 250 */
246struct GNUNET_SET_Option { 251struct GNUNET_SET_Option
252{
247 /** 253 /**
248 * Type of the option. 254 * Type of the option.
249 */ 255 */
@@ -252,7 +258,8 @@ struct GNUNET_SET_Option {
252 /** 258 /**
253 * Value for the option, only used with some options. 259 * Value for the option, only used with some options.
254 */ 260 */
255 union { 261 union
262 {
256 uint64_t num; 263 uint64_t num;
257 } v; 264 } v;
258}; 265};
@@ -335,8 +342,8 @@ typedef void
335 * @return a handle to the set 342 * @return a handle to the set
336 */ 343 */
337struct GNUNET_SET_Handle * 344struct GNUNET_SET_Handle *
338GNUNET_SET_create(const struct GNUNET_CONFIGURATION_Handle *cfg, 345GNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
339 enum GNUNET_SET_OperationType op); 346 enum GNUNET_SET_OperationType op);
340 347
341 348
342/** 349/**
@@ -353,10 +360,10 @@ GNUNET_SET_create(const struct GNUNET_CONFIGURATION_Handle *cfg,
353 * set is invalid (e.g. the set service crashed) 360 * set is invalid (e.g. the set service crashed)
354 */ 361 */
355int 362int
356GNUNET_SET_add_element(struct GNUNET_SET_Handle *set, 363GNUNET_SET_add_element (struct GNUNET_SET_Handle *set,
357 const struct GNUNET_SET_Element *element, 364 const struct GNUNET_SET_Element *element,
358 GNUNET_SET_Continuation cont, 365 GNUNET_SET_Continuation cont,
359 void *cont_cls); 366 void *cont_cls);
360 367
361 368
362/** 369/**
@@ -373,16 +380,16 @@ GNUNET_SET_add_element(struct GNUNET_SET_Handle *set,
373 * set is invalid (e.g. the set service crashed) 380 * set is invalid (e.g. the set service crashed)
374 */ 381 */
375int 382int
376GNUNET_SET_remove_element(struct GNUNET_SET_Handle *set, 383GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set,
377 const struct GNUNET_SET_Element *element, 384 const struct GNUNET_SET_Element *element,
378 GNUNET_SET_Continuation cont, 385 GNUNET_SET_Continuation cont,
379 void *cont_cls); 386 void *cont_cls);
380 387
381 388
382void 389void
383GNUNET_SET_copy_lazy(struct GNUNET_SET_Handle *set, 390GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set,
384 GNUNET_SET_CopyReadyCallback cb, 391 GNUNET_SET_CopyReadyCallback cb,
385 void *cls); 392 void *cls);
386 393
387 394
388/** 395/**
@@ -394,7 +401,7 @@ GNUNET_SET_copy_lazy(struct GNUNET_SET_Handle *set,
394 * @param set set to destroy 401 * @param set set to destroy
395 */ 402 */
396void 403void
397GNUNET_SET_destroy(struct GNUNET_SET_Handle *set); 404GNUNET_SET_destroy (struct GNUNET_SET_Handle *set);
398 405
399 406
400/** 407/**
@@ -412,13 +419,13 @@ GNUNET_SET_destroy(struct GNUNET_SET_Handle *set);
412 * @return a handle to cancel the operation 419 * @return a handle to cancel the operation
413 */ 420 */
414struct GNUNET_SET_OperationHandle * 421struct GNUNET_SET_OperationHandle *
415GNUNET_SET_prepare(const struct GNUNET_PeerIdentity *other_peer, 422GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer,
416 const struct GNUNET_HashCode *app_id, 423 const struct GNUNET_HashCode *app_id,
417 const struct GNUNET_MessageHeader *context_msg, 424 const struct GNUNET_MessageHeader *context_msg,
418 enum GNUNET_SET_ResultMode result_mode, 425 enum GNUNET_SET_ResultMode result_mode,
419 struct GNUNET_SET_Option options[], 426 struct GNUNET_SET_Option options[],
420 GNUNET_SET_ResultIterator result_cb, 427 GNUNET_SET_ResultIterator result_cb,
421 void *result_cls); 428 void *result_cls);
422 429
423 430
424/** 431/**
@@ -436,11 +443,11 @@ GNUNET_SET_prepare(const struct GNUNET_PeerIdentity *other_peer,
436 * @return a handle that can be used to cancel the listen operation 443 * @return a handle that can be used to cancel the listen operation
437 */ 444 */
438struct GNUNET_SET_ListenHandle * 445struct GNUNET_SET_ListenHandle *
439GNUNET_SET_listen(const struct GNUNET_CONFIGURATION_Handle *cfg, 446GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg,
440 enum GNUNET_SET_OperationType op_type, 447 enum GNUNET_SET_OperationType op_type,
441 const struct GNUNET_HashCode *app_id, 448 const struct GNUNET_HashCode *app_id,
442 GNUNET_SET_ListenCallback listen_cb, 449 GNUNET_SET_ListenCallback listen_cb,
443 void *listen_cls); 450 void *listen_cls);
444 451
445 452
446/** 453/**
@@ -452,7 +459,7 @@ GNUNET_SET_listen(const struct GNUNET_CONFIGURATION_Handle *cfg,
452 * @param lh handle for the listen operation 459 * @param lh handle for the listen operation
453 */ 460 */
454void 461void
455GNUNET_SET_listen_cancel(struct GNUNET_SET_ListenHandle *lh); 462GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh);
456 463
457 464
458/** 465/**
@@ -470,11 +477,11 @@ GNUNET_SET_listen_cancel(struct GNUNET_SET_ListenHandle *lh);
470 * @return a handle to cancel the operation 477 * @return a handle to cancel the operation
471 */ 478 */
472struct GNUNET_SET_OperationHandle * 479struct GNUNET_SET_OperationHandle *
473GNUNET_SET_accept(struct GNUNET_SET_Request *request, 480GNUNET_SET_accept (struct GNUNET_SET_Request *request,
474 enum GNUNET_SET_ResultMode result_mode, 481 enum GNUNET_SET_ResultMode result_mode,
475 struct GNUNET_SET_Option options[], 482 struct GNUNET_SET_Option options[],
476 GNUNET_SET_ResultIterator result_cb, 483 GNUNET_SET_ResultIterator result_cb,
477 void *result_cls); 484 void *result_cls);
478 485
479 486
480/** 487/**
@@ -491,8 +498,8 @@ GNUNET_SET_accept(struct GNUNET_SET_Request *request,
491 * set is invalid (e.g. the set service crashed) 498 * set is invalid (e.g. the set service crashed)
492 */ 499 */
493int 500int
494GNUNET_SET_commit(struct GNUNET_SET_OperationHandle *oh, 501GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh,
495 struct GNUNET_SET_Handle *set); 502 struct GNUNET_SET_Handle *set);
496 503
497 504
498/** 505/**
@@ -503,7 +510,7 @@ GNUNET_SET_commit(struct GNUNET_SET_OperationHandle *oh,
503 * @param oh set operation to cancel 510 * @param oh set operation to cancel
504 */ 511 */
505void 512void
506GNUNET_SET_operation_cancel(struct GNUNET_SET_OperationHandle *oh); 513GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh);
507 514
508 515
509/** 516/**
@@ -520,9 +527,9 @@ GNUNET_SET_operation_cancel(struct GNUNET_SET_OperationHandle *oh);
520 * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected) 527 * #GNUNET_SYSERR if the set is invalid (e.g. the server crashed, disconnected)
521 */ 528 */
522int 529int
523GNUNET_SET_iterate(struct GNUNET_SET_Handle *set, 530GNUNET_SET_iterate (struct GNUNET_SET_Handle *set,
524 GNUNET_SET_ElementIterator iter, 531 GNUNET_SET_ElementIterator iter,
525 void *iter_cls); 532 void *iter_cls);
526 533
527 534
528/** 535/**
@@ -533,7 +540,7 @@ GNUNET_SET_iterate(struct GNUNET_SET_Handle *set,
533 * @param set the set to stop iterating over 540 * @param set the set to stop iterating over
534 */ 541 */
535void 542void
536GNUNET_SET_iterate_cancel(struct GNUNET_SET_Handle *set); 543GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set);
537 544
538 545
539/** 546/**
@@ -544,7 +551,7 @@ GNUNET_SET_iterate_cancel(struct GNUNET_SET_Handle *set);
544 * @return the copied element 551 * @return the copied element
545 */ 552 */
546struct GNUNET_SET_Element * 553struct GNUNET_SET_Element *
547GNUNET_SET_element_dup(const struct GNUNET_SET_Element *element); 554GNUNET_SET_element_dup (const struct GNUNET_SET_Element *element);
548 555
549 556
550/** 557/**
@@ -555,8 +562,8 @@ GNUNET_SET_element_dup(const struct GNUNET_SET_Element *element);
555 * should be stored 562 * should be stored
556 */ 563 */
557void 564void
558GNUNET_SET_element_hash(const struct GNUNET_SET_Element *element, 565GNUNET_SET_element_hash (const struct GNUNET_SET_Element *element,
559 struct GNUNET_HashCode *ret_hash); 566 struct GNUNET_HashCode *ret_hash);
560 567
561 568
562#if 0 /* keep Emacsens' auto-indent happy */ 569#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h
index 5d6e861a9..9be1683db 100644
--- a/src/include/gnunet_signal_lib.h
+++ b/src/include/gnunet_signal_lib.h
@@ -68,8 +68,8 @@ typedef void
68 * @return context that can be used to restore, NULL on error 68 * @return context that can be used to restore, NULL on error
69 */ 69 */
70struct GNUNET_SIGNAL_Context * 70struct GNUNET_SIGNAL_Context *
71GNUNET_SIGNAL_handler_install(int signal, 71GNUNET_SIGNAL_handler_install (int signal,
72 GNUNET_SIGNAL_Handler handler); 72 GNUNET_SIGNAL_Handler handler);
73 73
74 74
75/** 75/**
@@ -79,7 +79,7 @@ GNUNET_SIGNAL_handler_install(int signal,
79 * signal handler was installed 79 * signal handler was installed
80 */ 80 */
81void 81void
82GNUNET_SIGNAL_handler_uninstall(struct GNUNET_SIGNAL_Context *ctx); 82GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx);
83 83
84 84
85/** 85/**
@@ -90,7 +90,7 @@ GNUNET_SIGNAL_handler_uninstall(struct GNUNET_SIGNAL_Context *ctx);
90 * @param sig the signal to raise 90 * @param sig the signal to raise
91 */ 91 */
92void 92void
93GNUNET_SIGNAL_raise(const int sig); 93GNUNET_SIGNAL_raise (const int sig);
94 94
95 95
96#if 0 /* keep Emacsens' auto-indent happy */ 96#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_socks.h b/src/include/gnunet_socks.h
index 68a4677dd..1a6ae1119 100644
--- a/src/include/gnunet_socks.h
+++ b/src/include/gnunet_socks.h
@@ -52,8 +52,8 @@ extern "C"
52 * @return GNUNET_YES if so, GNUNET_NO if not 52 * @return GNUNET_YES if so, GNUNET_NO if not
53 */ 53 */
54int 54int
55GNUNET_SOCKS_check_service(const char *service_name, 55GNUNET_SOCKS_check_service (const char *service_name,
56 const struct GNUNET_CONFIGURATION_Handle *cfg); 56 const struct GNUNET_CONFIGURATION_Handle *cfg);
57 57
58 58
59/** 59/**
@@ -65,8 +65,8 @@ GNUNET_SOCKS_check_service(const char *service_name,
65 * NULL if SOCKS not configured or not configured properly 65 * NULL if SOCKS not configured or not configured properly
66 */ 66 */
67struct GNUNET_CONNECTION_Handle * 67struct GNUNET_CONNECTION_Handle *
68GNUNET_SOCKS_do_connect(const char *service_name, 68GNUNET_SOCKS_do_connect (const char *service_name,
69 const struct GNUNET_CONFIGURATION_Handle *cfg); 69 const struct GNUNET_CONFIGURATION_Handle *cfg);
70 70
71 71
72#if 0 /* keep Emacsens' auto-indent happy */ 72#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_speaker_lib.h b/src/include/gnunet_speaker_lib.h
index 261ea5981..71a7c2166 100644
--- a/src/include/gnunet_speaker_lib.h
+++ b/src/include/gnunet_speaker_lib.h
@@ -81,7 +81,8 @@ typedef void (*GNUNET_SPEAKER_PlayCallback)(void *cls,
81/** 81/**
82 * A speaker is a device that can play or record audio data. 82 * A speaker is a device that can play or record audio data.
83 */ 83 */
84struct GNUNET_SPEAKER_Handle { 84struct GNUNET_SPEAKER_Handle
85{
85 /** 86 /**
86 * Turn on the speaker. 87 * Turn on the speaker.
87 */ 88 */
@@ -117,7 +118,8 @@ struct GNUNET_SPEAKER_Handle {
117 * @return NULL on error 118 * @return NULL on error
118 */ 119 */
119struct GNUNET_SPEAKER_Handle * 120struct GNUNET_SPEAKER_Handle *
120GNUNET_SPEAKER_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cfg); 121GNUNET_SPEAKER_create_from_hardware (const struct
122 GNUNET_CONFIGURATION_Handle *cfg);
121 123
122 124
123/** 125/**
@@ -126,7 +128,7 @@ GNUNET_SPEAKER_create_from_hardware(const struct GNUNET_CONFIGURATION_Handle *cf
126 * @param speaker speaker to destroy 128 * @param speaker speaker to destroy
127 */ 129 */
128void 130void
129GNUNET_SPEAKER_destroy(struct GNUNET_SPEAKER_Handle *speaker); 131GNUNET_SPEAKER_destroy (struct GNUNET_SPEAKER_Handle *speaker);
130 132
131 133
132#if 0 /* keep Emacsens' auto-indent happy */ 134#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_sq_lib.h b/src/include/gnunet_sq_lib.h
index 31ac0675c..b6b09eb67 100644
--- a/src/include/gnunet_sq_lib.h
+++ b/src/include/gnunet_sq_lib.h
@@ -51,7 +51,8 @@ typedef int
51/** 51/**
52 * @brief Description of a DB query parameter. 52 * @brief Description of a DB query parameter.
53 */ 53 */
54struct GNUNET_SQ_QueryParam { 54struct GNUNET_SQ_QueryParam
55{
55 /** 56 /**
56 * Function for how to handle this type of entry. 57 * Function for how to handle this type of entry.
57 */ 58 */
@@ -93,8 +94,8 @@ struct GNUNET_SQ_QueryParam {
93 * @oaran ptr_size number of bytes in @a ptr 94 * @oaran ptr_size number of bytes in @a ptr
94 */ 95 */
95struct GNUNET_SQ_QueryParam 96struct GNUNET_SQ_QueryParam
96GNUNET_SQ_query_param_fixed_size(const void *ptr, 97GNUNET_SQ_query_param_fixed_size (const void *ptr,
97 size_t ptr_size); 98 size_t ptr_size);
98 99
99 100
100 101
@@ -104,7 +105,7 @@ GNUNET_SQ_query_param_fixed_size(const void *ptr,
104 * @param ptr pointer to the string query parameter to pass 105 * @param ptr pointer to the string query parameter to pass
105 */ 106 */
106struct GNUNET_SQ_QueryParam 107struct GNUNET_SQ_QueryParam
107GNUNET_SQ_query_param_string(const char *ptr); 108GNUNET_SQ_query_param_string (const char *ptr);
108 109
109 110
110/** 111/**
@@ -113,7 +114,8 @@ GNUNET_SQ_query_param_string(const char *ptr);
113 * 114 *
114 * @param x pointer to the query parameter to pass. 115 * @param x pointer to the query parameter to pass.
115 */ 116 */
116#define GNUNET_SQ_query_param_auto_from_type(x) GNUNET_SQ_query_param_fixed_size((x), sizeof(*(x))) 117#define GNUNET_SQ_query_param_auto_from_type( \
118 x) GNUNET_SQ_query_param_fixed_size ((x), sizeof(*(x)))
117 119
118 120
119/** 121/**
@@ -123,7 +125,8 @@ GNUNET_SQ_query_param_string(const char *ptr);
123 * @param x the query parameter to pass. 125 * @param x the query parameter to pass.
124 */ 126 */
125struct GNUNET_SQ_QueryParam 127struct GNUNET_SQ_QueryParam
126GNUNET_SQ_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x); 128GNUNET_SQ_query_param_rsa_public_key (const struct
129 GNUNET_CRYPTO_RsaPublicKey *x);
127 130
128 131
129/** 132/**
@@ -133,7 +136,8 @@ GNUNET_SQ_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x)
133 * @param x the query parameter to pass 136 * @param x the query parameter to pass
134 */ 137 */
135struct GNUNET_SQ_QueryParam 138struct GNUNET_SQ_QueryParam
136GNUNET_SQ_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); 139GNUNET_SQ_query_param_rsa_signature (const struct
140 GNUNET_CRYPTO_RsaSignature *x);
137 141
138 142
139/** 143/**
@@ -143,7 +147,7 @@ GNUNET_SQ_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x);
143 * @param x pointer to the query parameter to pass 147 * @param x pointer to the query parameter to pass
144 */ 148 */
145struct GNUNET_SQ_QueryParam 149struct GNUNET_SQ_QueryParam
146GNUNET_SQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); 150GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x);
147 151
148 152
149/** 153/**
@@ -153,7 +157,8 @@ GNUNET_SQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x);
153 * @param x pointer to the query parameter to pass 157 * @param x pointer to the query parameter to pass
154 */ 158 */
155struct GNUNET_SQ_QueryParam 159struct GNUNET_SQ_QueryParam
156GNUNET_SQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x); 160GNUNET_SQ_query_param_absolute_time_nbo (const struct
161 GNUNET_TIME_AbsoluteNBO *x);
157 162
158 163
159/** 164/**
@@ -162,7 +167,7 @@ GNUNET_SQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x)
162 * @param x pointer to the query parameter to pass 167 * @param x pointer to the query parameter to pass
163 */ 168 */
164struct GNUNET_SQ_QueryParam 169struct GNUNET_SQ_QueryParam
165GNUNET_SQ_query_param_uint16(const uint16_t *x); 170GNUNET_SQ_query_param_uint16 (const uint16_t *x);
166 171
167 172
168/** 173/**
@@ -171,7 +176,7 @@ GNUNET_SQ_query_param_uint16(const uint16_t *x);
171 * @param x pointer to the query parameter to pass 176 * @param x pointer to the query parameter to pass
172 */ 177 */
173struct GNUNET_SQ_QueryParam 178struct GNUNET_SQ_QueryParam
174GNUNET_SQ_query_param_uint32(const uint32_t *x); 179GNUNET_SQ_query_param_uint32 (const uint32_t *x);
175 180
176 181
177/** 182/**
@@ -180,7 +185,7 @@ GNUNET_SQ_query_param_uint32(const uint32_t *x);
180 * @param x pointer to the query parameter to pass 185 * @param x pointer to the query parameter to pass
181 */ 186 */
182struct GNUNET_SQ_QueryParam 187struct GNUNET_SQ_QueryParam
183GNUNET_SQ_query_param_uint64(const uint64_t *x); 188GNUNET_SQ_query_param_uint64 (const uint64_t *x);
184 189
185 190
186/** 191/**
@@ -191,8 +196,8 @@ GNUNET_SQ_query_param_uint64(const uint64_t *x);
191 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 196 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
192 */ 197 */
193int 198int
194GNUNET_SQ_bind(sqlite3_stmt *stmt, 199GNUNET_SQ_bind (sqlite3_stmt *stmt,
195 const struct GNUNET_SQ_QueryParam *params); 200 const struct GNUNET_SQ_QueryParam *params);
196 201
197 202
198/** 203/**
@@ -202,8 +207,8 @@ GNUNET_SQ_bind(sqlite3_stmt *stmt,
202 * @param stmt statement to reset 207 * @param stmt statement to reset
203 */ 208 */
204void 209void
205GNUNET_SQ_reset(sqlite3 *dbh, 210GNUNET_SQ_reset (sqlite3 *dbh,
206 sqlite3_stmt *stmt); 211 sqlite3_stmt *stmt);
207 212
208 213
209/** 214/**
@@ -245,7 +250,8 @@ typedef void
245/** 250/**
246 * @brief Description of a DB result cell. 251 * @brief Description of a DB result cell.
247 */ 252 */
248struct GNUNET_SQ_ResultSpec { 253struct GNUNET_SQ_ResultSpec
254{
249 /** 255 /**
250 * What is the format of the result? 256 * What is the format of the result?
251 */ 257 */
@@ -304,8 +310,8 @@ struct GNUNET_SQ_ResultSpec {
304 * @return array entry for the result specification to use 310 * @return array entry for the result specification to use
305 */ 311 */
306struct GNUNET_SQ_ResultSpec 312struct GNUNET_SQ_ResultSpec
307GNUNET_SQ_result_spec_variable_size(void **dst, 313GNUNET_SQ_result_spec_variable_size (void **dst,
308 size_t *sptr); 314 size_t *sptr);
309 315
310 316
311/** 317/**
@@ -316,8 +322,8 @@ GNUNET_SQ_result_spec_variable_size(void **dst,
316 * @return array entry for the result specification to use 322 * @return array entry for the result specification to use
317 */ 323 */
318struct GNUNET_SQ_ResultSpec 324struct GNUNET_SQ_ResultSpec
319GNUNET_SQ_result_spec_fixed_size(void *dst, 325GNUNET_SQ_result_spec_fixed_size (void *dst,
320 size_t dst_size); 326 size_t dst_size);
321 327
322 328
323/** 329/**
@@ -326,7 +332,8 @@ GNUNET_SQ_result_spec_fixed_size(void *dst,
326 * @param dst point to where to store the result, type fits expected result size 332 * @param dst point to where to store the result, type fits expected result size
327 * @return array entry for the result specification to use 333 * @return array entry for the result specification to use
328 */ 334 */
329#define GNUNET_SQ_result_spec_auto_from_type(dst) GNUNET_SQ_result_spec_fixed_size((dst), sizeof(*(dst))) 335#define GNUNET_SQ_result_spec_auto_from_type( \
336 dst) GNUNET_SQ_result_spec_fixed_size ((dst), sizeof(*(dst)))
330 337
331 338
332/** 339/**
@@ -337,8 +344,8 @@ GNUNET_SQ_result_spec_fixed_size(void *dst,
337 * @return array entry for the result specification to use 344 * @return array entry for the result specification to use
338 */ 345 */
339struct GNUNET_SQ_ResultSpec 346struct GNUNET_SQ_ResultSpec
340GNUNET_SQ_result_spec_variable_size(void **dst, 347GNUNET_SQ_result_spec_variable_size (void **dst,
341 size_t *sptr); 348 size_t *sptr);
342 349
343 350
344/** 351/**
@@ -348,7 +355,7 @@ GNUNET_SQ_result_spec_variable_size(void **dst,
348 * @return array entry for the result specification to use 355 * @return array entry for the result specification to use
349 */ 356 */
350struct GNUNET_SQ_ResultSpec 357struct GNUNET_SQ_ResultSpec
351GNUNET_SQ_result_spec_string(char **dst); 358GNUNET_SQ_result_spec_string (char **dst);
352 359
353 360
354/** 361/**
@@ -358,7 +365,7 @@ GNUNET_SQ_result_spec_string(char **dst);
358 * @return array entry for the result specification to use 365 * @return array entry for the result specification to use
359 */ 366 */
360struct GNUNET_SQ_ResultSpec 367struct GNUNET_SQ_ResultSpec
361GNUNET_SQ_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); 368GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa);
362 369
363 370
364/** 371/**
@@ -368,7 +375,7 @@ GNUNET_SQ_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa);
368 * @return array entry for the result specification to use 375 * @return array entry for the result specification to use
369 */ 376 */
370struct GNUNET_SQ_ResultSpec 377struct GNUNET_SQ_ResultSpec
371GNUNET_SQ_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); 378GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig);
372 379
373 380
374/** 381/**
@@ -378,7 +385,7 @@ GNUNET_SQ_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig);
378 * @return array entry for the result specification to use 385 * @return array entry for the result specification to use
379 */ 386 */
380struct GNUNET_SQ_ResultSpec 387struct GNUNET_SQ_ResultSpec
381GNUNET_SQ_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); 388GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at);
382 389
383 390
384/** 391/**
@@ -388,7 +395,7 @@ GNUNET_SQ_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at);
388 * @return array entry for the result specification to use 395 * @return array entry for the result specification to use
389 */ 396 */
390struct GNUNET_SQ_ResultSpec 397struct GNUNET_SQ_ResultSpec
391GNUNET_SQ_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); 398GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at);
392 399
393 400
394/** 401/**
@@ -398,7 +405,7 @@ GNUNET_SQ_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at);
398 * @return array entry for the result specification to use 405 * @return array entry for the result specification to use
399 */ 406 */
400struct GNUNET_SQ_ResultSpec 407struct GNUNET_SQ_ResultSpec
401GNUNET_SQ_result_spec_uint16(uint16_t *u16); 408GNUNET_SQ_result_spec_uint16 (uint16_t *u16);
402 409
403 410
404/** 411/**
@@ -408,7 +415,7 @@ GNUNET_SQ_result_spec_uint16(uint16_t *u16);
408 * @return array entry for the result specification to use 415 * @return array entry for the result specification to use
409 */ 416 */
410struct GNUNET_SQ_ResultSpec 417struct GNUNET_SQ_ResultSpec
411GNUNET_SQ_result_spec_uint32(uint32_t *u32); 418GNUNET_SQ_result_spec_uint32 (uint32_t *u32);
412 419
413 420
414/** 421/**
@@ -418,7 +425,7 @@ GNUNET_SQ_result_spec_uint32(uint32_t *u32);
418 * @return array entry for the result specification to use 425 * @return array entry for the result specification to use
419 */ 426 */
420struct GNUNET_SQ_ResultSpec 427struct GNUNET_SQ_ResultSpec
421GNUNET_SQ_result_spec_uint64(uint64_t *u64); 428GNUNET_SQ_result_spec_uint64 (uint64_t *u64);
422 429
423 430
424/** 431/**
@@ -431,8 +438,8 @@ GNUNET_SQ_result_spec_uint64(uint64_t *u64);
431 * #GNUNET_SYSERR if a result was invalid (non-existing field) 438 * #GNUNET_SYSERR if a result was invalid (non-existing field)
432 */ 439 */
433int 440int
434GNUNET_SQ_extract_result(sqlite3_stmt *result, 441GNUNET_SQ_extract_result (sqlite3_stmt *result,
435 struct GNUNET_SQ_ResultSpec *rs); 442 struct GNUNET_SQ_ResultSpec *rs);
436 443
437 444
438/** 445/**
@@ -442,7 +449,7 @@ GNUNET_SQ_extract_result(sqlite3_stmt *result,
442 * @param rs reult specification to clean up 449 * @param rs reult specification to clean up
443 */ 450 */
444void 451void
445GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs); 452GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs);
446 453
447 454
448 455
@@ -453,7 +460,8 @@ GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs);
453 * Information needed to run a list of SQL statements using 460 * Information needed to run a list of SQL statements using
454 * #GNUNET_SQ_exec_statements(). 461 * #GNUNET_SQ_exec_statements().
455 */ 462 */
456struct GNUNET_SQ_PrepareStatement { 463struct GNUNET_SQ_PrepareStatement
464{
457 /** 465 /**
458 * Actual SQL statement. 466 * Actual SQL statement.
459 */ 467 */
@@ -480,8 +488,8 @@ struct GNUNET_SQ_PrepareStatement {
480 * @return initialized struct 488 * @return initialized struct
481 */ 489 */
482struct GNUNET_SQ_PrepareStatement 490struct GNUNET_SQ_PrepareStatement
483GNUNET_SQ_make_prepare(const char *sql, 491GNUNET_SQ_make_prepare (const char *sql,
484 sqlite3_stmt **pstmt); 492 sqlite3_stmt **pstmt);
485 493
486 494
487 495
@@ -494,8 +502,8 @@ GNUNET_SQ_make_prepare(const char *sql,
494 * @return #GNUNET_OK on success 502 * @return #GNUNET_OK on success
495 */ 503 */
496int 504int
497GNUNET_SQ_prepare(sqlite3 *dbh, 505GNUNET_SQ_prepare (sqlite3 *dbh,
498 const struct GNUNET_SQ_PrepareStatement *ps); 506 const struct GNUNET_SQ_PrepareStatement *ps);
499 507
500 508
501/* ******************** sq_exec.c functions ************** */ 509/* ******************** sq_exec.c functions ************** */
@@ -505,7 +513,8 @@ GNUNET_SQ_prepare(sqlite3 *dbh,
505 * Information needed to run a list of SQL statements using 513 * Information needed to run a list of SQL statements using
506 * #GNUNET_SQ_exec_statements(). 514 * #GNUNET_SQ_exec_statements().
507 */ 515 */
508struct GNUNET_SQ_ExecuteStatement { 516struct GNUNET_SQ_ExecuteStatement
517{
509 /** 518 /**
510 * Actual SQL statement. 519 * Actual SQL statement.
511 */ 520 */
@@ -531,7 +540,7 @@ struct GNUNET_SQ_ExecuteStatement {
531 * @return initialized struct 540 * @return initialized struct
532 */ 541 */
533struct GNUNET_SQ_ExecuteStatement 542struct GNUNET_SQ_ExecuteStatement
534GNUNET_SQ_make_execute(const char *sql); 543GNUNET_SQ_make_execute (const char *sql);
535 544
536 545
537/** 546/**
@@ -542,7 +551,7 @@ GNUNET_SQ_make_execute(const char *sql);
542 * @return initialized struct 551 * @return initialized struct
543 */ 552 */
544struct GNUNET_SQ_ExecuteStatement 553struct GNUNET_SQ_ExecuteStatement
545GNUNET_SQ_make_try_execute(const char *sql); 554GNUNET_SQ_make_try_execute (const char *sql);
546 555
547 556
548/** 557/**
@@ -555,8 +564,8 @@ GNUNET_SQ_make_try_execute(const char *sql);
555 * #GNUNET_SYSERR on error 564 * #GNUNET_SYSERR on error
556 */ 565 */
557int 566int
558GNUNET_SQ_exec_statements(sqlite3 *dbh, 567GNUNET_SQ_exec_statements (sqlite3 *dbh,
559 const struct GNUNET_SQ_ExecuteStatement *es); 568 const struct GNUNET_SQ_ExecuteStatement *es);
560 569
561 570
562 571
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h
index 3dd6e9ce1..dfb03d67a 100644
--- a/src/include/gnunet_statistics_service.h
+++ b/src/include/gnunet_statistics_service.h
@@ -85,8 +85,8 @@ typedef int
85 * @return handle to use 85 * @return handle to use
86 */ 86 */
87struct GNUNET_STATISTICS_Handle * 87struct GNUNET_STATISTICS_Handle *
88GNUNET_STATISTICS_create(const char *subsystem, 88GNUNET_STATISTICS_create (const char *subsystem,
89 const struct GNUNET_CONFIGURATION_Handle *cfg); 89 const struct GNUNET_CONFIGURATION_Handle *cfg);
90 90
91 91
92/** 92/**
@@ -97,8 +97,8 @@ GNUNET_STATISTICS_create(const char *subsystem,
97 * be completed 97 * be completed
98 */ 98 */
99void 99void
100GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h, 100GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
101 int sync_first); 101 int sync_first);
102 102
103 103
104/** 104/**
@@ -112,11 +112,11 @@ GNUNET_STATISTICS_destroy(struct GNUNET_STATISTICS_Handle *h,
112 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 112 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
113 */ 113 */
114int 114int
115GNUNET_STATISTICS_watch(struct GNUNET_STATISTICS_Handle *handle, 115GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
116 const char *subsystem, 116 const char *subsystem,
117 const char *name, 117 const char *name,
118 GNUNET_STATISTICS_Iterator proc, 118 GNUNET_STATISTICS_Iterator proc,
119 void *proc_cls); 119 void *proc_cls);
120 120
121 121
122/** 122/**
@@ -130,11 +130,11 @@ GNUNET_STATISTICS_watch(struct GNUNET_STATISTICS_Handle *handle,
130 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error (no such watch) 130 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error (no such watch)
131 */ 131 */
132int 132int
133GNUNET_STATISTICS_watch_cancel(struct GNUNET_STATISTICS_Handle *handle, 133GNUNET_STATISTICS_watch_cancel (struct GNUNET_STATISTICS_Handle *handle,
134 const char *subsystem, 134 const char *subsystem,
135 const char *name, 135 const char *name,
136 GNUNET_STATISTICS_Iterator proc, 136 GNUNET_STATISTICS_Iterator proc,
137 void *proc_cls); 137 void *proc_cls);
138 138
139 139
140/** 140/**
@@ -168,12 +168,12 @@ struct GNUNET_STATISTICS_GetHandle;
168 * @return NULL on error 168 * @return NULL on error
169 */ 169 */
170struct GNUNET_STATISTICS_GetHandle * 170struct GNUNET_STATISTICS_GetHandle *
171GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle, 171GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle,
172 const char *subsystem, 172 const char *subsystem,
173 const char *name, 173 const char *name,
174 GNUNET_STATISTICS_Callback cont, 174 GNUNET_STATISTICS_Callback cont,
175 GNUNET_STATISTICS_Iterator proc, 175 GNUNET_STATISTICS_Iterator proc,
176 void *cls); 176 void *cls);
177 177
178 178
179/** 179/**
@@ -183,7 +183,7 @@ GNUNET_STATISTICS_get(struct GNUNET_STATISTICS_Handle *handle,
183 * @param gh handle of the request to cancel 183 * @param gh handle of the request to cancel
184 */ 184 */
185void 185void
186GNUNET_STATISTICS_get_cancel(struct GNUNET_STATISTICS_GetHandle *gh); 186GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh);
187 187
188 188
189/** 189/**
@@ -196,10 +196,10 @@ GNUNET_STATISTICS_get_cancel(struct GNUNET_STATISTICS_GetHandle *gh);
196 * @param make_persistent should the value be kept across restarts? 196 * @param make_persistent should the value be kept across restarts?
197 */ 197 */
198void 198void
199GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle, 199GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle,
200 const char *name, 200 const char *name,
201 uint64_t value, 201 uint64_t value,
202 int make_persistent); 202 int make_persistent);
203 203
204 204
205/** 205/**
@@ -212,10 +212,10 @@ GNUNET_STATISTICS_set(struct GNUNET_STATISTICS_Handle *handle,
212 * @param make_persistent should the value be kept across restarts? 212 * @param make_persistent should the value be kept across restarts?
213 */ 213 */
214void 214void
215GNUNET_STATISTICS_update(struct GNUNET_STATISTICS_Handle *handle, 215GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle,
216 const char *name, 216 const char *name,
217 int64_t delta, 217 int64_t delta,
218 int make_persistent); 218 int make_persistent);
219 219
220 220
221 221
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index 25dfada42..7f532c97a 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -61,8 +61,8 @@ extern "C"
61 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 61 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
62 */ 62 */
63int 63int
64GNUNET_STRINGS_fancy_size_to_bytes(const char *fancy_size, 64GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size,
65 unsigned long long *size); 65 unsigned long long *size);
66 66
67 67
68/** 68/**
@@ -74,8 +74,8 @@ GNUNET_STRINGS_fancy_size_to_bytes(const char *fancy_size,
74 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 74 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
75 */ 75 */
76int 76int
77GNUNET_STRINGS_fancy_time_to_relative(const char *fancy_time, 77GNUNET_STRINGS_fancy_time_to_relative (const char *fancy_time,
78 struct GNUNET_TIME_Relative *rtime); 78 struct GNUNET_TIME_Relative *rtime);
79 79
80 80
81/** 81/**
@@ -89,8 +89,8 @@ GNUNET_STRINGS_fancy_time_to_relative(const char *fancy_time,
89 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 89 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
90 */ 90 */
91int 91int
92GNUNET_STRINGS_fancy_time_to_absolute(const char *fancy_time, 92GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
93 struct GNUNET_TIME_Absolute *atime); 93 struct GNUNET_TIME_Absolute *atime);
94 94
95 95
96/** 96/**
@@ -100,7 +100,7 @@ GNUNET_STRINGS_fancy_time_to_absolute(const char *fancy_time,
100 * @return fancy representation of the size (possibly rounded) for humans 100 * @return fancy representation of the size (possibly rounded) for humans
101 */ 101 */
102char * 102char *
103GNUNET_STRINGS_byte_size_fancy(unsigned long long size); 103GNUNET_STRINGS_byte_size_fancy (unsigned long long size);
104 104
105 105
106/** 106/**
@@ -117,9 +117,9 @@ GNUNET_STRINGS_byte_size_fancy(unsigned long long size);
117 * string is returned. 117 * string is returned.
118 */ 118 */
119char * 119char *
120GNUNET_STRINGS_conv(const char *input, size_t len, 120GNUNET_STRINGS_conv (const char *input, size_t len,
121 const char *input_charset, 121 const char *input_charset,
122 const char *output_charset); 122 const char *output_charset);
123 123
124 124
125/** 125/**
@@ -133,9 +133,9 @@ GNUNET_STRINGS_conv(const char *input, size_t len,
133 * @return the converted string (0-terminated) 133 * @return the converted string (0-terminated)
134 */ 134 */
135char * 135char *
136GNUNET_STRINGS_to_utf8(const char *input, 136GNUNET_STRINGS_to_utf8 (const char *input,
137 size_t len, 137 size_t len,
138 const char *charset); 138 const char *charset);
139 139
140 140
141/** 141/**
@@ -150,9 +150,9 @@ GNUNET_STRINGS_to_utf8(const char *input,
150 * string is returned. 150 * string is returned.
151 */ 151 */
152char * 152char *
153GNUNET_STRINGS_from_utf8(const char *input, 153GNUNET_STRINGS_from_utf8 (const char *input,
154 size_t len, 154 size_t len,
155 const char *charset); 155 const char *charset);
156 156
157 157
158/** 158/**
@@ -163,8 +163,8 @@ GNUNET_STRINGS_from_utf8(const char *input,
163 * @param output output buffer 163 * @param output output buffer
164 */ 164 */
165void 165void
166GNUNET_STRINGS_utf8_tolower(const char *input, 166GNUNET_STRINGS_utf8_tolower (const char *input,
167 char *output); 167 char *output);
168 168
169 169
170/** 170/**
@@ -175,8 +175,8 @@ GNUNET_STRINGS_utf8_tolower(const char *input,
175 * @param output output buffer 175 * @param output output buffer
176 */ 176 */
177void 177void
178GNUNET_STRINGS_utf8_toupper(const char *input, 178GNUNET_STRINGS_utf8_toupper (const char *input,
179 char *output); 179 char *output);
180 180
181 181
182/** 182/**
@@ -188,7 +188,7 @@ GNUNET_STRINGS_utf8_toupper(const char *input,
188 * NULL is returned on error 188 * NULL is returned on error
189 */ 189 */
190char * 190char *
191GNUNET_STRINGS_filename_expand(const char *fil); 191GNUNET_STRINGS_filename_expand (const char *fil);
192 192
193 193
194/** 194/**
@@ -211,10 +211,10 @@ GNUNET_STRINGS_filename_expand(const char *fil);
211 * (or number of bytes that would have been written) 211 * (or number of bytes that would have been written)
212 */ 212 */
213size_t 213size_t
214GNUNET_STRINGS_buffer_fill(char *buffer, 214GNUNET_STRINGS_buffer_fill (char *buffer,
215 size_t size, 215 size_t size,
216 unsigned int count, 216 unsigned int count,
217 ...); 217 ...);
218 218
219 219
220/** 220/**
@@ -230,9 +230,9 @@ GNUNET_STRINGS_buffer_fill(char *buffer,
230 * in the buffer, or 0 on error. 230 * in the buffer, or 0 on error.
231 */ 231 */
232unsigned int 232unsigned int
233GNUNET_STRINGS_buffer_tokenize(const char *buffer, 233GNUNET_STRINGS_buffer_tokenize (const char *buffer,
234 size_t size, 234 size_t size,
235 unsigned int count, ...); 235 unsigned int count, ...);
236 236
237 237
238 238
@@ -247,7 +247,7 @@ GNUNET_STRINGS_buffer_tokenize(const char *buffer,
247 * @return timestamp in human-readable form in local time 247 * @return timestamp in human-readable form in local time
248 */ 248 */
249const char * 249const char *
250GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t); 250GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t);
251 251
252 252
253/** 253/**
@@ -261,8 +261,8 @@ GNUNET_STRINGS_absolute_time_to_string(struct GNUNET_TIME_Absolute t);
261 * @return string in human-readable form 261 * @return string in human-readable form
262 */ 262 */
263const char * 263const char *
264GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, 264GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta,
265 int do_round); 265 int do_round);
266 266
267 267
268/** 268/**
@@ -277,7 +277,7 @@ GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta,
277 * itself. 277 * itself.
278 */ 278 */
279const char * 279const char *
280GNUNET_STRINGS_get_short_name(const char *filename); 280GNUNET_STRINGS_get_short_name (const char *filename);
281 281
282 282
283/** 283/**
@@ -293,10 +293,10 @@ GNUNET_STRINGS_get_short_name(const char *filename);
293 * @return pointer to the next byte in 'out' or NULL on error. 293 * @return pointer to the next byte in 'out' or NULL on error.
294 */ 294 */
295char * 295char *
296GNUNET_STRINGS_data_to_string(const void *data, 296GNUNET_STRINGS_data_to_string (const void *data,
297 size_t size, 297 size_t size,
298 char *out, 298 char *out,
299 size_t out_size); 299 size_t out_size);
300 300
301 301
302/** 302/**
@@ -310,8 +310,8 @@ GNUNET_STRINGS_data_to_string(const void *data,
310 * @return freshly allocated, null-terminated string 310 * @return freshly allocated, null-terminated string
311 */ 311 */
312char * 312char *
313GNUNET_STRINGS_data_to_string_alloc(const void *buf, 313GNUNET_STRINGS_data_to_string_alloc (const void *buf,
314 size_t size); 314 size_t size);
315 315
316 316
317/** 317/**
@@ -325,10 +325,10 @@ GNUNET_STRINGS_data_to_string_alloc(const void *buf,
325 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding 325 * @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong encoding
326 */ 326 */
327int 327int
328GNUNET_STRINGS_string_to_data(const char *enc, 328GNUNET_STRINGS_string_to_data (const char *enc,
329 size_t enclen, 329 size_t enclen,
330 void *out, 330 void *out,
331 size_t out_size); 331 size_t out_size);
332 332
333 333
334/** 334/**
@@ -341,9 +341,9 @@ GNUNET_STRINGS_string_to_data(const char *enc,
341 * @return the size of the output 341 * @return the size of the output
342 */ 342 */
343size_t 343size_t
344GNUNET_STRINGS_base64_encode(const void *in, 344GNUNET_STRINGS_base64_encode (const void *in,
345 size_t len, 345 size_t len,
346 char **output); 346 char **output);
347 347
348 348
349/** 349/**
@@ -356,9 +356,9 @@ GNUNET_STRINGS_base64_encode(const void *in,
356 * @return the size of the output 356 * @return the size of the output
357 */ 357 */
358size_t 358size_t
359GNUNET_STRINGS_base64_decode(const char *data, 359GNUNET_STRINGS_base64_decode (const char *data,
360 size_t len, 360 size_t len,
361 void **output); 361 void **output);
362 362
363 363
364/** 364/**
@@ -369,8 +369,8 @@ GNUNET_STRINGS_base64_decode(const char *data,
369 * @return string representing the array of @a pids 369 * @return string representing the array of @a pids
370 */ 370 */
371char * 371char *
372GNUNET_STRINGS_pp2s(const struct GNUNET_PeerIdentity *pids, 372GNUNET_STRINGS_pp2s (const struct GNUNET_PeerIdentity *pids,
373 unsigned int num_pids); 373 unsigned int num_pids);
374 374
375 375
376/** 376/**
@@ -390,9 +390,9 @@ GNUNET_STRINGS_pp2s(const struct GNUNET_PeerIdentity *pids,
390 * (if they weren't NULL). 390 * (if they weren't NULL).
391 */ 391 */
392int 392int
393GNUNET_STRINGS_parse_uri(const char *path, 393GNUNET_STRINGS_parse_uri (const char *path,
394 char **scheme_part, 394 char **scheme_part,
395 const char **path_part); 395 const char **path_part);
396 396
397 397
398/** 398/**
@@ -410,16 +410,17 @@ GNUNET_STRINGS_parse_uri(const char *path,
410 * @return #GNUNET_YES if 'filename' is absolute, #GNUNET_NO otherwise. 410 * @return #GNUNET_YES if 'filename' is absolute, #GNUNET_NO otherwise.
411 */ 411 */
412int 412int
413GNUNET_STRINGS_path_is_absolute(const char *filename, 413GNUNET_STRINGS_path_is_absolute (const char *filename,
414 int can_be_uri, 414 int can_be_uri,
415 int *r_is_uri, 415 int *r_is_uri,
416 char **r_uri_scheme); 416 char **r_uri_scheme);
417 417
418 418
419/** 419/**
420 * Flags for what we should check a file for. 420 * Flags for what we should check a file for.
421 */ 421 */
422enum GNUNET_STRINGS_FilenameCheck { 422enum GNUNET_STRINGS_FilenameCheck
423{
423 /** 424 /**
424 * Check that it exists. 425 * Check that it exists.
425 */ 426 */
@@ -452,8 +453,8 @@ enum GNUNET_STRINGS_FilenameCheck {
452 * fails, #GNUNET_SYSERR when a check can't be performed 453 * fails, #GNUNET_SYSERR when a check can't be performed
453 */ 454 */
454int 455int
455GNUNET_STRINGS_check_filename(const char *filename, 456GNUNET_STRINGS_check_filename (const char *filename,
456 enum GNUNET_STRINGS_FilenameCheck checks); 457 enum GNUNET_STRINGS_FilenameCheck checks);
457 458
458 459
459/** 460/**
@@ -468,9 +469,9 @@ GNUNET_STRINGS_check_filename(const char *filename,
468 * case the contents of r_buf are undefined. 469 * case the contents of r_buf are undefined.
469 */ 470 */
470int 471int
471GNUNET_STRINGS_to_address_ipv6(const char *zt_addr, 472GNUNET_STRINGS_to_address_ipv6 (const char *zt_addr,
472 uint16_t addrlen, 473 uint16_t addrlen,
473 struct sockaddr_in6 *r_buf); 474 struct sockaddr_in6 *r_buf);
474 475
475 476
476/** 477/**
@@ -484,9 +485,9 @@ GNUNET_STRINGS_to_address_ipv6(const char *zt_addr,
484 * the contents of r_buf are undefined. 485 * the contents of r_buf are undefined.
485 */ 486 */
486int 487int
487GNUNET_STRINGS_to_address_ipv4(const char *zt_addr, 488GNUNET_STRINGS_to_address_ipv4 (const char *zt_addr,
488 uint16_t addrlen, 489 uint16_t addrlen,
489 struct sockaddr_in *r_buf); 490 struct sockaddr_in *r_buf);
490 491
491 492
492/** 493/**
@@ -499,9 +500,9 @@ GNUNET_STRINGS_to_address_ipv4(const char *zt_addr,
499 * @return 0 on error, otherwise number of bytes in @a sa 500 * @return 0 on error, otherwise number of bytes in @a sa
500 */ 501 */
501size_t 502size_t
502GNUNET_STRINGS_parse_socket_addr(const char *addr, 503GNUNET_STRINGS_parse_socket_addr (const char *addr,
503 uint8_t *af, 504 uint8_t *af,
504 struct sockaddr **sa); 505 struct sockaddr **sa);
505 506
506 507
507/** 508/**
@@ -516,9 +517,9 @@ GNUNET_STRINGS_parse_socket_addr(const char *addr,
516 * case the contents of r_buf are undefined. 517 * case the contents of r_buf are undefined.
517 */ 518 */
518int 519int
519GNUNET_STRINGS_to_address_ip(const char *addr, 520GNUNET_STRINGS_to_address_ip (const char *addr,
520 uint16_t addrlen, 521 uint16_t addrlen,
521 struct sockaddr_storage *r_buf); 522 struct sockaddr_storage *r_buf);
522 523
523 524
524/** 525/**
@@ -534,10 +535,10 @@ GNUNET_STRINGS_to_address_ip(const char *addr,
534 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure 535 * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure
535 */ 536 */
536int 537int
537GNUNET_STRINGS_get_utf8_args(int argc, 538GNUNET_STRINGS_get_utf8_args (int argc,
538 char *const *argv, 539 char *const *argv,
539 int *u8argc, 540 int *u8argc,
540 char *const **u8argv); 541 char *const **u8argv);
541 542
542 543
543/** 544/**
@@ -556,12 +557,13 @@ GNUNET_STRINGS_get_utf8_args(int argc,
556 * null byte 557 * null byte
557 */ 558 */
558size_t 559size_t
559GNUNET_strlcpy(char *dst, const char *src, size_t n); 560GNUNET_strlcpy (char *dst, const char *src, size_t n);
560 561
561 562
562/* ***************** IPv4/IPv6 parsing ****************** */ 563/* ***************** IPv4/IPv6 parsing ****************** */
563 564
564struct GNUNET_STRINGS_PortPolicy { 565struct GNUNET_STRINGS_PortPolicy
566{
565 /** 567 /**
566 * Starting port range (0 if none given). 568 * Starting port range (0 if none given).
567 */ 569 */
@@ -583,7 +585,8 @@ struct GNUNET_STRINGS_PortPolicy {
583/** 585/**
584 * @brief IPV4 network in CIDR notation. 586 * @brief IPV4 network in CIDR notation.
585 */ 587 */
586struct GNUNET_STRINGS_IPv4NetworkPolicy { 588struct GNUNET_STRINGS_IPv4NetworkPolicy
589{
587 /** 590 /**
588 * IPv4 address. 591 * IPv4 address.
589 */ 592 */
@@ -604,7 +607,8 @@ struct GNUNET_STRINGS_IPv4NetworkPolicy {
604/** 607/**
605 * @brief network in CIDR notation for IPV6. 608 * @brief network in CIDR notation for IPV6.
606 */ 609 */
607struct GNUNET_STRINGS_IPv6NetworkPolicy { 610struct GNUNET_STRINGS_IPv6NetworkPolicy
611{
608 /** 612 /**
609 * IPv6 address. 613 * IPv6 address.
610 */ 614 */
@@ -634,7 +638,7 @@ struct GNUNET_STRINGS_IPv6NetworkPolicy {
634 * NULL if the synatx is flawed 638 * NULL if the synatx is flawed
635 */ 639 */
636struct GNUNET_STRINGS_IPv4NetworkPolicy * 640struct GNUNET_STRINGS_IPv4NetworkPolicy *
637GNUNET_STRINGS_parse_ipv4_policy(const char *routeListX); 641GNUNET_STRINGS_parse_ipv4_policy (const char *routeListX);
638 642
639 643
640/** 644/**
@@ -649,7 +653,7 @@ GNUNET_STRINGS_parse_ipv4_policy(const char *routeListX);
649 * @return the converted list, 0-terminated, NULL if the synatx is flawed 653 * @return the converted list, 0-terminated, NULL if the synatx is flawed
650 */ 654 */
651struct GNUNET_STRINGS_IPv6NetworkPolicy * 655struct GNUNET_STRINGS_IPv6NetworkPolicy *
652GNUNET_STRINGS_parse_ipv6_policy(const char *routeListX); 656GNUNET_STRINGS_parse_ipv6_policy (const char *routeListX);
653 657
654 658
655#if 0 /* keep Emacsens' auto-indent happy */ 659#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_testbed_logger_service.h b/src/include/gnunet_testbed_logger_service.h
index 5d820e20b..72b5ab364 100644
--- a/src/include/gnunet_testbed_logger_service.h
+++ b/src/include/gnunet_testbed_logger_service.h
@@ -56,7 +56,7 @@ struct GNUNET_TESTBED_LOGGER_Handle;
56 * upon any error 56 * upon any error
57 */ 57 */
58struct GNUNET_TESTBED_LOGGER_Handle * 58struct GNUNET_TESTBED_LOGGER_Handle *
59GNUNET_TESTBED_LOGGER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 59GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
60 60
61 61
62/** 62/**
@@ -65,7 +65,7 @@ GNUNET_TESTBED_LOGGER_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
65 * @param h the logger handle 65 * @param h the logger handle
66 */ 66 */
67void 67void
68GNUNET_TESTBED_LOGGER_disconnect(struct GNUNET_TESTBED_LOGGER_Handle *h); 68GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h);
69 69
70 70
71/** 71/**
@@ -90,9 +90,9 @@ typedef void
90 * @param size how many bytes of @a data to send 90 * @param size how many bytes of @a data to send
91 */ 91 */
92void 92void
93GNUNET_TESTBED_LOGGER_write(struct GNUNET_TESTBED_LOGGER_Handle *h, 93GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h,
94 const void *data, 94 const void *data,
95 size_t size); 95 size_t size);
96 96
97 97
98/** 98/**
@@ -103,9 +103,9 @@ GNUNET_TESTBED_LOGGER_write(struct GNUNET_TESTBED_LOGGER_Handle *h,
103 * @param cb_cls the closure for @a cb 103 * @param cb_cls the closure for @a cb
104 */ 104 */
105void 105void
106GNUNET_TESTBED_LOGGER_flush(struct GNUNET_TESTBED_LOGGER_Handle *h, 106GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h,
107 GNUNET_TESTBED_LOGGER_FlushCompletion cb, 107 GNUNET_TESTBED_LOGGER_FlushCompletion cb,
108 void *cb_cls); 108 void *cb_cls);
109 109
110 110
111/** 111/**
@@ -116,7 +116,7 @@ GNUNET_TESTBED_LOGGER_flush(struct GNUNET_TESTBED_LOGGER_Handle *h,
116 * @param h the logger handle 116 * @param h the logger handle
117 */ 117 */
118void 118void
119GNUNET_TESTBED_LOGGER_flush_cancel(struct GNUNET_TESTBED_LOGGER_Handle *h); 119GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h);
120 120
121 121
122#if 0 /* keep Emacsens' auto-indent happy */ 122#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index 5acf885dc..d45f5bc34 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -89,10 +89,10 @@ struct GNUNET_TESTBED_Controller;
89 * @return handle to the host, NULL on error 89 * @return handle to the host, NULL on error
90 */ 90 */
91struct GNUNET_TESTBED_Host * 91struct GNUNET_TESTBED_Host *
92GNUNET_TESTBED_host_create(const char *hostname, 92GNUNET_TESTBED_host_create (const char *hostname,
93 const char *username, 93 const char *username,
94 const struct GNUNET_CONFIGURATION_Handle *cfg, 94 const struct GNUNET_CONFIGURATION_Handle *cfg,
95 uint16_t port); 95 uint16_t port);
96 96
97 97
98 98
@@ -112,12 +112,12 @@ GNUNET_TESTBED_host_create(const char *hostname,
112 * @return handle to the host, NULL on error 112 * @return handle to the host, NULL on error
113 */ 113 */
114struct GNUNET_TESTBED_Host * 114struct GNUNET_TESTBED_Host *
115GNUNET_TESTBED_host_create_with_id(uint32_t id, 115GNUNET_TESTBED_host_create_with_id (uint32_t id,
116 const char *hostname, 116 const char *hostname,
117 const char *username, 117 const char *username,
118 const struct GNUNET_CONFIGURATION_Handle 118 const struct GNUNET_CONFIGURATION_Handle
119 *cfg, 119 *cfg,
120 uint16_t port); 120 uint16_t port);
121 121
122 122
123/** 123/**
@@ -133,10 +133,10 @@ GNUNET_TESTBED_host_create_with_id(uint32_t id,
133 * @return number of hosts returned in 'hosts', 0 on error 133 * @return number of hosts returned in 'hosts', 0 on error
134 */ 134 */
135unsigned int 135unsigned int
136GNUNET_TESTBED_hosts_load_from_file(const char *filename, 136GNUNET_TESTBED_hosts_load_from_file (const char *filename,
137 const struct GNUNET_CONFIGURATION_Handle 137 const struct GNUNET_CONFIGURATION_Handle
138 *cfg, 138 *cfg,
139 struct GNUNET_TESTBED_Host ***hosts); 139 struct GNUNET_TESTBED_Host ***hosts);
140 140
141 141
142/** 142/**
@@ -152,10 +152,10 @@ GNUNET_TESTBED_hosts_load_from_file(const char *filename,
152 * @return number of hosts returned in 'hosts', 0 on error 152 * @return number of hosts returned in 'hosts', 0 on error
153 */ 153 */
154unsigned int 154unsigned int
155GNUNET_TESTBED_hosts_load_from_loadleveler(const struct 155GNUNET_TESTBED_hosts_load_from_loadleveler (const struct
156 GNUNET_CONFIGURATION_Handle *cfg, 156 GNUNET_CONFIGURATION_Handle *cfg,
157 struct GNUNET_TESTBED_Host 157 struct GNUNET_TESTBED_Host
158 ***hosts); 158 ***hosts);
159 159
160/** 160/**
161 * Destroy a host handle. Must only be called once everything 161 * Destroy a host handle. Must only be called once everything
@@ -164,7 +164,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler(const struct
164 * @param host handle to destroy 164 * @param host handle to destroy
165 */ 165 */
166void 166void
167GNUNET_TESTBED_host_destroy(struct GNUNET_TESTBED_Host *host); 167GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host);
168 168
169 169
170/** 170/**
@@ -201,11 +201,11 @@ typedef void
201 * GNUNET_TESTBED_is_host_habitable_cancel() 201 * GNUNET_TESTBED_is_host_habitable_cancel()
202 */ 202 */
203struct GNUNET_TESTBED_HostHabitableCheckHandle * 203struct GNUNET_TESTBED_HostHabitableCheckHandle *
204GNUNET_TESTBED_is_host_habitable(const struct GNUNET_TESTBED_Host *host, 204GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
205 const struct GNUNET_CONFIGURATION_Handle 205 const struct GNUNET_CONFIGURATION_Handle
206 *config, 206 *config,
207 GNUNET_TESTBED_HostHabitableCallback cb, 207 GNUNET_TESTBED_HostHabitableCallback cb,
208 void *cb_cls); 208 void *cb_cls);
209 209
210 210
211/** 211/**
@@ -214,9 +214,9 @@ GNUNET_TESTBED_is_host_habitable(const struct GNUNET_TESTBED_Host *host,
214 * @param handle the habitability check handle 214 * @param handle the habitability check handle
215 */ 215 */
216void 216void
217GNUNET_TESTBED_is_host_habitable_cancel(struct 217GNUNET_TESTBED_is_host_habitable_cancel (struct
218 GNUNET_TESTBED_HostHabitableCheckHandle 218 GNUNET_TESTBED_HostHabitableCheckHandle
219 *handle); 219 *handle);
220 220
221/** 221/**
222 * Obtain the host's hostname. 222 * Obtain the host's hostname.
@@ -225,14 +225,15 @@ GNUNET_TESTBED_is_host_habitable_cancel(struct
225 * @return hostname of the host 225 * @return hostname of the host
226 */ 226 */
227const char * 227const char *
228GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host); 228GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host);
229 229
230 230
231/** 231/**
232 * Enumeration with (at most 64) possible event types that 232 * Enumeration with (at most 64) possible event types that
233 * can be monitored using the testbed framework. 233 * can be monitored using the testbed framework.
234 */ 234 */
235enum GNUNET_TESTBED_EventType { 235enum GNUNET_TESTBED_EventType
236{
236 /** 237 /**
237 * A peer has been started. 238 * A peer has been started.
238 */ 239 */
@@ -263,7 +264,8 @@ enum GNUNET_TESTBED_EventType {
263/** 264/**
264 * Types of information that can be requested about a peer. 265 * Types of information that can be requested about a peer.
265 */ 266 */
266enum GNUNET_TESTBED_PeerInformationType { 267enum GNUNET_TESTBED_PeerInformationType
268{
267 /** 269 /**
268 * Special value (not valid for requesting information) 270 * Special value (not valid for requesting information)
269 * that is used in the event struct if a 'generic' pointer 271 * that is used in the event struct if a 'generic' pointer
@@ -294,7 +296,8 @@ enum GNUNET_TESTBED_PeerInformationType {
294 * Argument to GNUNET_TESTBED_ControllerCallback with details about 296 * Argument to GNUNET_TESTBED_ControllerCallback with details about
295 * the event. 297 * the event.
296 */ 298 */
297struct GNUNET_TESTBED_EventInformation { 299struct GNUNET_TESTBED_EventInformation
300{
298 /** 301 /**
299 * Type of the event. 302 * Type of the event.
300 */ 303 */
@@ -313,11 +316,13 @@ struct GNUNET_TESTBED_EventInformation {
313 /** 316 /**
314 * Details about the event. 317 * Details about the event.
315 */ 318 */
316 union { 319 union
320 {
317 /** 321 /**
318 * Details about peer start event. 322 * Details about peer start event.
319 */ 323 */
320 struct { 324 struct
325 {
321 /** 326 /**
322 * Handle for the host where the peer 327 * Handle for the host where the peer
323 * was started. 328 * was started.
@@ -333,7 +338,8 @@ struct GNUNET_TESTBED_EventInformation {
333 /** 338 /**
334 * Details about peer stop event. 339 * Details about peer stop event.
335 */ 340 */
336 struct { 341 struct
342 {
337 /** 343 /**
338 * Handle for the peer that was started. 344 * Handle for the peer that was started.
339 */ 345 */
@@ -343,7 +349,8 @@ struct GNUNET_TESTBED_EventInformation {
343 /** 349 /**
344 * Details about connect event. 350 * Details about connect event.
345 */ 351 */
346 struct { 352 struct
353 {
347 /** 354 /**
348 * Handle for one of the connected peers. 355 * Handle for one of the connected peers.
349 */ 356 */
@@ -358,7 +365,8 @@ struct GNUNET_TESTBED_EventInformation {
358 /** 365 /**
359 * Details about disconnect event. 366 * Details about disconnect event.
360 */ 367 */
361 struct { 368 struct
369 {
362 /** 370 /**
363 * Handle for one of the disconnected peers. 371 * Handle for one of the disconnected peers.
364 */ 372 */
@@ -373,7 +381,8 @@ struct GNUNET_TESTBED_EventInformation {
373 /** 381 /**
374 * Details about an operation finished event. 382 * Details about an operation finished event.
375 */ 383 */
376 struct { 384 struct
385 {
377 /** 386 /**
378 * Error message for the operation, NULL on success. 387 * Error message for the operation, NULL on success.
379 */ 388 */
@@ -398,7 +407,8 @@ struct GNUNET_TESTBED_EventInformation {
398 */ 407 */
399typedef void 408typedef void
400(*GNUNET_TESTBED_ControllerCallback)(void *cls, 409(*GNUNET_TESTBED_ControllerCallback)(void *cls,
401 const struct GNUNET_TESTBED_EventInformation *event); 410 const struct
411 GNUNET_TESTBED_EventInformation *event);
402 412
403 413
404/** 414/**
@@ -418,7 +428,8 @@ struct GNUNET_TESTBED_ControllerProc;
418 */ 428 */
419typedef void 429typedef void
420(*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, 430(*GNUNET_TESTBED_ControllerStatusCallback) (void *cls,
421 const struct GNUNET_CONFIGURATION_Handle *cfg, 431 const struct
432 GNUNET_CONFIGURATION_Handle *cfg,
422 int status); 433 int status);
423 434
424 435
@@ -446,10 +457,10 @@ typedef void
446 * @return the controller process handle, NULL on errors 457 * @return the controller process handle, NULL on errors
447 */ 458 */
448struct GNUNET_TESTBED_ControllerProc * 459struct GNUNET_TESTBED_ControllerProc *
449GNUNET_TESTBED_controller_start(const char *trusted_ip, 460GNUNET_TESTBED_controller_start (const char *trusted_ip,
450 struct GNUNET_TESTBED_Host *host, 461 struct GNUNET_TESTBED_Host *host,
451 GNUNET_TESTBED_ControllerStatusCallback cb, 462 GNUNET_TESTBED_ControllerStatusCallback cb,
452 void *cls); 463 void *cls);
453 464
454 465
455/** 466/**
@@ -461,7 +472,7 @@ GNUNET_TESTBED_controller_start(const char *trusted_ip,
461 * @param cproc the controller process handle 472 * @param cproc the controller process handle
462 */ 473 */
463void 474void
464GNUNET_TESTBED_controller_stop(struct GNUNET_TESTBED_ControllerProc *cproc); 475GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc);
465 476
466 477
467/** 478/**
@@ -481,10 +492,10 @@ GNUNET_TESTBED_controller_stop(struct GNUNET_TESTBED_ControllerProc *cproc);
481 * @return handle to the controller 492 * @return handle to the controller
482 */ 493 */
483struct GNUNET_TESTBED_Controller * 494struct GNUNET_TESTBED_Controller *
484GNUNET_TESTBED_controller_connect(struct GNUNET_TESTBED_Host *host, 495GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
485 uint64_t event_mask, 496 uint64_t event_mask,
486 GNUNET_TESTBED_ControllerCallback cc, 497 GNUNET_TESTBED_ControllerCallback cc,
487 void *cc_cls); 498 void *cc_cls);
488 499
489 500
490/** 501/**
@@ -495,7 +506,7 @@ GNUNET_TESTBED_controller_connect(struct GNUNET_TESTBED_Host *host,
495 * @param c handle to controller to stop 506 * @param c handle to controller to stop
496 */ 507 */
497void 508void
498GNUNET_TESTBED_controller_disconnect(struct GNUNET_TESTBED_Controller *c); 509GNUNET_TESTBED_controller_disconnect (struct GNUNET_TESTBED_Controller *c);
499 510
500 511
501/** 512/**
@@ -511,8 +522,8 @@ struct GNUNET_TESTBED_HostRegistrationHandle;
511 * @param emsg the error message; NULL if host registration is successful 522 * @param emsg the error message; NULL if host registration is successful
512 */ 523 */
513typedef void 524typedef void
514(* GNUNET_TESTBED_HostRegistrationCompletion) (void *cls, 525(*GNUNET_TESTBED_HostRegistrationCompletion) (void *cls,
515 const char *emsg); 526 const char *emsg);
516 527
517 528
518/** 529/**
@@ -531,10 +542,10 @@ typedef void
531 * is not cancelled 542 * is not cancelled
532 */ 543 */
533struct GNUNET_TESTBED_HostRegistrationHandle * 544struct GNUNET_TESTBED_HostRegistrationHandle *
534GNUNET_TESTBED_register_host(struct GNUNET_TESTBED_Controller *controller, 545GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller,
535 struct GNUNET_TESTBED_Host *host, 546 struct GNUNET_TESTBED_Host *host,
536 GNUNET_TESTBED_HostRegistrationCompletion cc, 547 GNUNET_TESTBED_HostRegistrationCompletion cc,
537 void *cc_cls); 548 void *cc_cls);
538 549
539 550
540/** 551/**
@@ -547,8 +558,8 @@ GNUNET_TESTBED_register_host(struct GNUNET_TESTBED_Controller *controller,
547 * @param handle the registration handle to cancel 558 * @param handle the registration handle to cancel
548 */ 559 */
549void 560void
550GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle 561GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle
551 *handle); 562 *handle);
552 563
553 564
554/** 565/**
@@ -561,7 +572,8 @@ GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle
561 */ 572 */
562typedef void 573typedef void
563(*GNUNET_TESTBED_OperationCompletionCallback) (void *cls, 574(*GNUNET_TESTBED_OperationCompletionCallback) (void *cls,
564 struct GNUNET_TESTBED_Operation *op, 575 struct GNUNET_TESTBED_Operation *
576 op,
565 const char *emsg); 577 const char *emsg);
566 578
567 579
@@ -594,11 +606,11 @@ typedef void
594 * @return the operation handle 606 * @return the operation handle
595 */ 607 */
596struct GNUNET_TESTBED_Operation * 608struct GNUNET_TESTBED_Operation *
597GNUNET_TESTBED_controller_link(void *op_cls, 609GNUNET_TESTBED_controller_link (void *op_cls,
598 struct GNUNET_TESTBED_Controller *master, 610 struct GNUNET_TESTBED_Controller *master,
599 struct GNUNET_TESTBED_Host *delegated_host, 611 struct GNUNET_TESTBED_Host *delegated_host,
600 struct GNUNET_TESTBED_Host *slave_host, 612 struct GNUNET_TESTBED_Host *slave_host,
601 int is_subordinate); 613 int is_subordinate);
602 614
603 615
604/** 616/**
@@ -617,9 +629,9 @@ GNUNET_TESTBED_controller_link(void *op_cls,
617 * master 629 * master
618 */ 630 */
619struct GNUNET_TESTBED_Operation * 631struct GNUNET_TESTBED_Operation *
620GNUNET_TESTBED_get_slave_config(void *op_cls, 632GNUNET_TESTBED_get_slave_config (void *op_cls,
621 struct GNUNET_TESTBED_Controller *master, 633 struct GNUNET_TESTBED_Controller *master,
622 struct GNUNET_TESTBED_Host *slave_host); 634 struct GNUNET_TESTBED_Host *slave_host);
623 635
624 636
625/** 637/**
@@ -667,11 +679,11 @@ typedef void
667 * @return the operation handle 679 * @return the operation handle
668 */ 680 */
669struct GNUNET_TESTBED_Operation * 681struct GNUNET_TESTBED_Operation *
670GNUNET_TESTBED_peer_create(struct GNUNET_TESTBED_Controller *controller, 682GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller,
671 struct GNUNET_TESTBED_Host *host, 683 struct GNUNET_TESTBED_Host *host,
672 const struct GNUNET_CONFIGURATION_Handle *cfg, 684 const struct GNUNET_CONFIGURATION_Handle *cfg,
673 GNUNET_TESTBED_PeerCreateCallback cb, 685 GNUNET_TESTBED_PeerCreateCallback cb,
674 void *cls); 686 void *cls);
675 687
676 688
677/** 689/**
@@ -697,10 +709,10 @@ typedef void
697 * @return handle to the operation 709 * @return handle to the operation
698 */ 710 */
699struct GNUNET_TESTBED_Operation * 711struct GNUNET_TESTBED_Operation *
700GNUNET_TESTBED_peer_start(void *op_cls, 712GNUNET_TESTBED_peer_start (void *op_cls,
701 struct GNUNET_TESTBED_Peer *peer, 713 struct GNUNET_TESTBED_Peer *peer,
702 GNUNET_TESTBED_PeerChurnCallback pcc, 714 GNUNET_TESTBED_PeerChurnCallback pcc,
703 void *pcc_cls); 715 void *pcc_cls);
704 716
705 717
706/** 718/**
@@ -716,16 +728,17 @@ GNUNET_TESTBED_peer_start(void *op_cls,
716 * @return handle to the operation 728 * @return handle to the operation
717 */ 729 */
718struct GNUNET_TESTBED_Operation * 730struct GNUNET_TESTBED_Operation *
719GNUNET_TESTBED_peer_stop(void *op_cls, 731GNUNET_TESTBED_peer_stop (void *op_cls,
720 struct GNUNET_TESTBED_Peer *peer, 732 struct GNUNET_TESTBED_Peer *peer,
721 GNUNET_TESTBED_PeerChurnCallback pcc, 733 GNUNET_TESTBED_PeerChurnCallback pcc,
722 void *pcc_cls); 734 void *pcc_cls);
723 735
724 736
725/** 737/**
726 * Data returned from GNUNET_TESTBED_peer_get_information 738 * Data returned from GNUNET_TESTBED_peer_get_information
727 */ 739 */
728struct GNUNET_TESTBED_PeerInformation { 740struct GNUNET_TESTBED_PeerInformation
741{
729 /** 742 /**
730 * Peer information type; captures which of the types 743 * Peer information type; captures which of the types
731 * in the 'op_result' is actually in use. 744 * in the 'op_result' is actually in use.
@@ -735,7 +748,8 @@ struct GNUNET_TESTBED_PeerInformation {
735 /** 748 /**
736 * The result of the get information operation; Choose according to the pit 749 * The result of the get information operation; Choose according to the pit
737 */ 750 */
738 union { 751 union
752 {
739 /** 753 /**
740 * The configuration of the peer 754 * The configuration of the peer
741 */ 755 */
@@ -762,7 +776,8 @@ struct GNUNET_TESTBED_PeerInformation {
762typedef void 776typedef void
763(*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls, 777(*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls,
764 struct GNUNET_TESTBED_Operation *op, 778 struct GNUNET_TESTBED_Operation *op,
765 const struct GNUNET_TESTBED_PeerInformation *pinfo, 779 const struct
780 GNUNET_TESTBED_PeerInformation *pinfo,
766 const char *emsg); 781 const char *emsg);
767 782
768 783
@@ -781,11 +796,11 @@ typedef void
781 * @return handle to the operation 796 * @return handle to the operation
782 */ 797 */
783struct GNUNET_TESTBED_Operation * 798struct GNUNET_TESTBED_Operation *
784GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer, 799GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer,
785 enum GNUNET_TESTBED_PeerInformationType 800 enum GNUNET_TESTBED_PeerInformationType
786 pit, 801 pit,
787 GNUNET_TESTBED_PeerInfoCallback cb, 802 GNUNET_TESTBED_PeerInfoCallback cb,
788 void *cb_cls); 803 void *cb_cls);
789 804
790 805
791/** 806/**
@@ -797,8 +812,9 @@ GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer,
797 * @return handle to the operation 812 * @return handle to the operation
798 */ 813 */
799struct GNUNET_TESTBED_Operation * 814struct GNUNET_TESTBED_Operation *
800GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer, 815GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer,
801 const struct GNUNET_CONFIGURATION_Handle *cfg); 816 const struct
817 GNUNET_CONFIGURATION_Handle *cfg);
802 818
803 819
804/** 820/**
@@ -809,7 +825,7 @@ GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer,
809 * @return handle to the operation 825 * @return handle to the operation
810 */ 826 */
811struct GNUNET_TESTBED_Operation * 827struct GNUNET_TESTBED_Operation *
812GNUNET_TESTBED_peer_destroy(struct GNUNET_TESTBED_Peer *peer); 828GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer);
813 829
814 830
815/** 831/**
@@ -828,12 +844,13 @@ GNUNET_TESTBED_peer_destroy(struct GNUNET_TESTBED_Peer *peer);
828 * @return an operation handle; NULL upon error (peer not running) 844 * @return an operation handle; NULL upon error (peer not running)
829 */ 845 */
830struct GNUNET_TESTBED_Operation * 846struct GNUNET_TESTBED_Operation *
831GNUNET_TESTBED_peer_manage_service(void *op_cls, 847GNUNET_TESTBED_peer_manage_service (void *op_cls,
832 struct GNUNET_TESTBED_Peer *peer, 848 struct GNUNET_TESTBED_Peer *peer,
833 const char *service_name, 849 const char *service_name,
834 GNUNET_TESTBED_OperationCompletionCallback cb, 850 GNUNET_TESTBED_OperationCompletionCallback
835 void *cb_cls, 851 cb,
836 unsigned int start); 852 void *cb_cls,
853 unsigned int start);
837 854
838 855
839/** 856/**
@@ -852,17 +869,18 @@ GNUNET_TESTBED_peer_manage_service(void *op_cls,
852 * present 869 * present
853 */ 870 */
854struct GNUNET_TESTBED_Operation * 871struct GNUNET_TESTBED_Operation *
855GNUNET_TESTBED_shutdown_peers(struct GNUNET_TESTBED_Controller *c, 872GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c,
856 void *op_cls, 873 void *op_cls,
857 GNUNET_TESTBED_OperationCompletionCallback cb, 874 GNUNET_TESTBED_OperationCompletionCallback cb,
858 void *cb_cls); 875 void *cb_cls);
859 876
860 877
861 878
862/** 879/**
863 * Options for peer connections. 880 * Options for peer connections.
864 */ 881 */
865enum GNUNET_TESTBED_ConnectOption { 882enum GNUNET_TESTBED_ConnectOption
883{
866 /** 884 /**
867 * No option (not valid as an argument). 885 * No option (not valid as an argument).
868 */ 886 */
@@ -898,11 +916,11 @@ enum GNUNET_TESTBED_ConnectOption {
898 * time is not allowed 916 * time is not allowed
899 */ 917 */
900struct GNUNET_TESTBED_Operation * 918struct GNUNET_TESTBED_Operation *
901GNUNET_TESTBED_underlay_configure_link_va(void *op_cls, 919GNUNET_TESTBED_underlay_configure_link_va (void *op_cls,
902 struct GNUNET_TESTBED_Peer *p1, 920 struct GNUNET_TESTBED_Peer *p1,
903 struct GNUNET_TESTBED_Peer *p2, 921 struct GNUNET_TESTBED_Peer *p2,
904 enum GNUNET_TESTBED_ConnectOption co, 922 enum GNUNET_TESTBED_ConnectOption co,
905 va_list ap); 923 va_list ap);
906 924
907 925
908/** 926/**
@@ -918,10 +936,11 @@ GNUNET_TESTBED_underlay_configure_link_va(void *op_cls,
918 * time is not allowed 936 * time is not allowed
919 */ 937 */
920struct GNUNET_TESTBED_Operation * 938struct GNUNET_TESTBED_Operation *
921GNUNET_TESTBED_underlay_configure_link(void *op_cls, 939GNUNET_TESTBED_underlay_configure_link (void *op_cls,
922 struct GNUNET_TESTBED_Peer *p1, 940 struct GNUNET_TESTBED_Peer *p1,
923 struct GNUNET_TESTBED_Peer *p2, 941 struct GNUNET_TESTBED_Peer *p2,
924 enum GNUNET_TESTBED_ConnectOption co, ...); 942 enum GNUNET_TESTBED_ConnectOption co,
943 ...);
925 944
926 945
927 946
@@ -929,7 +948,8 @@ GNUNET_TESTBED_underlay_configure_link(void *op_cls,
929 * Topologies and topology options supported for testbeds. Options should always 948 * Topologies and topology options supported for testbeds. Options should always
930 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END 949 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END
931 */ 950 */
932enum GNUNET_TESTBED_TopologyOption { 951enum GNUNET_TESTBED_TopologyOption
952{
933 /** 953 /**
934 * A clique (everyone connected to everyone else). No options. If there are N 954 * A clique (everyone connected to everyone else). No options. If there are N
935 * peers this topology results in (N * (N -1)) connections. 955 * peers this topology results in (N * (N -1)) connections.
@@ -1036,11 +1056,14 @@ enum GNUNET_TESTBED_TopologyOption {
1036 * is not allowed at this time 1056 * is not allowed at this time
1037 */ 1057 */
1038struct GNUNET_TESTBED_Operation * 1058struct GNUNET_TESTBED_Operation *
1039GNUNET_TESTBED_underlay_configure_topology_va(void *op_cls, 1059GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls,
1040 unsigned int num_peers, 1060 unsigned int num_peers,
1041 struct GNUNET_TESTBED_Peer **peers, 1061 struct GNUNET_TESTBED_Peer **
1042 enum GNUNET_TESTBED_TopologyOption topo, 1062 peers,
1043 va_list ap); 1063 enum
1064 GNUNET_TESTBED_TopologyOption
1065 topo,
1066 va_list ap);
1044 1067
1045 1068
1046/** 1069/**
@@ -1055,11 +1078,12 @@ GNUNET_TESTBED_underlay_configure_topology_va(void *op_cls,
1055 * is not allowed at this time 1078 * is not allowed at this time
1056 */ 1079 */
1057struct GNUNET_TESTBED_Operation * 1080struct GNUNET_TESTBED_Operation *
1058GNUNET_TESTBED_underlay_configure_topology(void *op_cls, 1081GNUNET_TESTBED_underlay_configure_topology (void *op_cls,
1059 unsigned int num_peers, 1082 unsigned int num_peers,
1060 struct GNUNET_TESTBED_Peer **peers, 1083 struct GNUNET_TESTBED_Peer **peers,
1061 enum GNUNET_TESTBED_TopologyOption topo, 1084 enum GNUNET_TESTBED_TopologyOption
1062 ...); 1085 topo,
1086 ...);
1063 1087
1064 1088
1065/** 1089/**
@@ -1077,11 +1101,11 @@ GNUNET_TESTBED_underlay_configure_topology(void *op_cls,
1077 * not running or underlay disallows) 1101 * not running or underlay disallows)
1078 */ 1102 */
1079struct GNUNET_TESTBED_Operation * 1103struct GNUNET_TESTBED_Operation *
1080GNUNET_TESTBED_overlay_connect(void *op_cls, 1104GNUNET_TESTBED_overlay_connect (void *op_cls,
1081 GNUNET_TESTBED_OperationCompletionCallback cb, 1105 GNUNET_TESTBED_OperationCompletionCallback cb,
1082 void *cb_cls, 1106 void *cb_cls,
1083 struct GNUNET_TESTBED_Peer *p1, 1107 struct GNUNET_TESTBED_Peer *p1,
1084 struct GNUNET_TESTBED_Peer *p2); 1108 struct GNUNET_TESTBED_Peer *p2);
1085 1109
1086 1110
1087/** 1111/**
@@ -1094,8 +1118,10 @@ GNUNET_TESTBED_overlay_connect(void *op_cls,
1094 * @param nfailures the number of overlay connects which failed 1118 * @param nfailures the number of overlay connects which failed
1095 */ 1119 */
1096typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls, 1120typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls,
1097 unsigned int nsuccess, 1121 unsigned int
1098 unsigned int nfailures); 1122 nsuccess,
1123 unsigned int
1124 nfailures);
1099 1125
1100 1126
1101/** 1127/**
@@ -1119,15 +1145,16 @@ typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls,
1119 * not running or underlay disallows) or if num_peers is less than 2 1145 * not running or underlay disallows) or if num_peers is less than 2
1120 */ 1146 */
1121struct GNUNET_TESTBED_Operation * 1147struct GNUNET_TESTBED_Operation *
1122GNUNET_TESTBED_overlay_configure_topology_va(void *op_cls, 1148GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
1123 unsigned int num_peers, 1149 unsigned int num_peers,
1124 struct GNUNET_TESTBED_Peer **peers, 1150 struct GNUNET_TESTBED_Peer **peers,
1125 unsigned int *max_connections, 1151 unsigned int *max_connections,
1126 GNUNET_TESTBED_TopologyCompletionCallback 1152 GNUNET_TESTBED_TopologyCompletionCallback
1127 comp_cb, 1153 comp_cb,
1128 void *comp_cb_cls, 1154 void *comp_cb_cls,
1129 enum GNUNET_TESTBED_TopologyOption topo, 1155 enum GNUNET_TESTBED_TopologyOption
1130 va_list va); 1156 topo,
1157 va_list va);
1131 1158
1132 1159
1133/** 1160/**
@@ -1151,15 +1178,16 @@ GNUNET_TESTBED_overlay_configure_topology_va(void *op_cls,
1151 * not running or underlay disallows) or if num_peers is less than 2 1178 * not running or underlay disallows) or if num_peers is less than 2
1152 */ 1179 */
1153struct GNUNET_TESTBED_Operation * 1180struct GNUNET_TESTBED_Operation *
1154GNUNET_TESTBED_overlay_configure_topology(void *op_cls, 1181GNUNET_TESTBED_overlay_configure_topology (void *op_cls,
1155 unsigned int num_peers, 1182 unsigned int num_peers,
1156 struct GNUNET_TESTBED_Peer **peers, 1183 struct GNUNET_TESTBED_Peer **peers,
1157 unsigned int *max_connections, 1184 unsigned int *max_connections,
1158 GNUNET_TESTBED_TopologyCompletionCallback 1185 GNUNET_TESTBED_TopologyCompletionCallback
1159 comp_cb, 1186 comp_cb,
1160 void *comp_cb_cls, 1187 void *comp_cb_cls,
1161 enum GNUNET_TESTBED_TopologyOption topo, 1188 enum GNUNET_TESTBED_TopologyOption
1162 ...); 1189 topo,
1190 ...);
1163 1191
1164 1192
1165/** 1193/**
@@ -1173,8 +1201,10 @@ GNUNET_TESTBED_overlay_configure_topology(void *op_cls,
1173 * be written to. 1201 * be written to.
1174 */ 1202 */
1175void 1203void
1176GNUNET_TESTBED_overlay_write_topology_to_file(struct GNUNET_TESTBED_Controller *controller, 1204GNUNET_TESTBED_overlay_write_topology_to_file (struct
1177 const char *filename); 1205 GNUNET_TESTBED_Controller *
1206 controller,
1207 const char *filename);
1178 1208
1179 1209
1180/** 1210/**
@@ -1215,7 +1245,8 @@ typedef void
1215 */ 1245 */
1216typedef void 1246typedef void
1217(*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls, 1247(*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls,
1218 struct GNUNET_TESTBED_Operation *op, 1248 struct
1249 GNUNET_TESTBED_Operation *op,
1219 void *ca_result, 1250 void *ca_result,
1220 const char *emsg); 1251 const char *emsg);
1221 1252
@@ -1243,14 +1274,15 @@ typedef void
1243 * @return handle for the operation 1274 * @return handle for the operation
1244 */ 1275 */
1245struct GNUNET_TESTBED_Operation * 1276struct GNUNET_TESTBED_Operation *
1246GNUNET_TESTBED_service_connect(void *op_cls, 1277GNUNET_TESTBED_service_connect (void *op_cls,
1247 struct GNUNET_TESTBED_Peer *peer, 1278 struct GNUNET_TESTBED_Peer *peer,
1248 const char *service_name, 1279 const char *service_name,
1249 GNUNET_TESTBED_ServiceConnectCompletionCallback cb, 1280 GNUNET_TESTBED_ServiceConnectCompletionCallback
1250 void *cb_cls, 1281 cb,
1251 GNUNET_TESTBED_ConnectAdapter ca, 1282 void *cb_cls,
1252 GNUNET_TESTBED_DisconnectAdapter da, 1283 GNUNET_TESTBED_ConnectAdapter ca,
1253 void *cada_cls); 1284 GNUNET_TESTBED_DisconnectAdapter da,
1285 void *cada_cls);
1254 1286
1255 1287
1256/** 1288/**
@@ -1275,7 +1307,7 @@ GNUNET_TESTBED_service_connect(void *op_cls,
1275 * @param operation operation to signal completion or cancellation 1307 * @param operation operation to signal completion or cancellation
1276 */ 1308 */
1277void 1309void
1278GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation); 1310GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation);
1279 1311
1280 1312
1281/** 1313/**
@@ -1314,12 +1346,12 @@ typedef int
1314 * @return operation handle to cancel the operation 1346 * @return operation handle to cancel the operation
1315 */ 1347 */
1316struct GNUNET_TESTBED_Operation * 1348struct GNUNET_TESTBED_Operation *
1317GNUNET_TESTBED_get_statistics(unsigned int num_peers, 1349GNUNET_TESTBED_get_statistics (unsigned int num_peers,
1318 struct GNUNET_TESTBED_Peer **peers, 1350 struct GNUNET_TESTBED_Peer **peers,
1319 const char *subsystem, const char *name, 1351 const char *subsystem, const char *name,
1320 GNUNET_TESTBED_StatisticsIterator proc, 1352 GNUNET_TESTBED_StatisticsIterator proc,
1321 GNUNET_TESTBED_OperationCompletionCallback cont, 1353 GNUNET_TESTBED_OperationCompletionCallback cont,
1322 void *cls); 1354 void *cls);
1323 1355
1324 1356
1325/** 1357/**
@@ -1331,7 +1363,7 @@ GNUNET_TESTBED_get_statistics(unsigned int num_peers,
1331 * @return The peer's unique ID. 1363 * @return The peer's unique ID.
1332 */ 1364 */
1333uint32_t 1365uint32_t
1334GNUNET_TESTBED_get_index(const struct GNUNET_TESTBED_Peer *peer); 1366GNUNET_TESTBED_get_index (const struct GNUNET_TESTBED_Peer *peer);
1335 1367
1336 1368
1337/** 1369/**
@@ -1397,14 +1429,14 @@ typedef void
1397 * @param test_master_cls closure for 'test_master'. 1429 * @param test_master_cls closure for 'test_master'.
1398 */ 1430 */
1399void 1431void
1400GNUNET_TESTBED_run(const char *host_filename, 1432GNUNET_TESTBED_run (const char *host_filename,
1401 const struct GNUNET_CONFIGURATION_Handle *cfg, 1433 const struct GNUNET_CONFIGURATION_Handle *cfg,
1402 unsigned int num_peers, 1434 unsigned int num_peers,
1403 uint64_t event_mask, 1435 uint64_t event_mask,
1404 GNUNET_TESTBED_ControllerCallback cc, 1436 GNUNET_TESTBED_ControllerCallback cc,
1405 void *cc_cls, 1437 void *cc_cls,
1406 GNUNET_TESTBED_TestMaster test_master, 1438 GNUNET_TESTBED_TestMaster test_master,
1407 void *test_master_cls); 1439 void *test_master_cls);
1408 1440
1409 1441
1410/** 1442/**
@@ -1446,14 +1478,14 @@ GNUNET_TESTBED_run(const char *host_filename,
1446 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1478 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1447 */ 1479 */
1448int 1480int
1449GNUNET_TESTBED_test_run(const char *testname, 1481GNUNET_TESTBED_test_run (const char *testname,
1450 const char *cfg_filename, 1482 const char *cfg_filename,
1451 unsigned int num_peers, 1483 unsigned int num_peers,
1452 uint64_t event_mask, 1484 uint64_t event_mask,
1453 GNUNET_TESTBED_ControllerCallback cc, 1485 GNUNET_TESTBED_ControllerCallback cc,
1454 void *cc_cls, 1486 void *cc_cls,
1455 GNUNET_TESTBED_TestMaster test_master, 1487 GNUNET_TESTBED_TestMaster test_master,
1456 void *test_master_cls); 1488 void *test_master_cls);
1457 1489
1458 1490
1459/** 1491/**
@@ -1464,7 +1496,7 @@ GNUNET_TESTBED_test_run(const char *testname,
1464 * @return handle to the master controller 1496 * @return handle to the master controller
1465 */ 1497 */
1466struct GNUNET_TESTBED_Controller * 1498struct GNUNET_TESTBED_Controller *
1467GNUNET_TESTBED_run_get_controller_handle(struct GNUNET_TESTBED_RunHandle *h); 1499GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h);
1468 1500
1469 1501
1470/** 1502/**
@@ -1476,7 +1508,8 @@ struct GNUNET_TESTBED_Barrier;
1476/** 1508/**
1477 * Status of a barrier 1509 * Status of a barrier
1478 */ 1510 */
1479enum GNUNET_TESTBED_BarrierStatus { 1511enum GNUNET_TESTBED_BarrierStatus
1512{
1480 /** 1513 /**
1481 * Barrier initialised successfully 1514 * Barrier initialised successfully
1482 */ 1515 */
@@ -1532,11 +1565,11 @@ typedef void
1532 * @return barrier handle 1565 * @return barrier handle
1533 */ 1566 */
1534struct GNUNET_TESTBED_Barrier * 1567struct GNUNET_TESTBED_Barrier *
1535GNUNET_TESTBED_barrier_init(struct GNUNET_TESTBED_Controller *controller, 1568GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller,
1536 const char *name, 1569 const char *name,
1537 unsigned int quorum, 1570 unsigned int quorum,
1538 GNUNET_TESTBED_barrier_status_cb cb, 1571 GNUNET_TESTBED_barrier_status_cb cb,
1539 void *cb_cls); 1572 void *cb_cls);
1540 1573
1541 1574
1542/** 1575/**
@@ -1545,7 +1578,7 @@ GNUNET_TESTBED_barrier_init(struct GNUNET_TESTBED_Controller *controller,
1545 * @param barrier the barrier handle 1578 * @param barrier the barrier handle
1546 */ 1579 */
1547void 1580void
1548GNUNET_TESTBED_barrier_cancel(struct GNUNET_TESTBED_Barrier *barrier); 1581GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier);
1549 1582
1550 1583
1551/** 1584/**
@@ -1582,9 +1615,9 @@ typedef void
1582 * anytime before the callback is called. NULL upon error. 1615 * anytime before the callback is called. NULL upon error.
1583 */ 1616 */
1584struct GNUNET_TESTBED_BarrierWaitHandle * 1617struct GNUNET_TESTBED_BarrierWaitHandle *
1585GNUNET_TESTBED_barrier_wait(const char *name, 1618GNUNET_TESTBED_barrier_wait (const char *name,
1586 GNUNET_TESTBED_barrier_wait_cb cb, 1619 GNUNET_TESTBED_barrier_wait_cb cb,
1587 void *cls); 1620 void *cls);
1588 1621
1589 1622
1590/** 1623/**
@@ -1594,7 +1627,7 @@ GNUNET_TESTBED_barrier_wait(const char *name,
1594 * @param h the barrier wait handle 1627 * @param h the barrier wait handle
1595 */ 1628 */
1596void 1629void
1597GNUNET_TESTBED_barrier_wait_cancel(struct GNUNET_TESTBED_BarrierWaitHandle *h); 1630GNUNET_TESTBED_barrier_wait_cancel (struct GNUNET_TESTBED_BarrierWaitHandle *h);
1598 1631
1599 1632
1600/** 1633/**
@@ -1608,7 +1641,8 @@ struct GNUNET_TESTBED_UnderlayLinkModel;
1608 * The type of GNUNET_TESTBED_UnderlayLinkModel 1641 * The type of GNUNET_TESTBED_UnderlayLinkModel
1609 * @ingroup underlay 1642 * @ingroup underlay
1610 */ 1643 */
1611enum GNUNET_TESTBED_UnderlayLinkModelType { 1644enum GNUNET_TESTBED_UnderlayLinkModelType
1645{
1612 /** 1646 /**
1613 * The model is based on white listing of peers to which underlay connections 1647 * The model is based on white listing of peers to which underlay connections
1614 * are permitted. Underlay connections to all other peers will not be 1648 * are permitted. Underlay connections to all other peers will not be
@@ -1635,8 +1669,10 @@ enum GNUNET_TESTBED_UnderlayLinkModelType {
1635 * @return the model 1669 * @return the model
1636 */ 1670 */
1637struct GNUNET_TESTBED_UnderlayLinkModel * 1671struct GNUNET_TESTBED_UnderlayLinkModel *
1638GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer, 1672GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer,
1639 enum GNUNET_TESTBED_UnderlayLinkModelType type); 1673 enum
1674 GNUNET_TESTBED_UnderlayLinkModelType
1675 type);
1640 1676
1641 1677
1642/** 1678/**
@@ -1649,8 +1685,10 @@ GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer,
1649 * @param peer the peer to add 1685 * @param peer the peer to add
1650 */ 1686 */
1651void 1687void
1652GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model, 1688GNUNET_TESTBED_underlaylinkmodel_add_peer (struct
1653 struct GNUNET_TESTBED_Peer *peer); 1689 GNUNET_TESTBED_UnderlayLinkModel *
1690 model,
1691 struct GNUNET_TESTBED_Peer *peer);
1654 1692
1655 1693
1656/** 1694/**
@@ -1665,11 +1703,13 @@ GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkMode
1665 * @param bandwidth bandwidth of the link in kilobytes per second [kB/s] 1703 * @param bandwidth bandwidth of the link in kilobytes per second [kB/s]
1666 */ 1704 */
1667void 1705void
1668GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkModel *model, 1706GNUNET_TESTBED_underlaylinkmodel_set_link (struct
1669 struct GNUNET_TESTBED_Peer *peer, 1707 GNUNET_TESTBED_UnderlayLinkModel *
1670 uint32_t latency, 1708 model,
1671 uint32_t loss, 1709 struct GNUNET_TESTBED_Peer *peer,
1672 uint32_t bandwidth); 1710 uint32_t latency,
1711 uint32_t loss,
1712 uint32_t bandwidth);
1673 1713
1674 1714
1675/** 1715/**
@@ -1679,7 +1719,8 @@ GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkMode
1679 * @param model the model to commit 1719 * @param model the model to commit
1680 */ 1720 */
1681void 1721void
1682GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model); 1722GNUNET_TESTBED_underlaylinkmodel_commit (struct
1723 GNUNET_TESTBED_UnderlayLinkModel *model);
1683 1724
1684 1725
1685/** 1726/**
@@ -1691,7 +1732,8 @@ GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel
1691 * @param model the model to unallocate 1732 * @param model the model to unallocate
1692 */ 1733 */
1693void 1734void
1694GNUNET_TESTBED_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model); 1735GNUNET_TESTBED_underlaylinkmodel_free (struct
1736 GNUNET_TESTBED_UnderlayLinkModel *model);
1695 1737
1696 1738
1697#if 0 /* keep Emacsens' auto-indent happy */ 1739#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 370360eb1..3c3ef8f2e 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -56,7 +56,8 @@ extern "C"
56/** 56/**
57 * Size of each hostkey in the hostkey file (in BYTES). 57 * Size of each hostkey in the hostkey file (in BYTES).
58 */ 58 */
59#define GNUNET_TESTING_HOSTKEYFILESIZE sizeof(struct GNUNET_CRYPTO_EddsaPrivateKey) 59#define GNUNET_TESTING_HOSTKEYFILESIZE sizeof(struct \
60 GNUNET_CRYPTO_EddsaPrivateKey)
60 61
61/** 62/**
62 * The environmental variable, if set, that dictates where testing should place 63 * The environmental variable, if set, that dictates where testing should place
@@ -81,7 +82,8 @@ struct GNUNET_TESTING_Peer;
81/** 82/**
82 * Specification of a service that is to be shared among peers 83 * Specification of a service that is to be shared among peers
83 */ 84 */
84struct GNUNET_TESTING_SharedService { 85struct GNUNET_TESTING_SharedService
86{
85 /** 87 /**
86 * The name of the service. 88 * The name of the service.
87 */ 89 */
@@ -121,11 +123,11 @@ struct GNUNET_TESTING_SharedService {
121 * @return handle to this system, NULL on error 123 * @return handle to this system, NULL on error
122 */ 124 */
123struct GNUNET_TESTING_System * 125struct GNUNET_TESTING_System *
124GNUNET_TESTING_system_create(const char *testdir, 126GNUNET_TESTING_system_create (const char *testdir,
125 const char *trusted_ip, 127 const char *trusted_ip,
126 const char *hostname, 128 const char *hostname,
127 const struct GNUNET_TESTING_SharedService * 129 const struct GNUNET_TESTING_SharedService *
128 shared_services); 130 shared_services);
129 131
130 132
131/** 133/**
@@ -153,12 +155,14 @@ GNUNET_TESTING_system_create(const char *testdir,
153 * @return handle to this system, NULL on error 155 * @return handle to this system, NULL on error
154 */ 156 */
155struct GNUNET_TESTING_System * 157struct GNUNET_TESTING_System *
156GNUNET_TESTING_system_create_with_portrange(const char *testdir, 158GNUNET_TESTING_system_create_with_portrange (const char *testdir,
157 const char *trusted_ip, 159 const char *trusted_ip,
158 const char *hostname, 160 const char *hostname,
159 const struct GNUNET_TESTING_SharedService *shared_services, 161 const struct
160 uint16_t lowport, 162 GNUNET_TESTING_SharedService *
161 uint16_t highport); 163 shared_services,
164 uint16_t lowport,
165 uint16_t highport);
162 166
163 167
164/** 168/**
@@ -169,8 +173,8 @@ GNUNET_TESTING_system_create_with_portrange(const char *testdir,
169 * be removed (clean up on shutdown)? 173 * be removed (clean up on shutdown)?
170 */ 174 */
171void 175void
172GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system, 176GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system,
173 int remove_paths); 177 int remove_paths);
174 178
175 179
176/** 180/**
@@ -191,9 +195,9 @@ GNUNET_TESTING_system_destroy(struct GNUNET_TESTING_System *system,
191 * @return NULL on error (not enough keys) 195 * @return NULL on error (not enough keys)
192 */ 196 */
193struct GNUNET_CRYPTO_EddsaPrivateKey * 197struct GNUNET_CRYPTO_EddsaPrivateKey *
194GNUNET_TESTING_hostkey_get(const struct GNUNET_TESTING_System *system, 198GNUNET_TESTING_hostkey_get (const struct GNUNET_TESTING_System *system,
195 uint32_t key_number, 199 uint32_t key_number,
196 struct GNUNET_PeerIdentity *id); 200 struct GNUNET_PeerIdentity *id);
197 201
198 202
199/** 203/**
@@ -203,7 +207,7 @@ GNUNET_TESTING_hostkey_get(const struct GNUNET_TESTING_System *system,
203 * @return 0 if no free port was available 207 * @return 0 if no free port was available
204 */ 208 */
205uint16_t 209uint16_t
206GNUNET_TESTING_reserve_port(struct GNUNET_TESTING_System *system); 210GNUNET_TESTING_reserve_port (struct GNUNET_TESTING_System *system);
207 211
208 212
209/** 213/**
@@ -214,8 +218,8 @@ GNUNET_TESTING_reserve_port(struct GNUNET_TESTING_System *system);
214 * @param port reserved port to release 218 * @param port reserved port to release
215 */ 219 */
216void 220void
217GNUNET_TESTING_release_port(struct GNUNET_TESTING_System *system, 221GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
218 uint16_t port); 222 uint16_t port);
219 223
220 224
221/** 225/**
@@ -236,8 +240,8 @@ GNUNET_TESTING_release_port(struct GNUNET_TESTING_System *system,
236 * be incomplete and should not be used there upon 240 * be incomplete and should not be used there upon
237 */ 241 */
238int 242int
239GNUNET_TESTING_configuration_create(struct GNUNET_TESTING_System *system, 243GNUNET_TESTING_configuration_create (struct GNUNET_TESTING_System *system,
240 struct GNUNET_CONFIGURATION_Handle *cfg); 244 struct GNUNET_CONFIGURATION_Handle *cfg);
241// FIXME: add dual to 'release' ports again... 245// FIXME: add dual to 'release' ports again...
242 246
243 247
@@ -255,11 +259,11 @@ GNUNET_TESTING_configuration_create(struct GNUNET_TESTING_System *system,
255 * @return handle to the peer, NULL on error 259 * @return handle to the peer, NULL on error
256 */ 260 */
257struct GNUNET_TESTING_Peer * 261struct GNUNET_TESTING_Peer *
258GNUNET_TESTING_peer_configure(struct GNUNET_TESTING_System *system, 262GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
259 struct GNUNET_CONFIGURATION_Handle *cfg, 263 struct GNUNET_CONFIGURATION_Handle *cfg,
260 uint32_t key_number, 264 uint32_t key_number,
261 struct GNUNET_PeerIdentity *id, 265 struct GNUNET_PeerIdentity *id,
262 char **emsg); 266 char **emsg);
263 267
264 268
265/** 269/**
@@ -269,8 +273,8 @@ GNUNET_TESTING_peer_configure(struct GNUNET_TESTING_System *system,
269 * @param id identifier for the daemon, will be set 273 * @param id identifier for the daemon, will be set
270 */ 274 */
271void 275void
272GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer, 276GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer,
273 struct GNUNET_PeerIdentity *id); 277 struct GNUNET_PeerIdentity *id);
274 278
275 279
276/** 280/**
@@ -281,7 +285,7 @@ GNUNET_TESTING_peer_get_identity(struct GNUNET_TESTING_Peer *peer,
281 * #GNUNET_SYSERR on error (i.e. peer already running) 285 * #GNUNET_SYSERR on error (i.e. peer already running)
282 */ 286 */
283int 287int
284GNUNET_TESTING_peer_start(struct GNUNET_TESTING_Peer *peer); 288GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer);
285 289
286 290
287/** 291/**
@@ -294,7 +298,7 @@ GNUNET_TESTING_peer_start(struct GNUNET_TESTING_Peer *peer);
294 * #GNUNET_SYSERR on error (i.e. peer not running) 298 * #GNUNET_SYSERR on error (i.e. peer not running)
295 */ 299 */
296int 300int
297GNUNET_TESTING_peer_stop(struct GNUNET_TESTING_Peer *peer); 301GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer);
298 302
299 303
300/** 304/**
@@ -305,7 +309,7 @@ GNUNET_TESTING_peer_stop(struct GNUNET_TESTING_Peer *peer);
305 * @param peer peer to destroy 309 * @param peer peer to destroy
306 */ 310 */
307void 311void
308GNUNET_TESTING_peer_destroy(struct GNUNET_TESTING_Peer *peer); 312GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer);
309 313
310 314
311/** 315/**
@@ -316,7 +320,7 @@ GNUNET_TESTING_peer_destroy(struct GNUNET_TESTING_Peer *peer);
316 * or upon any error while sending SIGTERM 320 * or upon any error while sending SIGTERM
317 */ 321 */
318int 322int
319GNUNET_TESTING_peer_kill(struct GNUNET_TESTING_Peer *peer); 323GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer);
320 324
321 325
322/** 326/**
@@ -327,7 +331,7 @@ GNUNET_TESTING_peer_kill(struct GNUNET_TESTING_Peer *peer);
327 * or upon any error while waiting 331 * or upon any error while waiting
328 */ 332 */
329int 333int
330GNUNET_TESTING_peer_wait(struct GNUNET_TESTING_Peer *peer); 334GNUNET_TESTING_peer_wait (struct GNUNET_TESTING_Peer *peer);
331 335
332 336
333/** 337/**
@@ -356,9 +360,9 @@ typedef void
356 * upon any error. 360 * upon any error.
357 */ 361 */
358int 362int
359GNUNET_TESTING_peer_stop_async(struct GNUNET_TESTING_Peer *peer, 363GNUNET_TESTING_peer_stop_async (struct GNUNET_TESTING_Peer *peer,
360 GNUNET_TESTING_PeerStopCallback cb, 364 GNUNET_TESTING_PeerStopCallback cb,
361 void *cb_cls); 365 void *cb_cls);
362 366
363 367
364/** 368/**
@@ -371,7 +375,7 @@ GNUNET_TESTING_peer_stop_async(struct GNUNET_TESTING_Peer *peer,
371 * before. 375 * before.
372 */ 376 */
373void 377void
374GNUNET_TESTING_peer_stop_async_cancel(struct GNUNET_TESTING_Peer *peer); 378GNUNET_TESTING_peer_stop_async_cancel (struct GNUNET_TESTING_Peer *peer);
375 379
376 380
377/** 381/**
@@ -405,10 +409,10 @@ typedef void
405 * @return 0 on success, 1 on error 409 * @return 0 on success, 1 on error
406 */ 410 */
407int 411int
408GNUNET_TESTING_peer_run(const char *testdir, 412GNUNET_TESTING_peer_run (const char *testdir,
409 const char *cfgfilename, 413 const char *cfgfilename,
410 GNUNET_TESTING_TestMain tm, 414 GNUNET_TESTING_TestMain tm,
411 void *tm_cls); 415 void *tm_cls);
412 416
413 417
414/** 418/**
@@ -433,11 +437,11 @@ GNUNET_TESTING_peer_run(const char *testdir,
433 * @return 0 on success, 1 on error 437 * @return 0 on success, 1 on error
434 */ 438 */
435int 439int
436GNUNET_TESTING_service_run(const char *testdir, 440GNUNET_TESTING_service_run (const char *testdir,
437 const char *service_name, 441 const char *service_name,
438 const char *cfgfilename, 442 const char *cfgfilename,
439 GNUNET_TESTING_TestMain tm, 443 GNUNET_TESTING_TestMain tm,
440 void *tm_cls); 444 void *tm_cls);
441 445
442 446
443/** 447/**
@@ -454,7 +458,7 @@ GNUNET_TESTING_service_run(const char *testdir,
454 * NULL if argv0 has no '_' 458 * NULL if argv0 has no '_'
455 */ 459 */
456char * 460char *
457GNUNET_TESTING_get_testname_from_underscore(const char *argv0); 461GNUNET_TESTING_get_testname_from_underscore (const char *argv0);
458 462
459 463
460#if 0 /* keep Emacsens' auto-indent happy */ 464#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h
index 28a76e3ef..fd6010f5d 100644
--- a/src/include/gnunet_time_lib.h
+++ b/src/include/gnunet_time_lib.h
@@ -45,7 +45,8 @@ extern "C"
45/** 45/**
46 * Time for absolute times used by GNUnet, in microseconds. 46 * Time for absolute times used by GNUnet, in microseconds.
47 */ 47 */
48struct GNUNET_TIME_Absolute { 48struct GNUNET_TIME_Absolute
49{
49 /** 50 /**
50 * The actual value. 51 * The actual value.
51 */ 52 */
@@ -56,7 +57,8 @@ struct GNUNET_TIME_Absolute {
56 * Time for relative time used by GNUnet, in microseconds. 57 * Time for relative time used by GNUnet, in microseconds.
57 * Always positive, so we can only refer to future time. 58 * Always positive, so we can only refer to future time.
58 */ 59 */
59struct GNUNET_TIME_Relative { 60struct GNUNET_TIME_Relative
61{
60 /** 62 /**
61 * The actual value. 63 * The actual value.
62 */ 64 */
@@ -68,7 +70,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
68/** 70/**
69 * Time for relative time used by GNUnet, in microseconds and in network byte order. 71 * Time for relative time used by GNUnet, in microseconds and in network byte order.
70 */ 72 */
71struct GNUNET_TIME_RelativeNBO { 73struct GNUNET_TIME_RelativeNBO
74{
72 /** 75 /**
73 * The actual value (in network byte order). 76 * The actual value (in network byte order).
74 */ 77 */
@@ -79,7 +82,8 @@ struct GNUNET_TIME_RelativeNBO {
79/** 82/**
80 * Time for absolute time used by GNUnet, in microseconds and in network byte order. 83 * Time for absolute time used by GNUnet, in microseconds and in network byte order.
81 */ 84 */
82struct GNUNET_TIME_AbsoluteNBO { 85struct GNUNET_TIME_AbsoluteNBO
86{
83 /** 87 /**
84 * The actual value (in network byte order). 88 * The actual value (in network byte order).
85 */ 89 */
@@ -90,76 +94,81 @@ GNUNET_NETWORK_STRUCT_END
90/** 94/**
91 * Relative time zero. 95 * Relative time zero.
92 */ 96 */
93#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero_() 97#define GNUNET_TIME_UNIT_ZERO GNUNET_TIME_relative_get_zero_ ()
94 98
95/** 99/**
96 * Absolute time zero. 100 * Absolute time zero.
97 */ 101 */
98#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_() 102#define GNUNET_TIME_UNIT_ZERO_ABS GNUNET_TIME_absolute_get_zero_ ()
99 103
100/** 104/**
101 * One microsecond, our basic time unit. 105 * One microsecond, our basic time unit.
102 */ 106 */
103#define GNUNET_TIME_UNIT_MICROSECONDS GNUNET_TIME_relative_get_unit_() 107#define GNUNET_TIME_UNIT_MICROSECONDS GNUNET_TIME_relative_get_unit_ ()
104 108
105/** 109/**
106 * One millisecond. 110 * One millisecond.
107 */ 111 */
108#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_millisecond_() 112#define GNUNET_TIME_UNIT_MILLISECONDS GNUNET_TIME_relative_get_millisecond_ ()
109 113
110/** 114/**
111 * One second. 115 * One second.
112 */ 116 */
113#define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_get_second_() 117#define GNUNET_TIME_UNIT_SECONDS GNUNET_TIME_relative_get_second_ ()
114 118
115/** 119/**
116 * One minute. 120 * One minute.
117 */ 121 */
118#define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_get_minute_() 122#define GNUNET_TIME_UNIT_MINUTES GNUNET_TIME_relative_get_minute_ ()
119 123
120/** 124/**
121 * One hour. 125 * One hour.
122 */ 126 */
123#define GNUNET_TIME_UNIT_HOURS GNUNET_TIME_relative_get_hour_() 127#define GNUNET_TIME_UNIT_HOURS GNUNET_TIME_relative_get_hour_ ()
124 128
125/** 129/**
126 * One day. 130 * One day.
127 */ 131 */
128#define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_HOURS, 24) 132#define GNUNET_TIME_UNIT_DAYS GNUNET_TIME_relative_multiply ( \
133 GNUNET_TIME_UNIT_HOURS, 24)
129 134
130/** 135/**
131 * One week. 136 * One week.
132 */ 137 */
133#define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 7) 138#define GNUNET_TIME_UNIT_WEEKS GNUNET_TIME_relative_multiply ( \
139 GNUNET_TIME_UNIT_DAYS, 7)
134 140
135/** 141/**
136 * One month (30 days). 142 * One month (30 days).
137 */ 143 */
138#define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 30) 144#define GNUNET_TIME_UNIT_MONTHS GNUNET_TIME_relative_multiply ( \
145 GNUNET_TIME_UNIT_DAYS, 30)
139 146
140/** 147/**
141 * One year (365 days). 148 * One year (365 days).
142 */ 149 */
143#define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_DAYS, 365) 150#define GNUNET_TIME_UNIT_YEARS GNUNET_TIME_relative_multiply ( \
151 GNUNET_TIME_UNIT_DAYS, 365)
144 152
145/** 153/**
146 * Constant used to specify "forever". This constant 154 * Constant used to specify "forever". This constant
147 * will be treated specially in all time operations. 155 * will be treated specially in all time operations.
148 */ 156 */
149#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_() 157#define GNUNET_TIME_UNIT_FOREVER_REL GNUNET_TIME_relative_get_forever_ ()
150 158
151/** 159/**
152 * Constant used to specify "forever". This constant 160 * Constant used to specify "forever". This constant
153 * will be treated specially in all time operations. 161 * will be treated specially in all time operations.
154 */ 162 */
155#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_() 163#define GNUNET_TIME_UNIT_FOREVER_ABS GNUNET_TIME_absolute_get_forever_ ()
156 164
157 165
158 166
159/** 167/**
160 * Threshold after which exponential backoff should not increase (15 m). 168 * Threshold after which exponential backoff should not increase (15 m).
161 */ 169 */
162#define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 15) 170#define GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD \
171 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15)
163 172
164 173
165/** 174/**
@@ -168,8 +177,10 @@ GNUNET_NETWORK_STRUCT_END
168 * 177 *
169 * @param r current backoff time, initially zero 178 * @param r current backoff time, initially zero
170 */ 179 */
171#define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min(GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \ 180#define GNUNET_TIME_STD_BACKOFF(r) GNUNET_TIME_relative_min ( \
172 GNUNET_TIME_relative_multiply(GNUNET_TIME_relative_max(GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2)); 181 GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD, \
182 GNUNET_TIME_relative_multiply ( \
183 GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS, (r)), 2));
173 184
174 185
175/** 186/**
@@ -182,7 +193,8 @@ GNUNET_NETWORK_STRUCT_END
182 * @return the next backoff time 193 * @return the next backoff time
183 */ 194 */
184struct GNUNET_TIME_Relative 195struct GNUNET_TIME_Relative
185GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIME_Relative threshold); 196GNUNET_TIME_randomized_backoff (struct GNUNET_TIME_Relative rt, struct
197 GNUNET_TIME_Relative threshold);
186 198
187 199
188/** 200/**
@@ -192,70 +204,70 @@ GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIM
192 * @return randomized time 204 * @return randomized time
193 */ 205 */
194struct GNUNET_TIME_Relative 206struct GNUNET_TIME_Relative
195GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r); 207GNUNET_TIME_randomize (struct GNUNET_TIME_Relative r);
196 208
197 209
198/** 210/**
199 * Return relative time of 0ms. 211 * Return relative time of 0ms.
200 */ 212 */
201struct GNUNET_TIME_Relative 213struct GNUNET_TIME_Relative
202GNUNET_TIME_relative_get_zero_(void); 214GNUNET_TIME_relative_get_zero_ (void);
203 215
204 216
205/** 217/**
206 * Return absolute time of 0ms. 218 * Return absolute time of 0ms.
207 */ 219 */
208struct GNUNET_TIME_Absolute 220struct GNUNET_TIME_Absolute
209GNUNET_TIME_absolute_get_zero_(void); 221GNUNET_TIME_absolute_get_zero_ (void);
210 222
211 223
212/** 224/**
213 * Return relative time of 1 microsecond. 225 * Return relative time of 1 microsecond.
214 */ 226 */
215struct GNUNET_TIME_Relative 227struct GNUNET_TIME_Relative
216GNUNET_TIME_relative_get_unit_(void); 228GNUNET_TIME_relative_get_unit_ (void);
217 229
218 230
219/** 231/**
220 * Return relative time of 1ms. 232 * Return relative time of 1ms.
221 */ 233 */
222struct GNUNET_TIME_Relative 234struct GNUNET_TIME_Relative
223GNUNET_TIME_relative_get_millisecond_(void); 235GNUNET_TIME_relative_get_millisecond_ (void);
224 236
225 237
226/** 238/**
227 * Return relative time of 1s. 239 * Return relative time of 1s.
228 */ 240 */
229struct GNUNET_TIME_Relative 241struct GNUNET_TIME_Relative
230GNUNET_TIME_relative_get_second_(void); 242GNUNET_TIME_relative_get_second_ (void);
231 243
232 244
233/** 245/**
234 * Return relative time of 1 minute. 246 * Return relative time of 1 minute.
235 */ 247 */
236struct GNUNET_TIME_Relative 248struct GNUNET_TIME_Relative
237GNUNET_TIME_relative_get_minute_(void); 249GNUNET_TIME_relative_get_minute_ (void);
238 250
239 251
240/** 252/**
241 * Return relative time of 1 hour. 253 * Return relative time of 1 hour.
242 */ 254 */
243struct GNUNET_TIME_Relative 255struct GNUNET_TIME_Relative
244GNUNET_TIME_relative_get_hour_(void); 256GNUNET_TIME_relative_get_hour_ (void);
245 257
246 258
247/** 259/**
248 * Return "forever". 260 * Return "forever".
249 */ 261 */
250struct GNUNET_TIME_Relative 262struct GNUNET_TIME_Relative
251GNUNET_TIME_relative_get_forever_(void); 263GNUNET_TIME_relative_get_forever_ (void);
252 264
253 265
254/** 266/**
255 * Return "forever". 267 * Return "forever".
256 */ 268 */
257struct GNUNET_TIME_Absolute 269struct GNUNET_TIME_Absolute
258GNUNET_TIME_absolute_get_forever_(void); 270GNUNET_TIME_absolute_get_forever_ (void);
259 271
260 272
261/** 273/**
@@ -264,7 +276,7 @@ GNUNET_TIME_absolute_get_forever_(void);
264 * @return the current time 276 * @return the current time
265 */ 277 */
266struct GNUNET_TIME_Absolute 278struct GNUNET_TIME_Absolute
267GNUNET_TIME_absolute_get(void); 279GNUNET_TIME_absolute_get (void);
268 280
269 281
270/** 282/**
@@ -275,7 +287,7 @@ GNUNET_TIME_absolute_get(void);
275 * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) 287 * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow)
276 */ 288 */
277struct GNUNET_TIME_Absolute 289struct GNUNET_TIME_Absolute
278GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel); 290GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel);
279 291
280 292
281/** 293/**
@@ -287,7 +299,7 @@ GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel);
287 * it was just now rounded 299 * it was just now rounded
288 */ 300 */
289int 301int
290GNUNET_TIME_round_abs(struct GNUNET_TIME_Absolute *at); 302GNUNET_TIME_round_abs (struct GNUNET_TIME_Absolute *at);
291 303
292 304
293/** 305/**
@@ -299,7 +311,7 @@ GNUNET_TIME_round_abs(struct GNUNET_TIME_Absolute *at);
299 * it was just now rounded 311 * it was just now rounded
300 */ 312 */
301int 313int
302GNUNET_TIME_round_rel(struct GNUNET_TIME_Relative *rt); 314GNUNET_TIME_round_rel (struct GNUNET_TIME_Relative *rt);
303 315
304 316
305/** 317/**
@@ -310,8 +322,8 @@ GNUNET_TIME_round_rel(struct GNUNET_TIME_Relative *rt);
310 * @return timestamp that is smaller 322 * @return timestamp that is smaller
311 */ 323 */
312struct GNUNET_TIME_Relative 324struct GNUNET_TIME_Relative
313GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, 325GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1,
314 struct GNUNET_TIME_Relative t2); 326 struct GNUNET_TIME_Relative t2);
315 327
316 328
317 329
@@ -323,8 +335,8 @@ GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1,
323 * @return timestamp that is larger 335 * @return timestamp that is larger
324 */ 336 */
325struct GNUNET_TIME_Relative 337struct GNUNET_TIME_Relative
326GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1, 338GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1,
327 struct GNUNET_TIME_Relative t2); 339 struct GNUNET_TIME_Relative t2);
328 340
329 341
330/** 342/**
@@ -335,8 +347,8 @@ GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1,
335 * @return timestamp that is smaller 347 * @return timestamp that is smaller
336 */ 348 */
337struct GNUNET_TIME_Absolute 349struct GNUNET_TIME_Absolute
338GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1, 350GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1,
339 struct GNUNET_TIME_Absolute t2); 351 struct GNUNET_TIME_Absolute t2);
340 352
341 353
342/** 354/**
@@ -347,8 +359,8 @@ GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1,
347 * @return timestamp that is smaller 359 * @return timestamp that is smaller
348 */ 360 */
349struct GNUNET_TIME_Absolute 361struct GNUNET_TIME_Absolute
350GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1, 362GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1,
351 struct GNUNET_TIME_Absolute t2); 363 struct GNUNET_TIME_Absolute t2);
352 364
353 365
354/** 366/**
@@ -359,7 +371,7 @@ GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1,
359 * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. 371 * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER.
360 */ 372 */
361struct GNUNET_TIME_Relative 373struct GNUNET_TIME_Relative
362GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future); 374GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future);
363 375
364 376
365/** 377/**
@@ -373,9 +385,9 @@ GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future);
373 * assuming it continues at the same speed 385 * assuming it continues at the same speed
374 */ 386 */
375struct GNUNET_TIME_Relative 387struct GNUNET_TIME_Relative
376GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start, 388GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start,
377 uint64_t finished, 389 uint64_t finished,
378 uint64_t total); 390 uint64_t total);
379 391
380 392
381/** 393/**
@@ -388,8 +400,8 @@ GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start,
388 * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start 400 * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start
389 */ 401 */
390struct GNUNET_TIME_Relative 402struct GNUNET_TIME_Relative
391GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, 403GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start,
392 struct GNUNET_TIME_Absolute end); 404 struct GNUNET_TIME_Absolute end);
393 405
394 406
395/** 407/**
@@ -400,7 +412,7 @@ GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start,
400 * @return 0 if hence > now, otherwise now-hence. 412 * @return 0 if hence > now, otherwise now-hence.
401 */ 413 */
402struct GNUNET_TIME_Relative 414struct GNUNET_TIME_Relative
403GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence); 415GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence);
404 416
405 417
406/** 418/**
@@ -412,8 +424,8 @@ GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence);
412 * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise 424 * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise
413 */ 425 */
414struct GNUNET_TIME_Absolute 426struct GNUNET_TIME_Absolute
415GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, 427GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start,
416 struct GNUNET_TIME_Relative duration); 428 struct GNUNET_TIME_Relative duration);
417 429
418 430
419/** 431/**
@@ -425,8 +437,8 @@ GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start,
425 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise 437 * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise
426 */ 438 */
427struct GNUNET_TIME_Absolute 439struct GNUNET_TIME_Absolute
428GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start, 440GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start,
429 struct GNUNET_TIME_Relative duration); 441 struct GNUNET_TIME_Relative duration);
430 442
431 443
432/** 444/**
@@ -437,8 +449,8 @@ GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start,
437 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor 449 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
438 */ 450 */
439struct GNUNET_TIME_Relative 451struct GNUNET_TIME_Relative
440GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, 452GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
441 unsigned long long factor); 453 unsigned long long factor);
442 454
443 455
444/** 456/**
@@ -449,8 +461,8 @@ GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel,
449 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor 461 * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor
450 */ 462 */
451struct GNUNET_TIME_Relative 463struct GNUNET_TIME_Relative
452GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel, 464GNUNET_TIME_relative_saturating_multiply (struct GNUNET_TIME_Relative rel,
453 unsigned long long factor); 465 unsigned long long factor);
454 466
455 467
456/** 468/**
@@ -461,8 +473,8 @@ GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel,
461 * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor 473 * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor
462 */ 474 */
463struct GNUNET_TIME_Relative 475struct GNUNET_TIME_Relative
464GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, 476GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel,
465 unsigned long long factor); 477 unsigned long long factor);
466 478
467 479
468/** 480/**
@@ -473,8 +485,8 @@ GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel,
473 * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise 485 * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise
474 */ 486 */
475struct GNUNET_TIME_Relative 487struct GNUNET_TIME_Relative
476GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, 488GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1,
477 struct GNUNET_TIME_Relative a2); 489 struct GNUNET_TIME_Relative a2);
478 490
479 491
480/** 492/**
@@ -485,8 +497,8 @@ GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1,
485 * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise 497 * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise
486 */ 498 */
487struct GNUNET_TIME_Relative 499struct GNUNET_TIME_Relative
488GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, 500GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1,
489 struct GNUNET_TIME_Relative a2); 501 struct GNUNET_TIME_Relative a2);
490 502
491 503
492/** 504/**
@@ -496,7 +508,7 @@ GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1,
496 * @return converted time value 508 * @return converted time value
497 */ 509 */
498struct GNUNET_TIME_RelativeNBO 510struct GNUNET_TIME_RelativeNBO
499GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a); 511GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a);
500 512
501 513
502/** 514/**
@@ -506,7 +518,7 @@ GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a);
506 * @return converted time value 518 * @return converted time value
507 */ 519 */
508struct GNUNET_TIME_Relative 520struct GNUNET_TIME_Relative
509GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a); 521GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a);
510 522
511 523
512/** 524/**
@@ -516,7 +528,7 @@ GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a);
516 * @return converted time value 528 * @return converted time value
517 */ 529 */
518struct GNUNET_TIME_AbsoluteNBO 530struct GNUNET_TIME_AbsoluteNBO
519GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a); 531GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a);
520 532
521 533
522/** 534/**
@@ -526,7 +538,7 @@ GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a);
526 * @return converted time value 538 * @return converted time value
527 */ 539 */
528struct GNUNET_TIME_Absolute 540struct GNUNET_TIME_Absolute
529GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a); 541GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a);
530 542
531 543
532/** 544/**
@@ -535,7 +547,7 @@ GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a);
535 * @param offset the offset to skew the locale time by 547 * @param offset the offset to skew the locale time by
536 */ 548 */
537void 549void
538GNUNET_TIME_set_offset(long long offset); 550GNUNET_TIME_set_offset (long long offset);
539 551
540 552
541/** 553/**
@@ -544,14 +556,14 @@ GNUNET_TIME_set_offset(long long offset);
544 * @return the offset we currently skew the locale time by 556 * @return the offset we currently skew the locale time by
545 */ 557 */
546long long 558long long
547GNUNET_TIME_get_offset(void); 559GNUNET_TIME_get_offset (void);
548 560
549 561
550/** 562/**
551 * Return the current year (i.e. '2011'). 563 * Return the current year (i.e. '2011').
552 */ 564 */
553unsigned int 565unsigned int
554GNUNET_TIME_get_current_year(void); 566GNUNET_TIME_get_current_year (void);
555 567
556 568
557/** 569/**
@@ -561,7 +573,7 @@ GNUNET_TIME_get_current_year(void);
561 * @return absolute time for January 1st of that year. 573 * @return absolute time for January 1st of that year.
562 */ 574 */
563struct GNUNET_TIME_Absolute 575struct GNUNET_TIME_Absolute
564GNUNET_TIME_year_to_time(unsigned int year); 576GNUNET_TIME_year_to_time (unsigned int year);
565 577
566 578
567/** 579/**
@@ -571,7 +583,7 @@ GNUNET_TIME_year_to_time(unsigned int year);
571 * @return year a year (after 1970), 0 on error 583 * @return year a year (after 1970), 0 on error
572 */ 584 */
573unsigned int 585unsigned int
574GNUNET_TIME_time_to_year(struct GNUNET_TIME_Absolute at); 586GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at);
575 587
576 588
577/** 589/**
@@ -599,7 +611,8 @@ struct GNUNET_CONFIGURATION_Handle;
599 * @return monotonically increasing time 611 * @return monotonically increasing time
600 */ 612 */
601struct GNUNET_TIME_Absolute 613struct GNUNET_TIME_Absolute
602GNUNET_TIME_absolute_get_monotonic(const struct GNUNET_CONFIGURATION_Handle *cfg); 614GNUNET_TIME_absolute_get_monotonic (const struct
615 GNUNET_CONFIGURATION_Handle *cfg);
603 616
604 617
605#if 0 /* keep Emacsens' auto-indent happy */ 618#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_application_service.h b/src/include/gnunet_transport_application_service.h
index 2219cf7a7..ea254d242 100644
--- a/src/include/gnunet_transport_application_service.h
+++ b/src/include/gnunet_transport_application_service.h
@@ -50,7 +50,7 @@ struct GNUNET_TRANSPORT_ApplicationHandle;
50 * @return ats application handle, NULL on error 50 * @return ats application handle, NULL on error
51 */ 51 */
52struct GNUNET_TRANSPORT_ApplicationHandle * 52struct GNUNET_TRANSPORT_ApplicationHandle *
53GNUNET_TRANSPORT_application_init( 53GNUNET_TRANSPORT_application_init (
54 const struct GNUNET_CONFIGURATION_Handle *cfg); 54 const struct GNUNET_CONFIGURATION_Handle *cfg);
55 55
56 56
@@ -60,7 +60,7 @@ GNUNET_TRANSPORT_application_init(
60 * @param ch handle to destroy 60 * @param ch handle to destroy
61 */ 61 */
62void 62void
63GNUNET_TRANSPORT_application_done( 63GNUNET_TRANSPORT_application_done (
64 struct GNUNET_TRANSPORT_ApplicationHandle *ch); 64 struct GNUNET_TRANSPORT_ApplicationHandle *ch);
65 65
66 66
@@ -75,7 +75,7 @@ GNUNET_TRANSPORT_application_done(
75 * @return suggest handle, NULL if a request is already pending 75 * @return suggest handle, NULL if a request is already pending
76 */ 76 */
77struct GNUNET_TRANSPORT_ApplicationSuggestHandle * 77struct GNUNET_TRANSPORT_ApplicationSuggestHandle *
78GNUNET_TRANSPORT_application_suggest( 78GNUNET_TRANSPORT_application_suggest (
79 struct GNUNET_TRANSPORT_ApplicationHandle *ch, 79 struct GNUNET_TRANSPORT_ApplicationHandle *ch,
80 const struct GNUNET_PeerIdentity *peer, 80 const struct GNUNET_PeerIdentity *peer,
81 enum GNUNET_MQ_PriorityPreferences pk, 81 enum GNUNET_MQ_PriorityPreferences pk,
@@ -88,7 +88,7 @@ GNUNET_TRANSPORT_application_suggest(
88 * @param sh handle to stop 88 * @param sh handle to stop
89 */ 89 */
90void 90void
91GNUNET_TRANSPORT_application_suggest_cancel( 91GNUNET_TRANSPORT_application_suggest_cancel (
92 struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh); 92 struct GNUNET_TRANSPORT_ApplicationSuggestHandle *sh);
93 93
94 94
@@ -108,7 +108,7 @@ GNUNET_TRANSPORT_application_suggest_cancel(
108 * @param addr address to validate 108 * @param addr address to validate
109 */ 109 */
110void 110void
111GNUNET_TRANSPORT_application_validate( 111GNUNET_TRANSPORT_application_validate (
112 struct GNUNET_TRANSPORT_ApplicationHandle *ch, 112 struct GNUNET_TRANSPORT_ApplicationHandle *ch,
113 const struct GNUNET_PeerIdentity *peer, 113 const struct GNUNET_PeerIdentity *peer,
114 enum GNUNET_NetworkType nt, 114 enum GNUNET_NetworkType nt,
diff --git a/src/include/gnunet_transport_communication_service.h b/src/include/gnunet_transport_communication_service.h
index e7c8be0c6..f4dfc8745 100644
--- a/src/include/gnunet_transport_communication_service.h
+++ b/src/include/gnunet_transport_communication_service.h
@@ -87,7 +87,8 @@ struct GNUNET_TRANSPORT_CommunicatorHandle;
87 * FIXME: may want to distinguish bi-directional as well, 87 * FIXME: may want to distinguish bi-directional as well,
88 * should we define a bit for that? Needed in DV logic (handle_dv_learn)! 88 * should we define a bit for that? Needed in DV logic (handle_dv_learn)!
89 */ 89 */
90enum GNUNET_TRANSPORT_CommunicatorCharacteristics { 90enum GNUNET_TRANSPORT_CommunicatorCharacteristics
91{
91 /** 92 /**
92 * Characteristics are unknown (i.e. DV). 93 * Characteristics are unknown (i.e. DV).
93 */ 94 */
@@ -143,7 +144,7 @@ typedef void (*GNUNET_TRANSPORT_CommunicatorNotify) (
143 * @return NULL on error 144 * @return NULL on error
144 */ 145 */
145struct GNUNET_TRANSPORT_CommunicatorHandle * 146struct GNUNET_TRANSPORT_CommunicatorHandle *
146GNUNET_TRANSPORT_communicator_connect( 147GNUNET_TRANSPORT_communicator_connect (
147 const struct GNUNET_CONFIGURATION_Handle *cfg, 148 const struct GNUNET_CONFIGURATION_Handle *cfg,
148 const char *config_section_name, 149 const char *config_section_name,
149 const char *addr_prefix, 150 const char *addr_prefix,
@@ -160,7 +161,7 @@ GNUNET_TRANSPORT_communicator_connect(
160 * @param ch handle returned from connect 161 * @param ch handle returned from connect
161 */ 162 */
162void 163void
163GNUNET_TRANSPORT_communicator_disconnect( 164GNUNET_TRANSPORT_communicator_disconnect (
164 struct GNUNET_TRANSPORT_CommunicatorHandle *ch); 165 struct GNUNET_TRANSPORT_CommunicatorHandle *ch);
165 166
166 167
@@ -200,7 +201,7 @@ typedef void (*GNUNET_TRANSPORT_MessageCompletedCallback) (void *cls,
200 * the tranport service is not yet up 201 * the tranport service is not yet up
201 */ 202 */
202int 203int
203GNUNET_TRANSPORT_communicator_receive( 204GNUNET_TRANSPORT_communicator_receive (
204 struct GNUNET_TRANSPORT_CommunicatorHandle *handle, 205 struct GNUNET_TRANSPORT_CommunicatorHandle *handle,
205 const struct GNUNET_PeerIdentity *sender, 206 const struct GNUNET_PeerIdentity *sender,
206 const struct GNUNET_MessageHeader *msg, 207 const struct GNUNET_MessageHeader *msg,
@@ -221,7 +222,8 @@ struct GNUNET_TRANSPORT_QueueHandle;
221/** 222/**
222 * Possible states of a connection. 223 * Possible states of a connection.
223 */ 224 */
224enum GNUNET_TRANSPORT_ConnectionStatus { 225enum GNUNET_TRANSPORT_ConnectionStatus
226{
225 /** 227 /**
226 * Connection is down. 228 * Connection is down.
227 */ 229 */
@@ -255,7 +257,7 @@ enum GNUNET_TRANSPORT_ConnectionStatus {
255 * @return API handle identifying the new MQ 257 * @return API handle identifying the new MQ
256 */ 258 */
257struct GNUNET_TRANSPORT_QueueHandle * 259struct GNUNET_TRANSPORT_QueueHandle *
258GNUNET_TRANSPORT_communicator_mq_add( 260GNUNET_TRANSPORT_communicator_mq_add (
259 struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 261 struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
260 const struct GNUNET_PeerIdentity *peer, 262 const struct GNUNET_PeerIdentity *peer,
261 const char *address, 263 const char *address,
@@ -272,7 +274,7 @@ GNUNET_TRANSPORT_communicator_mq_add(
272 * @param qh handle for the queue that must be invalidated 274 * @param qh handle for the queue that must be invalidated
273 */ 275 */
274void 276void
275GNUNET_TRANSPORT_communicator_mq_del(struct GNUNET_TRANSPORT_QueueHandle *qh); 277GNUNET_TRANSPORT_communicator_mq_del (struct GNUNET_TRANSPORT_QueueHandle *qh);
276 278
277 279
278/** 280/**
@@ -292,7 +294,7 @@ struct GNUNET_TRANSPORT_AddressIdentifier;
292 * @param expiration when does the communicator forsee this address expiring? 294 * @param expiration when does the communicator forsee this address expiring?
293 */ 295 */
294struct GNUNET_TRANSPORT_AddressIdentifier * 296struct GNUNET_TRANSPORT_AddressIdentifier *
295GNUNET_TRANSPORT_communicator_address_add( 297GNUNET_TRANSPORT_communicator_address_add (
296 struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 298 struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
297 const char *address, 299 const char *address,
298 enum GNUNET_NetworkType nt, 300 enum GNUNET_NetworkType nt,
@@ -306,7 +308,7 @@ GNUNET_TRANSPORT_communicator_address_add(
306 * @param ai address that is no longer provided 308 * @param ai address that is no longer provided
307 */ 309 */
308void 310void
309GNUNET_TRANSPORT_communicator_address_remove( 311GNUNET_TRANSPORT_communicator_address_remove (
310 struct GNUNET_TRANSPORT_AddressIdentifier *ai); 312 struct GNUNET_TRANSPORT_AddressIdentifier *ai);
311 313
312 314
@@ -329,7 +331,7 @@ GNUNET_TRANSPORT_communicator_address_remove(
329 * notify-API to @a pid's communicator @a comm 331 * notify-API to @a pid's communicator @a comm
330 */ 332 */
331void 333void
332GNUNET_TRANSPORT_communicator_notify( 334GNUNET_TRANSPORT_communicator_notify (
333 struct GNUNET_TRANSPORT_CommunicatorHandle *ch, 335 struct GNUNET_TRANSPORT_CommunicatorHandle *ch,
334 const struct GNUNET_PeerIdentity *pid, 336 const struct GNUNET_PeerIdentity *pid,
335 const char *comm, 337 const char *comm,
diff --git a/src/include/gnunet_transport_core_service.h b/src/include/gnunet_transport_core_service.h
index e9ae4a2b4..314eb342f 100644
--- a/src/include/gnunet_transport_core_service.h
+++ b/src/include/gnunet_transport_core_service.h
@@ -107,12 +107,12 @@ typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (
107 * @return NULL on error 107 * @return NULL on error
108 */ 108 */
109struct GNUNET_TRANSPORT_CoreHandle * 109struct GNUNET_TRANSPORT_CoreHandle *
110GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 110GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
111 const struct GNUNET_PeerIdentity *self, 111 const struct GNUNET_PeerIdentity *self,
112 const struct GNUNET_MQ_MessageHandler *handlers, 112 const struct GNUNET_MQ_MessageHandler *handlers,
113 void *cls, 113 void *cls,
114 GNUNET_TRANSPORT_NotifyConnect nc, 114 GNUNET_TRANSPORT_NotifyConnect nc,
115 GNUNET_TRANSPORT_NotifyDisconnect nd); 115 GNUNET_TRANSPORT_NotifyDisconnect nd);
116 116
117 117
118/** 118/**
@@ -121,7 +121,7 @@ GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
121 * @param handle handle returned from connect 121 * @param handle handle returned from connect
122 */ 122 */
123void 123void
124GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle); 124GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle);
125 125
126 126
127/** 127/**
@@ -145,8 +145,8 @@ GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle);
145 * @param pid which peer was the message from that was fully processed by CORE 145 * @param pid which peer was the message from that was fully processed by CORE
146 */ 146 */
147void 147void
148GNUNET_TRANSPORT_core_receive_continue(struct GNUNET_TRANSPORT_CoreHandle *ch, 148GNUNET_TRANSPORT_core_receive_continue (struct GNUNET_TRANSPORT_CoreHandle *ch,
149 const struct GNUNET_PeerIdentity *pid); 149 const struct GNUNET_PeerIdentity *pid);
150 150
151 151
152/** 152/**
@@ -158,8 +158,8 @@ GNUNET_TRANSPORT_core_receive_continue(struct GNUNET_TRANSPORT_CoreHandle *ch,
158 * @return NULL if disconnected, otherwise message queue for @a peer 158 * @return NULL if disconnected, otherwise message queue for @a peer
159 */ 159 */
160struct GNUNET_MQ_Handle * 160struct GNUNET_MQ_Handle *
161GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, 161GNUNET_TRANSPORT_core_get_mq (struct GNUNET_TRANSPORT_CoreHandle *handle,
162 const struct GNUNET_PeerIdentity *peer); 162 const struct GNUNET_PeerIdentity *peer);
163 163
164 164
165#if 0 /* keep Emacsens' auto-indent happy */ 165#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_hello_service.h b/src/include/gnunet_transport_hello_service.h
index 512103c54..fecffd527 100644
--- a/src/include/gnunet_transport_hello_service.h
+++ b/src/include/gnunet_transport_hello_service.h
@@ -58,7 +58,8 @@ extern "C" {
58 * classes to filter addresses by which domain they make 58 * classes to filter addresses by which domain they make
59 * sense to be used in. These are used in a bitmask. 59 * sense to be used in. These are used in a bitmask.
60 */ 60 */
61enum GNUNET_TRANSPORT_AddressClass { 61enum GNUNET_TRANSPORT_AddressClass
62{
62 /** 63 /**
63 * No address. 64 * No address.
64 */ 65 */
@@ -138,10 +139,10 @@ struct GNUNET_TRANSPORT_HelloGetHandle;
138 * @return handle to cancel the operation 139 * @return handle to cancel the operation
139 */ 140 */
140struct GNUNET_TRANSPORT_HelloGetHandle * 141struct GNUNET_TRANSPORT_HelloGetHandle *
141GNUNET_TRANSPORT_hello_get(const struct GNUNET_CONFIGURATION_Handle *cfg, 142GNUNET_TRANSPORT_hello_get (const struct GNUNET_CONFIGURATION_Handle *cfg,
142 enum GNUNET_TRANSPORT_AddressClass ac, 143 enum GNUNET_TRANSPORT_AddressClass ac,
143 GNUNET_TRANSPORT_HelloUpdateCallback rec, 144 GNUNET_TRANSPORT_HelloUpdateCallback rec,
144 void *rec_cls); 145 void *rec_cls);
145 146
146 147
147/** 148/**
@@ -150,7 +151,7 @@ GNUNET_TRANSPORT_hello_get(const struct GNUNET_CONFIGURATION_Handle *cfg,
150 * @param ghh handle to cancel 151 * @param ghh handle to cancel
151 */ 152 */
152void 153void
153GNUNET_TRANSPORT_hello_get_cancel(struct GNUNET_TRANSPORT_HelloGetHandle *ghh); 154GNUNET_TRANSPORT_hello_get_cancel (struct GNUNET_TRANSPORT_HelloGetHandle *ghh);
154 155
155 156
156/** 157/**
@@ -180,9 +181,9 @@ typedef void (*GNUNET_TRANSPORT_AddressCallback) (
180 * @return #GNUNET_OK if hello was well-formed, #GNUNET_SYSERR if not 181 * @return #GNUNET_OK if hello was well-formed, #GNUNET_SYSERR if not
181 */ 182 */
182int 183int
183GNUNET_TRANSPORT_hello_parse(const struct GNUNET_MessageHeader *hello, 184GNUNET_TRANSPORT_hello_parse (const struct GNUNET_MessageHeader *hello,
184 GNUNET_TRANSPORT_AddressCallback cb, 185 GNUNET_TRANSPORT_AddressCallback cb,
185 void *cb_cls); 186 void *cb_cls);
186 187
187 188
188#if 0 /* keep Emacsens' auto-indent happy */ 189#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_manipulation_service.h b/src/include/gnunet_transport_manipulation_service.h
index 3149d1dd5..09fb138f8 100644
--- a/src/include/gnunet_transport_manipulation_service.h
+++ b/src/include/gnunet_transport_manipulation_service.h
@@ -66,7 +66,8 @@ struct GNUNET_TRANSPORT_ManipulationHandle;
66 * @return NULL on error 66 * @return NULL on error
67 */ 67 */
68struct GNUNET_TRANSPORT_ManipulationHandle * 68struct GNUNET_TRANSPORT_ManipulationHandle *
69GNUNET_TRANSPORT_manipulation_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 69GNUNET_TRANSPORT_manipulation_connect (const struct
70 GNUNET_CONFIGURATION_Handle *cfg);
70 71
71 72
72/** 73/**
@@ -75,7 +76,9 @@ GNUNET_TRANSPORT_manipulation_connect(const struct GNUNET_CONFIGURATION_Handle *
75 * @param handle handle returned from connect 76 * @param handle handle returned from connect
76 */ 77 */
77void 78void
78GNUNET_TRANSPORT_manipulation_disconnect(struct GNUNET_TRANSPORT_ManipulationHandle *handle); 79GNUNET_TRANSPORT_manipulation_disconnect (struct
80 GNUNET_TRANSPORT_ManipulationHandle *
81 handle);
79 82
80 83
81/** 84/**
@@ -91,11 +94,12 @@ GNUNET_TRANSPORT_manipulation_disconnect(struct GNUNET_TRANSPORT_ManipulationHan
91 * with one message delay. 94 * with one message delay.
92 */ 95 */
93void 96void
94GNUNET_TRANSPORT_manipulation_set(struct GNUNET_TRANSPORT_ManipulationHandle *handle, 97GNUNET_TRANSPORT_manipulation_set (struct
95 const struct GNUNET_PeerIdentity *peer, 98 GNUNET_TRANSPORT_ManipulationHandle *handle,
96 const struct GNUNET_ATS_Properties *prop, 99 const struct GNUNET_PeerIdentity *peer,
97 struct GNUNET_TIME_Relative delay_in, 100 const struct GNUNET_ATS_Properties *prop,
98 struct GNUNET_TIME_Relative delay_out); 101 struct GNUNET_TIME_Relative delay_in,
102 struct GNUNET_TIME_Relative delay_out);
99 103
100 104
101#if 0 /* keep Emacsens' auto-indent happy */ 105#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_monitor_service.h b/src/include/gnunet_transport_monitor_service.h
index a67fca778..f39be16d7 100644
--- a/src/include/gnunet_transport_monitor_service.h
+++ b/src/include/gnunet_transport_monitor_service.h
@@ -56,7 +56,8 @@ extern "C"
56/** 56/**
57 * Information about another peer's address. 57 * Information about another peer's address.
58 */ 58 */
59struct GNUNET_TRANSPORT_MonitorInformation { 59struct GNUNET_TRANSPORT_MonitorInformation
60{
60 /** 61 /**
61 * Address we have for the peer, human-readable, 0-terminated, in UTF-8. 62 * Address we have for the peer, human-readable, 0-terminated, in UTF-8.
62 */ 63 */
@@ -123,7 +124,8 @@ struct GNUNET_TRANSPORT_MonitorInformation {
123typedef void 124typedef void
124(*GNUNET_TRANSPORT_MonitorCallback) (void *cls, 125(*GNUNET_TRANSPORT_MonitorCallback) (void *cls,
125 const struct GNUNET_PeerIdentity *peer, 126 const struct GNUNET_PeerIdentity *peer,
126 const struct GNUNET_TRANSPORT_MonitorInformation *mi); 127 const struct
128 GNUNET_TRANSPORT_MonitorInformation *mi);
127 129
128 130
129/** 131/**
@@ -159,11 +161,11 @@ struct GNUNET_TRANSPORT_MonitorContext;
159 * @param cb_cls closure for @a mc 161 * @param cb_cls closure for @a mc
160 */ 162 */
161struct GNUNET_TRANSPORT_MonitorContext * 163struct GNUNET_TRANSPORT_MonitorContext *
162GNUNET_TRANSPORT_monitor(const struct GNUNET_CONFIGURATION_Handle *cfg, 164GNUNET_TRANSPORT_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
163 const struct GNUNET_PeerIdentity *peer, 165 const struct GNUNET_PeerIdentity *peer,
164 int one_shot, 166 int one_shot,
165 GNUNET_TRANSPORT_MonitorCallback cb, 167 GNUNET_TRANSPORT_MonitorCallback cb,
166 void *cb_cls); 168 void *cb_cls);
167 169
168 170
169/** 171/**
@@ -172,7 +174,7 @@ GNUNET_TRANSPORT_monitor(const struct GNUNET_CONFIGURATION_Handle *cfg,
172 * @param mc handle for the request to cancel 174 * @param mc handle for the request to cancel
173 */ 175 */
174void 176void
175GNUNET_TRANSPORT_monitor_cancel(struct GNUNET_TRANSPORT_MonitorContext *mc); 177GNUNET_TRANSPORT_monitor_cancel (struct GNUNET_TRANSPORT_MonitorContext *mc);
176 178
177 179
178#if 0 /* keep Emacsens' auto-indent happy */ 180#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h
index 12ecb88f2..5ca9f5015 100644
--- a/src/include/gnunet_transport_plugin.h
+++ b/src/include/gnunet_transport_plugin.h
@@ -118,9 +118,11 @@ typedef void
118 */ 118 */
119typedef struct GNUNET_TIME_Relative 119typedef struct GNUNET_TIME_Relative
120(*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls, 120(*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls,
121 const struct GNUNET_HELLO_Address *address, 121 const struct
122 GNUNET_HELLO_Address *address,
122 struct GNUNET_ATS_Session *session, 123 struct GNUNET_ATS_Session *session,
123 const struct GNUNET_MessageHeader *message); 124 const struct
125 GNUNET_MessageHeader *message);
124 126
125 127
126/** 128/**
@@ -148,7 +150,8 @@ typedef enum GNUNET_NetworkType
148 */ 150 */
149typedef void 151typedef void
150(*GNUNET_TRANSPORT_UpdateAddressDistance) (void *cls, 152(*GNUNET_TRANSPORT_UpdateAddressDistance) (void *cls,
151 const struct GNUNET_HELLO_Address *address, 153 const struct
154 GNUNET_HELLO_Address *address,
152 uint32_t distance); 155 uint32_t distance);
153 156
154 157
@@ -164,7 +167,8 @@ typedef void
164typedef void 167typedef void
165(*GNUNET_TRANSPORT_AddressNotification) (void *cls, 168(*GNUNET_TRANSPORT_AddressNotification) (void *cls,
166 int add_remove, 169 int add_remove,
167 const struct GNUNET_HELLO_Address *address); 170 const struct
171 GNUNET_HELLO_Address *address);
168 172
169 173
170/** 174/**
@@ -203,7 +207,8 @@ typedef const struct GNUNET_MessageHeader *
203 * of this type as the first and only argument to the 207 * of this type as the first and only argument to the
204 * entry point of each transport plugin. 208 * entry point of each transport plugin.
205 */ 209 */
206struct GNUNET_TRANSPORT_PluginEnvironment { 210struct GNUNET_TRANSPORT_PluginEnvironment
211{
207 /** 212 /**
208 * Configuration to use. 213 * Configuration to use.
209 */ 214 */
@@ -300,7 +305,8 @@ struct GNUNET_TRANSPORT_PluginEnvironment {
300 */ 305 */
301typedef void 306typedef void
302(*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, 307(*GNUNET_TRANSPORT_TransmitContinuation) (void *cls,
303 const struct GNUNET_PeerIdentity *target, 308 const struct
309 GNUNET_PeerIdentity *target,
304 int result, 310 int result,
305 size_t size_payload, 311 size_t size_payload,
306 size_t size_on_wire); 312 size_t size_on_wire);
@@ -360,7 +366,8 @@ typedef ssize_t
360 */ 366 */
361typedef int 367typedef int
362(*GNUNET_TRANSPORT_DisconnectSessionFunction) (void *cls, 368(*GNUNET_TRANSPORT_DisconnectSessionFunction) (void *cls,
363 struct GNUNET_ATS_Session *session); 369 struct GNUNET_ATS_Session *
370 session);
364 371
365 372
366/** 373/**
@@ -389,7 +396,8 @@ typedef unsigned int
389 */ 396 */
390typedef void 397typedef void
391(*GNUNET_TRANSPORT_DisconnectPeerFunction) (void *cls, 398(*GNUNET_TRANSPORT_DisconnectPeerFunction) (void *cls,
392 const struct GNUNET_PeerIdentity *target); 399 const struct
400 GNUNET_PeerIdentity *target);
393 401
394 402
395/** 403/**
@@ -433,7 +441,8 @@ typedef void
433 size_t addrlen, 441 size_t addrlen,
434 int numeric, 442 int numeric,
435 struct GNUNET_TIME_Relative timeout, 443 struct GNUNET_TIME_Relative timeout,
436 GNUNET_TRANSPORT_AddressStringCallback asc, 444 GNUNET_TRANSPORT_AddressStringCallback
445 asc,
437 void *asc_cls); 446 void *asc_cls);
438 447
439 448
@@ -482,7 +491,8 @@ typedef struct GNUNET_ATS_Session *
482 */ 491 */
483typedef void 492typedef void
484(*GNUNET_TRANSPORT_UpdateSessionTimeout) (void *cls, 493(*GNUNET_TRANSPORT_UpdateSessionTimeout) (void *cls,
485 const struct GNUNET_PeerIdentity *peer, 494 const struct
495 GNUNET_PeerIdentity *peer,
486 struct GNUNET_ATS_Session *session); 496 struct GNUNET_ATS_Session *session);
487 497
488 498
@@ -561,7 +571,8 @@ typedef enum GNUNET_NetworkType
561 */ 571 */
562typedef enum GNUNET_NetworkType 572typedef enum GNUNET_NetworkType
563(*GNUNET_TRANSPORT_GetNetworkTypeForAddress)(void *cls, 573(*GNUNET_TRANSPORT_GetNetworkTypeForAddress)(void *cls,
564 const struct GNUNET_HELLO_Address *address); 574 const struct
575 GNUNET_HELLO_Address *address);
565 576
566 577
567/** 578/**
@@ -579,7 +590,8 @@ typedef enum GNUNET_NetworkType
579typedef void 590typedef void
580(*GNUNET_TRANSPORT_SessionInfoCallback) (void *cls, 591(*GNUNET_TRANSPORT_SessionInfoCallback) (void *cls,
581 struct GNUNET_ATS_Session *session, 592 struct GNUNET_ATS_Session *session,
582 const struct GNUNET_TRANSPORT_SessionInfo *info); 593 const struct
594 GNUNET_TRANSPORT_SessionInfo *info);
583 595
584 596
585/** 597/**
@@ -596,7 +608,8 @@ typedef void
596 */ 608 */
597typedef void 609typedef void
598(*GNUNET_TRANSPORT_SessionMonitorSetup) (void *cls, 610(*GNUNET_TRANSPORT_SessionMonitorSetup) (void *cls,
599 GNUNET_TRANSPORT_SessionInfoCallback sic, 611 GNUNET_TRANSPORT_SessionInfoCallback
612 sic,
600 void *sic_cls); 613 void *sic_cls);
601 614
602 615
@@ -604,7 +617,8 @@ typedef void
604 * Each plugin is required to return a pointer to a struct of this 617 * Each plugin is required to return a pointer to a struct of this
605 * type as the return value from its entry point. 618 * type as the return value from its entry point.
606 */ 619 */
607struct GNUNET_TRANSPORT_PluginFunctions { 620struct GNUNET_TRANSPORT_PluginFunctions
621{
608 /** 622 /**
609 * Closure for all of the callbacks. 623 * Closure for all of the callbacks.
610 */ 624 */
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 735e216e8..d190eff92 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -75,10 +75,10 @@ struct GNUNET_TRANSPORT_OfferHelloHandle;
75 * 75 *
76 */ 76 */
77struct GNUNET_TRANSPORT_OfferHelloHandle * 77struct GNUNET_TRANSPORT_OfferHelloHandle *
78GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg, 78GNUNET_TRANSPORT_offer_hello (const struct GNUNET_CONFIGURATION_Handle *cfg,
79 const struct GNUNET_MessageHeader *hello, 79 const struct GNUNET_MessageHeader *hello,
80 GNUNET_SCHEDULER_TaskCallback cont, 80 GNUNET_SCHEDULER_TaskCallback cont,
81 void *cont_cls); 81 void *cont_cls);
82 82
83 83
84/** 84/**
@@ -87,7 +87,7 @@ GNUNET_TRANSPORT_offer_hello(const struct GNUNET_CONFIGURATION_Handle *cfg,
87 * @param ohh the `struct GNUNET_TRANSPORT_OfferHelloHandle` to cancel 87 * @param ohh the `struct GNUNET_TRANSPORT_OfferHelloHandle` to cancel
88 */ 88 */
89void 89void
90GNUNET_TRANSPORT_offer_hello_cancel( 90GNUNET_TRANSPORT_offer_hello_cancel (
91 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh); 91 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh);
92 92
93 93
@@ -133,7 +133,7 @@ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls,
133 * @return handle to cancel the operation, NULL on error 133 * @return handle to cancel the operation, NULL on error
134 */ 134 */
135struct GNUNET_TRANSPORT_AddressToStringContext * 135struct GNUNET_TRANSPORT_AddressToStringContext *
136GNUNET_TRANSPORT_address_to_string( 136GNUNET_TRANSPORT_address_to_string (
137 const struct GNUNET_CONFIGURATION_Handle *cfg, 137 const struct GNUNET_CONFIGURATION_Handle *cfg,
138 const struct GNUNET_HELLO_Address *address, 138 const struct GNUNET_HELLO_Address *address,
139 int numeric, 139 int numeric,
@@ -148,7 +148,7 @@ GNUNET_TRANSPORT_address_to_string(
148 * @param alc the context handle 148 * @param alc the context handle
149 */ 149 */
150void 150void
151GNUNET_TRANSPORT_address_to_string_cancel( 151GNUNET_TRANSPORT_address_to_string_cancel (
152 struct GNUNET_TRANSPORT_AddressToStringContext *alc); 152 struct GNUNET_TRANSPORT_AddressToStringContext *alc);
153 153
154 154
@@ -211,7 +211,8 @@ GNUNET_TRANSPORT_address_to_string_cancel(
211 * to 0). 211 * to 0).
212 * 212 *
213 */ 213 */
214enum GNUNET_TRANSPORT_PeerState { 214enum GNUNET_TRANSPORT_PeerState
215{
215 /** 216 /**
216 * Fresh peer or completely disconnected 217 * Fresh peer or completely disconnected
217 */ 218 */
@@ -288,7 +289,7 @@ enum GNUNET_TRANSPORT_PeerState {
288 * @param state the state 289 * @param state the state
289 */ 290 */
290const char * 291const char *
291GNUNET_TRANSPORT_ps2s(enum GNUNET_TRANSPORT_PeerState state); 292GNUNET_TRANSPORT_ps2s (enum GNUNET_TRANSPORT_PeerState state);
292 293
293 294
294/** 295/**
@@ -298,7 +299,7 @@ GNUNET_TRANSPORT_ps2s(enum GNUNET_TRANSPORT_PeerState state);
298 * @return #GNUNET_YES or #GNUNET_NO 299 * @return #GNUNET_YES or #GNUNET_NO
299 */ 300 */
300int 301int
301GNUNET_TRANSPORT_is_connected(enum GNUNET_TRANSPORT_PeerState state); 302GNUNET_TRANSPORT_is_connected (enum GNUNET_TRANSPORT_PeerState state);
302 303
303 304
304/** 305/**
@@ -360,7 +361,7 @@ typedef void (*GNUNET_TRANSPORT_PeerIterateCallback) (
360 * @param peer_callback_cls closure for @a peer_callback 361 * @param peer_callback_cls closure for @a peer_callback
361 */ 362 */
362struct GNUNET_TRANSPORT_PeerMonitoringContext * 363struct GNUNET_TRANSPORT_PeerMonitoringContext *
363GNUNET_TRANSPORT_monitor_peers( 364GNUNET_TRANSPORT_monitor_peers (
364 const struct GNUNET_CONFIGURATION_Handle *cfg, 365 const struct GNUNET_CONFIGURATION_Handle *cfg,
365 const struct GNUNET_PeerIdentity *peer, 366 const struct GNUNET_PeerIdentity *peer,
366 int one_shot, 367 int one_shot,
@@ -374,7 +375,7 @@ GNUNET_TRANSPORT_monitor_peers(
374 * @param pic handle for the request to cancel 375 * @param pic handle for the request to cancel
375 */ 376 */
376void 377void
377GNUNET_TRANSPORT_monitor_peers_cancel( 378GNUNET_TRANSPORT_monitor_peers_cancel (
378 struct GNUNET_TRANSPORT_PeerMonitoringContext *pic); 379 struct GNUNET_TRANSPORT_PeerMonitoringContext *pic);
379 380
380 381
@@ -413,9 +414,9 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (
413 * @return NULL on error, otherwise handle for cancellation 414 * @return NULL on error, otherwise handle for cancellation
414 */ 415 */
415struct GNUNET_TRANSPORT_Blacklist * 416struct GNUNET_TRANSPORT_Blacklist *
416GNUNET_TRANSPORT_blacklist(const struct GNUNET_CONFIGURATION_Handle *cfg, 417GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg,
417 GNUNET_TRANSPORT_BlacklistCallback cb, 418 GNUNET_TRANSPORT_BlacklistCallback cb,
418 void *cb_cls); 419 void *cb_cls);
419 420
420 421
421/** 422/**
@@ -425,7 +426,7 @@ GNUNET_TRANSPORT_blacklist(const struct GNUNET_CONFIGURATION_Handle *cfg,
425 * @param br handle of the request that is to be cancelled 426 * @param br handle of the request that is to be cancelled
426 */ 427 */
427void 428void
428GNUNET_TRANSPORT_blacklist_cancel(struct GNUNET_TRANSPORT_Blacklist *br); 429GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br);
429 430
430 431
431/** 432/**
@@ -443,7 +444,8 @@ struct GNUNET_TRANSPORT_PluginSession;
443/** 444/**
444 * Possible states of a session in a plugin. 445 * Possible states of a session in a plugin.
445 */ 446 */
446enum GNUNET_TRANSPORT_SessionState { 447enum GNUNET_TRANSPORT_SessionState
448{
447 /** 449 /**
448 * The session was created (first call for each session object). 450 * The session was created (first call for each session object).
449 */ 451 */
@@ -476,7 +478,8 @@ enum GNUNET_TRANSPORT_SessionState {
476/** 478/**
477 * Information about a plugin's session. 479 * Information about a plugin's session.
478 */ 480 */
479struct GNUNET_TRANSPORT_SessionInfo { 481struct GNUNET_TRANSPORT_SessionInfo
482{
480 /** 483 /**
481 * New state of the session. 484 * New state of the session.
482 */ 485 */
@@ -555,9 +558,9 @@ typedef void (*GNUNET_TRANSPORT_SessionMonitorCallback) (
555 * @return NULL on error, otherwise handle for cancellation 558 * @return NULL on error, otherwise handle for cancellation
556 */ 559 */
557struct GNUNET_TRANSPORT_PluginMonitor * 560struct GNUNET_TRANSPORT_PluginMonitor *
558GNUNET_TRANSPORT_monitor_plugins(const struct GNUNET_CONFIGURATION_Handle *cfg, 561GNUNET_TRANSPORT_monitor_plugins (const struct GNUNET_CONFIGURATION_Handle *cfg,
559 GNUNET_TRANSPORT_SessionMonitorCallback cb, 562 GNUNET_TRANSPORT_SessionMonitorCallback cb,
560 void *cb_cls); 563 void *cb_cls);
561 564
562 565
563/** 566/**
@@ -568,7 +571,7 @@ GNUNET_TRANSPORT_monitor_plugins(const struct GNUNET_CONFIGURATION_Handle *cfg,
568 * @param pm handle of the request that is to be cancelled 571 * @param pm handle of the request that is to be cancelled
569 */ 572 */
570void 573void
571GNUNET_TRANSPORT_monitor_plugins_cancel( 574GNUNET_TRANSPORT_monitor_plugins_cancel (
572 struct GNUNET_TRANSPORT_PluginMonitor *pm); 575 struct GNUNET_TRANSPORT_PluginMonitor *pm);
573 576
574 577
@@ -653,13 +656,13 @@ typedef void (*GNUNET_TRANSPORT_NotifyExcessBandwidth) (
653 * @return NULL on error 656 * @return NULL on error
654 */ 657 */
655struct GNUNET_TRANSPORT_CoreHandle * 658struct GNUNET_TRANSPORT_CoreHandle *
656GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, 659GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
657 const struct GNUNET_PeerIdentity *self, 660 const struct GNUNET_PeerIdentity *self,
658 const struct GNUNET_MQ_MessageHandler *handlers, 661 const struct GNUNET_MQ_MessageHandler *handlers,
659 void *cls, 662 void *cls,
660 GNUNET_TRANSPORT_NotifyConnect nc, 663 GNUNET_TRANSPORT_NotifyConnect nc,
661 GNUNET_TRANSPORT_NotifyDisconnect nd, 664 GNUNET_TRANSPORT_NotifyDisconnect nd,
662 GNUNET_TRANSPORT_NotifyExcessBandwidth neb); 665 GNUNET_TRANSPORT_NotifyExcessBandwidth neb);
663 666
664 667
665/** 668/**
@@ -668,7 +671,7 @@ GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg,
668 * @param handle handle returned from connect 671 * @param handle handle returned from connect
669 */ 672 */
670void 673void
671GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle); 674GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle);
672 675
673 676
674/** 677/**
@@ -679,8 +682,8 @@ GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle);
679 * @return NULL if disconnected, otherwise message queue for @a peer 682 * @return NULL if disconnected, otherwise message queue for @a peer
680 */ 683 */
681struct GNUNET_MQ_Handle * 684struct GNUNET_MQ_Handle *
682GNUNET_TRANSPORT_core_get_mq(struct GNUNET_TRANSPORT_CoreHandle *handle, 685GNUNET_TRANSPORT_core_get_mq (struct GNUNET_TRANSPORT_CoreHandle *handle,
683 const struct GNUNET_PeerIdentity *peer); 686 const struct GNUNET_PeerIdentity *peer);
684 687
685 688
686#if 0 /* keep Emacsens' auto-indent happy */ 689#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_tun_lib.h b/src/include/gnunet_tun_lib.h
index 941f394aa..0af9a1d3e 100644
--- a/src/include/gnunet_tun_lib.h
+++ b/src/include/gnunet_tun_lib.h
@@ -78,7 +78,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
78/** 78/**
79 * Header from Linux TUN interface. 79 * Header from Linux TUN interface.
80 */ 80 */
81struct GNUNET_TUN_Layer2PacketHeader { 81struct GNUNET_TUN_Layer2PacketHeader
82{
82 /** 83 /**
83 * Some flags (unused). 84 * Some flags (unused).
84 */ 85 */
@@ -94,7 +95,8 @@ struct GNUNET_TUN_Layer2PacketHeader {
94/** 95/**
95 * Standard IPv4 header. 96 * Standard IPv4 header.
96 */ 97 */
97struct GNUNET_TUN_IPv4Header { 98struct GNUNET_TUN_IPv4Header
99{
98#if __BYTE_ORDER == __LITTLE_ENDIAN 100#if __BYTE_ORDER == __LITTLE_ENDIAN
99 unsigned int header_length : 4 GNUNET_PACKED; 101 unsigned int header_length : 4 GNUNET_PACKED;
100 unsigned int version : 4 GNUNET_PACKED; 102 unsigned int version : 4 GNUNET_PACKED;
@@ -150,7 +152,8 @@ struct GNUNET_TUN_IPv4Header {
150/** 152/**
151 * Standard IPv6 header. 153 * Standard IPv6 header.
152 */ 154 */
153struct GNUNET_TUN_IPv6Header { 155struct GNUNET_TUN_IPv6Header
156{
154#if __BYTE_ORDER == __LITTLE_ENDIAN 157#if __BYTE_ORDER == __LITTLE_ENDIAN
155 unsigned int traffic_class_h : 4 GNUNET_PACKED; 158 unsigned int traffic_class_h : 4 GNUNET_PACKED;
156 unsigned int version : 4 GNUNET_PACKED; 159 unsigned int version : 4 GNUNET_PACKED;
@@ -205,7 +208,8 @@ struct GNUNET_TUN_IPv6Header {
205/** 208/**
206 * TCP packet header. 209 * TCP packet header.
207 */ 210 */
208struct GNUNET_TUN_TcpHeader { 211struct GNUNET_TUN_TcpHeader
212{
209 /** 213 /**
210 * Source port (in NBO). 214 * Source port (in NBO).
211 */ 215 */
@@ -272,7 +276,8 @@ struct GNUNET_TUN_TcpHeader {
272/** 276/**
273 * UDP packet header. 277 * UDP packet header.
274 */ 278 */
275struct GNUNET_TUN_UdpHeader { 279struct GNUNET_TUN_UdpHeader
280{
276 /** 281 /**
277 * Source port (in NBO). 282 * Source port (in NBO).
278 */ 283 */
@@ -331,7 +336,8 @@ struct GNUNET_TUN_UdpHeader {
331/** 336/**
332 * DNS flags (largely RFC 1035 / RFC 2136). 337 * DNS flags (largely RFC 1035 / RFC 2136).
333 */ 338 */
334struct GNUNET_TUN_DnsFlags { 339struct GNUNET_TUN_DnsFlags
340{
335#if __BYTE_ORDER == __LITTLE_ENDIAN 341#if __BYTE_ORDER == __LITTLE_ENDIAN
336 /** 342 /**
337 * Set to 1 if recursion is desired (client -> server) 343 * Set to 1 if recursion is desired (client -> server)
@@ -442,7 +448,8 @@ struct GNUNET_TUN_DnsFlags {
442/** 448/**
443 * DNS header. 449 * DNS header.
444 */ 450 */
445struct GNUNET_TUN_DnsHeader { 451struct GNUNET_TUN_DnsHeader
452{
446 /** 453 /**
447 * Unique identifier for the request/response. 454 * Unique identifier for the request/response.
448 */ 455 */
@@ -478,7 +485,8 @@ struct GNUNET_TUN_DnsHeader {
478/** 485/**
479 * Payload of DNS SOA record (header). 486 * Payload of DNS SOA record (header).
480 */ 487 */
481struct GNUNET_TUN_DnsSoaRecord { 488struct GNUNET_TUN_DnsSoaRecord
489{
482 /** 490 /**
483 * The version number of the original copy of the zone. (NBO) 491 * The version number of the original copy of the zone. (NBO)
484 */ 492 */
@@ -512,7 +520,8 @@ struct GNUNET_TUN_DnsSoaRecord {
512/** 520/**
513 * Payload of DNS SRV record (header). 521 * Payload of DNS SRV record (header).
514 */ 522 */
515struct GNUNET_TUN_DnsSrvRecord { 523struct GNUNET_TUN_DnsSrvRecord
524{
516 /** 525 /**
517 * Preference for this entry (lower value is higher preference). Clients 526 * Preference for this entry (lower value is higher preference). Clients
518 * will contact hosts from the lowest-priority group first and fall back 527 * will contact hosts from the lowest-priority group first and fall back
@@ -539,7 +548,8 @@ struct GNUNET_TUN_DnsSrvRecord {
539/** 548/**
540 * Payload of DNS CERT record. 549 * Payload of DNS CERT record.
541 */ 550 */
542struct GNUNET_TUN_DnsCertRecord { 551struct GNUNET_TUN_DnsCertRecord
552{
543 /** 553 /**
544 * Certificate type 554 * Certificate type
545 */ 555 */
@@ -563,7 +573,8 @@ struct GNUNET_TUN_DnsCertRecord {
563 * Payload of DNSSEC TLSA record. 573 * Payload of DNSSEC TLSA record.
564 * http://datatracker.ietf.org/doc/draft-ietf-dane-protocol/ 574 * http://datatracker.ietf.org/doc/draft-ietf-dane-protocol/
565 */ 575 */
566struct GNUNET_TUN_DnsTlsaRecord { 576struct GNUNET_TUN_DnsTlsaRecord
577{
567 /** 578 /**
568 * Certificate usage 579 * Certificate usage
569 * 0: CA cert 580 * 0: CA cert
@@ -607,7 +618,8 @@ struct GNUNET_TUN_DnsTlsaRecord {
607/** 618/**
608 * Payload of GNS VPN record 619 * Payload of GNS VPN record
609 */ 620 */
610struct GNUNET_TUN_GnsVpnRecord { 621struct GNUNET_TUN_GnsVpnRecord
622{
611 /** 623 /**
612 * The peer to contact 624 * The peer to contact
613 */ 625 */
@@ -625,7 +637,8 @@ struct GNUNET_TUN_GnsVpnRecord {
625/** 637/**
626 * DNS query prefix. 638 * DNS query prefix.
627 */ 639 */
628struct GNUNET_TUN_DnsQueryLine { 640struct GNUNET_TUN_DnsQueryLine
641{
629 /** 642 /**
630 * Desired type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) 643 * Desired type (GNUNET_DNSPARSER_TYPE_XXX). (NBO)
631 */ 644 */
@@ -641,7 +654,8 @@ struct GNUNET_TUN_DnsQueryLine {
641/** 654/**
642 * General DNS record prefix. 655 * General DNS record prefix.
643 */ 656 */
644struct GNUNET_TUN_DnsRecordLine { 657struct GNUNET_TUN_DnsRecordLine
658{
645 /** 659 /**
646 * Record type (GNUNET_DNSPARSER_TYPE_XXX). (NBO) 660 * Record type (GNUNET_DNSPARSER_TYPE_XXX). (NBO)
647 */ 661 */
@@ -684,16 +698,19 @@ struct GNUNET_TUN_DnsRecordLine {
684/** 698/**
685 * ICMP header. 699 * ICMP header.
686 */ 700 */
687struct GNUNET_TUN_IcmpHeader { 701struct GNUNET_TUN_IcmpHeader
702{
688 uint8_t type; 703 uint8_t type;
689 uint8_t code; 704 uint8_t code;
690 uint16_t crc GNUNET_PACKED; 705 uint16_t crc GNUNET_PACKED;
691 706
692 union { 707 union
708 {
693 /** 709 /**
694 * ICMP Echo (request/reply) 710 * ICMP Echo (request/reply)
695 */ 711 */
696 struct { 712 struct
713 {
697 uint16_t identifier GNUNET_PACKED; 714 uint16_t identifier GNUNET_PACKED;
698 uint16_t sequence_number GNUNET_PACKED; 715 uint16_t sequence_number GNUNET_PACKED;
699 } echo; 716 } echo;
@@ -701,7 +718,8 @@ struct GNUNET_TUN_IcmpHeader {
701 /** 718 /**
702 * ICMP Destination Unreachable (RFC 1191) 719 * ICMP Destination Unreachable (RFC 1191)
703 */ 720 */
704 struct ih_pmtu { 721 struct ih_pmtu
722 {
705 uint16_t empty GNUNET_PACKED; 723 uint16_t empty GNUNET_PACKED;
706 uint16_t next_hop_mtu GNUNET_PACKED; 724 uint16_t next_hop_mtu GNUNET_PACKED;
707 /* followed by original IP header + first 8 bytes of original IP datagram 725 /* followed by original IP header + first 8 bytes of original IP datagram
@@ -735,11 +753,11 @@ GNUNET_NETWORK_STRUCT_END
735 * @param dst destination IP address to use 753 * @param dst destination IP address to use
736 */ 754 */
737void 755void
738GNUNET_TUN_initialize_ipv4_header(struct GNUNET_TUN_IPv4Header *ip, 756GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip,
739 uint8_t protocol, 757 uint8_t protocol,
740 uint16_t payload_length, 758 uint16_t payload_length,
741 const struct in_addr *src, 759 const struct in_addr *src,
742 const struct in_addr *dst); 760 const struct in_addr *dst);
743 761
744 762
745/** 763/**
@@ -753,11 +771,11 @@ GNUNET_TUN_initialize_ipv4_header(struct GNUNET_TUN_IPv4Header *ip,
753 * @param dst destination IP address to use 771 * @param dst destination IP address to use
754 */ 772 */
755void 773void
756GNUNET_TUN_initialize_ipv6_header(struct GNUNET_TUN_IPv6Header *ip, 774GNUNET_TUN_initialize_ipv6_header (struct GNUNET_TUN_IPv6Header *ip,
757 uint8_t protocol, 775 uint8_t protocol,
758 uint16_t payload_length, 776 uint16_t payload_length,
759 const struct in6_addr *src, 777 const struct in6_addr *src,
760 const struct in6_addr *dst); 778 const struct in6_addr *dst);
761 779
762/** 780/**
763 * Calculate IPv4 TCP checksum. 781 * Calculate IPv4 TCP checksum.
@@ -768,10 +786,10 @@ GNUNET_TUN_initialize_ipv6_header(struct GNUNET_TUN_IPv6Header *ip,
768 * @param payload_length number of bytes of TCP @a payload 786 * @param payload_length number of bytes of TCP @a payload
769 */ 787 */
770void 788void
771GNUNET_TUN_calculate_tcp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, 789GNUNET_TUN_calculate_tcp4_checksum (const struct GNUNET_TUN_IPv4Header *ip,
772 struct GNUNET_TUN_TcpHeader *tcp, 790 struct GNUNET_TUN_TcpHeader *tcp,
773 const void *payload, 791 const void *payload,
774 uint16_t payload_length); 792 uint16_t payload_length);
775 793
776/** 794/**
777 * Calculate IPv6 TCP checksum. 795 * Calculate IPv6 TCP checksum.
@@ -782,10 +800,10 @@ GNUNET_TUN_calculate_tcp4_checksum(const struct GNUNET_TUN_IPv4Header *ip,
782 * @param payload_length number of bytes of TCP payload 800 * @param payload_length number of bytes of TCP payload
783 */ 801 */
784void 802void
785GNUNET_TUN_calculate_tcp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, 803GNUNET_TUN_calculate_tcp6_checksum (const struct GNUNET_TUN_IPv6Header *ip,
786 struct GNUNET_TUN_TcpHeader *tcp, 804 struct GNUNET_TUN_TcpHeader *tcp,
787 const void *payload, 805 const void *payload,
788 uint16_t payload_length); 806 uint16_t payload_length);
789 807
790/** 808/**
791 * Calculate IPv4 UDP checksum. 809 * Calculate IPv4 UDP checksum.
@@ -796,10 +814,10 @@ GNUNET_TUN_calculate_tcp6_checksum(const struct GNUNET_TUN_IPv6Header *ip,
796 * @param payload_length number of bytes of UDP @a payload 814 * @param payload_length number of bytes of UDP @a payload
797 */ 815 */
798void 816void
799GNUNET_TUN_calculate_udp4_checksum(const struct GNUNET_TUN_IPv4Header *ip, 817GNUNET_TUN_calculate_udp4_checksum (const struct GNUNET_TUN_IPv4Header *ip,
800 struct GNUNET_TUN_UdpHeader *udp, 818 struct GNUNET_TUN_UdpHeader *udp,
801 const void *payload, 819 const void *payload,
802 uint16_t payload_length); 820 uint16_t payload_length);
803 821
804 822
805/** 823/**
@@ -811,10 +829,10 @@ GNUNET_TUN_calculate_udp4_checksum(const struct GNUNET_TUN_IPv4Header *ip,
811 * @param payload_length number of bytes of @a payload 829 * @param payload_length number of bytes of @a payload
812 */ 830 */
813void 831void
814GNUNET_TUN_calculate_udp6_checksum(const struct GNUNET_TUN_IPv6Header *ip, 832GNUNET_TUN_calculate_udp6_checksum (const struct GNUNET_TUN_IPv6Header *ip,
815 struct GNUNET_TUN_UdpHeader *udp, 833 struct GNUNET_TUN_UdpHeader *udp,
816 const void *payload, 834 const void *payload,
817 uint16_t payload_length); 835 uint16_t payload_length);
818 836
819 837
820/** 838/**
@@ -825,9 +843,9 @@ GNUNET_TUN_calculate_udp6_checksum(const struct GNUNET_TUN_IPv6Header *ip,
825 * @param payload_length number of bytes of @a payload 843 * @param payload_length number of bytes of @a payload
826 */ 844 */
827void 845void
828GNUNET_TUN_calculate_icmp_checksum(struct GNUNET_TUN_IcmpHeader *icmp, 846GNUNET_TUN_calculate_icmp_checksum (struct GNUNET_TUN_IcmpHeader *icmp,
829 const void *payload, 847 const void *payload,
830 uint16_t payload_length); 848 uint16_t payload_length);
831 849
832 850
833/** 851/**
@@ -839,9 +857,9 @@ GNUNET_TUN_calculate_icmp_checksum(struct GNUNET_TUN_IcmpHeader *icmp,
839 * bytes long. 857 * bytes long.
840 */ 858 */
841void 859void
842GNUNET_TUN_ipv4toregexsearch(const struct in_addr *ip, 860GNUNET_TUN_ipv4toregexsearch (const struct in_addr *ip,
843 uint16_t port, 861 uint16_t port,
844 char *rxstr); 862 char *rxstr);
845 863
846 864
847/** 865/**
@@ -853,9 +871,9 @@ GNUNET_TUN_ipv4toregexsearch(const struct in_addr *ip,
853 * bytes long. 871 * bytes long.
854 */ 872 */
855void 873void
856GNUNET_TUN_ipv6toregexsearch(const struct in6_addr *ipv6, 874GNUNET_TUN_ipv6toregexsearch (const struct in6_addr *ipv6,
857 uint16_t port, 875 uint16_t port,
858 char *rxstr); 876 char *rxstr);
859 877
860 878
861/** 879/**
@@ -868,7 +886,7 @@ GNUNET_TUN_ipv6toregexsearch(const struct in6_addr *ipv6,
868 * @return regular expression, NULL on error 886 * @return regular expression, NULL on error
869 */ 887 */
870char * 888char *
871GNUNET_TUN_ipv6policy2regex(const char *policy); 889GNUNET_TUN_ipv6policy2regex (const char *policy);
872 890
873 891
874/** 892/**
@@ -881,7 +899,7 @@ GNUNET_TUN_ipv6policy2regex(const char *policy);
881 * @return regular expression, NULL on error 899 * @return regular expression, NULL on error
882 */ 900 */
883char * 901char *
884GNUNET_TUN_ipv4policy2regex(const char *policy); 902GNUNET_TUN_ipv4policy2regex (const char *policy);
885 903
886 904
887/** 905/**
@@ -893,8 +911,8 @@ GNUNET_TUN_ipv4policy2regex(const char *policy);
893 * @param[out] hc corresponding hash 911 * @param[out] hc corresponding hash
894 */ 912 */
895void 913void
896GNUNET_TUN_service_name_to_hash(const char *service_name, 914GNUNET_TUN_service_name_to_hash (const char *service_name,
897 struct GNUNET_HashCode *hc); 915 struct GNUNET_HashCode *hc);
898 916
899 917
900/** 918/**
@@ -906,9 +924,9 @@ GNUNET_TUN_service_name_to_hash(const char *service_name,
906 * @return #GNUNET_YES if they are equal 924 * @return #GNUNET_YES if they are equal
907 */ 925 */
908int 926int
909GNUNET_TUN_sockaddr_cmp(const struct sockaddr *sa, 927GNUNET_TUN_sockaddr_cmp (const struct sockaddr *sa,
910 const struct sockaddr *sb, 928 const struct sockaddr *sb,
911 int include_port); 929 int include_port);
912 930
913 931
914/** 932/**
@@ -921,9 +939,9 @@ GNUNET_TUN_sockaddr_cmp(const struct sockaddr *sa,
921 * @param[out] cadet_port CADET port to use 939 * @param[out] cadet_port CADET port to use
922 */ 940 */
923void 941void
924GNUNET_TUN_compute_service_cadet_port(const struct GNUNET_HashCode *desc, 942GNUNET_TUN_compute_service_cadet_port (const struct GNUNET_HashCode *desc,
925 uint16_t ip_port, 943 uint16_t ip_port,
926 struct GNUNET_HashCode *cadet_port); 944 struct GNUNET_HashCode *cadet_port);
927 945
928#endif 946#endif
929 947
diff --git a/src/include/gnunet_vpn_service.h b/src/include/gnunet_vpn_service.h
index 7e066b14f..31476e140 100644
--- a/src/include/gnunet_vpn_service.h
+++ b/src/include/gnunet_vpn_service.h
@@ -69,7 +69,7 @@ typedef void (*GNUNET_VPN_AllocationCallback)(void *cls,
69 * @param rr request to cancel 69 * @param rr request to cancel
70 */ 70 */
71void 71void
72GNUNET_VPN_cancel_request(struct GNUNET_VPN_RedirectionRequest *rr); 72GNUNET_VPN_cancel_request (struct GNUNET_VPN_RedirectionRequest *rr);
73 73
74 74
75/** 75/**
@@ -95,14 +95,14 @@ GNUNET_VPN_cancel_request(struct GNUNET_VPN_RedirectionRequest *rr);
95 * anyway) 95 * anyway)
96 */ 96 */
97struct GNUNET_VPN_RedirectionRequest * 97struct GNUNET_VPN_RedirectionRequest *
98GNUNET_VPN_redirect_to_peer(struct GNUNET_VPN_Handle *vh, 98GNUNET_VPN_redirect_to_peer (struct GNUNET_VPN_Handle *vh,
99 int result_af, 99 int result_af,
100 uint8_t protocol, 100 uint8_t protocol,
101 const struct GNUNET_PeerIdentity *peer, 101 const struct GNUNET_PeerIdentity *peer,
102 const struct GNUNET_HashCode *serv, 102 const struct GNUNET_HashCode *serv,
103 struct GNUNET_TIME_Absolute expiration_time, 103 struct GNUNET_TIME_Absolute expiration_time,
104 GNUNET_VPN_AllocationCallback cb, 104 GNUNET_VPN_AllocationCallback cb,
105 void *cb_cls); 105 void *cb_cls);
106 106
107 107
108/** 108/**
@@ -129,13 +129,13 @@ GNUNET_VPN_redirect_to_peer(struct GNUNET_VPN_Handle *vh,
129 * anyway) 129 * anyway)
130 */ 130 */
131struct GNUNET_VPN_RedirectionRequest * 131struct GNUNET_VPN_RedirectionRequest *
132GNUNET_VPN_redirect_to_ip(struct GNUNET_VPN_Handle *vh, 132GNUNET_VPN_redirect_to_ip (struct GNUNET_VPN_Handle *vh,
133 int result_af, 133 int result_af,
134 int addr_af, 134 int addr_af,
135 const void *addr, 135 const void *addr,
136 struct GNUNET_TIME_Absolute expiration_time, 136 struct GNUNET_TIME_Absolute expiration_time,
137 GNUNET_VPN_AllocationCallback cb, 137 GNUNET_VPN_AllocationCallback cb,
138 void *cb_cls); 138 void *cb_cls);
139 139
140 140
141/** 141/**
@@ -145,7 +145,7 @@ GNUNET_VPN_redirect_to_ip(struct GNUNET_VPN_Handle *vh,
145 * @return VPN handle 145 * @return VPN handle
146 */ 146 */
147struct GNUNET_VPN_Handle * 147struct GNUNET_VPN_Handle *
148GNUNET_VPN_connect(const struct GNUNET_CONFIGURATION_Handle *cfg); 148GNUNET_VPN_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
149 149
150 150
151/** 151/**
@@ -154,7 +154,7 @@ GNUNET_VPN_connect(const struct GNUNET_CONFIGURATION_Handle *cfg);
154 * @param vh VPN handle 154 * @param vh VPN handle
155 */ 155 */
156void 156void
157GNUNET_VPN_disconnect(struct GNUNET_VPN_Handle *vh); 157GNUNET_VPN_disconnect (struct GNUNET_VPN_Handle *vh);
158 158
159#endif 159#endif
160 160
diff --git a/src/include/platform.h b/src/include/platform.h
index bdfbb4a4b..85f451bea 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -178,11 +178,11 @@
178/** 178/**
179 * GNU gettext support macro. 179 * GNU gettext support macro.
180 */ 180 */
181#define _(String) dgettext(PACKAGE, String) 181#define _(String) dgettext (PACKAGE, String)
182#define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor" 182#define LIBEXTRACTOR_GETTEXT_DOMAIN "libextractor"
183#else 183#else
184#include "libintlemu.h" 184#include "libintlemu.h"
185#define _(String) dgettext("org.gnunet.gnunet", String) 185#define _(String) dgettext ("org.gnunet.gnunet", String)
186#define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor" 186#define LIBEXTRACTOR_GETTEXT_DOMAIN "org.gnunet.libextractor"
187#endif 187#endif
188 188
@@ -202,9 +202,9 @@
202#endif 202#endif
203 203
204 204
205#if !HAVE_ATOLL 205#if ! HAVE_ATOLL
206long long 206long long
207atoll(const char *nptr); 207atoll (const char *nptr);
208#endif 208#endif
209 209
210#if ENABLE_NLS 210#if ENABLE_NLS
@@ -212,7 +212,7 @@ atoll(const char *nptr);
212#endif 212#endif
213 213
214#ifndef SIZE_MAX 214#ifndef SIZE_MAX
215#define SIZE_MAX ((size_t)(-1)) 215#define SIZE_MAX ((size_t) (-1))
216#endif 216#endif
217 217
218#ifndef O_LARGEFILE 218#ifndef O_LARGEFILE
@@ -228,7 +228,9 @@ atoll(const char *nptr);
228 228
229 229
230#if defined(__sparc__) 230#if defined(__sparc__)
231#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove(&__tmp, &(val), sizeof((val))); __tmp; }) 231#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, &(val), \
232 sizeof((val))); \
233 __tmp; })
232#else 234#else
233#define MAKE_UNALIGNED(val) val 235#define MAKE_UNALIGNED(val) val
234#endif 236#endif
@@ -258,7 +260,7 @@ atoll(const char *nptr);
258/** 260/**
259 * clang et al do not have such an attribute 261 * clang et al do not have such an attribute
260 */ 262 */
261#if __has_attribute(__nonstring__) 263#if __has_attribute (__nonstring__)
262# define __nonstring __attribute__((__nonstring__)) 264# define __nonstring __attribute__((__nonstring__))
263#else 265#else
264# define __nonstring 266# define __nonstring