[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31379 - in gnunet/src: dv include transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31379 - in gnunet/src: dv include transport |
Date: |
Fri, 13 Dec 2013 20:51:38 +0100 |
Author: grothoff
Date: 2013-12-13 20:51:37 +0100 (Fri, 13 Dec 2013)
New Revision: 31379
Modified:
gnunet/src/dv/test_transport_dv_data.conf
gnunet/src/include/gnunet_nat_lib.h
gnunet/src/transport/plugin_transport_http_client.c
gnunet/src/transport/plugin_transport_udp.c
Log:
-doxygen, indentation
Modified: gnunet/src/dv/test_transport_dv_data.conf
===================================================================
--- gnunet/src/dv/test_transport_dv_data.conf 2013-12-13 19:40:36 UTC (rev
31378)
+++ gnunet/src/dv/test_transport_dv_data.conf 2013-12-13 19:51:37 UTC (rev
31379)
@@ -7,12 +7,12 @@
[dv]
AUTOSTART = YES
-PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
+# PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
[set]
AUTOSTART = YES
-PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
+# PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
[core]
-PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
+# PREFIX = valgrind --leak-check=full --track-fds=yes --leak-resolution=high
Modified: gnunet/src/include/gnunet_nat_lib.h
===================================================================
--- gnunet/src/include/gnunet_nat_lib.h 2013-12-13 19:40:36 UTC (rev 31378)
+++ gnunet/src/include/gnunet_nat_lib.h 2013-12-13 19:51:37 UTC (rev 31379)
@@ -32,14 +32,14 @@
#include "gnunet_util_lib.h"
/**
- * Signature of the callback passed to GNUNET_NAT_register for
+ * Signature of the callback passed to #GNUNET_NAT_register() for
* a function to call whenever our set of 'valid' addresses changes.
*
* @param cls closure
- * @param add_remove GNUNET_YES to mean the new public IP address, GNUNET_NO
to mean
+ * @param add_remove #GNUNET_YES to mean the new public IP address, #GNUNET_NO
to mean
* the previous (now invalid) one
* @param addr either the previous or the new public IP address
- * @param addrlen actual lenght of the address
+ * @param addrlen actual length of the @a addr
*/
typedef void (*GNUNET_NAT_AddressCallback) (void *cls, int add_remove,
const struct sockaddr *addr,
@@ -47,13 +47,13 @@
/**
- * Signature of the callback passed to GNUNET_NAT_register
+ * Signature of the callback passed to #GNUNET_NAT_register().
* for a function to call whenever someone asks us to do connection
* reversal.
*
* @param cls closure
* @param addr public IP address of the other peer
- * @param addrlen actual lenght of the address
+ * @param addrlen actual lenght of the @a addr
*/
typedef void (*GNUNET_NAT_ReversalCallback) (void *cls,
const struct sockaddr *addr,
@@ -74,22 +74,25 @@
* should call the given callback for any 'plausible' external address.
*
* @param cfg configuration to use
- * @param is_tcp GNUNET_YES for TCP, GNUNET_NO for UDP
+ * @param is_tcp #GNUNET_YES for TCP, #GNUNET_NO for UDP
* @param adv_port advertised port (port we are either bound to or that our OS
* locally performs redirection from to our bound port).
- * @param num_addrs number of addresses in 'addrs'
+ * @param num_addrs number of addresses in @a addrs
* @param addrs list of local addresses packets should be redirected to
- * @param addrlens actual lengths of the addresses
+ * @param addrlens actual lengths of the addresses in @a addrs
* @param address_callback function to call everytime the public IP address
changes
* @param reversal_callback function to call if someone wants connection
reversal from us,
* NULL if connection reversal is not supported
- * @param callback_cls closure for callback
+ * @param callback_cls closure for callbacks
* @return NULL on error, otherwise handle that can be used to unregister
*/
struct GNUNET_NAT_Handle *
-GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp,
- uint16_t adv_port, unsigned int num_addrs,
- const struct sockaddr **addrs, const socklen_t *addrlens,
+GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ int is_tcp,
+ uint16_t adv_port,
+ unsigned int num_addrs,
+ const struct sockaddr **addrs,
+ const socklen_t *addrlens,
GNUNET_NAT_AddressCallback address_callback,
GNUNET_NAT_ReversalCallback reversal_callback,
void *callback_cls);
@@ -100,13 +103,14 @@
*
* @param h the handle returned by register
* @param addr IP address to test (IPv4 or IPv6)
- * @param addrlen number of bytes in addr
- * @return GNUNET_YES if the address is plausible,
- * GNUNET_NO if the address is not plausible,
- * GNUNET_SYSERR if the address is malformed
+ * @param addrlen number of bytes in @a addr
+ * @return #GNUNET_YES if the address is plausible,
+ * #GNUNET_NO if the address is not plausible,
+ * #GNUNET_SYSERR if the address is malformed
*/
int
-GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr,
+GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h,
+ const void *addr,
socklen_t addrlen);
@@ -117,19 +121,18 @@
*
* @param h handle (used for configuration)
* @param sa the address of the peer (IPv4-only)
- *
- * @return GNUNET_SYSERR on error, GNUNET_NO if nat client is disabled,
- * GNUNET_OK otherwise
+ * @return #GNUNET_SYSERR on error, #GNUNET_NO if nat client is disabled,
+ * #GNUNET_OK otherwise
*/
int
GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h,
const struct sockaddr_in *sa);
-
/**
- * Stop port redirection and public IP address detection for the given handle.
- * This frees the handle, after having sent the needed commands to close open
ports.
+ * Stop port redirection and public IP address detection for the given
+ * handle. This frees the handle, after having sent the needed
+ * commands to close open ports.
*
* @param h the handle to stop
*/
@@ -142,13 +145,14 @@
*/
struct GNUNET_NAT_Test;
+
/**
* Function called to report success or failure for
* NAT configuration test.
*
* @param cls closure
- * @param success GNUNET_OK on success, GNUNET_NO on failure,
- * GNUNET_SYSERR if the test could not be
+ * @param success #GNUNET_OK on success, #GNUNET_NO on failure,
+ * #GNUNET_SYSERR if the test could not be
* properly started (internal failure)
*/
typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success);
@@ -158,17 +162,20 @@
* given configuration (IPv4-only).
*
* @param cfg configuration for the NAT traversal
- * @param is_tcp GNUNET_YES to test TCP, GNUNET_NO to test UDP
+ * @param is_tcp #GNUNET_YES to test TCP, #GNUNET_NO to test UDP
* @param bnd_port port to bind to, 0 for connection reversal
* @param adv_port externally advertised port to use
* @param report function to call with the result of the test
- * @param report_cls closure for report
+ * @param report_cls closure for @a report
* @return handle to cancel NAT test
*/
struct GNUNET_NAT_Test *
GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
- int is_tcp, uint16_t bnd_port, uint16_t adv_port,
- GNUNET_NAT_TestCallback report, void *report_cls);
+ int is_tcp,
+ uint16_t bnd_port,
+ uint16_t adv_port,
+ GNUNET_NAT_TestCallback report,
+ void *report_cls);
/**
@@ -186,12 +193,13 @@
* @param cls closure
* @param addr the address, NULL on errors
*/
-typedef void (*GNUNET_NAT_IPCallback) (void *cls, const struct in_addr * addr);
+typedef void (*GNUNET_NAT_IPCallback) (void *cls,
+ const struct in_addr * addr);
/**
- * Opaque handle to cancel "GNUNET_NAT_mini_get_external_ipv4" operation.
+ * Opaque handle to cancel #GNUNET_NAT_mini_get_external_ipv4() operation.
*/
struct GNUNET_NAT_ExternalHandle;
@@ -201,12 +209,13 @@
*
* @param timeout when to fail
* @param cb function to call with result
- * @param cb_cls closure for 'cb'
- * @return handle for cancellation (can only be used until 'cb' is called),
NULL on error
+ * @param cb_cls closure for @a cb
+ * @return handle for cancellation (can only be used until @a cb is called),
NULL on error
*/
struct GNUNET_NAT_ExternalHandle *
GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout,
- GNUNET_NAT_IPCallback cb, void *cb_cls);
+ GNUNET_NAT_IPCallback cb,
+ void *cb_cls);
/**
@@ -227,19 +236,20 @@
/**
* Start mapping the given port using (mini)upnpc. This function
* should typically not be used directly (it is used within the
- * general-purpose 'GNUNET_NAT_register' code). However, it can be
+ * general-purpose #GNUNET_NAT_register() code). However, it can be
* used if specifically UPnP-based NAT traversal is to be used or
* tested.
*
* @param port port to map
- * @param is_tcp GNUNET_YES to map TCP, GNUNET_NO for UDP
+ * @param is_tcp #GNUNET_YES to map TCP, #GNUNET_NO for UDP
* @param ac function to call with mapping result
- * @param ac_cls closure for 'ac'
+ * @param ac_cls closure for @a ac
* @return NULL on error
*/
struct GNUNET_NAT_MiniHandle *
GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp,
- GNUNET_NAT_AddressCallback ac, void *ac_cls);
+ GNUNET_NAT_AddressCallback ac,
+ void *ac_cls);
/**
@@ -277,15 +287,15 @@
*
* @param cfg initial configuration
* @param cb function to call with autoconfiguration result
- * @param cb_cls closure for cb
+ * @param cb_cls closure for @a cb
* @return handle to cancel operation
*/
struct GNUNET_NAT_AutoHandle *
GNUNET_NAT_autoconfig_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
GNUNET_NAT_AutoResultCallback cb,
void *cb_cls);
-
+
/**
* Abort autoconfiguration.
*
Modified: gnunet/src/transport/plugin_transport_http_client.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_client.c 2013-12-13 19:40:36 UTC
(rev 31378)
+++ gnunet/src/transport/plugin_transport_http_client.c 2013-12-13 19:51:37 UTC
(rev 31379)
@@ -678,10 +678,9 @@
GNUNET_assert (plugin->cur_connections >= 2);
plugin->cur_connections -= 2;
GNUNET_STATISTICS_set (plugin->env->stats,
- HTTP_STAT_STR_CONNECTIONS,
- plugin->cur_connections,
- GNUNET_NO);
-
+ HTTP_STAT_STR_CONNECTIONS,
+ plugin->cur_connections,
+ GNUNET_NO);
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"Session %p: notifying transport about ending session\n",s);
@@ -921,7 +920,9 @@
s,
&atsi, 1);
- GNUNET_asprintf (&stat_txt, "# bytes received via %s_client",
plugin->protocol);
+ GNUNET_asprintf (&stat_txt,
+ "# bytes received via %s_client",
+ plugin->protocol);
GNUNET_STATISTICS_update (plugin->env->stats,
stat_txt, ntohs(message->size), GNUNET_NO);
GNUNET_free (stat_txt);
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2013-12-13 19:40:36 UTC (rev
31378)
+++ gnunet/src/transport/plugin_transport_udp.c 2013-12-13 19:51:37 UTC (rev
31379)
@@ -213,6 +213,9 @@
};
+/**
+ * Closure for #session_cmp_it().
+ */
struct SessionCompareContext
{
struct Session *res;
@@ -222,7 +225,7 @@
/**
- * Closure for 'process_inbound_tokenized_messages'
+ * Closure for #process_inbound_tokenized_messages().
*/
struct SourceInformation
{
@@ -236,6 +239,9 @@
*/
const void *arg;
+ /**
+ * Associated session.
+ */
struct Session *session;
/**
@@ -247,7 +253,7 @@
/**
- * Closure for 'find_receive_context'.
+ * Closure for #find_receive_context().
*/
struct FindReceiveContext
{
@@ -788,7 +794,7 @@
* @param numeric should (IP) addresses be displayed in numeric form?
* @param timeout after how long should we give up?
* @param asc function to call on each string
- * @param asc_cls closure for asc
+ * @param asc_cls closure for @a asc
*/
static void
udp_plugin_address_pretty_printer (void *cls, const char *type,
@@ -1036,11 +1042,11 @@
/**
* Check if the given port is plausible (must be either our listen
* port or our advertised port). If it is neither, we return
- * GNUNET_SYSERR.
+ * #GNUNET_SYSERR.
*
* @param plugin global variables
* @param in_port port number to check
- * @return GNUNET_OK if port is either open_port or adv_port
+ * @return #GNUNET_OK if port is either open_port or adv_port
*/
static int
check_port (struct Plugin *plugin, uint16_t in_port)
@@ -1062,13 +1068,15 @@
*
* @param cls closure, should be our handle to the Plugin
* @param addr pointer to the address
- * @param addrlen length of addr
- * @return GNUNET_OK if this is a plausible address for this peer
- * and transport, GNUNET_SYSERR if not
+ * @param addrlen length of @a addr
+ * @return #GNUNET_OK if this is a plausible address for this peer
+ * and transport, #GNUNET_SYSERR if not
*
*/
static int
-udp_plugin_check_address (void *cls, const void *addr, size_t addrlen)
+udp_plugin_check_address (void *cls,
+ const void *addr,
+ size_t addrlen)
{
struct Plugin *plugin = cls;
struct IPv4UdpAddress *v4;
@@ -1077,6 +1085,7 @@
if ((addrlen != sizeof (struct IPv4UdpAddress)) &&
(addrlen != sizeof (struct IPv6UdpAddress)))
{
+ GNUNET_break_op (0);
return GNUNET_SYSERR;
}
if (addrlen == sizeof (struct IPv4UdpAddress))
@@ -1488,7 +1497,6 @@
struct SessionCompareContext * cctx = cls;
const struct GNUNET_HELLO_Address *address = cctx->addr;
struct Session *s = value;
-
socklen_t s_addrlen = s->addrlen;
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1536,7 +1544,7 @@
*
* @param cls closure ('struct Plugin*')
* @param session the session
- * @return the network type in HBO or #GNUNET_SYSERR
+ * @return the network type
*/
static enum GNUNET_ATS_Network_Type
udp_get_network (void *cls,
@@ -1547,8 +1555,8 @@
/**
- * Creates a new outbound session the transport service will use to send data
to the
- * peer
+ * Creates a new outbound session the transport service will use to
+ * send data to the peer
*
* @param cls the plugin
* @param address the address
@@ -1963,8 +1971,9 @@
* to the service.
*
* @param cls the 'struct Plugin'
- * @param client the 'struct SourceInformation'
+ * @param client the `struct SourceInformation`
* @param hdr the actual message
+ * @return #GNUNET_OK (always)
*/
static int
process_inbound_tokenized_messages (void *cls, void *client,
@@ -2091,12 +2100,12 @@
/**
* Scan the heap for a receive context with the given address.
*
- * @param cls the 'struct FindReceiveContext'
+ * @param cls the `struct FindReceiveContext`
* @param node internal node of the heap
* @param element value stored at the node (a 'struct ReceiveContext')
* @param cost cost associated with the node
- * @return GNUNET_YES if we should continue to iterate,
- * GNUNET_NO if not.
+ * @return #GNUNET_YES if we should continue to iterate,
+ * #GNUNET_NO if not.
*/
static int
find_receive_context (void *cls, struct GNUNET_CONTAINER_HeapNode *node,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31379 - in gnunet/src: dv include transport,
gnunet <=