*/
struct GNUNET_TRANSPORT_WLAN_MacAddress addr;
+ /**
+ * Message delay for fragmentation context
+ */
+ struct GNUNET_TIME_Relative msg_delay;
+
+ /**
+ * ACK delay for fragmentation context
+ */
+ struct GNUNET_TIME_Relative ack_delay;
+
/**
* Desired transmission power for this MAC
*/
GNUNET_HELPER_send_cancel (fm->sh);
fm->sh = NULL;
}
- GNUNET_FRAGMENT_context_destroy (fm->fragcontext);
+ GNUNET_FRAGMENT_context_destroy (fm->fragcontext,
+ &endpoint->msg_delay,
+ &endpoint->ack_delay);
if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (fm->timeout_task);
* @param timeout how long can the message wait?
* @param target peer that should receive the message
* @param msg message to transmit
- * @param bytes of payload
+ * @param payload_size bytes of payload
* @param cont continuation to call once the message has
* been transmitted (or if the transport is ready
* for the next transmission call; or if the
fm->timeout = GNUNET_TIME_relative_to_absolute (timeout);
fm->cont = cont;
fm->cont_cls = cont_cls;
+ /* 1 MBit/s typical data rate, 1430 byte fragments => ~100 ms per message */
fm->fragcontext =
GNUNET_FRAGMENT_context_create (plugin->env->stats, WLAN_MTU,
&plugin->tracker,
- GNUNET_TIME_UNIT_SECONDS,
+ endpoint->msg_delay,
+ endpoint->ack_delay,
msg,
&transmit_fragment, fm);
fm->timeout_task =
pos,
&wlan_data_message_handler,
&send_ack);
+
+ pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS;
+ pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+ 100);
pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT);
pos->timeout_task =
GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout,
struct Plugin *plugin;
char *interface;
unsigned long long testmode;
+ char *binary;
/* check for 'special' mode */
if (NULL == env->receive)
"transport-wlan", "TESTMODE");
return NULL;
}
+ binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-transport-wlan");
if ( (0 == testmode) &&
- (GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-transport-wlan")) )
+ (GNUNET_YES != GNUNET_OS_check_helper_binary (binary)) )
{
LOG (GNUNET_ERROR_TYPE_ERROR,
_("Helper binary `%s' not SUID, cannot run WLAN transport\n"),
"gnunet-helper-transport-wlan");
+ GNUNET_free (binary);
return NULL;
}
+ GNUNET_free (binary);
if (GNUNET_YES !=
GNUNET_CONFIGURATION_get_value_string
(env->cfg, "transport-wlan", "INTERFACE",
plugin->helper_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, plugin);
plugin->beacon_task = GNUNET_SCHEDULER_add_now (&send_hello_beacon,
plugin);
- switch (testmode)
+ /* some compilers do not like switch on 'long long'... */
+ switch ((unsigned int) testmode)
{
case 0: /* normal */
plugin->helper_argv[0] = (char *) "gnunet-helper-transport-wlan";