[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29466 - in gnunet/src: include mesh vpn
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29466 - in gnunet/src: include mesh vpn |
Date: |
Sun, 22 Sep 2013 16:26:50 +0200 |
Author: grothoff
Date: 2013-09-22 16:26:50 +0200 (Sun, 22 Sep 2013)
New Revision: 29466
Modified:
gnunet/src/include/gnunet_mesh_service.h
gnunet/src/include/gnunet_mesh_service_enc.h
gnunet/src/mesh/mesh_api_enc.c
gnunet/src/vpn/gnunet-service-vpn.c
Log:
-doxygen, following naming conventions
Modified: gnunet/src/include/gnunet_mesh_service.h
===================================================================
--- gnunet/src/include/gnunet_mesh_service.h 2013-09-21 22:34:00 UTC (rev
29465)
+++ gnunet/src/include/gnunet_mesh_service.h 2013-09-22 14:26:50 UTC (rev
29466)
@@ -190,7 +190,7 @@
* Can be NULL if no inbound tunnels are desired.
* See @c ports.
* @param cleaner Function called when a tunnel is destroyed by the remote
peer.
- * It is NOT called if GNUNET_MESH_tunnel_destroy is called on
+ * It is NOT called if #GNUNET_MESH_tunnel_destroy is called on
* the tunnel.
* @param handlers Callbacks for messages we care about, NULL-terminated. Each
* one must call #GNUNET_MESH_receive_done on the tunnel to
@@ -270,7 +270,7 @@
/**
* Peer on the other side of the tunnel
*/
- struct GNUNET_PeerIdentity *peer;
+ const struct GNUNET_PeerIdentity *peer;
};
Modified: gnunet/src/include/gnunet_mesh_service_enc.h
===================================================================
--- gnunet/src/include/gnunet_mesh_service_enc.h 2013-09-21 22:34:00 UTC
(rev 29465)
+++ gnunet/src/include/gnunet_mesh_service_enc.h 2013-09-22 14:26:50 UTC
(rev 29466)
@@ -92,17 +92,16 @@
* Functions with this signature are called whenever a message is
* received.
*
- * Each time the function must call GNUNET_MESH_receive_done on the channel
+ * Each time the function must call #GNUNET_MESH_receive_done on the channel
* in order to receive the next message. This doesn't need to be immediate:
* can be delayed if some processing is done on the message.
*
- * @param cls Closure (set from GNUNET_MESH_connect).
+ * @param cls Closure (set from #GNUNET_MESH_connect).
* @param channel Connection to the other end.
* @param channel_ctx Place to store local state associated with the channel.
* @param message The actual message.
- *
- * @return GNUNET_OK to keep the channel open,
- * GNUNET_SYSERR to close it (signal serious error).
+ * @return #GNUNET_OK to keep the channel open,
+ * #GNUNET_SYSERR to close it (signal serious error).
*/
typedef int (*GNUNET_MESH_MessageCallback) (void *cls,
struct GNUNET_MESH_Channel
*channel,
@@ -139,7 +138,7 @@
* Method called whenever another peer has added us to a channel
* the other peer initiated.
* Only called (once) upon reception of data with a message type which was
- * subscribed to in GNUNET_MESH_connect. A call to GNUNET_MESH_channel_destroy
+ * subscribed to in #GNUNET_MESH_connect. A call to
#GNUNET_MESH_channel_destroy
* causes te channel to be ignored and no further notifications are sent about
* the same channel.
*
@@ -164,9 +163,9 @@
* Function called whenever a channel is destroyed. Should clean up
* any associated state.
*
- * It must NOT call GNUNET_MESH_channel_destroy on the channel.
+ * It must NOT call #GNUNET_MESH_channel_destroy on the channel.
*
- * @param cls closure (set from GNUNET_MESH_connect)
+ * @param cls closure (set from #GNUNET_MESH_connect)
* @param channel connection to the other end (henceforth invalid)
* @param channel_ctx place where local state associated
* with the channel is stored
@@ -185,16 +184,16 @@
* handlers in the handlers array).
* @param new_channel Function called when an *incoming* channel is created.
* Can be NULL if no inbound channels are desired.
- * See @c ports.
+ * See @a ports.
* @param cleaner Function called when a channel is destroyed by the remote
peer.
- * It is NOT called if GNUNET_MESH_channel_destroy is called on
+ * It is NOT called if #GNUNET_MESH_channel_destroy is called on
* the channel.
* @param handlers Callbacks for messages we care about, NULL-terminated. Each
- * one must call GNUNET_MESH_receive_done on the channel to
+ * one must call #GNUNET_MESH_receive_done on the channel to
* receive the next message. Messages of a type that is not
* in the handlers array are ignored if received.
* @param ports NULL or 0-terminated array of port numbers for incoming
channels.
- * See @c new_channel.
+ * See @a new_channel.
*
* @return handle to the mesh service NULL on error
* (in this case, init is never called)
@@ -229,7 +228,6 @@
* @param port Port number.
* @param nobuffer Flag for disabling buffering on relay nodes.
* @param reliable Flag for end-to-end reliability.
- *
* @return handle to the channel
*/
struct GNUNET_MESH_Channel *
@@ -257,17 +255,18 @@
/**
* Struct to retrieve info about a channel.
*/
-union MeshChannelInfo {
+union GNUNET_MESH_ChannelInfo
+{
/**
- * GNUNET_YES / GNUNET_NO, for binary flags.
+ * #GNUNET_YES / #GNUNET_NO, for binary flags.
*/
int yes_no;
/**
* Peer on the other side of the channel
*/
- struct GNUNET_PeerIdentity *peer;
+ const struct GNUNET_PeerIdentity *peer;
};
@@ -277,10 +276,9 @@
* @param channel Channel handle.
* @param option Query type GNUNET_MESH_OPTION_*
* @param ... dependant on option, currently not used
- *
* @return Union with an answer to the query.
*/
-const union MeshChannelInfo *
+const union GNUNET_MESH_ChannelInfo *
GNUNET_MESH_channel_get_info (struct GNUNET_MESH_Channel *channel,
enum MeshOption option, ...);
@@ -292,7 +290,7 @@
/**
- * Ask the mesh to call "notify" once it is ready to transmit the
+ * Ask the mesh to call @a notify once it is ready to transmit the
* given number of bytes to the specified channel.
* Only one call can be active at any time, to issue another request,
* wait for the callback or cancel the current request.
@@ -305,10 +303,10 @@
* will be called with NULL on timeout or if the overall queue
* for this peer is larger than queue_size and this is currently
* the message with the lowest priority
- * @param notify_cls closure for notify
+ * @param notify_cls closure for @a notify
* @return non-NULL if the notify callback was queued,
* NULL if we can not even queue the request (insufficient
- * memory); if NULL is returned, "notify" will NOT be called.
+ * memory); if NULL is returned, @a notify will NOT be called.
*/
struct GNUNET_MESH_TransmitHandle *
GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Channel *channel,
Modified: gnunet/src/mesh/mesh_api_enc.c
===================================================================
--- gnunet/src/mesh/mesh_api_enc.c 2013-09-21 22:34:00 UTC (rev 29465)
+++ gnunet/src/mesh/mesh_api_enc.c 2013-09-22 14:26:50 UTC (rev 29466)
@@ -1499,25 +1499,25 @@
*
* @return Union with an answer to the query.
*/
-const union MeshChannelInfo *
+const union GNUNET_MESH_ChannelInfo *
GNUNET_MESH_channel_get_info (struct GNUNET_MESH_Channel *channel,
enum MeshOption option, ...)
{
- const union MeshChannelInfo *ret;
+ const union GNUNET_MESH_ChannelInfo *ret;
switch (option)
{
case GNUNET_MESH_OPTION_NOBUFFER:
- ret = (const union MeshChannelInfo *) &channel->nobuffer;
+ ret = (const union GNUNET_MESH_ChannelInfo *) &channel->nobuffer;
break;
case GNUNET_MESH_OPTION_RELIABLE:
- ret = (const union MeshChannelInfo *) &channel->reliable;
+ ret = (const union GNUNET_MESH_ChannelInfo *) &channel->reliable;
break;
case GNUNET_MESH_OPTION_OOORDER:
- ret = (const union MeshChannelInfo *) &channel->ooorder;
+ ret = (const union GNUNET_MESH_ChannelInfo *) &channel->ooorder;
break;
case GNUNET_MESH_OPTION_PEER:
- ret = (const union MeshChannelInfo *) &channel->peer;
+ ret = (const union GNUNET_MESH_ChannelInfo *) &channel->peer;
break;
default:
GNUNET_break (0);
Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2013-09-21 22:34:00 UTC (rev 29465)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2013-09-22 14:26:50 UTC (rev 29466)
@@ -828,10 +828,10 @@
{
ts->tunnel = GNUNET_MESH_tunnel_create (mesh_handle,
ts,
- &de->details.service_destination.target,
+
&de->details.service_destination.target,
PORT_VPN,
- GNUNET_YES,
- GNUNET_NO);
+ GNUNET_YES,
+ GNUNET_NO);
if (NULL == ts->tunnel)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -2822,11 +2822,9 @@
/**
- * Function called whenever an inbound tunnel is destroyed. Should clean up
+ * Function called whenever a tunnel is destroyed. Should clean up
* any associated state.
*
- * FIXME now its also user for disconnections
- *
* @param cls closure (set from #GNUNET_MESH_connect)
* @param tunnel connection to the other end (henceforth invalid)
* @param tunnel_ctx place where local state associated
@@ -2837,8 +2835,10 @@
const struct GNUNET_MESH_Tunnel *tunnel,
void *tunnel_ctx)
{
- /* we don't have inbound tunnels, so this function should never be called */
- GNUNET_break (0);
+ struct TunnelState *ts = tunnel_ctx;
+
+ ts->tunnel = NULL; /* we must not call GNUNET_MESH_tunnel_destroy() anymore
*/
+ free_tunnel_state (ts);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29466 - in gnunet/src: include mesh vpn,
gnunet <=