/**
* @file mesh/test_mesh_local.c
- * @brief test mesh local: test of mesh tunnels with just one peer
+ * @brief test mesh local: test of mesh channels with just one peer
* @author Bartlomiej Polot
*/
* @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 connection open,
* GNUNET_SYSERR to close it (signal serious error)
*/
* (can be NULL -- that's not an error)
*/
static void *
-inbound_tunnel (void *cls, struct GNUNET_MESH_Channel *channel,
+inbound_channel (void *cls, struct GNUNET_MESH_Channel *channel,
const struct GNUNET_PeerIdentity *initiator,
uint32_t port)
{
long id = (long) cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "received incoming tunnel on peer %d, port %u\n",
+ "received incoming channel on peer %d, port %u\n",
id, port);
if (id != 2L)
{
/**
* Data send callback: fillbuffer with test packet.
- *
+ *
* @param cls Closure (unused).
* @param size Buffer size.
* @param buf Buffer to fill.
- *
+ *
* @return size of test packet.
*/
static size_t
/**
* Connect to other client and send data
- *
+ *
* @param cls Closue (unused).
* @param tc TaskContext.
*/
/**
* Initialize framework and start test
- *
+ *
* @param cls Closure (unused).
* @param cfg Configuration handle.
* @param peer Testing peer handle.
*/
static void
-run (void *cls,
+run (void *cls,
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Peer *peer)
{
NULL);
mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */
(void *) 1L, /* cls */
- &inbound_tunnel, /* inbound new hndlr */
+ &inbound_channel, /* inbound new hndlr */
&inbound_end, /* inbound end hndlr */
handlers1, /* traffic handlers */
NULL); /* ports offered */
mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */
(void *) 2L, /* cls */
- &inbound_tunnel, /* inbound new hndlr */
+ &inbound_channel, /* inbound new hndlr */
&inbound_end, /* inbound end hndlr */
handlers2, /* traffic handlers */
ports); /* ports offered */
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "YAY! CONNECTED TO MESH :D\n");
}
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_connect, NULL);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (
+ GNUNET_TIME_UNIT_SECONDS,
+ 2),
+ &do_connect, NULL);
}