better comments
authorChristian Grothoff <christian@grothoff.org>
Thu, 8 Oct 2009 19:00:19 +0000 (19:00 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 8 Oct 2009 19:00:19 +0000 (19:00 +0000)
43 files changed:
src/datastore/perf_plugin_datastore.c
src/fs/fs_file_information.c
src/include/gnunet_client_lib.h
src/include/gnunet_common.h
src/include/gnunet_configuration_lib.h
src/include/gnunet_container_lib.h
src/include/gnunet_crypto_lib.h
src/include/gnunet_dht_service.h
src/include/gnunet_fs_service.h
src/include/gnunet_getopt_lib.h
src/include/gnunet_network_lib.h
src/include/gnunet_pseudonym_lib.h
src/include/gnunet_scheduler_lib.h
src/include/gnunet_server_lib.h
src/include/gnunet_service_lib.h
src/include/gnunet_transport_service.h
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo_api.c
src/statistics/gnunet-statistics.c
src/statistics/statistics_api.c
src/topology/gnunet-daemon-topology.c
src/transport/gnunet-service-transport.c
src/transport/plugin_transport_http.c
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_template.c
src/transport/plugin_transport_udp.c
src/transport/transport_api.c
src/upnp/upnp.h
src/util/common_logging.c
src/util/container_bloomfilter.c
src/util/container_meta_data.c
src/util/crypto_hash.c
src/util/crypto_random.c
src/util/crypto_rsa.c
src/util/getopt.c
src/util/gnunet-service-resolver.c
src/util/os_network.c
src/util/os_priority.c
src/util/pseudonym.c
src/util/resolver.h
src/util/resolver_api.c
src/util/strings.c

index 1a3f890d94aba2ff0aae2f8610af3ac9646b9668..9d2b1cc6c44785e51c7310e3d7c790681abbf9b2 100644 (file)
@@ -192,6 +192,7 @@ iterateDummy (void *cls,
  * down.  Unloads our datastore plugin.
  *
  * @param api api to unload
+ * @param cfg configuration to use
  */
 static void
 unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
index 5afdc392f85631da38369b000c2e4baba4864850..c20af5ea60e0e65c2562198e8c65cded76130bb3 100644 (file)
@@ -37,6 +37,8 @@
 /**
  * Create a temporary file on disk to store the current
  * state of "fi" in.
+ *
+ * @param fi file information to sync with disk
  */
 void
 GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation * fi)
index 17f17ab507f7c2ca7352da27b40ef8c80340f911..20842de5c238be7458e8a4e2e44acee265cc10f6 100644 (file)
@@ -101,7 +101,7 @@ void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
  * are free in the transmission buffer.  May call the notify
  * method immediately if enough space is available.
  *
- * @param client connection to the service
+ * @param sock connection to the service
  * @param size number of bytes to send
  * @param timeout after how long should we give up (and call
  *        notify with buf NULL and size 0)?
index 402674f48922c0fc97b70828b31ac95d7b78c3e6..df601ac1976ed7e7efb9e926d89f85616c82bca0 100644 (file)
@@ -181,13 +181,13 @@ GNUNET_log_skip (unsigned int n, int check_reset);
 /**
  * Setup logging.
  *
- * @param component default component to use
+ * @param comp default component to use
  * @param loglevel what types of messages should be logged
  * @param logfile change logging to logfile (use NULL to keep stderr)
  * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened
  */
 int
-GNUNET_log_setup (const char *component,
+GNUNET_log_setup (const char *comp,
                   const char *loglevel, const char *logfile);
 
 /**
index 8e2f8e6d9a2cbba44613af742d44e70c43a6eef9..f05d294215d00bfe7bc279469646828d7cdc349f 100644 (file)
@@ -55,11 +55,11 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void);
 /**
  * Duplicate an existing configuration object.
  *
- * @param c configuration to duplicate
+ * @param cfg configuration to duplicate
  * @return duplicate configuration
  */
 struct GNUNET_CONFIGURATION_Handle *
-GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *c);
+GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
index ec190fdc6743543d8961dfefda5734149ef2e556..b9ce80d953f83a3328ae031b32aa6cf938566363 100644 (file)
@@ -217,13 +217,13 @@ struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void);
 /**
  * Duplicate a MetaData token.
  * 
- * @param meta what to duplicate
+ * @param md what to duplicate
  * @return duplicate meta-data container
  */
 struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const
                                                                         struct
                                                                         GNUNET_CONTAINER_MetaData
-                                                                        *meta);
+                                                                        *md);
 
 /**
  * Free meta data.
@@ -261,6 +261,7 @@ int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
 /**
  * Remove an item.
  *
+ * @param md metadata to manipulate
  * @param type type of the item to remove
  * @param data specific value to remove, NULL to remove all
  *        entries of the given type
@@ -373,7 +374,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions
  *
  * @param md metadata to serialize
  * @param target where to write the serialized metadata
- * @param size maximum number of bytes available
+ * @param max maximum number of bytes available
  * @param opt is it ok to just write SOME of the
  *        meta-data to match the size constraint,
  *        possibly discarding some data?
@@ -384,7 +385,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions
 ssize_t GNUNET_CONTAINER_meta_data_serialize (const struct
                                              GNUNET_CONTAINER_MetaData *md,
                                              char *target, 
-                                             size_t size,
+                                             size_t max,
                                              enum
                                           GNUNET_CONTAINER_MetaDataSerializationOptions
                                           opt);
@@ -958,7 +959,7 @@ void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l);
  * Check if a list contains a certain element
  * @param l list
  * @param buf payload buffer to find
- * @param lenght of the payload
+ * @param len length of the payload (number of bytes in buf)
  */
 int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, const void *buf, size_t len);
 
index 9b795cc75401d41ae19a45eb7efa4f4070a0d19b..76d28ad574bf7cf7e122c8b399fabcf47da2a202 100644 (file)
@@ -228,8 +228,7 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode,
 
 
 /**
- * Random on unsigned 64-bit values.  We break them down into signed
- * 32-bit values and reassemble the 64-bit random value bit-wise.
+ * Random on unsigned 64-bit values. 
  *
  * @param mode desired quality of the random number
  * @param max value returned will be in range [0,max) (exclusive)
@@ -278,7 +277,7 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct
  * @param sessionkey the key used to encrypt
  * @param iv the initialization vector to use, use INITVALUE
  *        for streams.
- * @returns the size of the encrypted block, -1 for errors
+ * @return the size of the encrypted block, -1 for errors
  */
 ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block,
                                   size_t len,
