#define MESH_DEBUG GNUNET_YES
#include "platform.h"
-#include "gnunet_common.h"
#include "gnunet_util_lib.h"
-#include "gnunet_peer_lib.h"
#include "gnunet_core_service.h"
#include "gnunet_protocols.h"
#include <gnunet_mesh_service.h>
* notify_transmit_ready None (queue / GNUNET_CLIENT_ntf_tmt_rdy)
* notify_transmit_ready_cancel None (clear of internal data structures)
*
- *
+ *
* EVENT MESSAGE USED
* ----- ------------
* data GNUNET_MESH_Unicast OR
* GNUNET_MESH_Multicast OR
* GNUNET_MESH_ToOrigin
* data ack GNUNET_MESH_LocalAck
- *
+ *
* new incoming tunnel GNUNET_MESH_PeerControl
* peer connects to a tunnel FIXME
* peer disconnects from a tunnel FIXME
#define HIGH_PID 0xFFFF0000
#define LOW_PID 0x0000FFFF
-/**
- * Value in tunnel info: *int (GNUNET_YES/GNUNET_NO)
- */
-#define GNUNET_MESH_OPTION_NOBUFFER 0x1
-#define GNUNET_MESH_OPTION_RELIABLE 0x2
-
#define PID_OVERFLOW(pid, max) (pid > HIGH_PID && max < LOW_PID)
/******************************************************************************/
/**
* Options.
*/
- int32_t options GNUNET_PACKED;
+ uint32_t opt GNUNET_PACKED;
};
/**
- * Message for the service to let a client know about created tunnels.
+ * Message for mesh data traffic.
*/
-struct GNUNET_MESH_TunnelNotification
+struct GNUNET_MESH_LocalData
{
/**
- * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_TUNNEL_CREATE
- *
- * Size: sizeof(struct GNUNET_MESH_TunnelMessage)
+ * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA
*/
struct GNUNET_MessageHeader header;
/**
- * ID of a tunnel controlled by this client.
- */
- MESH_TunnelNumber tunnel_id GNUNET_PACKED;
-
- /**
- * Peer at the other end.
- */
- struct GNUNET_PeerIdentity peer;
-
- /**
- * Port for this tunnel
+ * TID of the tunnel
*/
- uint32_t port GNUNET_PACKED;
+ uint32_t tid GNUNET_PACKED;
/**
- * Tunnel options (speed, buffering)
+ * Payload follows
*/
- uint32_t opt GNUNET_PACKED;
};
*/
MESH_TunnelNumber tunnel_id GNUNET_PACKED;
- /**
- * ID of the last packet allowed.
- */
- uint32_t ack GNUNET_PACKED;
};
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:
* FIND: "#define ([^ ]+)[ ]*([0-9]+)"
* REPLACE: " case \2: return "\1"; break;"
- *
+ *
* @param m Message type.
- *
+ *
* @return Human readable string description.
*/
const char *