aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2013-06-25 23:37:13 +0000
committerFlorian Dold <florian.dold@gmail.com>2013-06-25 23:37:13 +0000
commit4340fe90fc88c79a1f90b52ced9acfef6719b8be (patch)
treef7c3af808fed7bd672c8de2c644b6199aa688b0e
parent298adbb1d8ac5355e925c69fae5706518c18d8e9 (diff)
doxygen
-rw-r--r--doc/testbed_test.c4
-rw-r--r--src/consensus/consensus_api.c2
-rw-r--r--src/consensus/gnunet-service-consensus.c2
-rw-r--r--src/include/gnunet_mq_lib.h29
-rw-r--r--src/include/gnunet_set_service.h4
-rw-r--r--src/include/gnunet_stream_lib.h1
-rw-r--r--src/set/gnunet-service-set.c5
-rw-r--r--src/set/gnunet-service-set.h4
-rw-r--r--src/set/gnunet-service-set_intersection.c2
-rw-r--r--src/set/gnunet-service-set_union.c5
-rw-r--r--src/set/gnunet-set-profiler.c3
-rw-r--r--src/set/set_api.c6
-rw-r--r--src/stream/stream_api.c1
-rw-r--r--src/util/mq.c32
14 files changed, 69 insertions, 31 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c
index b1102ef92f..c34d064b05 100644
--- a/doc/testbed_test.c
+++ b/doc/testbed_test.c
@@ -111,6 +111,7 @@ dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
* Dual of 'dht_ca' to perform the 'disconnect'/cleanup operation
* once we no longer need to access this subsystem.
*
+ * @param cls closure
* @param op_result whatever we returned from 'dht_ca'
*/
static void
@@ -130,6 +131,7 @@ dht_da (void *cls, void *op_result)
* just to the DHT service of peer 0.
*
* @param cls closure
+ * @param peers started peers for the test
* @param num_peers size of the 'peers' array
* @param links_succeeded number of links between peers that were created
* @param links_failed number of links testbed was unable to establish
@@ -137,7 +139,7 @@ dht_da (void *cls, void *op_result)
static void
test_master (void *cls, unsigned int num_peers,
struct GNUNET_TESTBED_Peer **peers,
- unsigned int links_succeeeded,
+ unsigned int links_succeeded,
unsigned int links_failed)
{
/* Testbed is ready with peers running and connected in a pre-defined overlay
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c
index 6845807558..a1dc408261 100644
--- a/src/consensus/consensus_api.c
+++ b/src/consensus/consensus_api.c
@@ -141,7 +141,7 @@ handle_new_element (void *cls,
* that the conclusion is over.
*
* @param cls consensus handle
- * @param mh conclude done message
+ * @param msg conclude done message
*/
static void
handle_conclude_done (void *cls,
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 1c2c78422c..9cde0e46b9 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -702,6 +702,7 @@ initialize_session_peer_list (struct ConsensusSession *session,
* Called when another peer wants to do a set operation with the
* local peer.
*
+ * @param cls closure
* @param other_peer the other peer
* @param context_msg message with application specific information from
* the other peer
@@ -786,6 +787,7 @@ set_listen_cb (void *cls,
* Initialize the session, continue receiving messages from the owning client
*
* @param session the session to initialize
+ * @param join_msg the join message from the client
*/
static void
initialize_session (struct ConsensusSession *session,
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 3a4dd3d5fc..048ad39a08 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -20,7 +20,7 @@
/**
* @author Florian Dold
- * @file set/mq.h
+ * @file include/gnunet_mq_lib.h
* @brief general purpose message queue
*/
#ifndef GNUNET_MQ_H
@@ -114,6 +114,9 @@ GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh, uint16_t ba
*
* @param mhp pointer to the message header pointer that will be changed to allocate at
* the newly allocated space for the message.
+ * @param base_size size of the data before the nested message
+ * @param type type of the message in the envelope
+ * @param nested_mh the message to append to the message after base_size
*/
struct GNUNET_MQ_Envelope *
GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type,
@@ -271,7 +274,7 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm);
* May only be called once per message.
*
* @param mq message queue
- * @param mqm the message to send.
+ * @param ev the envelope with the message to send.
*/
void
GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev);
@@ -281,7 +284,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev);
* Cancel sending the message. Message must have been sent with GNUNET_MQ_send before.
* May not be called after the notify sent callback has been called
*
- * @param mqm queued message to cancel
+ * @param ev queued envelope to cancel
*/
void
GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev);
@@ -291,7 +294,6 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev);
* Associate the assoc_data in mq with a unique request id.
*
* @param mq message queue, id will be unique for the queue
- * @param mqm message to associate
* @param assoc_data to associate
*/
uint32_t
@@ -350,11 +352,11 @@ GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
*
* @param send function the implements sending messages
* @param destroy function that implements destroying the queue
- * @param destroy function that implements canceling a message
- * @param state for the queue, passed to 'send' and 'destroy'
+ * @param cancel function that implements canceling a message
+ * @param impl_state for the queue, passed to 'send' and 'destroy'
* @param handlers array of message handlers
* @param error_handler handler for read and write errors
- * @param cls closure for handlers
+ * @param cls closure for message handlers and error handler
* @return a new message queue
*/
struct GNUNET_MQ_Handle *
@@ -411,7 +413,11 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq);
/**
- * Call the right callback for a message.
+ * Call the message message handler that was registered
+ * for the type of the given message in the given message queue.
+ *
+ * This function is indended to be used for the implementation
+ * of message queues.
*
* @param mq message queue with the handlers
* @param mh message to dispatch
@@ -422,9 +428,14 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq,
/**
- * Call the right callback for an error condition.
+ * Call the error handler of a message queue with the given
+ * error code. If there is no error handler, log a warning.
+ *
+ * This function is intended to be used for the implementation
+ * of message queues.
*
* @param mq message queue
+ * @param error the error type
*/
void
GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq,
diff --git a/src/include/gnunet_set_service.h b/src/include/gnunet_set_service.h
index e08ed5d69e..2da53cac9b 100644
--- a/src/include/gnunet_set_service.h
+++ b/src/include/gnunet_set_service.h
@@ -156,7 +156,7 @@ struct GNUNET_SET_Element
/**
* Continuation used for some of the set operations
*
- * @cls closure
+ * @param cls closure
*/
typedef void (*GNUNET_SET_Continuation) (void *cls);
@@ -330,7 +330,7 @@ struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
- void *cls);
+ void *result_cls);
/**
diff --git a/src/include/gnunet_stream_lib.h b/src/include/gnunet_stream_lib.h
index 65e247eceb..f89815c57c 100644
--- a/src/include/gnunet_stream_lib.h
+++ b/src/include/gnunet_stream_lib.h
@@ -401,6 +401,7 @@ GNUNET_STREAM_read_cancel (struct GNUNET_STREAM_ReadHandle *rh);
* @param socket the socket to read/write in the message queue
* @param msg_handlers message handler array
* @param error_handler callback for errors
+ * @param cls closure for message handlers and error handler
* @return the message queue for the socket
*/
struct GNUNET_MQ_Handle *
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index 644626dd01..bab29b0975 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -251,6 +251,8 @@ tunnel_context_destroy (struct TunnelContext *tc)
* another peer.
*
* @param cls the incoming socket
+ * @param tunnel the tunnel that sent the message
+ * @param tunnel_ctx the tunnel context
* @param mh the message
*/
static int
@@ -524,7 +526,6 @@ handle_client_evaluate (void *cls,
return;
}
-
switch (set->operation)
{
case GNUNET_SET_OPERATION_INTERSECTION:
@@ -694,6 +695,8 @@ tunnel_new_cb (void *cls,
struct Incoming *incoming;
struct TunnelContext *tc;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "new incoming tunnel\n");
+
GNUNET_assert (port == GNUNET_APPLICATION_TYPE_SET);
tc = GNUNET_new (struct TunnelContext);
incoming = GNUNET_new (struct Incoming);
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h
index 937bc9adcd..d60b5f4776 100644
--- a/src/set/gnunet-service-set.h
+++ b/src/set/gnunet-service-set.h
@@ -257,7 +257,7 @@ _GSS_union_set_create (void);
* a remote peer.
*
* @param m the evaluate request message from the client
- * @parem set the set to evaluate the operation with
+ * @param set the set to evaluate the operation with
*/
void
_GSS_union_evaluate (struct GNUNET_SET_EvaluateMessage *m, struct Set *set);
@@ -287,7 +287,7 @@ _GSS_union_remove (struct GNUNET_SET_ElementMessage *m, struct Set *set);
/**
* Destroy a set that supports the union operation
*
- * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
+ * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
*/
void
_GSS_union_set_destroy (struct Set *set);
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 411959329d..fe3ba56eaf 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -1287,7 +1287,7 @@ _GSS_intersection_add (struct GNUNET_SET_ElementMessage *m, struct Set *set)
/**
* Destroy a set that supports the union operation
*
- * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
+ * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
*/
void
_GSS_union_set_destroy (struct Set *set)
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index 294fa3304f..670626cd4d 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -493,7 +493,8 @@ send_operation_request (struct UnionEvaluateOperation *eo)
struct GNUNET_MQ_Envelope *mqm;
struct OperationRequestMessage *msg;
- mqm = GNUNET_MQ_msg_nested_mh (msg, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, eo->context_msg);
+ mqm = GNUNET_MQ_msg_nested_mh (msg, GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST,
+ eo->context_msg);
if (NULL == mqm)
{
@@ -1287,7 +1288,7 @@ _GSS_union_add (struct GNUNET_SET_ElementMessage *m, struct Set *set)
/**
* Destroy a set that supports the union operation
*
- * @param the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
+ * @param set the set to destroy, must be of type GNUNET_SET_OPERATION_UNION
*/
void
_GSS_union_set_destroy (struct Set *set)
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c
index 0a2c2779b1..814c9e436a 100644
--- a/src/set/gnunet-set-profiler.c
+++ b/src/set/gnunet-set-profiler.c
@@ -38,7 +38,7 @@ static unsigned int num_c = 20;
static unsigned int salt = 42;
-static char* op_str = "union";
+static char *op_str = "union";
const static struct GNUNET_CONFIGURATION_Handle *config;
@@ -157,6 +157,7 @@ set_listen_cb (void *cls,
struct GNUNET_SET_Request *request)
{
GNUNET_assert (NULL == set_oh2);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "set listen cb called\n");
set_oh2 = GNUNET_SET_accept (request, GNUNET_SET_RESULT_ADDED,
set_result_cb_2, NULL);
GNUNET_SET_commit (set_oh2, set_b);
diff --git a/src/set/set_api.c b/src/set/set_api.c
index e1b6132cb2..370846baef 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -400,14 +400,14 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh)
* @param result_mode specified how results will be returned,
* see 'GNUNET_SET_ResultMode'.
* @param result_cb callback for the results
- * @param cls closure for result_cb
+ * @param result_cls closure for result_cb
* @return a handle to cancel the operation
*/
struct GNUNET_SET_OperationHandle *
GNUNET_SET_accept (struct GNUNET_SET_Request *request,
enum GNUNET_SET_ResultMode result_mode,
GNUNET_SET_ResultIterator result_cb,
- void *cls)
+ void *result_cls)
{
struct GNUNET_MQ_Envelope *mqm;
struct GNUNET_SET_OperationHandle *oh;
@@ -418,7 +418,7 @@ GNUNET_SET_accept (struct GNUNET_SET_Request *request,
oh = GNUNET_new (struct GNUNET_SET_OperationHandle);
oh->result_cb = result_cb;
- oh->result_cls = cls;
+ oh->result_cls = result_cls;
mqm = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_ACCEPT);
msg->accept_reject_id = htonl (request->accept_id);
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c
index 47ed04117f..b221d3a1df 100644
--- a/src/stream/stream_api.c
+++ b/src/stream/stream_api.c
@@ -3934,6 +3934,7 @@ mq_stream_destroy_impl (struct GNUNET_MQ_Handle *mq, void *impl_state)
* @param socket the socket to read/write in the message queue
* @param msg_handlers message handler array
* @param error_handler callback for errors
+ * @param cls closure for message handlers and error handler
* @return the message queue for the socket
*/
struct GNUNET_MQ_Handle *
diff --git a/src/util/mq.c b/src/util/mq.c
index 54d3d4a2e4..f318dd04a8 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -167,10 +167,12 @@ struct ClientConnectionState
};
-
-
/**
- * Call the right callback for a message.
+ * Call the message message handler that was registered
+ * for the type of the given message in the given message queue.
+ *
+ * This function is indended to be used for the implementation
+ * of message queues.
*
* @param mq message queue with the handlers
* @param mh message to dispatch
@@ -199,9 +201,14 @@ GNUNET_MQ_inject_message (struct GNUNET_MQ_Handle *mq, const struct GNUNET_Messa
/**
- * Call the right callback for an error condition.
+ * Call the error handler of a message queue with the given
+ * error code. If there is no error handler, log a warning.
+ *
+ * This function is intended to be used by the implementation
+ * of message queues.
*
* @param mq message queue
+ * @param error the error type
*/
void
GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq,
@@ -230,7 +237,7 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm)
* May only be called once per message.
*
* @param mq message queue
- * @param ev the message to send.
+ * @param ev the envelope with the message to send.
*/
void
GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
@@ -288,10 +295,11 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
*
* @param send function the implements sending messages
* @param destroy function that implements destroying the queue
- * @param destroy function that implements canceling a message
- * @param state for the queue, passed to 'send' and 'destroy'
+ * @param cancel function that implements canceling a message
+ * @param impl_state for the queue, passed to 'send' and 'destroy'
* @param handlers array of message handlers
* @param error_handler handler for read and write errors
+ * @param cls closure for message handlers and error handler
* @return a new message queue
*/
struct GNUNET_MQ_Handle *
@@ -391,6 +399,15 @@ GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp, uint16_t size, uint16_t type)
}
+/**
+ * Implementation of the GNUNET_MQ_msg_nested_mh macro.
+ *
+ * @param mhp pointer to the message header pointer that will be changed to allocate at
+ * the newly allocated space for the message.
+ * @param base_size size of the data before the nested message
+ * @param type type of the message in the envelope
+ * @param nested_mh the message to append to the message after base_size
+ */
struct GNUNET_MQ_Envelope *
GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp, uint16_t base_size, uint16_t type,
const struct GNUNET_MessageHeader *nested_mh)
@@ -633,7 +650,6 @@ GNUNET_MQ_replace_handlers (struct GNUNET_MQ_Handle *mq,
* Associate the assoc_data in mq with a unique request id.
*
* @param mq message queue, id will be unique for the queue
- * @param mqm message to associate
* @param assoc_data to associate
*/
uint32_t