@@ -307,10 +306,10 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block,
 
 
 /**
- * Convert GNUNET_CRYPTO_hash to ASCII encoding.
- * @param block the GNUNET_CRYPTO_hash code
+ * Convert hash to ASCII encoding.
+ * @param block the hash code
  * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
- *  safely cast to char*, a '\0' termination is set).
+ *  safely cast to char*, a '\\0' termination is set).
  */
 void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
                                 struct GNUNET_CRYPTO_HashAsciiEncoded
@@ -515,11 +514,11 @@ struct GNUNET_CRYPTO_RsaPrivateKey
  * Deterministically (!) create a private key using only the
  * given HashCode as input to the PRNG.
  *
- * @param input "random" input to PRNG
+ * @param hc "random" input to PRNG
  * @return some private key purely dependent on input
  */
 struct GNUNET_CRYPTO_RsaPrivateKey
-  *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * input);
+  *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc);
 
 
 /**
@@ -550,7 +549,7 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct
  * @param size the size of block
  * @param publicKey the encoded public key used to encrypt
  * @param target where to store the encrypted block
- * @returns GNUNET_SYSERR on error, GNUNET_OK if ok
+ * @return GNUNET_SYSERR on error, GNUNET_OK if ok
  */
 int GNUNET_CRYPTO_rsa_encrypt (const void *block,
                                size_t size,
@@ -566,14 +565,14 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block,
  * @param key the key to use
  * @param block the data to decrypt, encoded as returned by encrypt, not consumed
  * @param result pointer to a location where the result can be stored
- * @param size how many bytes of a result are expected? Must be exact.
- * @returns the size of the decrypted block (that is, size) or -1 on error
+ * @param max how many bytes of a result are expected? Must be exact.
+ * @return the size of the decrypted block (that is, size) or -1 on error
  */
 ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
                                   const struct GNUNET_CRYPTO_RsaEncryptedData
                                   *block,
                                   void *result, 
-                                  size_t size);
+                                  size_t max);
 
 
 /**
@@ -581,13 +580,13 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key
  *
  * @param key private key to use for the signing
  * @param purpose what to sign (size, purpose)
- * @param result where to write the signature
+ * @param sig where to write the signature
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
                             const struct GNUNET_CRYPTO_RsaSignaturePurpose
                             *purpose,
-                            struct GNUNET_CRYPTO_RsaSignature *result);
+                            struct GNUNET_CRYPTO_RsaSignature *sig);
 
 
 /**
@@ -598,7 +597,7 @@ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
  * @param validate block to validate (size, purpose, data)
  * @param sig signature that is being validated
  * @param publicKey public key of the signer
- * @returns GNUNET_OK if ok, GNUNET_SYSERR if invalid
+ * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid
  */
 int GNUNET_CRYPTO_rsa_verify (uint32_t purpose,
                               const struct GNUNET_CRYPTO_RsaSignaturePurpose
index 0dab0bcbceea91a816daea4e4004ca9aeed65e2f..4bf3ce15bafea2eeeebe02d9c88d6ab3e3407d2d 100644 (file)
@@ -93,6 +93,7 @@ typedef void (*GNUNET_DHT_Iterator)(void *cls,
 /**
  * Perform an asynchronous GET operation on the DHT identified.
  *
+ * @param h handle to the DHT service
  * @param type expected type of the response object
  * @param key the key to look up
  * @param iter function to call on each result
index ae1b46a891cf0cece1e0a9a2cd47c83d70c1b78e..5449f632436457c57380ad56fcd2406408de86cf 100644 (file)
@@ -198,7 +198,7 @@ GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri);
 /**
  * Construct a location URI (this peer will be used for the location).
  *
- * @param baseURI content offered by the sender
+ * @param baseUri content offered by the sender
  * @param cfg configuration information (used to find our hostkey)
  * @param expiration_time how long will the content be offered?
  * @return the location URI, NULL on error
@@ -1552,10 +1552,10 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s);
  * file information data should already call "sync" internally,
  * so this function is likely not useful for clients.
  * 
- * @param s the struct to sync
+ * @param fi the struct to sync
  */
 void
-GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation *s);
+GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation *f);
 
 
 /**
@@ -1809,14 +1809,14 @@ GNUNET_FS_file_information_create_empty_directory (void *client_info,
  * "GNUNET_FS_publish_start" already.
  *
  * @param dir the directory
- * @param end the entry to add; the entry must not have been
+ * @param ent the entry to add; the entry must not have been
  *            added to any other directory at this point and 
  *            must not include "dir" in its structure
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
 GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir,
-                               struct GNUNET_FS_FileInformation *end);
+                               struct GNUNET_FS_FileInformation *ent);
 
 
 /**
@@ -1926,7 +1926,7 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
  * Publish a KBlock on GNUnet.
  *
  * @param h handle to the file sharing subsystem
- * @param keywords keywords to use
+ * @param ksk_uri keywords to use
  * @param meta metadata to use
  * @param uri URI to refer to in the KBlock
  * @param expirationTime when the KBlock expires
@@ -1937,7 +1937,7 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
  */
 void
 GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
-                      struct GNUNET_FS_Uri *keywords,
+                      struct GNUNET_FS_Uri *ksk_uri,
                       struct GNUNET_CONTAINER_MetaData *meta,
                       struct GNUNET_FS_Uri *uri,
                       struct GNUNET_TIME_Absolute expirationTime,
@@ -2258,11 +2258,11 @@ GNUNET_FS_file_download_start (struct GNUNET_FS_Handle *h,
 /**
  * Stop a download (aborts if download is incomplete).
  *
- * @param rm handle for the download
+ * @param dc handle for the download
  * @param do_delete delete files of incomplete downloads
  */
 void
-GNUNET_FS_file_download_stop (struct GNUNET_FS_DownloadContext *rm,
+GNUNET_FS_file_download_stop (struct GNUNET_FS_DownloadContext *dc,
                              int do_delete);
 
 
@@ -2439,14 +2439,14 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld,
  * in-memory.
  *
  * @param bld directory to finish
- * @param size set to the number of bytes needed
- * @param data set to the encoded directory
+ * @param rsize set to the number of bytes needed
+ * @param rdata set to the encoded directory
  * @return GNUNET_OK on success
  */
 int
 GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld,
-                                   size_t *size,
-                                   void **data);
+                                   size_t *rsize,
+                                   void **rdata);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */
index 44525e2f28b80f6b7882395e539a8f4302a1db8c..d5f3d1198073529cc2cc8ca2af9a96da305c38ed 100644 (file)
@@ -186,14 +186,14 @@ struct GNUNET_GETOPT_CommandLineOption
 /**
  * Parse the command line.
  *
- * @param binaryName name of the binary / application with options
+ * @param binaryOptions Name of application with option summary
  * @param allOptions defined options and handlers
  * @param argc number of arguments
  * @param argv actual arguments
  * @return index into argv with first non-option
  *   argument, or GNUNET_SYSERR on error
  */
