* Fill in all of the generic fields for
* a download event.
*
- * @param pc structure to fill in
+ * @param pi structure to fill in
* @param dc overall download context
*/
static void
* the specified node.
*
* @param fsize overall file size
- * @param off offset of the node
+ * @param totaldepth depth of the entire tree
+ * @param offset offset of the node
* @param depth depth of the node
* @return number of bytes stored in this node
*/
/**
- * Process a search result.
+ * Process a download result.
*
- * @param sc our search context
+ * @param dc our download context
* @param type type of the result
* @param data the (encrypted) response
* @param size size of data
* Fill in all of the generic fields for
* a search event.
*
- * @param pc structure to fill in
+ * @param pi structure to fill in
* @param sc overall search context
*/
static void
* Fill in all of the generic fields for
* an unindex event.
*
- * @param pc structure to fill in
- * @param sc overall unindex context
+ * @param pi structure to fill in
+ * @param uc overall unindex context
+ * @param offset where we are in the file (for progress)
*/
static void
make_unindex_status (struct GNUNET_FS_ProgressInfo *pi,
/**
* Convert string back to binary data.
*
- * @param input '\0'-terminated string
+ * @param input '\\0'-terminated string
* @param data where to write binary data
* @param size how much data should be converted
* @return number of characters processed from input,
/**
* 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
/**
* Print a meta data entry.
+ *
+ * @param cls closure (unused)
+ * @param type type of the keyword
+ * @param data value of the keyword
*/
static int
item_printer (void *cls,
* @param cls closure (not used)
* @param filename name of the file in the directory
* @param uri URI of the file
- * @param metadata metadata for the file; metadata for
+ * @param meta metadata for the file; metadata for
* the directory if everything else is NULL/zero
* @param length length of the available data for the file
* (of type size_t since data must certainly fit
* @param sched the scheduler to use
* @param args remaining command-line arguments
* @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param cfg configuration
+ * @param c configuration
*/
static void
run (void *cls,
* @param sched the scheduler to use
* @param args remaining command-line arguments
* @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param cfg configuration
+ * @param c configuration
*/
static void
run (void *cls,
* @param sched the scheduler to use
* @param args remaining command-line arguments
* @param cfgfile name of the configuration file used (for saving, can be NULL!)
- * @param cfg configuration
+ * @param c configuration
*/
static void
run (void *cls,
/**
* Read from the service.
*
- * @param sched scheduler to use
* @param sock the service
* @param handler function to call with the message
* @param cls closure for handler
* Request that the service should shutdown.
* Afterwards, the connection should be disconnected.
*
- * @param sched scheduler to use
* @param sock the socket connected to the service
*/
void
* 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)?
* Reallocate memory. Checks the return value, aborts if no more
* memory is available.
*
- * @ptr the pointer to reallocate
- * @param size how many bytes of memory to allocate
+ * @param ptr the pointer to reallocate
+ * @param n how many bytes of memory to allocate
* @param filename where in the code was the call to GNUNET_realloc
* @param linenumber where in the code was the call to GNUNET_realloc
* @return pointer to size bytes of memory
*
* @param comp default component to use
* @param loglevel what types of messages should be logged
+ * @param logfile which file to write log messages to (can be NULL)
+ * @return GNUNET_OK on success
*/
int
GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile)
*
* @param block the GNUNET_CRYPTO_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,
*
* @param hostkey 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
/**
* Compare function for 'qsort' to sort command-line arguments by the
* short option.
+ *
+ * @param a1 first command line option
+ * @param a2 second command line option
*/
static int
cmd_sorter (const void *a1, const void *a2)
* @param argc number of command line arguments
* @param argv command line arguments
* @param binaryName our expected name
+ * @param binaryHelp help text for the program
* @param options command line options
* @param task main function to run
* @param task_cls closure for task
#include "gnunet_disk_lib.h"
#include "gnunet_pseudonym_lib.h"
+/**
+ * FIXME
+ */
#define PS_METADATA_DIR DIR_SEPARATOR_STR "data" DIR_SEPARATOR_STR "pseudonyms/metadata" DIR_SEPARATOR_STR
+
+/**
+ * FIXME
+ */
#define PS_NAMES_DIR DIR_SEPARATOR_STR "data" DIR_SEPARATOR_STR "pseudonyms/names" DIR_SEPARATOR_STR
+
+/**
+ * FIXME
+ */
struct DiscoveryCallback
{
+
+ /**
+ * FIXME
+ */
struct DiscoveryCallback *next;
+
+ /**
+ * FIXME
+ */
GNUNET_PSEUDONYM_Iterator callback;
+
+ /**
+ * FIXME
+ */
void *closure;
};
+
+/**
+ * FIXME
+ */
static struct DiscoveryCallback *head;
/**
* Internal notification about new tracked URI.
+ *
+ * FIXME
*/
static void
internal_notify (const GNUNET_HashCode * id,
/**
* Register callback to be invoked whenever we discover
* a new pseudonym.
+ *
+ * FIXME
*/
int
GNUNET_PSEUDONYM_discovery_callback_register (const struct
/**
* Unregister pseudonym discovery callback.
+ *
+ * FIXME
*/
int
GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
/**
* Get the filename (or directory name) for the given
* pseudonym identifier and directory prefix.
+ *
+ * FIXME
*/
static char *
get_data_filename (const struct GNUNET_CONFIGURATION_Handle
NULL);
}
+
+/**
+ * FIXME
+ */
static void
write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
const GNUNET_HashCode * nsid,
GNUNET_free_non_null (GNUNET_PSEUDONYM_id_to_name (cfg, nsid));
}
+
+/**
+ * FIXME
+ */
static int
read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
const GNUNET_HashCode * nsid,
/**
* Return the unique, human readable name for the given namespace.
*
+ * @param cfg configuration
+ * @param nsid cryptographic ID of the namespace
* @return NULL on failure (should never happen)
*/
char *
/**
* Get the namespace ID belonging to the given namespace name.
*
+ * @param cfg configuration to use
+ * @param ns_uname human-readable name for the namespace
+ * @param nsid set to namespace ID based on 'ns_uname'
* @return GNUNET_OK on success
*/
int
-
+/**
+ * FIXME
+ */
struct ListPseudonymClosure
{
+
+ /**
+ * FIXME
+ */
GNUNET_PSEUDONYM_Iterator iterator;
+
+ /**
+ * FIXME
+ */
void *closure;
+
+ /**
+ * FIXME
+ */
const struct GNUNET_CONFIGURATION_Handle *cfg;
};
+
+
+/**
+ * FIXME
+ */
static int
list_pseudonym_helper (void *cls, const char *fullname)
{
return ret;
}
+
/**
* List all available pseudonyms.
+ *
+ * @param cfg overall configuration
+ * @param iterator function to call for each pseudonym
+ * @param closure closure for iterator
+ * @return number of pseudonyms found
*/
int
GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
/**
* Change the ranking of a pseudonym.
*
+ * @param cfg overall configuration
* @param nsid id of the pseudonym
* @param delta by how much should the rating be
* changed?
/**
* Insert metadata into existing MD record (passed as cls).
+ *
+ * @param cls metadata to add to
+ * @param type type of entry to insert
+ * @param data value of entry to insert
*/
static int
merge_meta_helper (void *cls,
* For all pseudonym advertisements that we discover
* FSUI should automatically call this function.
*
+ * @param cfg overall configuration
* @param id the pseudonym identifier
+ * @param metadata for the pseudonym
*/
void
GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
/**
* Check that the given priority is legal (and return it).
+ *
+ * @param p priority value to check
+ * @return p on success, 0 on error
*/
static enum GNUNET_SCHEDULER_Priority
check_priority (enum GNUNET_SCHEDULER_Priority p)
* future), but only if the return value is "GNUNET_NO" (and
* the "lowest_pending_id" check failed).
*
+ * @param sched the scheduler
+ * @param id which task are we checking for
* @return GNUNET_YES if so, GNUNET_NO if not
*/
static int
/**
* Update all sets and timeout for select.
+ *
+ * @param sched the scheduler
+ * @param rs read-set, set to all FDs we would like to read (updated)
+ * @param ws write-set, set to all FDs we would like to write (updated)
+ * @param timeout next timeout (updated)
*/
static void
update_sets (struct GNUNET_SCHEDULER_Handle *sched,
- struct GNUNET_NETWORK_FDSet * rs, struct GNUNET_NETWORK_FDSet * ws, struct GNUNET_TIME_Relative *timeout)
+ struct GNUNET_NETWORK_FDSet * rs,
+ struct GNUNET_NETWORK_FDSet * ws,
+ struct GNUNET_TIME_Relative *timeout)
{
struct Task *pos;
* If so, update the want set (set all FDs that are ready). If not,
* return GNUNET_NO.
*
- * @param maxfd highest FD that needs to be checked.
+ * @param ready set that is ready
+ * @param want set that we want to be ready
* @return GNUNET_YES if there was some overlap
*/
static int
-set_overlaps (const struct GNUNET_NETWORK_FDSet * ready, struct GNUNET_NETWORK_FDSet * want)
+set_overlaps (const struct GNUNET_NETWORK_FDSet * ready,
+ struct GNUNET_NETWORK_FDSet * want)
{
if (GNUNET_NETWORK_fdset_overlap (ready, want))
{
* Check if the given task is eligible to run now.
* Also set the reason why it is eligible.
*
+ * @param sched the scheduler
+ * @param task task to check if it is ready
+ * @param now the current time
+ * @param rs set of FDs ready for reading
+ * @param ws set of FDs ready for writing
* @return GNUNET_YES if we can run it, GNUNET_NO if not.
*/
static int
is_ready (struct GNUNET_SCHEDULER_Handle *sched,
struct Task *task,
struct GNUNET_TIME_Absolute now,
- const struct GNUNET_NETWORK_FDSet * rs, const struct GNUNET_NETWORK_FDSet * ws)
+ const struct GNUNET_NETWORK_FDSet *rs,
+ const struct GNUNET_NETWORK_FDSet * ws)
{
if ((GNUNET_NO == task->run_on_shutdown) && (GNUNET_YES == sched->shutdown))
return GNUNET_NO;
/**
* Put a task that is ready for execution into the ready queue.
+ *
+ * @param handle the scheduler
+ * @param task task ready for execution
*/
static void
-queue_ready_task (struct GNUNET_SCHEDULER_Handle *handle, struct Task *task)
+queue_ready_task (struct GNUNET_SCHEDULER_Handle *handle,
+ struct Task *task)
{
task->next = handle->ready[check_priority (task->priority)];
handle->ready[check_priority (task->priority)] = task;
/**
* Check which tasks are ready and move them
* to the respective ready queue.
+ *
+ * @param handle the scheduler
+ * @param rs FDs ready for reading
+ * @param ws FDs ready for writing
*/
static void
check_ready (struct GNUNET_SCHEDULER_Handle *handle,
- const struct GNUNET_NETWORK_FDSet * rs, const struct GNUNET_NETWORK_FDSet * ws)
+ const struct GNUNET_NETWORK_FDSet * rs,
+ const struct GNUNET_NETWORK_FDSet * ws)
{
struct Task *pos;
struct Task *prev;
/**
- * Destroy a task
+ * Destroy a task (release associated resources)
+ *
+ * @param t task to destroy
*/
static void destroy_task (struct Task *t)
{
* "URGENT" tasks or until we have at least one "pending" task (which
* may become ready, hence we should select on it). Naturally, if
* there are no more ready tasks, we also return.
+ *
+ * @param sched the scheduler
*/
static void
run_ready (struct GNUNET_SCHEDULER_Handle *sched)
* stop a scheduling thread when created with the
* "GNUNET_SCHEDULER_init_thread" function or from within the signal
* handler for signals causing shutdowns.
+ *
+ * @param sched the scheduler
*/
void
GNUNET_SCHEDULER_shutdown (struct GNUNET_SCHEDULER_Handle *sched)
* tasks ready to run).
*
* @param sched scheduler to query
+ * @param p priority level to look at
* @return number of tasks pending right now
*/
unsigned int
*
* @param sched scheduler to use
* @param task id of the task to cancel
+ * @return original closure of the task
*/
void *
GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Handle *sched,
* and the reason code can be specified.
*
* @param sched scheduler to use
+ * @param run_on_shutdown should this task be run if we are shutting down?
* @param main main function of the task
- * @param cls closure of task
+ * @param cls closure for 'main'
* @param reason reason for task invocation
*/
void
* are satisfied). Use GNUNET_SCHEDULER_NO_TASK to not have any dependency
* on completion of other tasks.
* @param main main function of the task
- * @param cls closure of task
+ * @param cls closure for 'main'
* @return unique task identifier for the job
* only valid until "main" is started!
*/
* Wrapper to cancel receiving from a socket.
*
* @param cls handle to the GNUNET_CONNECTION_Handle to cancel
- * @param tc task ID that was returned by GNUNET_CONNECTION_receive
+ * @param ti task ID that was returned by GNUNET_CONNECTION_receive
*/
static void
sock_receive_cancel (void *cls, GNUNET_SCHEDULER_TaskIdentifier ti)
* Notify us when the server has enough space to transmit
* a message of the given size to the given client.
*
- * @param server the server to use
* @param client client to transmit message to
* @param size requested amount of buffer space
* @param timeout after how long should we give up (and call
* notation. The netmask must be given in CIDR notation (/16) or
* can be omitted to specify a single host.
* <p>
- * @param routeList a string specifying the forbidden networks
+ * @param routeListX a string specifying the forbidden networks
* @return the converted list, NULL if the synatx is flawed
*/
static struct IPv6NetworkSet *
* Check if the given IP address is in the list of IP addresses.
*
* @param list a list of networks
- * @param ip the IP to check (in network byte order)
+ * @param add the IP to check (in network byte order)
* @return GNUNET_NO if the IP is not in the list, GNUNET_YES if it it is
*/
static int
/**
* 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 *sctx)
/**
* Give relative time in human-readable fancy format.
- * @param delta time in milli seconds
+ *
+ * @param del time in milli seconds
+ * @return time as human-readable string
*/
char *
GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative del)
/**
* "man ctime_r", except for GNUnet time; also, unlike ctime, the
* return value does not include the newline character.
+ *
+ * @param t time to convert
+ * @return absolute time in human-readable format
*/
char *
GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t)