#define MESH_DEBUG GNUNET_YES
-#define INITIAL_WINDOW_SIZE 8
-#define ACK_THRESHOLD INITIAL_WINDOW_SIZE / 2
-
#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_util_lib.h"
* sizeof(uint16_t) * types
*/
struct GNUNET_MessageHeader header;
- uint16_t types GNUNET_PACKED;
- /* uint16_t list_types[types] */
+ /* uint32_t list_ports[] */
};
*/
typedef uint32_t MESH_TunnelNumber;
+
/**
* Message for a client to create and destroy tunnels.
*/
{
/**
* Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_[CREATE|DESTROY]
- * GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_[MAX|MIN]
*
* Size: sizeof(struct GNUNET_MESH_TunnelMessage)
*/
* Tunnel's peer
*/
struct GNUNET_PeerIdentity peer;
+
+ /**
+ * Port of the tunnel.
+ */
+ uint32_t port GNUNET_PACKED;
};
*/
struct GNUNET_PeerIdentity peer;
+ /**
+ * Port for this tunnel
+ */
+ uint32_t port GNUNET_PACKED;
+
/**
* Tunnel options (speed, buffering)
*/
- uint32_t opt;
+ uint32_t opt GNUNET_PACKED;
};
/**
* ID of the last packet allowed.
*/
- uint32_t max_pid GNUNET_PACKED;
+ uint32_t ack GNUNET_PACKED;
};
*/
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
- /**
- * Number of peers in the tunnel.
- */
- uint32_t npeers GNUNET_PACKED;
-
/**
* Alignment.
*/
*/
struct GNUNET_PeerIdentity owner;
- /* struct GNUNET_PeerIdentity peers[npeers] */
+ /**
+ * ID of the destination of the tunnel (can be local peer).
+ */
+ struct GNUNET_PeerIdentity destination;
};
/******************************************************************************/
/**
- * All the states a peer participating in a tunnel can be in.
+ * All the states a tunnel can be in.
*/
-enum MeshPeerState
+enum MeshTunnelState
{
/**
* Uninitialized status, should never appear in operation.
*/
- MESH_PEER_INVALID,
-
- /**
- * Peer is the root and owner of the tree
- */
- MESH_PEER_ROOT,
-
- /**
- * Peer only retransmits traffic, is not a final destination
- */
- MESH_PEER_RELAY,
+ MESH_TUNNEL_NEW,
/**
* Path to the peer not known yet
*/
- MESH_PEER_SEARCHING,
+ MESH_TUNNEL_SEARCHING,
/**
* Request sent, not yet answered.
*/
- MESH_PEER_WAITING,
+ MESH_TUNNEL_WAITING,
/**
* Peer connected and ready to accept data
*/
- MESH_PEER_READY,
+ MESH_TUNNEL_READY,
/**
* Peer connected previosly but not responding
*/
- MESH_PEER_RECONNECTING
+ MESH_TUNNEL_RECONNECTING
};
GMC_min_pid (uint32_t a, uint32_t b);
+/**
+ * Expand a 32 bit value (message type) into a hash for a MultiHashMap (fast).
+ * WARNING: do not use for anything other than MultiHashMap!
+ * does not alter anything other than bits used by idx_of !
+ *
+ * @param i 32 bit integer value.
+ * @param h Hash code to fill.
+ */
+void
+GMC_hash32 (uint32_t i, struct GNUNET_HashCode *h);
+
+
/**
* Convert a message type into a string to help debug
* Generated with: