From 4340fe90fc88c79a1f90b52ced9acfef6719b8be Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 25 Jun 2013 23:37:13 +0000 Subject: doxygen --- doc/testbed_test.c | 4 +++- src/consensus/consensus_api.c | 2 +- src/consensus/gnunet-service-consensus.c | 2 ++ src/include/gnunet_mq_lib.h | 29 +++++++++++++++++++--------- src/include/gnunet_set_service.h | 4 ++-- src/include/gnunet_stream_lib.h | 1 + src/set/gnunet-service-set.c | 5 ++++- src/set/gnunet-service-set.h | 4 ++-- src/set/gnunet-service-set_intersection.c | 2 +- src/set/gnunet-service-set_union.c | 5 +++-- src/set/gnunet-set-profiler.c | 3 ++- src/set/set_api.c | 6 +++--- src/stream/stream_api.c | 1 + src/util/mq.c | 32 +++++++++++++++++++++++-------- 14 files changed, 69 insertions(+), 31 deletions(-) diff --git a/doc/testbed_test.c b/doc/testbed_test.c index b1102ef92..c34d064b0 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 684580755..a1dc40826 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 1c2c78422..9cde0e46b 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 3a4dd3d5f..048ad39a0 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 e08ed5d69..2da53cac9 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 65e247ece..f89815c57 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 644626dd0..bab29b097 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 937bc9adc..d60b5f477 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 411959329..fe3ba56ea 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 294fa3304..670626cd4 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 0a2c2779b..814c9e436 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 e1b6132cb..370846bae 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 47ed04117..b221d3a1d 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 54d3d4a2e..f318dd04a 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 -- cgit v1.2.3