-int GNUNET_GETOPT_run (const char *binaryName,
+int GNUNET_GETOPT_run (const char *binaryOptions,
                        const struct GNUNET_GETOPT_CommandLineOption
                        *allOptions, unsigned int argc, char *const *argv);
 
index d966c3afefc3b6899e0c119d57a0230c1b3b9059..e4ba5585499598870c5327e28486b7ad111fa9ae 100644 (file)
@@ -100,11 +100,12 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
  *
  * @param desc socket to connect
  * @param address peer address
- * @param length of address
+ * @param address_len of address
  * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
  */
 int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc,
-                       const struct sockaddr *address, socklen_t address_len);
+                                  const struct sockaddr *address, 
+                                  socklen_t address_len);
 
 
 /**
@@ -262,7 +263,7 @@ void GNUNET_NETWORK_fdset_copy(struct GNUNET_NETWORK_FDSet *to,
  * Copy a native fd set
  * @param to destination
  * @param from native source set
- * @param the biggest socket number in from + 1
+ * @param nfds the biggest socket number in from + 1
  */
 void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, 
                                       const fd_set *from,
index ced9bf387ddfe7f982f959bf50196da713f8e86f..ba240941b54b48ca853732a4a389d21f8edf7193 100644 (file)
@@ -55,20 +55,25 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls,
 /**
  * Change the ranking of a pseudonym.
  *
- * @param pseudonym id of the pseudonym
+ * @param cfg overall configuration
+ * @param nsid id of the pseudonym
  * @param delta by how much should the rating be changed?
  * @return new rating of the namespace
  */
 int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                           const GNUNET_HashCode * pseudonym, int delta);
+                           const GNUNET_HashCode *nsid, int delta);
 
 /**
  * Add a pseudonym to the set of known pseudonyms.
+ * For all pseudonym advertisements that we discover
+ * FS should automatically call this function.
  *
- * @param pseudonym the pseudonym's identifier
+ * @param cfg overall configuration
+ * @param id the pseudonym identifier
+ * @param meta metadata for the pseudonym
  */
 void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                           const GNUNET_HashCode * pseudo,
+                           const GNUNET_HashCode *id,
                            const struct GNUNET_CONTAINER_MetaData *meta);
 
 
index db94f05ab832dc995255a01be732391af8d4a423..621e57fcf72b362fe62f2669940bc64b623f840f 100644 (file)
@@ -482,7 +482,6 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_SCHEDULER_Handle *sched,
  *        are satisfied).  Use GNUNET_SCHEDULER_NO_TASK to not have any dependency
  *        on completion of other tasks.
  * @param delay how long should we wait? Use GNUNET_TIME_UNIT_FOREVER_REL for "forever"
- * @param nfds highest-numbered file descriptor in any of the two sets plus one
  * @param rs set of file descriptors we want to read (can be NULL)
  * @param ws set of file descriptors we want to write (can be NULL)
  * @param main main function of the task
@@ -497,7 +496,8 @@ GNUNET_SCHEDULER_add_select (struct GNUNET_SCHEDULER_Handle *sched,
                              GNUNET_SCHEDULER_TaskIdentifier
                              prerequisite_task,
                              struct GNUNET_TIME_Relative delay,
-                             const struct GNUNET_NETWORK_FDSet * rs, const struct GNUNET_NETWORK_FDSet * ws,
+                             const struct GNUNET_NETWORK_FDSet * rs,
+                            const struct GNUNET_NETWORK_FDSet * ws,
                              GNUNET_SCHEDULER_Task main, void *cls);
 
 #if 0                           /* keep Emacsens' auto-indent happy */
index 135b1f196a23db7dae808c85ade9689eba7953a3..570985d16642c67247576e0ab844b22c4cfdd640 100644 (file)
@@ -329,7 +329,7 @@ typedef void (*GNUNET_SERVER_DestroyCallback) (void *cls);
  * @param server the server to use
  * @param chandle opaque handle for the connection
  * @param creceive receive function for the connection
- * @param creceive_cancel cancel receive function for the connection
+ * @param ccancel cancel receive function for the connection
  * @param cnotify transmit notification function for the connection
  * @param cnotify_cancel transmit notification cancellation function for the connection
  * @param ccheck function to test if the connection is still up
index 4d0eefb9898c7f10f07dd96fa710944e9f6dab97..0c69d297cddca343be57b31762b96f9264454797 100644 (file)
@@ -123,9 +123,9 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct
 /**
  * Stop a service that was started with "GNUNET_SERVICE_start".
  *
- * @param ctx the service context returned from the start function
+ * @param sctx the service context returned from the start function
  */
-void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *ctx);
+void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */
index 604610774a4e23edf6e30003637aa0ebec84261a..8bf295567f53f6d862072a33a87924800ad0340f 100644 (file)
@@ -106,7 +106,7 @@ typedef void
  * @param cls closure for the callbacks
  * @param rec receive function to call
  * @param nc function to call on connect events
- * @param dc function to call on disconnect events
+ * @param nd function to call on disconnect events
  */
 struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct
                                                           GNUNET_SCHEDULER_Handle
index 281779897d3c306e9dcb5c6468fc4735133db077..3608dab84c1b6d6994318a1f7d0523e97a89ed97 100644 (file)
@@ -104,6 +104,10 @@ static char *trustDirectory;
  * Address iterator that causes expired entries to be discarded.
  *
  * @param cls pointer to the current time
+ * @param tname name of the transport
+ * @param expiration expiration time for the address
+ * @param addr the address
+ * @param addrlen length of addr in bytes
  * @return GNUNET_NO if expiration smaller than the current time
  */
 static int
@@ -176,7 +180,6 @@ lookup_host_entry (const struct GNUNET_PeerIdentity *id)
  * Add a host to the list.
  *
  * @param identity the identity of the host
- * @param protocol the protocol for the host
  */
 static void
 add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
@@ -398,7 +401,9 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
  * argument or for all known hosts and change their trust values by
  * the given delta.
  *
- * @param only NULL to hit all hosts
+ * @param only NULL to hit all hosts, otherwise specifies a particular target
+ * @param trust_change how much should the trust be changed
+ * @param client who is making the request (and will thus receive our confirmation)
  */
 static void
 send_to_each_host (const struct GNUNET_PeerIdentity *only,
index 57197798bc402b8cbe0841ceba0c238c7f7159b3..14efa17082531543514440bca234b50759a8bfcd 100644 (file)
@@ -76,7 +76,6 @@ copy_and_free (void *cls, size_t size, void *buf)
  * @param sched scheduler to use
  * @param peer identity of the peer
  * @param hello the verified (!) HELLO message
- * @param expiration when the HELLO will expire
  */
 void
 GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
index fe75f93aa1394522576fc556035eaf38792a6858..bea9ca0cac999b80af87f6c1aea11bc1dd971908 100644 (file)
@@ -65,11 +65,11 @@ static int persistent;
 static int
 printer (void *cls,
          const char *subsystem,
-         const char *sname, unsigned long long value, int is_persistent)
+         const char *name, unsigned long long value, int is_persistent)
 {
   FPRINTF (stdout,
            "%s%-20s %-40s: %16llu\n",
-           is_persistent ? "!" : " ", subsystem, _(sname), value);
+           is_persistent ? "!" : " ", subsystem, _(name), value);
   return GNUNET_OK;
 }
 
