[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r28297 - gnunet/src/mesh
From: |
gnunet |
Subject: |
[GNUnet-SVN] r28297 - gnunet/src/mesh |
Date: |
Wed, 24 Jul 2013 14:12:51 +0200 |
Author: bartpolot
Date: 2013-07-24 14:12:51 +0200 (Wed, 24 Jul 2013)
New Revision: 28297
Modified:
gnunet/src/mesh/gnunet-service-mesh-enc.c
Log:
- new data structures
Modified: gnunet/src/mesh/gnunet-service-mesh-enc.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-07-24 11:39:30 UTC (rev
28296)
+++ gnunet/src/mesh/gnunet-service-mesh-enc.c 2013-07-24 12:12:51 UTC (rev
28297)
@@ -127,8 +127,11 @@
/******************************************************************************/
/** FWD declaration */
+struct MeshClient;
struct MeshPeer;
-struct MeshClient;
+struct MeshTunnel2;
+struct MeshChannel;
+struct MeshChannelReliability;
/**
@@ -154,7 +157,7 @@
/**
* Tunnel this message belongs to.
*/
- struct MeshTunnel *tunnel;
+ struct MeshTunnel2 *tunnel;
/**
* Pointer to info stucture used as cls.
@@ -173,56 +176,13 @@
};
-
/**
- * Struct containing all information regarding a given peer
+ * Struct to encapsulate all the Flow Control information to a peer to which
+ * we are directly connected (on a core level).
*/
-struct MeshPeer
+struct MeshFlowControl
{
/**
- * ID of the peer
- */
- GNUNET_PEER_Id id;
-
- /**
- * Last time we heard from this peer
- */
- struct GNUNET_TIME_Absolute last_contact;
-
- /**
- * Number of attempts to reconnect so far
- */
- int n_reconnect_attempts;
-
- /**
- * Paths to reach the peer, ordered by ascending hop count
- */
- struct MeshPeerPath *path_head;
-
- /**
- * Paths to reach the peer, ordered by ascending hop count
- */
- struct MeshPeerPath *path_tail;
-
- /**
- * Handle to stop the DHT search for a path to this peer
- */
- struct GNUNET_DHT_GetHandle *dhtget;
-
- /**
- * Array of tunnels this peer is the target of.
- * Most probably a small amount, therefore not a hashmap.
- * When the path to the peer changes, notify these tunnels to let them
- * re-adjust their path trees.
- */
- struct MeshTunnel **tunnels;
-
- /**
- * Number of tunnels this peers participates in
- */
- unsigned int ntunnels;
-
- /**
* Transmission queue to core DLL head
*/
struct MeshPeerQueue *queue_head;
@@ -241,17 +201,7 @@
* Handle for queued transmissions
*/
struct GNUNET_CORE_TransmitHandle *core_transmit;
-};
-
-/**
- * Struct to encapsulate all the Flow Control information to a peer in the
- * context of a tunnel: Same peer in different tunnels will have independent
- * flow control structures, allowing to choke/free tunnels according to its
- * own criteria.
- */
-struct MeshFlowControl
-{
/**
* ID of the last packet sent towards the peer.
*/
@@ -273,11 +223,6 @@
uint32_t last_ack_recv;
/**
- * How many payload messages are in the queue towards this peer.
- */
- uint32_t queue_n;
-
- /**
* Task to poll the peer in case of a lost ACK causes stall.
*/
GNUNET_SCHEDULER_TaskIdentifier poll_task;
@@ -286,41 +231,57 @@
* How frequently to poll for ACKs.
*/
struct GNUNET_TIME_Relative poll_time;
-
- /**
- * On which tunnel to poll.
- * Using an explicit poll_ctx would not help memory wise,
- * since the allocated context would have to be stored in the
- * fc struct in order to free it upon cancelling poll_task.
- */
- struct MeshTunnel *t;
};
/**
- * Globally unique tunnel identification (owner + number)
- * DO NOT USE OVER THE NETWORK
+ * Struct containing all information regarding a given peer
*/
-struct MESH_TunnelID
+struct MeshPeer
{
/**
- * Tunnel Owner.
+ * ID of the peer
*/
- GNUNET_PEER_Id oid;
+ GNUNET_PEER_Id id;
/**
- * Tunnel Destination.
+ * Last time we heard from this peer
*/
- GNUNET_PEER_Id did;
-};
+ struct GNUNET_TIME_Absolute last_contact;
+ /**
+ * Number of attempts to reconnect so far
+ */
+ int n_reconnect_attempts;
-/**
- * Data needed for reliable tunnel endpoint retransmission management.
- */
-struct MeshChannelReliability;
+ /**
+ * Paths to reach the peer, ordered by ascending hop count
+ */
+ struct MeshPeerPath *path_head;
+ /**
+ * Paths to reach the peer, ordered by ascending hop count
+ */
+ struct MeshPeerPath *path_tail;
+ /**
+ * Handle to stop the DHT search for a path to this peer
+ */
+ struct GNUNET_DHT_GetHandle *dhtget;
+
+ /**
+ * Tunnel to this peer, if any.
+ */
+ struct MeshTunnel2 *tunnel;
+
+ /**
+ * Flow control information for direct traffic.
+ */
+ struct MeshFlowControl *fc;
+
+};
+
+
/**
* Info needed to retry a message in case it gets lost.
*/
@@ -354,9 +315,9 @@
struct MeshChannelReliability
{
/**
- * Tunnel this is about.
+ * Channel this is about.
*/
- struct MeshTunnel *t;
+ struct MeshChannel *t;
/**
* DLL of messages sent and not yet ACK'd.
@@ -408,6 +369,11 @@
struct MeshChannel
{
/**
+ * Tunnel this channel is in.
+ */
+ struct MeshTunnel2 *t;
+
+ /**
* Port of the channel.
*/
uint32_t port;
@@ -465,16 +431,6 @@
GNUNET_PEER_Id prev_hop;
/**
- * Flow control information about @c next_hop or @c client.
- */
- struct MeshFlowControl next_fc;
-
- /**
- * Flow control information about @c prev_hop or @c owner.
- */
- struct MeshFlowControl prev_fc;
-
- /**
* Client owner of the tunnel, if any
*/
struct MeshClient *owner;
@@ -513,6 +469,12 @@
struct MeshPath
{
/**
+ * DLL
+ */
+ struct MeshPath next;
+ struct MeshPath prev;
+
+ /**
* Path being used for the tunnel.
*/
struct MeshPeerPath *path;
@@ -532,9 +494,27 @@
/**
+ * Globally unique tunnel identification (owner + number)
+ * DO NOT USE OVER THE NETWORK
+ */
+struct MESH_TunnelID
+{
+ /**
+ * Tunnel Owner.
+ */
+ GNUNET_PEER_Id oid;
+
+ /**
+ * Tunnel Destination.
+ */
+ GNUNET_PEER_Id did;
+};
+
+
+/**
* Struct containing all information regarding a tunnel to a peer.
*/
-struct MeshTunnel
+struct MeshTunnel2
{
/**
* Tunnel ID (owner, destination)
@@ -549,17 +529,17 @@
/**
* Local peer ephemeral private key
*/
- struct GNUNET_CRYPTO_EccPrivateKey* my_eph_key;
+ struct GNUNET_CRYPTO_EccPrivateKey *my_eph_key;
/**
* Local peer ephemeral public key
*/
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded* my_eph;
+ struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *my_eph;
/**
* Remote peer's public key.
*/
- struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded* peers_eph;
+ struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *peers_eph;
/**
* Encryption ("our") key.
@@ -571,10 +551,21 @@
*/
struct GNUNET_CRYPTO_AesSessionKey d_key;
-}
+ /**
+ * Paths that are actively used to reach the destination peer.
+ */
+ struct MeshPath *connection_head;
+ struct MeshPath *connection_tail;
+ /**
+ * Channels inside this tunnel.
+ */
+ struct MeshChannel *channel_head;
+ struct MeshChannel *channel_tail;
+};
+
/**
* Struct containing information about a client of the service
*
@@ -595,12 +586,12 @@
/**
* Tunnels that belong to this client, indexed by local id
*/
- struct GNUNET_CONTAINER_MultiHashMap32 *own_tunnels;
+ struct GNUNET_CONTAINER_MultiHashMap32 *own_channels;
/**
* Tunnels this client has accepted, indexed by incoming local id
*/
- struct GNUNET_CONTAINER_MultiHashMap32 *incoming_tunnels;
+ struct GNUNET_CONTAINER_MultiHashMap32 *incoming_channels;
/**
* Handle to communicate with the client
@@ -623,7 +614,6 @@
* ID of the client, mainly for debug messages
*/
unsigned int id;
-
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r28297 - gnunet/src/mesh,
gnunet <=