aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-08 19:00:19 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-08 19:00:19 +0000
commitfe947a9704bed14c2fc74b2f2069596fe884cbad (patch)
tree644efdaa37d692b09f8e279bfe5e8b2ebe81448b /src
parenta8b0ab037820f6a9f405be3855ce8d3ebbd4399b (diff)
downloadgnunet-fe947a9704bed14c2fc74b2f2069596fe884cbad.tar.gz
gnunet-fe947a9704bed14c2fc74b2f2069596fe884cbad.zip
better comments
Diffstat (limited to 'src')
-rw-r--r--src/datastore/perf_plugin_datastore.c1
-rw-r--r--src/fs/fs_file_information.c2
-rw-r--r--src/include/gnunet_client_lib.h2
-rw-r--r--src/include/gnunet_common.h4
-rw-r--r--src/include/gnunet_configuration_lib.h4
-rw-r--r--src/include/gnunet_container_lib.h11
-rw-r--r--src/include/gnunet_crypto_lib.h29
-rw-r--r--src/include/gnunet_dht_service.h1
-rw-r--r--src/include/gnunet_fs_service.h26
-rw-r--r--src/include/gnunet_getopt_lib.h4
-rw-r--r--src/include/gnunet_network_lib.h7
-rw-r--r--src/include/gnunet_pseudonym_lib.h13
-rw-r--r--src/include/gnunet_scheduler_lib.h4
-rw-r--r--src/include/gnunet_server_lib.h2
-rw-r--r--src/include/gnunet_service_lib.h4
-rw-r--r--src/include/gnunet_transport_service.h2
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c9
-rw-r--r--src/peerinfo/peerinfo_api.c1
-rw-r--r--src/statistics/gnunet-statistics.c4
-rw-r--r--src/statistics/statistics_api.c1
-rw-r--r--src/topology/gnunet-daemon-topology.c18
-rw-r--r--src/transport/gnunet-service-transport.c1
-rw-r--r--src/transport/plugin_transport_http.c2
-rw-r--r--src/transport/plugin_transport_smtp.c6
-rw-r--r--src/transport/plugin_transport_tcp.c11
-rw-r--r--src/transport/plugin_transport_template.c5
-rw-r--r--src/transport/plugin_transport_udp.c2
-rw-r--r--src/transport/transport_api.c3
-rw-r--r--src/upnp/upnp.h6
-rw-r--r--src/util/common_logging.c6
-rw-r--r--src/util/container_bloomfilter.c6
-rw-r--r--src/util/container_meta_data.c27
-rw-r--r--src/util/crypto_hash.c2
-rw-r--r--src/util/crypto_random.c21
-rw-r--r--src/util/crypto_rsa.c24
-rw-r--r--src/util/getopt.c2
-rw-r--r--src/util/gnunet-service-resolver.c60
-rw-r--r--src/util/os_network.c12
-rw-r--r--src/util/os_priority.c14
-rw-r--r--src/util/pseudonym.c2
-rw-r--r--src/util/resolver.h2
-rw-r--r--src/util/resolver_api.c2
-rw-r--r--src/util/strings.c24
43 files changed, 245 insertions, 144 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index 1a3f890d9..9d2b1cc6c 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -192,6 +192,7 @@ iterateDummy (void *cls,
192 * down. Unloads our datastore plugin. 192 * down. Unloads our datastore plugin.
193 * 193 *
194 * @param api api to unload 194 * @param api api to unload
195 * @param cfg configuration to use
195 */ 196 */
196static void 197static void
197unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api, 198unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index 5afdc392f..c20af5ea6 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -37,6 +37,8 @@
37/** 37/**
38 * Create a temporary file on disk to store the current 38 * Create a temporary file on disk to store the current
39 * state of "fi" in. 39 * state of "fi" in.
40 *
41 * @param fi file information to sync with disk
40 */ 42 */
41void 43void
42GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation * fi) 44GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation * fi)
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h
index 17f17ab50..20842de5c 100644
--- a/src/include/gnunet_client_lib.h
+++ b/src/include/gnunet_client_lib.h
@@ -101,7 +101,7 @@ void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
101 * are free in the transmission buffer. May call the notify 101 * are free in the transmission buffer. May call the notify
102 * method immediately if enough space is available. 102 * method immediately if enough space is available.
103 * 103 *
104 * @param client connection to the service 104 * @param sock connection to the service
105 * @param size number of bytes to send 105 * @param size number of bytes to send
106 * @param timeout after how long should we give up (and call 106 * @param timeout after how long should we give up (and call
107 * notify with buf NULL and size 0)? 107 * notify with buf NULL and size 0)?
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 402674f48..df601ac19 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -181,13 +181,13 @@ GNUNET_log_skip (unsigned int n, int check_reset);
181/** 181/**
182 * Setup logging. 182 * Setup logging.
183 * 183 *
184 * @param component default component to use 184 * @param comp default component to use
185 * @param loglevel what types of messages should be logged 185 * @param loglevel what types of messages should be logged
186 * @param logfile change logging to logfile (use NULL to keep stderr) 186 * @param logfile change logging to logfile (use NULL to keep stderr)
187 * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened 187 * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened
188 */ 188 */
189int 189int
190GNUNET_log_setup (const char *component, 190GNUNET_log_setup (const char *comp,
191 const char *loglevel, const char *logfile); 191 const char *loglevel, const char *logfile);
192 192
193/** 193/**
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index 8e2f8e6d9..f05d29421 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -55,11 +55,11 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void);
55/** 55/**
56 * Duplicate an existing configuration object. 56 * Duplicate an existing configuration object.
57 * 57 *
58 * @param c configuration to duplicate 58 * @param cfg configuration to duplicate
59 * @return duplicate configuration 59 * @return duplicate configuration
60 */ 60 */
61struct GNUNET_CONFIGURATION_Handle * 61struct GNUNET_CONFIGURATION_Handle *
62GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *c); 62GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg);
63 63
64 64
65/** 65/**
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index ec190fdc6..b9ce80d95 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -217,13 +217,13 @@ struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void);
217/** 217/**
218 * Duplicate a MetaData token. 218 * Duplicate a MetaData token.
219 * 219 *
220 * @param meta what to duplicate 220 * @param md what to duplicate
221 * @return duplicate meta-data container 221 * @return duplicate meta-data container
222 */ 222 */
223struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const 223struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const
224 struct 224 struct
225 GNUNET_CONTAINER_MetaData 225 GNUNET_CONTAINER_MetaData
226 *meta); 226 *md);
227 227
228/** 228/**
229 * Free meta data. 229 * Free meta data.
@@ -261,6 +261,7 @@ int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
261/** 261/**
262 * Remove an item. 262 * Remove an item.
263 * 263 *
264 * @param md metadata to manipulate
264 * @param type type of the item to remove 265 * @param type type of the item to remove
265 * @param data specific value to remove, NULL to remove all 266 * @param data specific value to remove, NULL to remove all
266 * entries of the given type 267 * entries of the given type
@@ -373,7 +374,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions
373 * 374 *
374 * @param md metadata to serialize 375 * @param md metadata to serialize
375 * @param target where to write the serialized metadata 376 * @param target where to write the serialized metadata
376 * @param size maximum number of bytes available 377 * @param max maximum number of bytes available
377 * @param opt is it ok to just write SOME of the 378 * @param opt is it ok to just write SOME of the
378 * meta-data to match the size constraint, 379 * meta-data to match the size constraint,
379 * possibly discarding some data? 380 * possibly discarding some data?
@@ -384,7 +385,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions
384ssize_t GNUNET_CONTAINER_meta_data_serialize (const struct 385ssize_t GNUNET_CONTAINER_meta_data_serialize (const struct
385 GNUNET_CONTAINER_MetaData *md, 386 GNUNET_CONTAINER_MetaData *md,
386 char *target, 387 char *target,
387 size_t size, 388 size_t max,
388 enum 389 enum
389 GNUNET_CONTAINER_MetaDataSerializationOptions 390 GNUNET_CONTAINER_MetaDataSerializationOptions
390 opt); 391 opt);
@@ -958,7 +959,7 @@ void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l);
958 * Check if a list contains a certain element 959 * Check if a list contains a certain element
959 * @param l list 960 * @param l list
960 * @param buf payload buffer to find 961 * @param buf payload buffer to find
961 * @param lenght of the payload 962 * @param len length of the payload (number of bytes in buf)
962 */ 963 */
963int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, const void *buf, size_t len); 964int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, const void *buf, size_t len);
964 965
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 9b795cc75..76d28ad57 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -228,8 +228,7 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode,
228 228
229 229
230/** 230/**
231 * Random on unsigned 64-bit values. We break them down into signed 231 * Random on unsigned 64-bit values.
232 * 32-bit values and reassemble the 64-bit random value bit-wise.
233 * 232 *
234 * @param mode desired quality of the random number 233 * @param mode desired quality of the random number
235 * @param max value returned will be in range [0,max) (exclusive) 234 * @param max value returned will be in range [0,max) (exclusive)
@@ -278,7 +277,7 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct
278 * @param sessionkey the key used to encrypt 277 * @param sessionkey the key used to encrypt
279 * @param iv the initialization vector to use, use INITVALUE 278 * @param iv the initialization vector to use, use INITVALUE
280 * for streams. 279 * for streams.
281 * @returns the size of the encrypted block, -1 for errors 280 * @return the size of the encrypted block, -1 for errors
282 */ 281 */
283ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, 282ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block,
284 size_t len, 283 size_t len,
@@ -307,10 +306,10 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block,
307 306
308 307
309/** 308/**
310 * Convert GNUNET_CRYPTO_hash to ASCII encoding. 309 * Convert hash to ASCII encoding.
311 * @param block the GNUNET_CRYPTO_hash code 310 * @param block the hash code
312 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be 311 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
313 * safely cast to char*, a '\0' termination is set). 312 * safely cast to char*, a '\\0' termination is set).
314 */ 313 */
315void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, 314void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
316 struct GNUNET_CRYPTO_HashAsciiEncoded 315 struct GNUNET_CRYPTO_HashAsciiEncoded
@@ -515,11 +514,11 @@ struct GNUNET_CRYPTO_RsaPrivateKey
515 * Deterministically (!) create a private key using only the 514 * Deterministically (!) create a private key using only the
516 * given HashCode as input to the PRNG. 515 * given HashCode as input to the PRNG.
517 * 516 *
518 * @param input "random" input to PRNG 517 * @param hc "random" input to PRNG
519 * @return some private key purely dependent on input 518 * @return some private key purely dependent on input
520 */ 519 */
521struct GNUNET_CRYPTO_RsaPrivateKey 520struct GNUNET_CRYPTO_RsaPrivateKey
522 *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * input); 521 *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc);
523 522
524 523
525/** 524/**
@@ -550,7 +549,7 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct
550 * @param size the size of block 549 * @param size the size of block
551 * @param publicKey the encoded public key used to encrypt 550 * @param publicKey the encoded public key used to encrypt
552 * @param target where to store the encrypted block 551 * @param target where to store the encrypted block
553 * @returns GNUNET_SYSERR on error, GNUNET_OK if ok 552 * @return GNUNET_SYSERR on error, GNUNET_OK if ok
554 */ 553 */
555int GNUNET_CRYPTO_rsa_encrypt (const void *block, 554int GNUNET_CRYPTO_rsa_encrypt (const void *block,
556 size_t size, 555 size_t size,
@@ -566,14 +565,14 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block,
566 * @param key the key to use 565 * @param key the key to use
567 * @param block the data to decrypt, encoded as returned by encrypt, not consumed 566 * @param block the data to decrypt, encoded as returned by encrypt, not consumed
568 * @param result pointer to a location where the result can be stored 567 * @param result pointer to a location where the result can be stored
569 * @param size how many bytes of a result are expected? Must be exact. 568 * @param max how many bytes of a result are expected? Must be exact.
570 * @returns the size of the decrypted block (that is, size) or -1 on error 569 * @return the size of the decrypted block (that is, size) or -1 on error
571 */ 570 */
572ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key, 571ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
573 const struct GNUNET_CRYPTO_RsaEncryptedData 572 const struct GNUNET_CRYPTO_RsaEncryptedData
574 *block, 573 *block,
575 void *result, 574 void *result,
576 size_t size); 575 size_t max);
577 576
578 577
579/** 578/**
@@ -581,13 +580,13 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key
581 * 580 *
582 * @param key private key to use for the signing 581 * @param key private key to use for the signing
583 * @param purpose what to sign (size, purpose) 582 * @param purpose what to sign (size, purpose)
584 * @param result where to write the signature 583 * @param sig where to write the signature
585 * @return GNUNET_SYSERR on error, GNUNET_OK on success 584 * @return GNUNET_SYSERR on error, GNUNET_OK on success
586 */ 585 */
587int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, 586int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
588 const struct GNUNET_CRYPTO_RsaSignaturePurpose 587 const struct GNUNET_CRYPTO_RsaSignaturePurpose
589 *purpose, 588 *purpose,
590 struct GNUNET_CRYPTO_RsaSignature *result); 589 struct GNUNET_CRYPTO_RsaSignature *sig);
591 590
592 591
593/** 592/**
@@ -598,7 +597,7 @@ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
598 * @param validate block to validate (size, purpose, data) 597 * @param validate block to validate (size, purpose, data)
599 * @param sig signature that is being validated 598 * @param sig signature that is being validated
600 * @param publicKey public key of the signer 599 * @param publicKey public key of the signer
601 * @returns GNUNET_OK if ok, GNUNET_SYSERR if invalid 600 * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid
602 */ 601 */
603int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, 602int GNUNET_CRYPTO_rsa_verify (uint32_t purpose,
604 const struct GNUNET_CRYPTO_RsaSignaturePurpose 603 const struct GNUNET_CRYPTO_RsaSignaturePurpose
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h
index 0dab0bcbc..4bf3ce15b 100644
--- a/src/include/gnunet_dht_service.h
+++ b/src/include/gnunet_dht_service.h
@@ -93,6 +93,7 @@ typedef void (*GNUNET_DHT_Iterator)(void *cls,
93/** 93/**
94 * Perform an asynchronous GET operation on the DHT identified. 94 * Perform an asynchronous GET operation on the DHT identified.
95 * 95 *
96 * @param h handle to the DHT service
96 * @param type expected type of the response object 97 * @param type expected type of the response object
97 * @param key the key to look up 98 * @param key the key to look up
98 * @param iter function to call on each result 99 * @param iter function to call on each result
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index ae1b46a89..5449f6324 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -198,7 +198,7 @@ GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
198/** 198/**
199 * Construct a location URI (this peer will be used for the location). 199 * Construct a location URI (this peer will be used for the location).
200 * 200 *
201 * @param baseURI content offered by the sender 201 * @param baseUri content offered by the sender
202 * @param cfg configuration information (used to find our hostkey) 202 * @param cfg configuration information (used to find our hostkey)
203 * @param expiration_time how long will the content be offered? 203 * @param expiration_time how long will the content be offered?
204 * @return the location URI, NULL on error 204 * @return the location URI, NULL on error
@@ -1552,10 +1552,10 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
1552 * file information data should already call "sync" internally, 1552 * file information data should already call "sync" internally,
1553 * so this function is likely not useful for clients. 1553 * so this function is likely not useful for clients.
1554 * 1554 *
1555 * @param s the struct to sync 1555 * @param fi the struct to sync
1556 */ 1556 */
1557void 1557void
1558GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation *s); 1558GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation *f);
1559 1559
1560 1560
1561/** 1561/**
@@ -1809,14 +1809,14 @@ GNUNET_FS_file_information_create_empty_directory (void *client_info,
1809 * "GNUNET_FS_publish_start" already. 1809 * "GNUNET_FS_publish_start" already.
1810 * 1810 *
1811 * @param dir the directory 1811 * @param dir the directory
1812 * @param end the entry to add; the entry must not have been 1812 * @param ent the entry to add; the entry must not have been
1813 * added to any other directory at this point and 1813 * added to any other directory at this point and
1814 * must not include "dir" in its structure 1814 * must not include "dir" in its structure
1815 * @return GNUNET_OK on success, GNUNET_SYSERR on error 1815 * @return GNUNET_OK on success, GNUNET_SYSERR on error
1816 */ 1816 */
1817int 1817int
1818GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, 1818GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
1819 struct GNUNET_FS_FileInformation *end); 1819 struct GNUNET_FS_FileInformation *ent);
1820 1820
1821 1821
1822/** 1822/**
@@ -1926,7 +1926,7 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
1926 * Publish a KBlock on GNUnet. 1926 * Publish a KBlock on GNUnet.
1927 * 1927 *
1928 * @param h handle to the file sharing subsystem 1928 * @param h handle to the file sharing subsystem
1929 * @param keywords keywords to use 1929 * @param ksk_uri keywords to use
1930 * @param meta metadata to use 1930 * @param meta metadata to use
1931 * @param uri URI to refer to in the KBlock 1931 * @param uri URI to refer to in the KBlock
1932 * @param expirationTime when the KBlock expires 1932 * @param expirationTime when the KBlock expires
@@ -1937,7 +1937,7 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
1937 */ 1937 */
1938void 1938void
1939GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, 1939GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1940 struct GNUNET_FS_Uri *keywords, 1940 struct GNUNET_FS_Uri *ksk_uri,
1941 struct GNUNET_CONTAINER_MetaData *meta, 1941 struct GNUNET_CONTAINER_MetaData *meta,
1942 struct GNUNET_FS_Uri *uri, 1942 struct GNUNET_FS_Uri *uri,
1943 struct GNUNET_TIME_Absolute expirationTime, 1943 struct GNUNET_TIME_Absolute expirationTime,
@@ -2258,11 +2258,11 @@ GNUNET_FS_file_download_start (struct GNUNET_FS_Handle *h,
2258/** 2258/**
2259 * Stop a download (aborts if download is incomplete). 2259 * Stop a download (aborts if download is incomplete).
2260 * 2260 *
2261 * @param rm handle for the download 2261 * @param dc handle for the download
2262 * @param do_delete delete files of incomplete downloads 2262 * @param do_delete delete files of incomplete downloads
2263 */ 2263 */
2264void 2264void
2265GNUNET_FS_file_download_stop (struct GNUNET_FS_DownloadContext *rm, 2265GNUNET_FS_file_download_stop (struct GNUNET_FS_DownloadContext *dc,
2266 int do_delete); 2266 int do_delete);
2267 2267
2268 2268
@@ -2439,14 +2439,14 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
2439 * in-memory. 2439 * in-memory.
2440 * 2440 *
2441 * @param bld directory to finish 2441 * @param bld directory to finish
2442 * @param size set to the number of bytes needed 2442 * @param rsize set to the number of bytes needed
2443 * @param data set to the encoded directory 2443 * @param rdata set to the encoded directory
2444 * @return GNUNET_OK on success 2444 * @return GNUNET_OK on success
2445 */ 2445 */
2446int 2446int
2447GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, 2447GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
2448 size_t *size, 2448 size_t *rsize,
2449 void **data); 2449 void **rdata);
2450 2450
2451 2451
2452#if 0 /* keep Emacsens' auto-indent happy */ 2452#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index 44525e2f2..d5f3d1198 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -186,14 +186,14 @@ struct GNUNET_GETOPT_CommandLineOption
186/** 186/**
187 * Parse the command line. 187 * Parse the command line.
188 * 188 *
189 * @param binaryName name of the binary / application with options 189 * @param binaryOptions Name of application with option summary
190 * @param allOptions defined options and handlers 190 * @param allOptions defined options and handlers
191 * @param argc number of arguments 191 * @param argc number of arguments
192 * @param argv actual arguments 192 * @param argv actual arguments
193 * @return index into argv with first non-option 193 * @return index into argv with first non-option
194 * argument, or GNUNET_SYSERR on error 194 * argument, or GNUNET_SYSERR on error
195 */ 195 */
196int GNUNET_GETOPT_run (const char *binaryName, 196int GNUNET_GETOPT_run (const char *binaryOptions,
197 const struct GNUNET_GETOPT_CommandLineOption 197 const struct GNUNET_GETOPT_CommandLineOption
198 *allOptions, unsigned int argc, char *const *argv); 198 *allOptions, unsigned int argc, char *const *argv);
199 199
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h
index d966c3afe..e4ba55854 100644
--- a/src/include/gnunet_network_lib.h
+++ b/src/include/gnunet_network_lib.h
@@ -100,11 +100,12 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
100 * 100 *
101 * @param desc socket to connect 101 * @param desc socket to connect
102 * @param address peer address 102 * @param address peer address
103 * @param length of address 103 * @param address_len of address
104 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 104 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
105 */ 105 */
106int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, 106int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
107 const struct sockaddr *address, socklen_t address_len); 107 const struct sockaddr *address,
108 socklen_t address_len);
108 109
109 110
110/** 111/**
@@ -262,7 +263,7 @@ void GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to,
262 * Copy a native fd set 263 * Copy a native fd set
263 * @param to destination 264 * @param to destination
264 * @param from native source set 265 * @param from native source set
265 * @param the biggest socket number in from + 1 266 * @param nfds the biggest socket number in from + 1
266 */ 267 */
267void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, 268void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to,
268 const fd_set *from, 269 const fd_set *from,
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h
index ced9bf387..ba240941b 100644
--- a/src/include/gnunet_pseudonym_lib.h
+++ b/src/include/gnunet_pseudonym_lib.h
@@ -55,20 +55,25 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls,
55/** 55/**
56 * Change the ranking of a pseudonym. 56 * Change the ranking of a pseudonym.
57 * 57 *
58 * @param pseudonym id of the pseudonym 58 * @param cfg overall configuration
59 * @param nsid id of the pseudonym
59 * @param delta by how much should the rating be changed? 60 * @param delta by how much should the rating be changed?
60 * @return new rating of the namespace 61 * @return new rating of the namespace
61 */ 62 */
62int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, 63int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
63 const GNUNET_HashCode * pseudonym, int delta); 64 const GNUNET_HashCode *nsid, int delta);
64 65
65/** 66/**
66 * Add a pseudonym to the set of known pseudonyms. 67 * Add a pseudonym to the set of known pseudonyms.
68 * For all pseudonym advertisements that we discover
69 * FS should automatically call this function.
67 * 70 *
68 * @param pseudonym the pseudonym's identifier 71 * @param cfg overall configuration
72 * @param id the pseudonym identifier
73 * @param meta metadata for the pseudonym
69 */ 74 */
70void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, 75void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
71 const GNUNET_HashCode * pseudo, 76 const GNUNET_HashCode *id,
72 const struct GNUNET_CONTAINER_MetaData *meta); 77 const struct GNUNET_CONTAINER_MetaData *meta);
73 78
74 79
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index db94f05ab..621e57fcf 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -482,7 +482,6 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_SCHEDULER_Handle *sched,
482 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency 482 * are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency
483 * on completion of other tasks. 483 * on completion of other tasks.
484 * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever" 484 * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever"
485 * @param nfds highest-numbered file descriptor in any of the two sets plus one
486 * @param rs set of file descriptors we want to read (can be NULL) 485 * @param rs set of file descriptors we want to read (can be NULL)
487 * @param ws set of file descriptors we want to write (can be NULL) 486 * @param ws set of file descriptors we want to write (can be NULL)
488 * @param main main function of the task 487 * @param main main function of the task
@@ -497,7 +496,8 @@ GNUNET_SCHEDULER_add_select (struct GNUNET_SCHEDULER_Handle *sched,
497 GNUNET_SCHEDULER_TaskIdentifier 496 GNUNET_SCHEDULER_TaskIdentifier
498 prerequisite_task, 497 prerequisite_task,
499 struct GNUNET_TIME_Relative delay, 498 struct GNUNET_TIME_Relative delay,
500 const struct GNUNET_NETWORK_FDSet * rs, const struct GNUNET_NETWORK_FDSet * ws, 499 const struct GNUNET_NETWORK_FDSet * rs,
500 const struct GNUNET_NETWORK_FDSet * ws,
501 GNUNET_SCHEDULER_Task main, void *cls); 501 GNUNET_SCHEDULER_Task main, void *cls);
502 502
503#if 0 /* keep Emacsens' auto-indent happy */ 503#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index 135b1f196..570985d16 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -329,7 +329,7 @@ typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls);
329 * @param server the server to use 329 * @param server the server to use
330 * @param chandle opaque handle for the connection 330 * @param chandle opaque handle for the connection
331 * @param creceive receive function for the connection 331 * @param creceive receive function for the connection
332 * @param creceive_cancel cancel receive function for the connection 332 * @param ccancel cancel receive function for the connection
333 * @param cnotify transmit notification function for the connection 333 * @param cnotify transmit notification function for the connection
334 * @param cnotify_cancel transmit notification cancellation function for the connection 334 * @param cnotify_cancel transmit notification cancellation function for the connection
335 * @param ccheck function to test if the connection is still up 335 * @param ccheck function to test if the connection is still up
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index 4d0eefb98..0c69d297c 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -123,9 +123,9 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct
123/** 123/**
124 * Stop a service that was started with "GNUNET_SERVICE_start". 124 * Stop a service that was started with "GNUNET_SERVICE_start".
125 * 125 *
126 * @param ctx the service context returned from the start function 126 * @param sctx the service context returned from the start function
127 */ 127 */
128void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *ctx); 128void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx);
129 129
130 130
131#if 0 /* keep Emacsens' auto-indent happy */ 131#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 604610774..8bf295567 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -106,7 +106,7 @@ typedef void
106 * @param cls closure for the callbacks 106 * @param cls closure for the callbacks
107 * @param rec receive function to call 107 * @param rec receive function to call
108 * @param nc function to call on connect events 108 * @param nc function to call on connect events
109 * @param dc function to call on disconnect events 109 * @param nd function to call on disconnect events
110 */ 110 */
111struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct 111struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct
112 GNUNET_SCHEDULER_Handle 112 GNUNET_SCHEDULER_Handle
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 281779897..3608dab84 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -104,6 +104,10 @@ static char *trustDirectory;
104 * Address iterator that causes expired entries to be discarded. 104 * Address iterator that causes expired entries to be discarded.
105 * 105 *
106 * @param cls pointer to the current time 106 * @param cls pointer to the current time
107 * @param tname name of the transport
108 * @param expiration expiration time for the address
109 * @param addr the address
110 * @param addrlen length of addr in bytes
107 * @return GNUNET_NO if expiration smaller than the current time 111 * @return GNUNET_NO if expiration smaller than the current time
108 */ 112 */
109static int 113static int
@@ -176,7 +180,6 @@ lookup_host_entry (const struct GNUNET_PeerIdentity *id)
176 * Add a host to the list. 180 * Add a host to the list.
177 * 181 *
178 * @param identity the identity of the host 182 * @param identity the identity of the host
179 * @param protocol the protocol for the host
180 */ 183 */
181static void 184static void
182add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) 185add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
@@ -398,7 +401,9 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
398 * argument or for all known hosts and change their trust values by 401 * argument or for all known hosts and change their trust values by
399 * the given delta. 402 * the given delta.
400 * 403 *
401 * @param only NULL to hit all hosts 404 * @param only NULL to hit all hosts, otherwise specifies a particular target
405 * @param trust_change how much should the trust be changed
406 * @param client who is making the request (and will thus receive our confirmation)
402 */ 407 */
403static void 408static void
404send_to_each_host (const struct GNUNET_PeerIdentity *only, 409send_to_each_host (const struct GNUNET_PeerIdentity *only,
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 57197798b..14efa1708 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -76,7 +76,6 @@ copy_and_free (void *cls, size_t size, void *buf)
76 * @param sched scheduler to use 76 * @param sched scheduler to use
77 * @param peer identity of the peer 77 * @param peer identity of the peer
78 * @param hello the verified (!) HELLO message 78 * @param hello the verified (!) HELLO message
79 * @param expiration when the HELLO will expire
80 */ 79 */
81void 80void
82GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg, 81GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index fe75f93aa..bea9ca0ca 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -65,11 +65,11 @@ static int persistent;
65static int 65static int
66printer (void *cls, 66printer (void *cls,
67 const char *subsystem, 67 const char *subsystem,
68 const char *sname, unsigned long long value, int is_persistent) 68 const char *name, unsigned long long value, int is_persistent)
69{ 69{
70 FPRINTF (stdout, 70 FPRINTF (stdout,
71 "%s%-20s %-40s: %16llu\n", 71 "%s%-20s %-40s: %16llu\n",
72 is_persistent ? "!" : " ", subsystem, _(sname), value); 72 is_persistent ? "!" : " ", subsystem, _(name), value);
73 return GNUNET_OK; 73 return GNUNET_OK;
74} 74}
75 75
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 26e2425e6..335cd4165 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -201,6 +201,7 @@ free_action_item (struct ActionItem *ai)
201/** 201/**
202 * Get handle for the statistics service. 202 * Get handle for the statistics service.
203 * 203 *
204 * @param sched scheduler to use
204 * @param subsystem name of subsystem using the service 205 * @param subsystem name of subsystem using the service
205 * @param cfg services configuration in use 206 * @param cfg services configuration in use
206 * @return handle to use 207 * @return handle to use
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 466e06961..6dc492a56 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -250,7 +250,8 @@ ready_callback (void *cls,
250/** 250/**
251 * Try to connect to the specified peer. 251 * Try to connect to the specified peer.
252 * 252 *
253 * @param pos NULL if not in friend list yet 253 * @param peer who we should try to connect to
254 * @param pos entry in our friend list; NULL if not in friend list yet
254 */ 255 */
255static void 256static void
256attempt_connect (const struct GNUNET_PeerIdentity *peer, 257attempt_connect (const struct GNUNET_PeerIdentity *peer,
@@ -475,7 +476,12 @@ schedule_peer_search ()
475/** 476/**
476 * Iterator called on each address. 477 * Iterator called on each address.
477 * 478 *
478 * @param cls flag that we will set if we see any addresses. 479 * @param cls flag that we will set if we see any addresses
480 * @param tname name of the transport
481 * @param expiration when will the given address expire
482 * @param addr the address of the peer
483 * @param addrlen number of bytes in addr
484 * @return GNUNET_SYSERR always, to terminate iteration
479 */ 485 */
480static int 486static int
481address_iterator (void *cls, 487address_iterator (void *cls,
@@ -840,7 +846,7 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
840 * received. 846 * received.
841 * 847 *
842 * @param cls closure 848 * @param cls closure
843 * @param peer the other peer involved (sender or receiver, NULL 849 * @param other the other peer involved (sender or receiver, NULL
844 * for loopback messages where we are both sender and receiver) 850 * for loopback messages where we are both sender and receiver)
845 * @param message the actual HELLO message 851 * @param message the actual HELLO message
846 * @return GNUNET_OK to keep the connection open, 852 * @return GNUNET_OK to keep the connection open,
@@ -862,6 +868,11 @@ handle_encrypted_hello (void *cls,
862/** 868/**
863 * Peerinfo calls this function to let us know about a 869 * Peerinfo calls this function to let us know about a
864 * possible peer that we might want to connect to. 870 * possible peer that we might want to connect to.
871 *
872 * @param cls unused
873 * @param peer NULL for the end of the list, otherwise a peer identity
874 * @param hello a HELLO for a peer, or NULL
875 * @param trust how much do we trust the given peer?
865 */ 876 */
866static void 877static void
867gather_hello_callback (void *cls, 878gather_hello_callback (void *cls,
@@ -882,6 +893,7 @@ gather_hello_callback (void *cls,
882/** 893/**
883 * Function to fill send buffer with HELLO. 894 * Function to fill send buffer with HELLO.
884 * 895 *
896 * @param cls unused
885 * @param receiver the receiver of the message 897 * @param receiver the receiver of the message
886 * @param position is the reference to the 898 * @param position is the reference to the
887 * first unused position in the buffer where GNUnet is building 899 * first unused position in the buffer where GNUnet is building
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 192ebf98f..6803e3179 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -2066,6 +2066,7 @@ setup_new_neighbour (const struct GNUNET_PeerIdentity *peer)
2066 * reducing the rate at which they read from the socket 2066 * reducing the rate at which they read from the socket
2067 * and generally forward to our receive callback. 2067 * and generally forward to our receive callback.
2068 * 2068 *
2069 * @param cls the "struct TransportPlugin *" we gave to the plugin
2069 * @param plugin_context value to pass to this plugin 2070 * @param plugin_context value to pass to this plugin
2070 * to respond to the given peer (use is optional, 2071 * to respond to the given peer (use is optional,
2071 * but may speed up processing) 2072 * but may speed up processing)
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index c2f531b54..5fd875623 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -1231,6 +1231,7 @@ create_curl_get (HTTPSession * httpSession)
1231 * 1231 *
1232 * @param hello the hello-Message for the target node 1232 * @param hello the hello-Message for the target node
1233 * @param tsessionPtr the session handle that is set 1233 * @param tsessionPtr the session handle that is set
1234 * @param may_reuse are we allowed to re-use an existing connection?
1234 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed 1235 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
1235 */ 1236 */
1236static int 1237static int
@@ -1458,6 +1459,7 @@ httpTestWouldTry (GNUNET_TSession * tsession, const unsigned int size,
1458 * @param tsession the GNUNET_MessageHello identifying the remote node 1459 * @param tsession the GNUNET_MessageHello identifying the remote node
1459 * @param msg the message 1460 * @param msg the message
1460 * @param size the size of the message 1461 * @param size the size of the message
1462 * @param important is this message so important that usual restrictions do not apply?
1461 * @return GNUNET_SYSERR on error, GNUNET_OK on success, GNUNET_NO if queue is full 1463 * @return GNUNET_SYSERR on error, GNUNET_OK on success, GNUNET_NO if queue is full
1462 */ 1464 */
1463static int 1465static int
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index b93b16fb7..ec54d3f22 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -516,8 +516,9 @@ get_message (void **buf, int *len, void *cls)
516 * Send a message to the specified remote node. 516 * Send a message to the specified remote node.
517 * 517 *
518 * @param tsession the GNUNET_MessageHello identifying the remote node 518 * @param tsession the GNUNET_MessageHello identifying the remote node
519 * @param message what to send 519 * @param msg what to send
520 * @param size the size of the message 520 * @param size the size of the message
521 * @param important is this message important enough to override typical limits?
521 * @return GNUNET_SYSERR on error, GNUNET_OK on success 522 * @return GNUNET_SYSERR on error, GNUNET_OK on success
522 */ 523 */
523static int 524static int
@@ -689,8 +690,9 @@ api_send (GNUNET_TSession * tsession,
689 690
690/** 691/**
691 * Establish a connection to a remote node. 692 * Establish a connection to a remote node.
692 * @param helo the hello-Message for the target node 693 * @param hello the hello-Message for the target node
693 * @param tsessionPtr the session handle that is to be set 694 * @param tsessionPtr the session handle that is to be set
695 * @param may_reuse can we re-use an existing connection?
694 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed 696 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
695 */ 697 */
696static int 698static int
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 8e5f5dcef..89c64021e 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1059,13 +1059,14 @@ session_try_connect (void *cls,
1059 * @param target who should receive this message 1059 * @param target who should receive this message
1060 * @param priority how important is the message 1060 * @param priority how important is the message
1061 * @param msg the message to transmit 1061 * @param msg the message to transmit
1062 * @param timeout when should we time out (give up) if we can not transmit?
1062 * @param cont continuation to call once the message has 1063 * @param cont continuation to call once the message has
1063 * been transmitted (or if the transport is ready 1064 * been transmitted (or if the transport is ready
1064 * for the next transmission call; or if the 1065 * for the next transmission call; or if the
1065 * peer disconnected...) 1066 * peer disconnected...)
1066 * @param cont_cls closure for cont 1067 * @param cont_cls closure for cont
1067 * @return plugin_context that should be used next time for 1068 * @return plugin_context that should be used next time for
1068 * sending messages to the specified peer 1069 * sending messages to the specified peer
1069 */ 1070 */
1070static void * 1071static void *
1071tcp_plugin_send (void *cls, 1072tcp_plugin_send (void *cls,
@@ -1252,7 +1253,7 @@ append_port (void *cls, const char *hostname)
1252 * format. 1253 * format.
1253 * 1254 *
1254 * @param cls closure 1255 * @param cls closure
1255 * @param name name of the transport that generated the address 1256 * @param type name of the transport that generated the address
1256 * @param addr one of the addresses of the host, NULL for the last address 1257 * @param addr one of the addresses of the host, NULL for the last address
1257 * the specific address format depends on the transport 1258 * the specific address format depends on the transport
1258 * @param addrlen length of the address 1259 * @param addrlen length of the address
@@ -1353,7 +1354,7 @@ update_quota (struct Session *session, int force)
1353 * calls to stay below the quota (in terms of incoming data). 1354 * calls to stay below the quota (in terms of incoming data).
1354 * 1355 *
1355 * @param cls closure 1356 * @param cls closure
1356 * @param peer the peer for whom the quota is given 1357 * @param target the peer for whom the quota is given
1357 * @param quota_in quota for receiving/sending data in bytes per ms 1358 * @param quota_in quota for receiving/sending data in bytes per ms
1358 */ 1359 */
1359static void 1360static void
@@ -1581,8 +1582,8 @@ handle_tcp_ping (void *cls,
1581/** 1582/**
1582 * Handle PONG-message. 1583 * Handle PONG-message.
1583 * 1584 *
1584 * @param plugin handle for this plugin 1585 * @param cls handle for this plugin
1585 * @param sender claimed sender of the PONG 1586 * @param client from where did we receive the PONG
1586 * @param message the actual message 1587 * @param message the actual message
1587 */ 1588 */
1588static void 1589static void
diff --git a/src/transport/plugin_transport_template.c b/src/transport/plugin_transport_template.c
index 6307092fc..95fd2de5f 100644
--- a/src/transport/plugin_transport_template.c
+++ b/src/transport/plugin_transport_template.c
@@ -171,6 +171,7 @@ template_plugin_validate (void *cls,
171 * @param target who should receive this message 171 * @param target who should receive this message
172 * @param priority how important is the message 172 * @param priority how important is the message
173 * @param msg the message to transmit 173 * @param msg the message to transmit
174 * @param timeout when should we time out
174 * @param cont continuation to call once the message has 175 * @param cont continuation to call once the message has
175 * been transmitted (or if the transport is ready 176 * been transmitted (or if the transport is ready
176 * for the next transmission call; or if the 177 * for the next transmission call; or if the
@@ -226,7 +227,7 @@ template_plugin_cancel (void *cls,
226 * format. 227 * format.
227 * 228 *
228 * @param cls closure 229 * @param cls closure
229 * @param name name of the transport that generated the address 230 * @param type name of the transport that generated the address
230 * @param addr one of the addresses of the host, NULL for the last address 231 * @param addr one of the addresses of the host, NULL for the last address
231 * the specific address format depends on the transport 232 * the specific address format depends on the transport
232 * @param addrlen length of the address 233 * @param addrlen length of the address
@@ -254,7 +255,7 @@ template_plugin_address_pretty_printer (void *cls,
254 * calls to stay below the quota (in terms of incoming data). 255 * calls to stay below the quota (in terms of incoming data).
255 * 256 *
256 * @param cls closure 257 * @param cls closure
257 * @param peer the peer for whom the quota is given 258 * @param target the peer for whom the quota is given
258 * @param quota_in quota for receiving/sending data in bytes per ms 259 * @param quota_in quota for receiving/sending data in bytes per ms
259 */ 260 */
260static void 261static void
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 0194a1667..624ca0933 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -151,6 +151,7 @@ select_close_handler (void *ch_cls,
151 * 151 *
152 * @param hello the hello-Message for the target node 152 * @param hello the hello-Message for the target node
153 * @param tsessionPtr the session handle that is to be set 153 * @param tsessionPtr the session handle that is to be set
154 * @param may_reuse are we allowed to re-use an existing connection (ignored for UDP)
154 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed 155 * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
155 */ 156 */
156static int 157static int
@@ -305,6 +306,7 @@ udp_create_socket ()
305 * @param tsession the GNUNET_MessageHello identifying the remote node 306 * @param tsession the GNUNET_MessageHello identifying the remote node
306 * @param message what to send 307 * @param message what to send
307 * @param size the size of the message 308 * @param size the size of the message
309 * @param important is this message "important" to override typical transmit limits?
308 * @return GNUNET_SYSERR on error, GNUNET_OK on success 310 * @return GNUNET_SYSERR on error, GNUNET_OK on success
309 */ 311 */
310static int 312static int
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 9a7068e42..f6ba793ce 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -598,6 +598,7 @@ peer_transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
598 * Queue control request for transmission to the transport 598 * Queue control request for transmission to the transport
599 * service. 599 * service.
600 * 600 *
601 * @param h handle to the transport service
601 * @param size number of bytes to be transmitted 602 * @param size number of bytes to be transmitted
602 * @param at_head request must be added to the head of the queue 603 * @param at_head request must be added to the head of the queue
603 * (otherwise request will be appended) 604 * (otherwise request will be appended)
@@ -1446,7 +1447,7 @@ add_neighbour (struct GNUNET_TRANSPORT_Handle *h,
1446 * @param cls closure for the callbacks 1447 * @param cls closure for the callbacks
1447 * @param rec receive function to call 1448 * @param rec receive function to call
1448 * @param nc function to call on connect events 1449 * @param nc function to call on connect events
1449 * @param dc function to call on disconnect events 1450 * @param nd function to call on disconnect events
1450 */ 1451 */
1451struct GNUNET_TRANSPORT_Handle * 1452struct GNUNET_TRANSPORT_Handle *
1452GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched, 1453GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched,
diff --git a/src/upnp/upnp.h b/src/upnp/upnp.h
index 1f99c5352..a77755a3c 100644
--- a/src/upnp/upnp.h
+++ b/src/upnp/upnp.h
@@ -61,12 +61,10 @@ const char *gaim_upnp_get_public_ip (void);
61 * this gaim client. Essentially, this function takes care of the port 61 * this gaim client. Essentially, this function takes care of the port
62 * forwarding so things like file transfers can work behind NAT firewalls 62 * forwarding so things like file transfers can work behind NAT firewalls
63 * 63 *
64 * @param cfg configuration to use
65 * @param do_add TRUE/GNUNET_YES to add, FALSE/GNUNET_NO to remove
64 * @param portmap The port to map to this client 66 * @param portmap The port to map to this client
65 * @param protocol The protocol to map, either "TCP" or "UDP" 67 * @param protocol The protocol to map, either "TCP" or "UDP"
66 * @param do_add TRUE/GNUNET_YES to add, FALSE/GNUNET_NO to remove
67 * @param cb an optional callback function to be notified when the mapping
68 * addition is complete
69 * @param cb_data Extra data to be passed to the callback
70 */ 68 */
71int gaim_upnp_change_port_mapping (struct GNUNET_CONFIGURATION_Handle *cfg, 69int gaim_upnp_change_port_mapping (struct GNUNET_CONFIGURATION_Handle *cfg,
72 int do_add, 70 int do_add,
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 0ee4edbe2..96cfcd85c 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -438,14 +438,14 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind)
438 * This is one of the very few calls in the entire API that is 438 * This is one of the very few calls in the entire API that is
439 * NOT reentrant! 439 * NOT reentrant!
440 * 440 *
441 * @param pid the peer identity 441 * @param hc the hash code
442 * @return string form; will be overwritten by next call to GNUNET_h2s. 442 * @return string form; will be overwritten by next call to GNUNET_h2s.
443 */ 443 */
444const char * 444const char *
445GNUNET_h2s (const GNUNET_HashCode *pid) 445GNUNET_h2s (const GNUNET_HashCode *hc)
446{ 446{
447 static struct GNUNET_CRYPTO_HashAsciiEncoded ret; 447 static struct GNUNET_CRYPTO_HashAsciiEncoded ret;
448 GNUNET_CRYPTO_hash_to_enc (pid, &ret); 448 GNUNET_CRYPTO_hash_to_enc (hc, &ret);
449 ret.encoding[8] = '\0'; 449 ret.encoding[8] = '\0';
450 return (const char *) ret.encoding; 450 return (const char *) ret.encoding;
451} 451}
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index 5e69fe8ab..612bad92f 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -666,14 +666,14 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
666 * 666 *
667 * @param bf the filter 667 * @param bf the filter
668 * @param iterator an iterator over all elements stored in the BF 668 * @param iterator an iterator over all elements stored in the BF
669 * @param iterator_arg argument to the iterator function 669 * @param iterator_cls argument to the iterator function
670 * @param size the new size for the filter 670 * @param size the new size for the filter
671 * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element 671 * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element
672 */ 672 */
673void 673void
674GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, 674GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
675 GNUNET_HashCodeIterator iterator, 675 GNUNET_HashCodeIterator iterator,
676 void *iterator_arg, 676 void *iterator_cls,
677 size_t size, 677 size_t size,
678 unsigned int k) 678 unsigned int k)
679{ 679{
@@ -691,7 +691,7 @@ GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
691 memset (bf->bitArray, 0, bf->bitArraySize); 691 memset (bf->bitArray, 0, bf->bitArraySize);
692 if (bf->filename != NULL) 692 if (bf->filename != NULL)
693 makeEmptyFile (bf->fh, bf->bitArraySize * 4); 693 makeEmptyFile (bf->fh, bf->bitArraySize * 4);
694 while (GNUNET_YES == iterator (iterator_arg, &hc)) 694 while (GNUNET_YES == iterator (iterator_cls, &hc))
695 GNUNET_CONTAINER_bloomfilter_add (bf, &hc); 695 GNUNET_CONTAINER_bloomfilter_add (bf, &hc);
696} 696}
697 697
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index bbe6dad3b..5ae3b15cf 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -139,6 +139,11 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
139 139
140/** 140/**
141 * Remove an item. 141 * Remove an item.
142 *
143 * @param md metadata to manipulate
144 * @param type type of the item to remove
145 * @param data specific value to remove, NULL to remove all
146 * entries of the given type
142 * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md 147 * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md
143 */ 148 */
144int 149int
@@ -170,13 +175,16 @@ GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
170/** 175/**
171 * Iterate over MD entries, excluding thumbnails. 176 * Iterate over MD entries, excluding thumbnails.
172 * 177 *
178 * @param md metadata to inspect
179 * @param iter function to call on each entry
180 * @param iter_cls closure for iterator
173 * @return number of entries 181 * @return number of entries
174 */ 182 */
175int 183int
176GNUNET_CONTAINER_meta_data_get_contents (const struct 184GNUNET_CONTAINER_meta_data_get_contents (const struct
177 GNUNET_CONTAINER_MetaData *md, 185 GNUNET_CONTAINER_MetaData *md,
178 GNUNET_CONTAINER_MetaDataProcessor 186 GNUNET_CONTAINER_MetaDataProcessor
179 iterator, void *closure) 187 iter, void *iter_cls)
180{ 188{
181 uint32_t i; 189 uint32_t i;
182 uint32_t sub; 190 uint32_t sub;
@@ -187,9 +195,9 @@ GNUNET_CONTAINER_meta_data_get_contents (const struct
187 if (!EXTRACTOR_isBinaryType (md->items[i].type)) 195 if (!EXTRACTOR_isBinaryType (md->items[i].type))
188 { 196 {
189 if ((iterator != NULL) && 197 if ((iterator != NULL) &&
190 (GNUNET_OK != iterator (closure, 198 (GNUNET_OK != iter (iter_cls,
191 md->items[i].type, 199 md->items[i].type,
192 md->items[i].data))) 200 md->items[i].data)))
193 return GNUNET_SYSERR; 201 return GNUNET_SYSERR;
194 } 202 }
195 else 203 else
@@ -280,6 +288,9 @@ GNUNET_CONTAINER_meta_data_get_thumbnail (const struct
280 288
281/** 289/**
282 * Duplicate struct GNUNET_CONTAINER_MetaData. 290 * Duplicate struct GNUNET_CONTAINER_MetaData.
291 *
292 * @param md what to duplicate
293 * @return duplicate meta-data container
283 */ 294 */
284struct GNUNET_CONTAINER_MetaData * 295struct GNUNET_CONTAINER_MetaData *
285GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData 296GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData
@@ -439,7 +450,7 @@ struct MetaDataHeader
439 * @param md metadata to serialize 450 * @param md metadata to serialize
440 * @param target where to write the serialized metadata 451 * @param target where to write the serialized metadata
441 * @param max maximum number of bytes available in target 452 * @param max maximum number of bytes available in target
442 * @param part is it ok to just write SOME of the 453 * @param opt is it ok to just write SOME of the
443 * meta-data to match the size constraint, 454 * meta-data to match the size constraint,
444 * possibly discarding some data? 455 * possibly discarding some data?
445 * @return number of bytes written on success, 456 * @return number of bytes written on success,
@@ -451,7 +462,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
451 *md, char *target, size_t max, 462 *md, char *target, size_t max,
452 enum 463 enum
453 GNUNET_CONTAINER_MetaDataSerializationOptions 464 GNUNET_CONTAINER_MetaDataSerializationOptions
454 part) 465 opt)
455{ 466{
456 struct MetaDataHeader *hdr; 467 struct MetaDataHeader *hdr;
457 size_t size; 468 size_t size;
@@ -488,7 +499,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
488 } 499 }
489 500
490 hdr->size = htonl (size); 501 hdr->size = htonl (size);
491 if ((part & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS) == 0) 502 if ((opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS) == 0)
492 { 503 {
493 pos = tryCompression ((char *) &hdr[1], 504 pos = tryCompression ((char *) &hdr[1],
494 size - sizeof (struct MetaDataHeader)); 505 size - sizeof (struct MetaDataHeader));
@@ -507,7 +518,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
507 GNUNET_free (hdr); 518 GNUNET_free (hdr);
508 hdr = NULL; 519 hdr = NULL;
509 520
510 if ((part & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART) == 0) 521 if ((opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART) == 0)
511 { 522 {
512 return GNUNET_SYSERR; /* does not fit! */ 523 return GNUNET_SYSERR; /* does not fit! */
513 } 524 }
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index c3fb9a84c..60e0ec5a2 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -562,7 +562,7 @@ getValue__ (unsigned char a)
562 * small number of characters. The GNUnet encoding uses 102 562 * small number of characters. The GNUnet encoding uses 102
563 * characters plus a null terminator. 563 * characters plus a null terminator.
564 * 564 *
565 * @param block the GNUNET_CRYPTO_hash code 565 * @param block the hash code
566 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be 566 * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
567 * safely cast to char*, a '\\0' termination is set). 567 * safely cast to char*, a '\\0' termination is set).
568 */ 568 */
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index b56523a46..50af9f251 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -30,6 +30,10 @@
30#include <gcrypt.h> 30#include <gcrypt.h>
31 31
32/** 32/**
33 * Produce a random value.
34 *
35 * @param mode desired quality of the random number
36 * @param i the upper limit (exclusive) for the random number
33 * @return a random value in the interval [0,i[. 37 * @return a random value in the interval [0,i[.
34 */ 38 */
35uint32_t 39uint32_t
@@ -97,26 +101,31 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n)
97 101
98/** 102/**
99 * Random on unsigned 64-bit values. 103 * Random on unsigned 64-bit values.
104 *
105 *
106 * @param mode desired quality of the random number
107 * @param max value returned will be in range [0,max) (exclusive)
108 * @return random 64-bit number
100 */ 109 */
101uint64_t 110uint64_t
102GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, 111GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode,
103 uint64_t u) 112 uint64_t max)
104{ 113{
105 uint64_t ret; 114 uint64_t ret;
106 115
107 GNUNET_assert (u > 0); 116 GNUNET_assert (max > 0);
108 if (mode == GNUNET_CRYPTO_QUALITY_STRONG) 117 if (mode == GNUNET_CRYPTO_QUALITY_STRONG)
109 { 118 {
110 gcry_randomize ((unsigned char *) &ret, 119 gcry_randomize ((unsigned char *) &ret,
111 sizeof (uint64_t), 120 sizeof (uint64_t),
112 GCRY_STRONG_RANDOM); 121 GCRY_STRONG_RANDOM);
113 return ret % u; 122 return ret % max;
114 } 123 }
115 else 124 else
116 { 125 {
117 ret = u * ((double) RANDOM () / RAND_MAX); 126 ret = max * ((double) RANDOM () / RAND_MAX);
118 if (ret >= u) 127 if (ret >= max)
119 ret = u - 1; 128 ret = max - 1;
120 return ret; 129 return ret;
121 } 130 }
122} 131}
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index 7bffa71ee..9da95a56e 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -186,15 +186,15 @@ key_from_sexp (gcry_mpi_t * array,
186 186
187/** 187/**
188 * Extract the public key of the host. 188 * Extract the public key of the host.
189 * @param hostkey the hostkey to extract into the result. 189 * @param priv the private key
190 * @param result where to write the result. 190 * @param pub where to write the public key
191 */ 191 */
192void 192void
193GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey 193GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
194 *hostkey, 194 *priv,
195 struct 195 struct
196 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded 196 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
197 *result) 197 *pub)
198{ 198{
199 gcry_mpi_t skey[2]; 199 gcry_mpi_t skey[2];
200 size_t size; 200 size_t size;
@@ -750,15 +750,15 @@ GNUNET_CRYPTO_rsa_encrypt (const void *block,
750/** 750/**
751 * Decrypt a given block with the hostkey. 751 * Decrypt a given block with the hostkey.
752 * 752 *
753 * @param hostkey the hostkey with which to decrypt this block 753 * @param key the key with which to decrypt this block
754 * @param block the data to decrypt, encoded as returned by encrypt 754 * @param block the data to decrypt, encoded as returned by encrypt
755 * @param result pointer to a location where the result can be stored 755 * @param result pointer to a location where the result can be stored
756 * @param max the maximum number of bits to store for the result, if 756 * @param max the maximum number of bits to store for the result, if
757 * the decrypted block is bigger, an error is returned 757 * the decrypted block is bigger, an error is returned
758 * @returns the size of the decrypted block, -1 on error 758 * @return the size of the decrypted block, -1 on error
759 */ 759 */
760ssize_t 760ssize_t
761GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey, 761GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
762 const struct GNUNET_CRYPTO_RsaEncryptedData *block, 762 const struct GNUNET_CRYPTO_RsaEncryptedData *block,
763 void *result, 763 void *result,
764 size_t max) 764 size_t max)
@@ -772,7 +772,7 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
772 unsigned char *tmp; 772 unsigned char *tmp;
773 773
774#if EXTRA_CHECKS 774#if EXTRA_CHECKS
775 GNUNET_assert (0 == gcry_pk_testkey (hostkey->sexp)); 775 GNUNET_assert (0 == gcry_pk_testkey (key->sexp));
776#endif 776#endif
777 size = sizeof (struct GNUNET_CRYPTO_RsaEncryptedData); 777 size = sizeof (struct GNUNET_CRYPTO_RsaEncryptedData);
778 GNUNET_assert (0 == gcry_mpi_scan (&val, 778 GNUNET_assert (0 == gcry_mpi_scan (&val,
@@ -782,7 +782,7 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
782 gcry_sexp_build (&data, &erroff, 782 gcry_sexp_build (&data, &erroff,
783 "(enc-val(flags)(rsa(a %m)))", val)); 783 "(enc-val(flags)(rsa(a %m)))", val));
784 gcry_mpi_release (val); 784 gcry_mpi_release (val);
785 GNUNET_assert (0 == gcry_pk_decrypt (&resultsexp, data, hostkey->sexp)); 785 GNUNET_assert (0 == gcry_pk_decrypt (&resultsexp, data, key->sexp));
786 gcry_sexp_release (data); 786 gcry_sexp_release (data);
787 /* resultsexp has format "(value %m)" */ 787 /* resultsexp has format "(value %m)" */
788 GNUNET_assert (NULL != 788 GNUNET_assert (NULL !=
@@ -805,13 +805,13 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
805/** 805/**
806 * Sign a given block. 806 * Sign a given block.
807 * 807 *
808 * @param hostkey private key to use for the signing 808 * @param key private key to use for the signing
809 * @param purpose what to sign (size, purpose) 809 * @param purpose what to sign (size, purpose)
810 * @param sig where to write the signature 810 * @param sig where to write the signature
811 * @return GNUNET_SYSERR on error, GNUNET_OK on success 811 * @return GNUNET_SYSERR on error, GNUNET_OK on success
812 */ 812 */
813int 813int
814GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey, 814GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
815 const struct GNUNET_CRYPTO_RsaSignaturePurpose 815 const struct GNUNET_CRYPTO_RsaSignaturePurpose
816 *purpose, struct GNUNET_CRYPTO_RsaSignature *sig) 816 *purpose, struct GNUNET_CRYPTO_RsaSignature *sig)
817{ 817{
@@ -835,7 +835,7 @@ GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
835 - 1], &hc, sizeof (GNUNET_HashCode)); 835 - 1], &hc, sizeof (GNUNET_HashCode));
836 GNUNET_assert (0 == gcry_sexp_new (&data, buff, bufSize, 0)); 836 GNUNET_assert (0 == gcry_sexp_new (&data, buff, bufSize, 0));
837 GNUNET_free (buff); 837 GNUNET_free (buff);
838 GNUNET_assert (0 == gcry_pk_sign (&result, data, hostkey->sexp)); 838 GNUNET_assert (0 == gcry_pk_sign (&result, data, key->sexp));
839 gcry_sexp_release (data); 839 gcry_sexp_release (data);
840 GNUNET_assert (0 == key_from_sexp (&rval, result, "rsa", "s")); 840 GNUNET_assert (0 == key_from_sexp (&rval, result, "rsa", "s"));
841 gcry_sexp_release (result); 841 gcry_sexp_release (result);
diff --git a/src/util/getopt.c b/src/util/getopt.c
index e37390a3a..82d0baebd 100644
--- a/src/util/getopt.c
+++ b/src/util/getopt.c
@@ -987,7 +987,7 @@ GNgetopt_long (int argc,
987/** 987/**
988 * Parse the command line. 988 * Parse the command line.
989 * 989 *
990 * @param binaryOptions name of this binary / application 990 * @param binaryOptions Name of application with option summary
991 * @param allOptions defined options and handlers 991 * @param allOptions defined options and handlers
992 * @param argc number of arguments 992 * @param argc number of arguments
993 * @param argv actual arguments 993 * @param argv actual arguments
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index 304f11b7b..1dce5cedc 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file resolver/gnunet-service-resolver.c 22 * @file util/gnunet-service-resolver.c
23 * @brief code to do DNS resolution 23 * @brief code to do DNS resolution
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
@@ -35,24 +35,55 @@
35#include "gnunet_time_lib.h" 35#include "gnunet_time_lib.h"
36#include "resolver.h" 36#include "resolver.h"
37 37
38 38/**
39 * A cached DNS lookup result.
40 */
39struct IPCache 41struct IPCache
40{ 42{
43 /**
44 * This is a linked list.
45 */
41 struct IPCache *next; 46 struct IPCache *next;
47
48 /**
49 * Hostname in human-readable form.
50 */
42 char *addr; 51 char *addr;
52
53 /**
54 * Hostname in binary format.
55 */
43 struct sockaddr *sa; 56 struct sockaddr *sa;
57
58 /**
59 * Last time this entry was updated.
60 */
44 struct GNUNET_TIME_Absolute last_refresh; 61 struct GNUNET_TIME_Absolute last_refresh;
62
63 /**
64 * Last time this entry was requested.
65 */
45 struct GNUNET_TIME_Absolute last_request; 66 struct GNUNET_TIME_Absolute last_request;
46 unsigned int salen; 67
68 /**
69 * Number of bytes in sa.
70 */
71 socklen_t salen;
47}; 72};
48 73
49 74
75/**
76 * Start of the linked list of cached DNS lookup results.
77 */
50static struct IPCache *head; 78static struct IPCache *head;
51 79
52 80
53
54
55#if HAVE_GETNAMEINFO 81#if HAVE_GETNAMEINFO
82/**
83 * Resolve the given request using getnameinfo
84 *
85 * @param cache the request to resolve (and where to store the result)
86 */
56static void 87static void
57getnameinfo_resolve (struct IPCache *cache) 88getnameinfo_resolve (struct IPCache *cache)
58{ 89{
@@ -69,6 +100,11 @@ getnameinfo_resolve (struct IPCache *cache)
69 100
70 101
71#if HAVE_GETHOSTBYADDR 102#if HAVE_GETHOSTBYADDR
103/**
104 * Resolve the given request using gethostbyaddr
105 *
106 * @param cache the request to resolve (and where to store the result)
107 */
72static void 108static void
73gethostbyaddr_resolve (struct IPCache *cache) 109gethostbyaddr_resolve (struct IPCache *cache)
74{ 110{
@@ -92,7 +128,11 @@ gethostbyaddr_resolve (struct IPCache *cache)
92} 128}
93#endif 129#endif
94 130
95 131/**
132 * Resolve the given request using the available methods.
133 *
134 * @param cache the request to resolve (and where to store the result)
135 */
96static void 136static void
97cache_resolve (struct IPCache *cache) 137cache_resolve (struct IPCache *cache)
98{ 138{
@@ -114,11 +154,13 @@ cache_resolve (struct IPCache *cache)
114 * may not immediately result in the FQN (but instead in a 154 * may not immediately result in the FQN (but instead in a
115 * human-readable IP address). 155 * human-readable IP address).
116 * 156 *
157 * @param client handle to the client making the request (for sending the reply)
117 * @param sa should be of type "struct sockaddr*" 158 * @param sa should be of type "struct sockaddr*"
159 * @param salen number of bytes in sa
118 */ 160 */
119static void 161static void
120get_ip_as_string (struct GNUNET_SERVER_Client *client, 162get_ip_as_string (struct GNUNET_SERVER_Client *client,
121 const struct sockaddr *sav, socklen_t salen) 163 const struct sockaddr *sa, socklen_t salen)
122{ 164{
123 struct IPCache *cache; 165 struct IPCache *cache;
124 struct IPCache *prev; 166 struct IPCache *prev;
@@ -134,7 +176,7 @@ get_ip_as_string (struct GNUNET_SERVER_Client *client,
134 cache = head; 176 cache = head;
135 prev = NULL; 177 prev = NULL;
136 while ((cache != NULL) && 178 while ((cache != NULL) &&
137 ((cache->salen != salen) || (0 != memcmp (cache->sa, sav, salen)))) 179 ((cache->salen != salen) || (0 != memcmp (cache->sa, sa, salen))))
138 { 180 {
139 if (GNUNET_TIME_absolute_get_duration (cache->last_request).value < 181 if (GNUNET_TIME_absolute_get_duration (cache->last_request).value <
140 60 * 60 * 1000) 182 60 * 60 * 1000)
@@ -178,7 +220,7 @@ get_ip_as_string (struct GNUNET_SERVER_Client *client,
178 cache->next = head; 220 cache->next = head;
179 cache->salen = salen; 221 cache->salen = salen;
180 cache->sa = GNUNET_malloc (salen); 222 cache->sa = GNUNET_malloc (salen);
181 memcpy (cache->sa, sav, salen); 223 memcpy (cache->sa, sa, salen);
182 cache->last_request = GNUNET_TIME_absolute_get (); 224 cache->last_request = GNUNET_TIME_absolute_get ();
183 cache->last_refresh = GNUNET_TIME_absolute_get (); 225 cache->last_refresh = GNUNET_TIME_absolute_get ();
184 cache->addr = NULL; 226 cache->addr = NULL;
diff --git a/src/util/os_network.c b/src/util/os_network.c
index c78dc71c5..d18e5eb76 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -35,11 +35,11 @@
35 * @brief Enumerate all network interfaces 35 * @brief Enumerate all network interfaces
36 * 36 *
37 * @param proc the callback function 37 * @param proc the callback function
38 * @param cls closure for proc 38 * @param proc_cls closure for proc
39 */ 39 */
40void 40void
41GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, 41GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
42 void *cls) 42 void *proc_cls)
43{ 43{
44#ifdef MINGW 44#ifdef MINGW
45 PMIB_IFTABLE pTable; 45 PMIB_IFTABLE pTable;
@@ -148,7 +148,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
148 free (pszIfName); 148 free (pszIfName);
149 149
150 if (GNUNET_OK != 150 if (GNUNET_OK !=
151 proc (cls, 151 proc (proc_cls,
152 szEntry, 152 szEntry,
153 pAddrTable->table[dwIfIdx].dwIndex == dwExternalNIC, 153 pAddrTable->table[dwIfIdx].dwIndex == dwExternalNIC,
154 NULL /* FIXME: pass actual IP address! */ , 154 NULL /* FIXME: pass actual IP address! */ ,
@@ -182,7 +182,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
182 alen = sizeof (struct sockaddr_in); 182 alen = sizeof (struct sockaddr_in);
183 else 183 else
184 alen = sizeof (struct sockaddr_in6); 184 alen = sizeof (struct sockaddr_in6);
185 if (GNUNET_OK != proc (cls, 185 if (GNUNET_OK != proc (proc_cls,
186 ifa_ptr->ifa_name, 186 ifa_ptr->ifa_name,
187 0 == strcmp (ifa_ptr->ifa_name, 187 0 == strcmp (ifa_ptr->ifa_name,
188 GNUNET_DEFAULT_INTERFACE), 188 GNUNET_DEFAULT_INTERFACE),
@@ -255,7 +255,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
255 a4.sin_family = AF_INET; 255 a4.sin_family = AF_INET;
256 a4.sin_addr = v4; 256 a4.sin_addr = v4;
257 if (GNUNET_OK != 257 if (GNUNET_OK !=
258 proc (cls, 258 proc (proc_cls,
259 ifc, 259 ifc,
260 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), 260 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
261 (const struct sockaddr *) &a4, sizeof (a4))) 261 (const struct sockaddr *) &a4, sizeof (a4)))
@@ -270,7 +270,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
270 a6.sin6_addr = v6; 270 a6.sin6_addr = v6;
271 fprintf (stderr, "procing %s\n", addrstr); 271 fprintf (stderr, "procing %s\n", addrstr);
272 if (GNUNET_OK != 272 if (GNUNET_OK !=
273 proc (cls, 273 proc (proc_cls,
274 ifc, 274 ifc,
275 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE), 275 0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
276 (const struct sockaddr *) &a6, sizeof (a6))) 276 (const struct sockaddr *) &a6, sizeof (a6)))
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 46e2deb5c..6e18d9278 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -29,19 +29,23 @@
29#include "gnunet_os_lib.h" 29#include "gnunet_os_lib.h"
30 30
31/** 31/**
32 * Set our process priority 32 * Set process priority
33 *
34 * @param proc id of the process
35 * @param prio priority value
36 * @return GNUNET_OK on success, GNUNET_SYSERR on error
33 */ 37 */
34int 38int
35GNUNET_OS_set_process_priority (pid_t proc, 39GNUNET_OS_set_process_priority (pid_t proc,
36 enum GNUNET_SCHEDULER_Priority eprio) 40 enum GNUNET_SCHEDULER_Priority prio)
37{ 41{
38 int prio = 0; 42 int prio = 0;
39 43
40 GNUNET_assert (eprio < GNUNET_SCHEDULER_PRIORITY_COUNT); 44 GNUNET_assert (prio < GNUNET_SCHEDULER_PRIORITY_COUNT);
41 if (eprio == GNUNET_SCHEDULER_PRIORITY_KEEP) 45 if (prio == GNUNET_SCHEDULER_PRIORITY_KEEP)
42 return GNUNET_OK; 46 return GNUNET_OK;
43 /* convert to MINGW/Unix values */ 47 /* convert to MINGW/Unix values */
44 switch (eprio) 48 switch (prio)
45 { 49 {
46 case GNUNET_SCHEDULER_PRIORITY_DEFAULT: 50 case GNUNET_SCHEDULER_PRIORITY_DEFAULT:
47#ifdef MINGW 51#ifdef MINGW
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c
index 8687b5c4d..04a6a1f78 100644
--- a/src/util/pseudonym.c
+++ b/src/util/pseudonym.c
@@ -588,7 +588,7 @@ merge_meta_helper (void *cls,
588/** 588/**
589 * Add a pseudonym to the set of known pseudonyms. 589 * Add a pseudonym to the set of known pseudonyms.
590 * For all pseudonym advertisements that we discover 590 * For all pseudonym advertisements that we discover
591 * FSUI should automatically call this function. 591 * FS should automatically call this function.
592 * 592 *
593 * @param cfg overall configuration 593 * @param cfg overall configuration
594 * @param id the pseudonym identifier 594 * @param id the pseudonym identifier
diff --git a/src/util/resolver.h b/src/util/resolver.h
index 31637f01d..5adf43633 100644
--- a/src/util/resolver.h
+++ b/src/util/resolver.h
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @author Christian Grothoff 22 * @author Christian Grothoff
23 * @file resolver/resolver.h 23 * @file util/resolver.h
24 */ 24 */
25#ifndef RESOLVER_H 25#ifndef RESOLVER_H
26#define RESOLVER_H 26#define RESOLVER_H
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index cc81aa6b8..b2c8fda66 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file resolver/resolver_api.c 22 * @file util/resolver_api.c
23 * @brief resolver for writing a tool 23 * @brief resolver for writing a tool
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
diff --git a/src/util/strings.c b/src/util/strings.c
index 23e6cd85b..133fda857 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -353,37 +353,37 @@ GNUNET_STRINGS_filename_expand (const char *fil)
353/** 353/**
354 * Give relative time in human-readable fancy format. 354 * Give relative time in human-readable fancy format.
355 * 355 *
356 * @param del time in milli seconds 356 * @param delta time in milli seconds
357 * @return time as human-readable string 357 * @return time as human-readable string
358 */ 358 */
359char * 359char *
360GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative del) 360GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta)
361{ 361{
362 const char *unit = _( /* time unit */ "ms"); 362 const char *unit = _( /* time unit */ "ms");
363 char *ret; 363 char *ret;
364 uint64_t delta = del.value; 364 uint64_t dval = delta.value;
365 365
366 if (delta > 5 * 1000) 366 if (dval > 5 * 1000)
367 { 367 {
368 delta = delta / 1000; 368 dval = dval / 1000;
369 unit = _( /* time unit */ "s"); 369 unit = _( /* time unit */ "s");
370 if (delta > 5 * 60) 370 if (dval > 5 * 60)
371 { 371 {
372 delta = delta / 60; 372 dval = dval / 60;
373 unit = _( /* time unit */ "m"); 373 unit = _( /* time unit */ "m");
374 if (delta > 5 * 60) 374 if (dval > 5 * 60)
375 { 375 {
376 delta = delta / 60; 376 dval = dval / 60;
377 unit = _( /* time unit */ "h"); 377 unit = _( /* time unit */ "h");
378 if (delta > 5 * 24) 378 if (dval > 5 * 24)
379 { 379 {
380 delta = delta / 24; 380 dval = dval / 24;
381 unit = _( /* time unit */ " days"); 381 unit = _( /* time unit */ " days");
382 } 382 }
383 } 383 }
384 } 384 }
385 } 385 }
386 GNUNET_asprintf (&ret, "%llu%s", delta, unit); 386 GNUNET_asprintf (&ret, "%llu%s", dval, unit);
387 return ret; 387 return ret;
388} 388}
389 389