index 26e2425e60298d9332d08498c5d3b65a47d5921b..335cd41652ce4b15fabc4e730bf60a4f44730111 100644 (file)
@@ -201,6 +201,7 @@ free_action_item (struct ActionItem *ai)
 /**
  * Get handle for the statistics service.
  *
+ * @param sched scheduler to use
  * @param subsystem name of subsystem using the service
  * @param cfg services configuration in use
  * @return handle to use
index 466e0696108d2c5ee80df780b12f63ad2da96e42..6dc492a56414a6feae9ae8bc6c3dfedcf95c7200 100644 (file)
@@ -250,7 +250,8 @@ ready_callback (void *cls,
 /**
  * Try to connect to the specified peer.
  *
- * @param pos NULL if not in friend list yet
+ * @param peer who we should try to connect to
+ * @param pos entry in our friend list; NULL if not in friend list yet
  */
 static void
 attempt_connect (const struct GNUNET_PeerIdentity *peer,
@@ -475,7 +476,12 @@ schedule_peer_search ()
 /**
  * Iterator called on each address.
  *
- * @param cls flag that we will set if we see any addresses.
+ * @param cls flag that we will set if we see any addresses
+ * @param tname name of the transport
+ * @param expiration when will the given address expire
+ * @param addr the address of the peer
+ * @param addrlen number of bytes in addr
+ * @return GNUNET_SYSERR always, to terminate iteration
  */
 static int
 address_iterator (void *cls,
@@ -840,7 +846,7 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
  * received.
  *
  * @param cls closure
- * @param peer the other peer involved (sender or receiver, NULL
+ * @param other the other peer involved (sender or receiver, NULL
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual HELLO message
  * @return GNUNET_OK to keep the connection open,
@@ -862,6 +868,11 @@ handle_encrypted_hello (void *cls,
 /**
  * Peerinfo calls this function to let us know about a
  * possible peer that we might want to connect to.
+ *
+ * @param cls unused
+ * @param peer NULL for the end of the list, otherwise a peer identity
+ * @param hello a HELLO for a peer, or NULL
+ * @param trust how much do we trust the given peer?
  */
 static void
 gather_hello_callback (void *cls,
@@ -882,6 +893,7 @@ gather_hello_callback (void *cls,
 /**
  * Function to fill send buffer with HELLO.
  *
+ * @param cls unused
  * @param receiver the receiver of the message
  * @param position is the reference to the
  *        first unused position in the buffer where GNUnet is building
index 192ebf98f91632d14badafc75aa56cb34c1fb30d..6803e3179842aa7721cc9b66f027b0b2bc0bf6ed 100644 (file)
@@ -2066,6 +2066,7 @@ setup_new_neighbour (const struct GNUNET_PeerIdentity *peer)
  * reducing the rate at which they read from the socket
  * and generally forward to our receive callback.
  *
+ * @param cls the "struct TransportPlugin *" we gave to the plugin
  * @param plugin_context value to pass to this plugin
  *        to respond to the given peer (use is optional,
  *        but may speed up processing)
index c2f531b54d2ea234e82482906283562e828eb371..5fd875623ffae7630780d4f4f4da8c528b5f7c18 100644 (file)
@@ -1231,6 +1231,7 @@ create_curl_get (HTTPSession * httpSession)
  *
  * @param hello the hello-Message for the target node
  * @param tsessionPtr the session handle that is set
+ * @param may_reuse are we allowed to re-use an existing connection?
  * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
  */
 static int
@@ -1458,6 +1459,7 @@ httpTestWouldTry (GNUNET_TSession * tsession, const unsigned int size,
  * @param tsession the GNUNET_MessageHello identifying the remote node
  * @param msg the message
  * @param size the size of the message
+ * @param important is this message so important that usual restrictions do not apply?
  * @return GNUNET_SYSERR on error, GNUNET_OK on success, GNUNET_NO if queue is full
  */
 static int
index b93b16fb70f1768ab6583a734e650277a86de536..ec54d3f22a4c9040966332ae7dea5313ba691fbd 100644 (file)
@@ -516,8 +516,9 @@ get_message (void **buf, int *len, void *cls)
  * Send a message to the specified remote node.
  *
  * @param tsession the GNUNET_MessageHello identifying the remote node
- * @param message what to send
+ * @param msg what to send
  * @param size the size of the message
+ * @param important is this message important enough to override typical limits?
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 static int
@@ -689,8 +690,9 @@ api_send (GNUNET_TSession * tsession,
 
 /**
  * Establish a connection to a remote node.
- * @param helo the hello-Message for the target node
+ * @param hello the hello-Message for the target node
  * @param tsessionPtr the session handle that is to be set
+ * @param may_reuse can we re-use an existing connection?
  * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
  */
 static int
index 8e5f5dcef77bc7c32c0342c22c1a90392b9dca68..89c64021ea1933e077b584c1fdfa11df7658548b 100644 (file)
@@ -1059,13 +1059,14 @@ session_try_connect (void *cls,
  * @param target who should receive this message
  * @param priority how important is the message
  * @param msg the message to transmit
+ * @param timeout when should we time out (give up) if we can not transmit?
  * @param cont continuation to call once the message has
  *        been transmitted (or if the transport is ready
  *        for the next transmission call; or if the
  *        peer disconnected...)
  * @param cont_cls closure for cont
  * @return plugin_context that should be used next time for
- *         sending messages to the specified peer
 *         sending messages to the specified peer
  */
 static void *
 tcp_plugin_send (void *cls,
@@ -1252,7 +1253,7 @@ append_port (void *cls, const char *hostname)
  * format.
  *
  * @param cls closure
- * @param name name of the transport that generated the address
+ * @param type name of the transport that generated the address
  * @param addr one of the addresses of the host, NULL for the last address
  *        the specific address format depends on the transport
  * @param addrlen length of the address
@@ -1353,7 +1354,7 @@ update_quota (struct Session *session, int force)
  * calls to stay below the quota (in terms of incoming data).
  *
  * @param cls closure
- * @param peer the peer for whom the quota is given
+ * @param target the peer for whom the quota is given
  * @param quota_in quota for receiving/sending data in bytes per ms
  */
 static void
@@ -1581,8 +1582,8 @@ handle_tcp_ping (void *cls,
 /**
  * Handle PONG-message.
  *
- * @param plugin handle for this plugin
- * @param sender claimed sender of the PONG
+ * @param cls handle for this plugin
+ * @param client from where did we receive the PONG
  * @param message the actual message
  */
 static void
index 6307092fc7cac218e39508be289517bc66e5a953..95fd2de5f71f3aae0ea0a5ca957052ad543e78ff 100644 (file)
@@ -171,6 +171,7 @@ template_plugin_validate (void *cls,
  * @param target who should receive this message
  * @param priority how important is the message
  * @param msg the message to transmit
+ * @param timeout when should we time out 
  * @param cont continuation to call once the message has
  *        been transmitted (or if the transport is ready
  *        for the next transmission call; or if the
@@ -226,7 +227,7 @@ template_plugin_cancel (void *cls,
  * format.
  *
  * @param cls closure
- * @param name name of the transport that generated the address
+ * @param type name of the transport that generated the address
  * @param addr one of the addresses of the host, NULL for the last address
  *        the specific address format depends on the transport
  * @param addrlen length of the address
@@ -254,7 +255,7 @@ template_plugin_address_pretty_printer (void *cls,
  * calls to stay below the quota (in terms of incoming data).
  *
  * @param cls closure
- * @param peer the peer for whom the quota is given
+ * @param target the peer for whom the quota is given
  * @param quota_in quota for receiving/sending data in bytes per ms
  */
 static void
index 0194a1667c8d600c1f1c170b8194d804d9421a4a..624ca0933a70e703fbf11f2e66b3876c448f3530 100644 (file)
@@ -151,6 +151,7 @@ select_close_handler (void *ch_cls,
  *
  * @param hello the hello-Message for the target node
  * @param tsessionPtr the session handle that is to be set
+ * @param may_reuse are we allowed to re-use an existing connection (ignored for UDP)
  * @return GNUNET_OK on success, GNUNET_SYSERR if the operation failed
  */
 static int
@@ -305,6 +306,7 @@ udp_create_socket ()
  * @param tsession the GNUNET_MessageHello identifying the remote node
  * @param message what to send
  * @param size the size of the message
+ * @param important is this message "important" to override typical transmit limits?
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 static int
index 9a7068e42ab10026e22e07a4f07a5b79b696c9dc..f6ba793ced79a8376201dab7dbf996642c84ef5c 100644 (file)
@@ -598,6 +598,7 @@ peer_transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * Queue control request for transmission to the transport
  * service.
  *
+ * @param h handle to the transport service
  * @param size number of bytes to be transmitted
  * @param at_head request must be added to the head of the queue
  *        (otherwise request will be appended)
@@ -1446,7 +1447,7 @@ add_neighbour (struct GNUNET_TRANSPORT_Handle *h,
  * @param cls closure for the callbacks
  * @param rec receive function to call
  * @param nc function to call on connect events
- * @param dc function to call on disconnect events
+ * @param nd function to call on disconnect events
  */
 struct GNUNET_TRANSPORT_Handle *
 GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched,
index 1f99c53526706ef6485cc29cb7bd2d60a2844d13..a77755a3c7992e004178f51e497a75332455be98 100644 (file)
@@ -61,12 +61,10 @@ const char *gaim_upnp_get_public_ip (void);
  * this gaim client. Essentially, this function takes care of the port
  * forwarding so things like file transfers can work behind NAT firewalls
  *
+ * @param cfg configuration to use
+ * @param do_add TRUE/GNUNET_YES to add, FALSE/GNUNET_NO to remove
  * @param portmap The port to map to this client
  * @param protocol The protocol to map, either "TCP" or "UDP"
- * @param do_add TRUE/GNUNET_YES to add, FALSE/GNUNET_NO to remove
- * @param cb an optional callback function to be notified when the mapping
- *           addition is complete
- * @param cb_data Extra data to be passed to the callback
  */
 int gaim_upnp_change_port_mapping (struct GNUNET_CONFIGURATION_Handle *cfg,
                                    int do_add,
index 0ee4edbe24a6d70b5955e1f4b8a364ae021fb82d..96cfcd85c33e1b9ad23f8517d16e238afb91355c 100644 (file)
@@ -438,14 +438,14 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind)
  * This is one of the very few calls in the entire API that is
  * NOT reentrant!
  *
- * @param pid the peer identity
+ * @param hc the hash code
  * @return string form; will be overwritten by next call to GNUNET_h2s.
  */
 const char *
-GNUNET_h2s (const GNUNET_HashCode *pid)
+GNUNET_h2s (const GNUNET_HashCode *hc)
 {
   static struct GNUNET_CRYPTO_HashAsciiEncoded ret;
-  GNUNET_CRYPTO_hash_to_enc (pid, &ret);
+  GNUNET_CRYPTO_hash_to_enc (hc, &ret);
   ret.encoding[8] = '\0';
   return (const char *) ret.encoding;
 }
index 5e69fe8ab4d0354ddabca47ae9b7b1ce199c5a51..612bad92ff416601541c0c304270e9c221aaad44 100644 (file)
@@ -666,14 +666,14 @@ GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf,
  *
  * @param bf the filter
  * @param iterator an iterator over all elements stored in the BF
- * @param iterator_arg argument to the iterator function
+ * @param iterator_cls argument to the iterator function
  * @param size the new size for the filter
  * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element
  */
 void
 GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
                                      GNUNET_HashCodeIterator iterator,
-                                     void *iterator_arg
+                                     void *iterator_cls
                                     size_t size,
                                      unsigned int k)
 {
@@ -691,7 +691,7 @@ GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf,
   memset (bf->bitArray, 0, bf->bitArraySize);
   if (bf->filename != NULL)
     makeEmptyFile (bf->fh, bf->bitArraySize * 4);
-  while (GNUNET_YES == iterator (iterator_arg, &hc))
+  while (GNUNET_YES == iterator (iterator_cls, &hc))
     GNUNET_CONTAINER_bloomfilter_add (bf, &hc);
 }
 
index bbe6dad3bc1cd9460c3af569f6c4748abf6a5201..5ae3b15cfc15273f0c3c1c60ccf2e53be6e90a8f 100644 (file)
@@ -139,6 +139,11 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md,
 
 /**
  * Remove an item.
+ *
+ * @param md metadata to manipulate
+ * @param type type of the item to remove
+ * @param data specific value to remove, NULL to remove all
+ *        entries of the given type
  * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md
  */
 int
@@ -170,13 +175,16 @@ GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md,
 /**
  * Iterate over MD entries, excluding thumbnails.
  *
+ * @param md metadata to inspect
+ * @param iter function to call on each entry
+ * @param iter_cls closure for iterator
  * @return number of entries
  */
 int
 GNUNET_CONTAINER_meta_data_get_contents (const struct
                                          GNUNET_CONTAINER_MetaData *md,
                                          GNUNET_CONTAINER_MetaDataProcessor
-                                         iterator, void *closure)
+                                         iter, void *iter_cls)
 {
   uint32_t i;
   uint32_t sub;
@@ -187,9 +195,9 @@ GNUNET_CONTAINER_meta_data_get_contents (const struct
       if (!EXTRACTOR_isBinaryType (md->items[i].type))
         {
           if ((iterator != NULL) &&
-              (GNUNET_OK != iterator (closure,
-                                     md->items[i].type,
-                                      md->items[i].data)))
+              (GNUNET_OK != iter (iter_cls,
+                                 md->items[i].type,
+                                 md->items[i].data)))
             return GNUNET_SYSERR;
         }
       else
@@ -280,6 +288,9 @@ GNUNET_CONTAINER_meta_data_get_thumbnail (const struct
 
 /**
  * Duplicate struct GNUNET_CONTAINER_MetaData.
+ * 
+ * @param md what to duplicate
+ * @return duplicate meta-data container
  */
 struct GNUNET_CONTAINER_MetaData *
 GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData
@@ -439,7 +450,7 @@ struct MetaDataHeader
  * @param md metadata to serialize
  * @param target where to write the serialized metadata
  * @param max maximum number of bytes available in target
- * @param part is it ok to just write SOME of the
+ * @param opt is it ok to just write SOME of the
  *        meta-data to match the size constraint,
  *        possibly discarding some data?
  * @return number of bytes written on success,
@@ -451,7 +462,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
                                       *md, char *target, size_t max,
                                       enum
                                       GNUNET_CONTAINER_MetaDataSerializationOptions
-                                      part)
+                                      opt)
 {
   struct MetaDataHeader *hdr;
   size_t size;
@@ -488,7 +499,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
         }
 
       hdr->size = htonl (size);
-      if ((part & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS) == 0)
+      if ((opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS) == 0)
         {
           pos = tryCompression ((char *) &hdr[1],
                                 size - sizeof (struct MetaDataHeader));
@@ -507,7 +518,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
       GNUNET_free (hdr);
       hdr = NULL;
 
-      if ((part & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART) == 0)
+      if ((opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_PART) == 0)
         {
           return GNUNET_SYSERR; /* does not fit! */
         }
index c3fb9a84c37641a47f2aaf8f028245c396883e26..60e0ec5a2c2c40321f7026e65689821300e0ac84 100644 (file)
@@ -562,7 +562,7 @@ getValue__ (unsigned char a)
  * small number of characters.  The GNUnet encoding uses 102
  * characters plus a null terminator.
  *
- * @param block the GNUNET_CRYPTO_hash code
+ * @param block the hash code
  * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be
  *  safely cast to char*, a '\\0' termination is set).
  */
index b56523a4685a3810eb67f4584ccb5cf1449cce1f..50af9f2519a366fb48f5882d9587966d16f9dfd9 100644 (file)
 #include <gcrypt.h>
 
 /**
+ * Produce a random value.
+ *
+ * @param mode desired quality of the random number
+ * @param i the upper limit (exclusive) for the random number
  * @return a random value in the interval [0,i[.
  */
 uint32_t
@@ -97,26 +101,31 @@ GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n)
 
 /**
  * Random on unsigned 64-bit values.
+ *
+ *
+ * @param mode desired quality of the random number
+ * @param max value returned will be in range [0,max) (exclusive)
+ * @return random 64-bit number
  */
 uint64_t
 GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode,
-                          uint64_t u)
+                          uint64_t max)
 {
   uint64_t ret;
 
-  GNUNET_assert (u > 0);
+  GNUNET_assert (max > 0);
   if (mode == GNUNET_CRYPTO_QUALITY_STRONG)
     {
       gcry_randomize ((unsigned char *) &ret,
                       sizeof (uint64_t),
                      GCRY_STRONG_RANDOM);
-      return ret % u;
+      return ret % max;
     }
   else
     {
-      ret = u * ((double) RANDOM () / RAND_MAX);
-      if (ret >= u)
-        ret = u - 1;
+      ret = max * ((double) RANDOM () / RAND_MAX);
+      if (ret >= max)
+        ret = max - 1;
       return ret;
     }
 }
index 7bffa71ee96bf4067d1460fe83a27ec1e9f8dc85..9da95a56e61fe0e9b30e1962c1d3d28b2d377246 100644 (file)
@@ -186,15 +186,15 @@ key_from_sexp (gcry_mpi_t * array,
 
 /**
  * Extract the public key of the host.
- * @param hostkey the hostkey to extract into the result.
- * @param result where to write the result.
+ * @param priv the private key
+ * @param pub where to write the public key
  */
 void
 GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey
-                                  *hostkey,
+                                  *priv,
                                   struct
                                   GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded
-                                  *result)
+                                  *pub)
 {
   gcry_mpi_t skey[2];
   size_t size;
@@ -750,15 +750,15 @@ GNUNET_CRYPTO_rsa_encrypt (const void *block,
 /**
  * Decrypt a given block with the hostkey.
  *
- * @param hostkey the hostkey with which to decrypt this block
+ * @param key the key with which to decrypt this block
  * @param block the data to decrypt, encoded as returned by encrypt
  * @param result pointer to a location where the result can be stored
  * @param max the maximum number of bits to store for the result, if
  *        the decrypted block is bigger, an error is returned
- * @returns the size of the decrypted block, -1 on error
+ * @return the size of the decrypted block, -1 on error
  */
 ssize_t
-GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
+GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
                            const struct GNUNET_CRYPTO_RsaEncryptedData *block,
                            void *result, 
                           size_t max)
@@ -772,7 +772,7 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
   unsigned char *tmp;
 
 #if EXTRA_CHECKS
-  GNUNET_assert (0 == gcry_pk_testkey (hostkey->sexp));
+  GNUNET_assert (0 == gcry_pk_testkey (key->sexp));
 #endif
   size = sizeof (struct GNUNET_CRYPTO_RsaEncryptedData);
   GNUNET_assert (0 == gcry_mpi_scan (&val,
@@ -782,7 +782,7 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
                  gcry_sexp_build (&data, &erroff,
                                   "(enc-val(flags)(rsa(a %m)))", val));
   gcry_mpi_release (val);
-  GNUNET_assert (0 == gcry_pk_decrypt (&resultsexp, data, hostkey->sexp));
+  GNUNET_assert (0 == gcry_pk_decrypt (&resultsexp, data, key->sexp));
   gcry_sexp_release (data);
   /* resultsexp has format "(value %m)" */
   GNUNET_assert (NULL !=
@@ -805,13 +805,13 @@ GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
 /**
  * Sign a given block.
  *
- * @param hostkey private key to use for the signing
+ * @param key private key to use for the signing
  * @param purpose what to sign (size, purpose)
  * @param sig where to write the signature
  * @return GNUNET_SYSERR on error, GNUNET_OK on success
  */
 int
-GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
+GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key,
                         const struct GNUNET_CRYPTO_RsaSignaturePurpose
                         *purpose, struct GNUNET_CRYPTO_RsaSignature *sig)
 {
@@ -835,7 +835,7 @@ GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *hostkey,
            - 1], &hc, sizeof (GNUNET_HashCode));
   GNUNET_assert (0 == gcry_sexp_new (&data, buff, bufSize, 0));
   GNUNET_free (buff);
-  GNUNET_assert (0 == gcry_pk_sign (&result, data, hostkey->sexp));
+  GNUNET_assert (0 == gcry_pk_sign (&result, data, key->sexp));
   gcry_sexp_release (data);
   GNUNET_assert (0 == key_from_sexp (&rval, result, "rsa", "s"));
   gcry_sexp_release (result);
index e37390a3a0dfdc64d9550c81272777168b516c2b..82d0baebd9655f7d3411d1d713b6cc5d2420ac6a 100644 (file)
@@ -987,7 +987,7 @@ GNgetopt_long (int argc,
 /**
  * Parse the command line.
  *
- * @param binaryOptions name of this binary / application
+ * @param binaryOptions Name of application with option summary
  * @param allOptions defined options and handlers
  * @param argc number of arguments
  * @param argv actual arguments
index 304f11b7b4a1bb7d0cd67f1fde7e532f3c3c5e68..1dce5cedc4c3c58172eaec9dfe31895b362ac459 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 /**
- * @file resolver/gnunet-service-resolver.c
+ * @file util/gnunet-service-resolver.c
  * @brief code to do DNS resolution
  * @author Christian Grothoff
  */
 #include "gnunet_time_lib.h"
 #include "resolver.h"
 
-
+/**
+ * A cached DNS lookup result.
+ */
 struct IPCache
 {
+  /**
+   * This is a linked list.
+   */
   struct IPCache *next;
+  
+  /**
+   * Hostname in human-readable form.
+   */
   char *addr;
+
+  /**
+   * Hostname in binary format.
+   */
   struct sockaddr *sa;
+  
+  /**
+   * Last time this entry was updated.
+   */
   struct GNUNET_TIME_Absolute last_refresh;
+
+  /**
+   * Last time this entry was requested.
+   */
   struct GNUNET_TIME_Absolute last_request;
-  unsigned int salen;
+
+  /**
+   * Number of bytes in sa.
+   */
+  socklen_t salen;
 };
 
 
+/**
+ * Start of the linked list of cached DNS lookup results.
+ */
 static struct IPCache *head;
 
 
-
-
 #if HAVE_GETNAMEINFO
+/**
+ * Resolve the given request using getnameinfo
+ *
+ * @param cache the request to resolve (and where to store the result)
+ */
 static void
 getnameinfo_resolve (struct IPCache *cache)
 {
@@ -69,6 +100,11 @@ getnameinfo_resolve (struct IPCache *cache)
 
 
 #if HAVE_GETHOSTBYADDR
+/**
+ * Resolve the given request using gethostbyaddr
+ *
+ * @param cache the request to resolve (and where to store the result)
+ */
 static void
 gethostbyaddr_resolve (struct IPCache *cache)
 {
@@ -92,7 +128,11 @@ gethostbyaddr_resolve (struct IPCache *cache)
 }
 #endif
 
-
+/**
+ * Resolve the given request using the available methods.
+ *
+ * @param cache the request to resolve (and where to store the result)
+ */
 static void
 cache_resolve (struct IPCache *cache)
 {
@@ -114,11 +154,13 @@ cache_resolve (struct IPCache *cache)
  * may not immediately result in the FQN (but instead in a
  * human-readable IP address).
  *
+ * @param client handle to the client making the request (for sending the reply)
  * @param sa should be of type "struct sockaddr*"
+ * @param salen number of bytes in sa
  */
 static void
 get_ip_as_string (struct GNUNET_SERVER_Client *client,
-                  const struct sockaddr *sav, socklen_t salen)
+                  const struct sockaddr *sa, socklen_t salen)
 {
   struct IPCache *cache;
   struct IPCache *prev;
@@ -134,7 +176,7 @@ get_ip_as_string (struct GNUNET_SERVER_Client *client,
   cache = head;
   prev = NULL;
   while ((cache != NULL) &&
-         ((cache->salen != salen) || (0 != memcmp (cache->sa, sav, salen))))
+         ((cache->salen != salen) || (0 != memcmp (cache->sa, sa, salen))))
     {
       if (GNUNET_TIME_absolute_get_duration (cache->last_request).value <
           60 * 60 * 1000)
@@ -178,7 +220,7 @@ get_ip_as_string (struct GNUNET_SERVER_Client *client,
       cache->next = head;
       cache->salen = salen;
       cache->sa = GNUNET_malloc (salen);
-      memcpy (cache->sa, sav, salen);
+      memcpy (cache->sa, sa, salen);
       cache->last_request = GNUNET_TIME_absolute_get ();
       cache->last_refresh = GNUNET_TIME_absolute_get ();
       cache->addr = NULL;
index c78dc71c56c7cb37e4b34fbe7c69446657829b05..d18e5eb769e35e0ad5109d462f1041c1177a874b 100644 (file)
  * @brief Enumerate all network interfaces
  *
  * @param proc the callback function
- * @param cls closure for proc
+ * @param proc_cls closure for proc
  */
 void
 GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
-                                   void *cls)
+                                   void *proc_cls)
 {
 #ifdef MINGW
   PMIB_IFTABLE pTable;
@@ -148,7 +148,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
                 free (pszIfName);
 
               if (GNUNET_OK !=
-                  proc (cls,
+                  proc (proc_cls,
                         szEntry,
                         pAddrTable->table[dwIfIdx].dwIndex == dwExternalNIC,
                         NULL /* FIXME: pass actual IP address! */ ,
@@ -182,7 +182,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
                 alen = sizeof (struct sockaddr_in);
               else
                 alen = sizeof (struct sockaddr_in6);
-              if (GNUNET_OK != proc (cls,
+              if (GNUNET_OK != proc (proc_cls,
                                      ifa_ptr->ifa_name,
                                      0 == strcmp (ifa_ptr->ifa_name,
                                                   GNUNET_DEFAULT_INTERFACE),
@@ -255,7 +255,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
               a4.sin_family = AF_INET;
               a4.sin_addr = v4;
               if (GNUNET_OK !=
-                  proc (cls,
+                  proc (proc_cls,
                         ifc,
                         0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
                         (const struct sockaddr *) &a4, sizeof (a4)))
@@ -270,7 +270,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
               a6.sin6_addr = v6;
               fprintf (stderr, "procing %s\n", addrstr);
               if (GNUNET_OK !=
-                  proc (cls,
+                  proc (proc_cls,
                         ifc,
                         0 == strcmp (ifc, GNUNET_DEFAULT_INTERFACE),
                         (const struct sockaddr *) &a6, sizeof (a6)))
index 46e2deb5c7dd98f3d2075f708914701cd8d96f26..6e18d9278aa7523df09212e3d350a33ec11715fc 100644 (file)
 #include "gnunet_os_lib.h"
 
 /**
- * Set our process priority
+ * Set process priority
+ *
+ * @param proc id of the process
+ * @param prio priority value
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
 GNUNET_OS_set_process_priority (pid_t proc,
-                                enum GNUNET_SCHEDULER_Priority eprio)
+                                enum GNUNET_SCHEDULER_Priority prio)
 {
   int prio = 0;
 
-  GNUNET_assert (eprio < GNUNET_SCHEDULER_PRIORITY_COUNT);
-  if (eprio == GNUNET_SCHEDULER_PRIORITY_KEEP)
+  GNUNET_assert (prio < GNUNET_SCHEDULER_PRIORITY_COUNT);
+  if (prio == GNUNET_SCHEDULER_PRIORITY_KEEP)
     return GNUNET_OK;
   /* convert to MINGW/Unix values */
-  switch (eprio)
+  switch (prio)
     {
     case GNUNET_SCHEDULER_PRIORITY_DEFAULT:
 #ifdef MINGW
index 8687b5c4d13a2a74952afbb7ec82638039f6f9ce..04a6a1f78ebcd71805bbf1e680fc6b80beb7f266 100644 (file)
@@ -588,7 +588,7 @@ merge_meta_helper (void *cls,
 /**
  * Add a pseudonym to the set of known pseudonyms.
  * For all pseudonym advertisements that we discover
- * FSUI should automatically call this function.
+ * FS should automatically call this function.
  *
  * @param cfg overall configuration
  * @param id the pseudonym identifier
index 31637f01dbfeb39ac52a19732fd70e2f9080b4a8..5adf43633199f5252eb8a1f173926743330b05c3 100644 (file)
@@ -20,7 +20,7 @@
 
 /**
  * @author Christian Grothoff
- * @file resolver/resolver.h
+ * @file util/resolver.h
  */
 #ifndef RESOLVER_H
 #define RESOLVER_H
index cc81aa6b8bdcf682db25de71326ec572259b0b6d..b2c8fda666cbd4b6ebb0a86f91518aa72bdd127a 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 /**
- * @file resolver/resolver_api.c
+ * @file util/resolver_api.c
  * @brief resolver for writing a tool
  * @author Christian Grothoff
  */
index 23e6cd85bfd404c5390256ec4e80ada56b71ce3c..133fda857d85f83487a1376d50a7f38a81fd4e5a 100644 (file)
@@ -353,37 +353,37 @@ GNUNET_STRINGS_filename_expand (const char *fil)
 /**
  * Give relative time in human-readable fancy format.
  *
- * @param del time in milli seconds
+ * @param delta time in milli seconds
  * @return time as human-readable string
  */
 char *
-GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative del)
+GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta)
 {
   const char *unit = _( /* time unit */ "ms");
   char *ret;
-  uint64_t delta = del.value;
+  uint64_t dval = delta.value;
 
-  if (delta > 5 * 1000)
+  if (dval > 5 * 1000)
     {
-      delta = delta / 1000;
+      dval = dval / 1000;
       unit = _( /* time unit */ "s");
-      if (delta > 5 * 60)
+      if (dval > 5 * 60)
         {
-          delta = delta / 60;
+          dval = dval / 60;
           unit = _( /* time unit */ "m");
-          if (delta > 5 * 60)
+          if (dval > 5 * 60)
             {
-              delta = delta / 60;
+              dval = dval / 60;
               unit = _( /* time unit */ "h");
-              if (delta > 5 * 24)
+              if (dval > 5 * 24)
                 {
-                  delta = delta / 24;
+                  dval = dval / 24;
                   unit = _( /* time unit */ " days");
                 }
             }
         }
     }
-  GNUNET_asprintf (&ret, "%llu%s", delta, unit);
+  GNUNET_asprintf (&ret, "%llu%s", dval, unit);
   return ret;
 }