[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29971 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29971 - gnunet/src/mesh |
Date: |
Tue, 8 Oct 2013 11:44:40 +0200 |
Author: bartpolot
Date: 2013-10-08 11:44:40 +0200 (Tue, 08 Oct 2013)
New Revision: 29971
Modified:
gnunet/src/mesh/gnunet-service-mesh-enc.c
gnunet/src/mesh/gnunet-service-mesh_connection.c
gnunet/src/mesh/gnunet-service-mesh_dht.c
gnunet/src/mesh/gnunet-service-mesh_dht.h
gnunet/src/mesh/gnunet-service-mesh_tunnel.h
Log:
- fix main mesh file
Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-10-08 09:44:09 UTC (rev
29970)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-10-08 09:44:40 UTC (rev
29971)
@@ -110,83 +110,17 @@
-/**
- * Send an ACK on the appropriate connection/channel, depending on
- * the direction and the position of the peer.
- *
- * @param c Which connection to send the hop-by-hop ACK.
- * @param ch Channel, if any.
- * @param fwd Is this a fwd ACK? (will go dest->root)
- */
-static void
-send_ack (struct MeshConnection *c, struct MeshChannel *ch, int fwd)
-{
- unsigned int buffer;
-
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "send ack %s on %p %p\n",
- fwd ? "FWD" : "BCK", c, ch);
- if (NULL == c || GMC_is_terminal (c, fwd))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " getting from all connections\n");
- buffer = tunnel_get_buffer (NULL == c ? ch->t : c->t, fwd);
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " getting from one connection\n");
- buffer = connection_get_buffer (c, fwd);
- }
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " buffer available: %u\n", buffer);
-
- if ( (NULL != ch && channel_is_origin (ch, fwd)) ||
- (NULL != c && connection_is_origin (c, fwd)) )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
- if (0 < buffer)
- {
- GNUNET_assert (NULL != ch);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " really sending!\n");
- send_local_ack (ch, fwd);
- }
- }
- else if (NULL == c)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on all connections\n");
- GNUNET_assert (NULL != ch);
- channel_send_connections_ack (ch, buffer, fwd);
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on connection\n");
- connection_send_ack (c, buffer, fwd);
- }
-}
-
-
-
-
-
-
-
-
-
-
/******************************************************************************/
/**************** MESH NETWORK HANDLER HELPERS
***********************/
/******************************************************************************/
-
-
-
/******************************************************************************/
/******************** MESH NETWORK HANDLERS
**************************/
/******************************************************************************/
-
-
/******************************************************************************/
/************************ MAIN FUNCTIONS
****************************/
/******************************************************************************/
@@ -248,7 +182,7 @@
GMC_init (c); /* Connections */
GMP_init (c); /* Peers */
GMD_init (c, &my_full_id); /* DHT */
- GMT_init (c, &my_full_id, &my_private_key);
+ GMT_init (c, &my_full_id, my_private_key);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Mesh service running\n");
}
Modified: gnunet/src/mesh/gnunet-service-mesh_connection.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-10-08 09:44:09 UTC
(rev 29970)
+++ gnunet/src/mesh/gnunet-service-mesh_connection.c 2013-10-08 09:44:40 UTC
(rev 29971)
@@ -1945,6 +1945,59 @@
+/**
+ * Send an ACK on the appropriate connection/channel, depending on
+ * the direction and the position of the peer.
+ *
+ * @param c Which connection to send the hop-by-hop ACK.
+ * @param ch Channel, if any.
+ * @param fwd Is this a fwd ACK? (will go dest->root)
+ */
+static void
+send_ack (struct MeshConnection *c, struct MeshChannel *ch, int fwd)
+{
+ unsigned int buffer;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "send ack %s on %p %p\n",
+ fwd ? "FWD" : "BCK", c, ch);
+ if (NULL == c || GMC_is_terminal (c, fwd))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " getting from all connections\n");
+ buffer = tunnel_get_buffer (NULL == c ? ch->t : c->t, fwd);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " getting from one connection\n");
+ buffer = connection_get_buffer (c, fwd);
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " buffer available: %u\n", buffer);
+
+ if ( (NULL != ch && channel_is_origin (ch, fwd)) ||
+ (NULL != c && connection_is_origin (c, fwd)) )
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on channel...\n");
+ if (0 < buffer)
+ {
+ GNUNET_assert (NULL != ch);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " really sending!\n");
+ send_local_ack (ch, fwd);
+ }
+ }
+ else if (NULL == c)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on all connections\n");
+ GNUNET_assert (NULL != ch);
+ channel_send_connections_ack (ch, buffer, fwd);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " sending on connection\n");
+ connection_send_ack (c, buffer, fwd);
+ }
+}
+
+
struct MeshConnection *
GMC_new (const struct GNUNET_HashCode *cid)
{
Modified: gnunet/src/mesh/gnunet-service-mesh_dht.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_dht.c 2013-10-08 09:44:09 UTC (rev
29970)
+++ gnunet/src/mesh/gnunet-service-mesh_dht.c 2013-10-08 09:44:40 UTC (rev
29971)
@@ -39,17 +39,6 @@
#define LOG (level, ...) GNUNET_log_from ("mesh-dht", level, __VA_ARGS__)
-
-/**
- * Callback called on each path found over the DHT.
- *
- * @param cls Closure.
- * @param path An unchecked, unoptimized path to the target node.
- * After callback will no longer be valid!
- */
-typedef void (*GMD_search_callback) (void *cls,
- const struct MeshPeerPath *path);
-
/******************************************************************************/
/******************************** STRUCTS
**********************************/
/******************************************************************************/
Modified: gnunet/src/mesh/gnunet-service-mesh_dht.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_dht.h 2013-10-08 09:44:09 UTC (rev
29970)
+++ gnunet/src/mesh/gnunet-service-mesh_dht.h 2013-10-08 09:44:40 UTC (rev
29971)
@@ -42,6 +42,17 @@
struct GMD_search_handle;
+
+/**
+ * Callback called on each path found over the DHT.
+ *
+ * @param cls Closure.
+ * @param path An unchecked, unoptimized path to the target node.
+ * After callback will no longer be valid!
+ */
+typedef void (*GMD_search_callback) (void *cls,
+ const struct MeshPeerPath *path);
+
/******************************************************************************/
/******************************** API
***********************************/
/******************************************************************************/
@@ -62,10 +73,12 @@
void
GMD_shutdown (void);
+
struct GMD_search_handle *
GMD_search (const struct GNUNET_PeerIdentity *peer_id,
GMD_search_callback callback, void *cls);
+
void
GMD_search_stop (struct GMD_search_handle *h);
Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.h
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-10-08 09:44:09 UTC
(rev 29970)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.h 2013-10-08 09:44:40 UTC
(rev 29971)
@@ -60,7 +60,7 @@
void
GMT_init (const struct GNUNET_CONFIGURATION_Handle *c,
const struct GNUNET_PeerIdentity *id,
- const GNUNET_CRYPTO_EccPrivateKey *key);
+ const struct GNUNET_CRYPTO_EccPrivateKey *key);
/**
* Shut down the tunnel subsystem.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29971 - gnunet/src/mesh,
gnunet <=