summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-transport-wlan-helper.c71
-rw-r--r--src/transport/plugin_transport_wlan.c346
-rwxr-xr-xsrc/transport/test_transport_api_wlan148
3 files changed, 426 insertions, 139 deletions
diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c
index 05fab4758..15fe21cfd 100644
--- a/src/transport/gnunet-transport-wlan-helper.c
+++ b/src/transport/gnunet-transport-wlan-helper.c
@@ -38,6 +38,7 @@
#include "plugin_transport_wlan.h"
#include "gnunet_common.h"
#include "gnunet-transport-wlan-helper.h"
+#include "gnunet_crypto_lib.h"
#include "ieee80211_radiotap.h"
#include <pcap.h>
#include <stdio.h>
@@ -395,7 +396,7 @@ int ieee80211_radiotap_iterator_next(
#define FIFO_FILE1 "/tmp/MYFIFOin"
#define FIFO_FILE2 "/tmp/MYFIFOout"
-#define MAXLINE 20
+#define MAXLINE 4096
static int first;
static int closeprog;
@@ -420,22 +421,36 @@ stdin_send (void *cls,
const struct GNUNET_MessageHeader *hdr)
{
struct sendbuf *write_pout = cls;
- int sendsize = ntohs(hdr->size) - sizeof(struct RadiotapHeader) ;
+ int sendsize;
struct GNUNET_MessageHeader newheader;
+ char * from;
+ char * to;
- GNUNET_assert(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA == ntohs(hdr->type));
- GNUNET_assert (sendsize + write_pout->size < MAXLINE *2);
+ sendsize = ntohs(hdr->size) - sizeof(struct RadiotapHeader) ;
+
+
+ if(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs(hdr->type)){
+ fprintf(stderr, "Function stdin_send: wrong packet type\n");
+ exit(1);
+ }
+ if((sendsize + write_pout->size) > MAXLINE * 2){
+ fprintf(stderr, "Function stdin_send: Packet too big for buffer\n");
+ exit(1);
+ }
newheader.size = htons(sendsize);
newheader.type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
- memcpy(write_pout->buf + write_pout->size, &newheader, sizeof(struct GNUNET_MessageHeader));
+ to = write_pout->buf + write_pout->size;
+ memcpy(to, &newheader, sizeof(struct GNUNET_MessageHeader));
write_pout->size += sizeof(struct GNUNET_MessageHeader);
- memcpy(write_pout->buf + write_pout->size, hdr + sizeof(struct RadiotapHeader) + sizeof(struct GNUNET_MessageHeader), sizeof(struct GNUNET_MessageHeader));
- write_pout->size += sendsize;
+ from = (char *) hdr + sizeof(struct RadiotapHeader) + sizeof(struct GNUNET_MessageHeader);
+ to = write_pout->buf + write_pout->size;
+ memcpy(to, from, sendsize - sizeof(struct GNUNET_MessageHeader));
+ write_pout->size += sendsize - sizeof(struct GNUNET_MessageHeader);
}
static void
@@ -444,10 +459,18 @@ file_in_send (void *cls,
const struct GNUNET_MessageHeader *hdr)
{
struct sendbuf * write_std = cls;
- int sendsize = ntohs(hdr->size);
+ int sendsize;
+
+ sendsize = ntohs(hdr->size);
- GNUNET_assert(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA == ntohs(hdr->type));
- GNUNET_assert (sendsize + write_std->size < MAXLINE *2);
+ if(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA != ntohs(hdr->type)){
+ fprintf(stderr, "Function file_in_send: wrong packet type\n");
+ exit(1);
+ }
+ if((sendsize + write_std->size) > MAXLINE * 2){
+ fprintf(stderr, "Function file_in_send: Packet too big for buffer\n");
+ exit(1);
+ }
memcpy(write_std->buf + write_std->size, hdr, sendsize);
write_std->size += sendsize;
@@ -470,7 +493,7 @@ testmode(int argc, char *argv[])
{
if (0 == stat(FIFO_FILE2, &st))
{
- fprintf(stderr, "FIFO_FILE2 exists, but FIFO_FILE1 not");
+ fprintf(stderr, "FIFO_FILE2 exists, but FIFO_FILE1 not\n");
exit(1);
}
@@ -484,7 +507,7 @@ testmode(int argc, char *argv[])
if (0 != stat(FIFO_FILE2, &st))
{
- fprintf(stderr, "FIFO_FILE1 exists, but FIFO_FILE2 not");
+ fprintf(stderr, "FIFO_FILE1 exists, but FIFO_FILE2 not\n");
exit(1);
}
@@ -497,12 +520,12 @@ testmode(int argc, char *argv[])
fpin = fopen(FIFO_FILE1, "r");
if (NULL == fpin)
{
- fprintf(stderr, "fopen of read FIFO_FILE1");
+ fprintf(stderr, "fopen of read FIFO_FILE1\n");
exit(1);
}
if (NULL == (fpout = fopen(FIFO_FILE2, "w")))
{
- fprintf(stderr, "fopen of write FIFO_FILE2");
+ fprintf(stderr, "fopen of write FIFO_FILE2\n");
exit(1);
}
@@ -513,12 +536,12 @@ testmode(int argc, char *argv[])
//fprintf(stderr, "Second\n");
if (NULL == (fpout = fopen(FIFO_FILE1, "w")))
{
- fprintf(stderr, "fopen of write FIFO_FILE1");
+ fprintf(stderr, "fopen of write FIFO_FILE1\n");
exit(1);
}
if (NULL == (fpin = fopen(FIFO_FILE2, "r")))
{
- fprintf(stderr, "fopen of read FIFO_FILE2");
+ fprintf(stderr, "fopen of read FIFO_FILE2\n");
exit(1);
}
@@ -581,8 +604,8 @@ testmode(int argc, char *argv[])
macmsg.mac.mac[1] = 0x22;
macmsg.mac.mac[2] = 0x33;
macmsg.mac.mac[3] = 0x44;
- macmsg.mac.mac[4] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 255);
- macmsg.mac.mac[5] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 255);
+ macmsg.mac.mac[4] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_STRONG, 256);
+ macmsg.mac.mac[5] = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_NONCE, 256);
macmsg.hdr.size = htons(sizeof(struct Wlan_Helper_Control_Message));
macmsg.hdr.type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL);
@@ -690,7 +713,7 @@ testmode(int argc, char *argv[])
if (0 > ret)
{
closeprog = 1;
- fprintf(stderr, "Write ERROR to STDOUT");
+ fprintf(stderr, "Write ERROR to STDOUT\n");
exit(1);
}
else
@@ -713,7 +736,7 @@ testmode(int argc, char *argv[])
if (0 > ret)
{
closeprog = 1;
- fprintf(stderr, "Write ERROR to fdpout");
+ fprintf(stderr, "Write ERROR to fdpout\n");
exit(1);
}
else
@@ -735,10 +758,10 @@ testmode(int argc, char *argv[])
if (0 > readsize)
{
closeprog = 1;
- fprintf(stderr, "Read ERROR to STDIN_FILENO");
+ fprintf(stderr, "Read ERROR to STDIN_FILENO\n");
exit(1);
}
- else
+ else if (0 < readsize)
{
GNUNET_SERVER_mst_receive(stdin_mst, NULL, readbuf, readsize,
GNUNET_NO, GNUNET_NO);
@@ -753,10 +776,10 @@ testmode(int argc, char *argv[])
if (0 > readsize)
{
closeprog = 1;
- fprintf(stderr, "Read ERROR to fdpin");
+ fprintf(stderr, "Read ERROR to fdpin: %s\n", strerror(errno));
exit(1);
}
- else
+ else if (0 < readsize)
{
GNUNET_SERVER_mst_receive(file_in_mst, NULL, readbuf, readsize,
GNUNET_NO, GNUNET_NO);
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 9f91cbfb6..e8d4d11c5 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -206,6 +206,14 @@ struct Plugin
};
+struct Finish_send
+{
+ struct Plugin * plugin;
+ char * msgheader;
+ struct GNUNET_MessageHeader * msgstart;
+ ssize_t size;
+};
+
/**
* Queue of sessions, for the general session queue and the pending session queue
*/
@@ -555,6 +563,9 @@ wlan_process_helper (void *cls,
void *client,
const struct GNUNET_MessageHeader *hdr);
+static void
+finish_sending(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+
/**
* get the next message number, at the moment just a random one
* @return returns the next valid message-number for sending packets
@@ -562,7 +573,7 @@ wlan_process_helper (void *cls,
uint32_t
get_next_message_id()
{
- return GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX);
+ return GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_NONCE, UINT32_MAX);
}
/**
@@ -1006,14 +1017,14 @@ check_finished_fragment(struct Plugin * plugin, struct FragmentMessage * fm){
}
/**
- * Function called to when wlan helper is ready to get some data
+ * Function called when wlan helper is ready to get some data
*
* @param cls closure
* @param tc GNUNET_SCHEDULER_TaskContext
*/
static void
-do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_transmit(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Plugin * plugin = cls;
@@ -1032,6 +1043,7 @@ do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_MessageHeader * msgheader2 = NULL;
struct FragmentationHeader fragheader;
struct FragmentationHeader * fragheaderptr = NULL;
+ struct Finish_send * finish = NULL;
uint16_t size = 0;
const char * copystart = NULL;
uint16_t copysize = 0;
@@ -1060,159 +1072,261 @@ do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
getWlanHeader(ieeewlanheader);
msgheader2 = (struct GNUNET_MessageHeader *) &ieeewlanheader[1];
- msgheader2->size = htons(GNUNET_HELLO_size(*(plugin->env->our_hello)) + sizeof(struct GNUNET_MessageHeader));
+ msgheader2->size = htons(GNUNET_HELLO_size(*(plugin->env->our_hello))
+ + sizeof(struct GNUNET_MessageHeader));
msgheader2->type = htons(GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT);
memcpy(&msgheader2[1], *plugin->env->our_hello, GNUNET_HELLO_size(
*(plugin->env->our_hello)));
-
bytes = GNUNET_DISK_file_write(plugin->server_stdin_handle, msgheader,
size);
+ if (bytes == GNUNET_SYSERR)
+ {
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+ _("Error writing to wlan healper. errno == %d, ERROR: %s\n"),
+ errno, strerror(errno));
+
+ }
+ GNUNET_assert(bytes != GNUNET_SYSERR);
GNUNET_assert(bytes == size);
+ GNUNET_free(msgheader);
+
set_next_beacon_time(plugin);
check_next_fragment_timeout(plugin);
+
return;
}
-
fm = plugin->pending_Fragment_Messages_head;
GNUNET_assert(fm != NULL);
session = fm->session;
GNUNET_assert(session != NULL);
// test if message timed out
- if (GNUNET_TIME_absolute_get_remaining(fm->timeout).rel_value == 0){
- free_acks(fm);
- GNUNET_assert(plugin->pending_fragment_messages > 0);
- plugin->pending_fragment_messages --;
- GNUNET_CONTAINER_DLL_remove(plugin->pending_Fragment_Messages_head,
- plugin->pending_Fragment_Messages_tail, fm);
+ if (GNUNET_TIME_absolute_get_remaining(fm->timeout).rel_value == 0)
+ {
+ free_acks(fm);
+ GNUNET_assert(plugin->pending_fragment_messages > 0);
+ plugin->pending_fragment_messages--;
+ GNUNET_CONTAINER_DLL_remove(plugin->pending_Fragment_Messages_head,
+ plugin->pending_Fragment_Messages_tail, fm);
- GNUNET_free(fm->msg);
+ GNUNET_free(fm->msg);
- GNUNET_free(fm);
- check_fragment_queue(plugin);
- } else {
+ GNUNET_free(fm);
+ check_fragment_queue(plugin);
+ }
+ else
+ {
- if (fm->message_size > WLAN_MTU) {
- size += sizeof(struct FragmentationHeader);
- // check/set for retransmission
- if (GNUNET_TIME_absolute_get_duration(fm->next_ack).rel_value == 0) {
+ if (fm->message_size > WLAN_MTU)
+ {
+ size += sizeof(struct FragmentationHeader);
+ // check/set for retransmission
+ if (GNUNET_TIME_absolute_get_duration(fm->next_ack).rel_value == 0)
+ {
- // be positive and try again later :-D
- fm->next_ack = GNUNET_TIME_relative_to_absolute(get_ack_timeout(fm));
- // find first missing fragment
- akt = fm->head;
- fm->message_pos = 0;
+ // be positive and try again later :-D
+ fm->next_ack = GNUNET_TIME_relative_to_absolute(get_ack_timeout(
+ fm));
+ // find first missing fragment
+ akt = fm->head;
+ fm->message_pos = 0;
- //test if ack 0 was already received
- while (akt != NULL){
- //if fragment is present, take next
- if (akt->fragment_num == fm->message_pos) {
- fm->message_pos ++;
- }
- //next ack is bigger then the fragment number
- //in case there is something like this: (acks) 1, 2, 5, 6, ...
- //and we send 3 again, the next number should be 4
- else if (akt->fragment_num > fm->message_pos) {
- break;
- }
-
- akt = akt->next;
+ //test if ack 0 was already received
+ while (akt != NULL)
+ {
+ //if fragment is present, take next
+ if (akt->fragment_num == fm->message_pos)
+ {
+ fm->message_pos++;
+ }
+ //next ack is bigger then the fragment number
+ //in case there is something like this: (acks) 1, 2, 5, 6, ...
+ //and we send 3 again, the next number should be 4
+ else if (akt->fragment_num > fm->message_pos)
+ {
+ break;
+ }
- }
+ akt = akt->next;
+ }
- }
+ }
- copyoffset = (WLAN_MTU - sizeof(struct FragmentationHeader)) * fm->message_pos;
- fragheader.fragment_off_or_num = htons(fm->message_pos);
- fragheader.message_id = htonl(session->message_id_out);
+ copyoffset = (WLAN_MTU - sizeof(struct FragmentationHeader))
+ * fm->message_pos;
+ fragheader.fragment_off_or_num = htons(fm->message_pos);
+ fragheader.message_id = htonl(session->message_id_out);
+
+ // start should be smaller then the packet size
+ GNUNET_assert(copyoffset < fm->message_size);
+ copystart = fm->msg + copyoffset;
+
+ //size of the fragment is either the MTU - overhead
+ //or the missing part of the message in case this is the last fragment
+ copysize = GNUNET_MIN(fm->message_size - copyoffset,
+ WLAN_MTU - sizeof(struct FragmentationHeader));
+ fragheader.header.size = htons(copysize
+ + sizeof(struct FragmentationHeader));
+ fragheader.header.type = htons(GNUNET_MESSAGE_TYPE_WLAN_FRAGMENT);
+
+ //get the next missing fragment
+ akt = fm->head;
+ fm->message_pos++;
+
+ //test if ack was already received
+ while (akt != NULL)
+ {
+ //if fragment is present, take next
+ if (akt->fragment_num == fm->message_pos)
+ {
+ fm->message_pos++;
+ }
+ //next ack is bigger then the fragment number
+ //in case there is something like this: (acks) 1, 2, 5, 6, ...
+ //and we send 3 again, the next number should be 4
+ else if (akt->fragment_num > fm->message_pos)
+ {
+ break;
+ }
- // start should be smaller then the packet size
- GNUNET_assert(copyoffset < fm->message_size);
- copystart = fm->msg + copyoffset;
+ akt = akt->next;
+ }
+ }
+ else
+ {
+ // there is no need to split
+ copystart = fm->msg;
+ copysize = fm->message_size;
+ }
- //size of the fragment is either the MTU - overhead
- //or the missing part of the message in case this is the last fragment
- copysize = GNUNET_MIN(fm->message_size - copyoffset,
- WLAN_MTU - sizeof(struct FragmentationHeader));
- fragheader.header.size = htons(copysize + sizeof(struct FragmentationHeader));
- fragheader.header.type = htons(GNUNET_MESSAGE_TYPE_WLAN_FRAGMENT);
+ size += copysize;
+ size += sizeof(struct RadiotapHeader) + sizeof(struct IeeeHeader)
+ + sizeof(struct GNUNET_MessageHeader);
+ msgheader = GNUNET_malloc(size);
+ msgheader->size = htons(size);
+ msgheader->type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
+ radioHeader = (struct RadiotapHeader*) &msgheader[1];
+ getRadiotapHeader(radioHeader);
- //get the next missing fragment
- akt = fm->head;
- fm->message_pos ++;
+ ieeewlanheader = (struct IeeeHeader *) &radioHeader[1];
+ getWlanHeader(ieeewlanheader);
- //test if ack was already received
- while (akt != NULL){
- //if fragment is present, take next
- if (akt->fragment_num == fm->message_pos) {
- fm->message_pos ++;
- }
- //next ack is bigger then the fragment number
- //in case there is something like this: (acks) 1, 2, 5, 6, ...
- //and we send 3 again, the next number should be 4
- else if (akt->fragment_num > fm->message_pos) {
- break;
- }
+ //could be faster if content is just send and not copyed before
+ //fragmentheader is needed
+ if (fm->message_size > WLAN_MTU)
+ {
+ fragheader.message_crc = htons(getcrc16(copystart, copysize));
+ memcpy(&ieeewlanheader[1], &fragheader,
+ sizeof(struct FragmentationHeader));
+ fragheaderptr = (struct FragmentationHeader *) &ieeewlanheader[1];
+ memcpy(&fragheaderptr[1], copystart, copysize);
+ }
+ else
+ {
+ memcpy(&ieeewlanheader[1], copystart, copysize);
+ }
- akt = akt->next;
- }
- } else {
- // there is no need to split
- copystart = fm->msg;
- copysize = fm->message_size;
- }
-
- size += copysize;
- size += sizeof(struct RadiotapHeader) + sizeof(struct IeeeHeader)
- + sizeof(struct GNUNET_MessageHeader);
- msgheader = GNUNET_malloc(size);
- msgheader->size = htons(size);
- msgheader->type = htons(GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA);
-
- radioHeader = (struct RadiotapHeader*) &msgheader[1];
- getRadiotapHeader(radioHeader);
-
- ieeewlanheader = (struct IeeeHeader *) &radioHeader[1];
- getWlanHeader(ieeewlanheader);
-
-
- //could be faster if content is just send and not copyed before
- //fragmentheader is needed
- if (fm->message_size > WLAN_MTU){
- fragheader.message_crc = htons(getcrc16(copystart, copysize));
- memcpy(&ieeewlanheader[1],&fragheader, sizeof(struct FragmentationHeader));
- fragheaderptr = (struct FragmentationHeader *) &ieeewlanheader[1];
- memcpy(&fragheaderptr[1],copystart,copysize);
- } else {
- memcpy(&ieeewlanheader[1],copystart,copysize);
- }
+ bytes = GNUNET_DISK_file_write(plugin->server_stdin_handle, msgheader, size);
+ if (bytes == GNUNET_SYSERR){
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+ _("Error writing to wlan healper. errno == %d, ERROR: %s\n"), errno, strerror(errno) );
- bytes = GNUNET_DISK_file_write(plugin->server_stdin_handle, msgheader, size);
- GNUNET_assert(bytes == size);
+ }
+ GNUNET_assert(bytes != GNUNET_SYSERR);
- //check if this was the last fragment of this message, if true then queue at the end of the list
- if (copysize + copyoffset >= fm->message_size){
- GNUNET_assert(copysize + copyoffset == fm->message_size);
+ if (bytes != size)
+ {
+ finish = GNUNET_malloc(sizeof( struct Finish_send));
+ finish->plugin = plugin;
+ finish->msgheader = (char * ) msgheader + bytes;
+ finish->size = size - bytes;
+ finish->msgstart = msgheader;
- GNUNET_CONTAINER_DLL_remove (plugin->pending_Fragment_Messages_head,
- plugin->pending_Fragment_Messages_tail, fm);
+ GNUNET_assert(plugin->server_write_task == GNUNET_SCHEDULER_NO_TASK);
- GNUNET_CONTAINER_DLL_insert_tail(plugin->pending_Fragment_Messages_head,
- plugin->pending_Fragment_Messages_tail, fm);
- // if fragments have opimized timeouts
- //sort_fragment_into_queue(plugin,fm);
+ plugin->server_write_task = GNUNET_SCHEDULER_add_write_file(
+ GNUNET_TIME_UNIT_FOREVER_REL, plugin->server_stdin_handle,
+ &finish_sending, finish);
- }
- check_next_fragment_timeout(plugin);
+ }
+ else
+ {
+ GNUNET_assert(bytes == size);
+
+ GNUNET_free(msgheader);
+ check_next_fragment_timeout(plugin);
+ }
+
+ //check if this was the last fragment of this message, if true then queue at the end of the list
+ if (copysize + copyoffset >= fm->message_size)
+ {
+ GNUNET_assert(copysize + copyoffset == fm->message_size);
+
+ GNUNET_CONTAINER_DLL_remove (plugin->pending_Fragment_Messages_head,
+ plugin->pending_Fragment_Messages_tail, fm);
+
+ GNUNET_CONTAINER_DLL_insert_tail(plugin->pending_Fragment_Messages_head,
+ plugin->pending_Fragment_Messages_tail, fm);
+ // if fragments have opimized timeouts
+ //sort_fragment_into_queue(plugin,fm);
+
+ }
+
+ }
+}
+
+
+static void
+finish_sending(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct Finish_send * finish;
+ struct Plugin * plugin;
+ ssize_t bytes;
+
+ finish = cls;
+ plugin = finish->plugin;
+
+ plugin->server_write_task = GNUNET_SCHEDULER_NO_TASK;
+
+ bytes = GNUNET_DISK_file_write(plugin->server_stdin_handle, finish->msgheader, finish->size);
+ GNUNET_assert(bytes != GNUNET_SYSERR);
+
+ GNUNET_assert(plugin->server_write_task == GNUNET_SCHEDULER_NO_TASK);
+ if (bytes != finish->size)
+ {
+
+ finish->plugin = plugin;
+ finish->msgheader = finish->msgheader + bytes;
+ finish->size = finish->size - bytes;
+ plugin->server_write_task = GNUNET_SCHEDULER_add_write_file(
+ GNUNET_TIME_UNIT_FOREVER_REL, plugin->server_stdin_handle,
+ &finish_sending, finish);
+ }
+ else
+ {
+ GNUNET_free(finish->msgstart);
+ GNUNET_free(finish);
+ check_next_fragment_timeout(plugin);
+ }
- }
+}
+
+int
+getRadiotapHeader(struct RadiotapHeader * Header){
+ return GNUNET_YES;
+};
+
+int
+getWlanHeader(struct IeeeHeader * Header){
+
+ return GNUNET_YES;
}
@@ -1746,7 +1860,7 @@ wlan_data_helper(void *cls, void * client, const struct GNUNET_MessageHeader * h
session_light->session = search_session(plugin, session_light->addr);
}
session = session_light->session;
- wlanheader = (struct WlanHeader *) &hdr[1];
+ wlanheader = (struct WlanHeader *) &hdr;
tempmsg = (char*) &wlanheader[1];
temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1];
@@ -2149,6 +2263,8 @@ wlan_transport_start_wlan_helper(struct Plugin *plugin, int testmode)
"Adding server_read_task for the wlan-helper\n");
#endif
+ sleep(2);
+
plugin->server_read_task = GNUNET_SCHEDULER_add_read_file(
GNUNET_TIME_UNIT_FOREVER_REL, plugin->server_stdout_handle,
&wlan_plugin_helper_read, plugin);
diff --git a/src/transport/test_transport_api_wlan b/src/transport/test_transport_api_wlan
new file mode 100755
index 000000000..49f205d3b
--- /dev/null
+++ b/src/transport/test_transport_api_wlan
@@ -0,0 +1,148 @@
+#! /bin/sh
+
+# test_transport_api_wlan - temporary wrapper script for .libs/test_transport_api_wlan
+# Generated by ltmain.sh (GNU libtool) 2.2.6b
+#
+# The test_transport_api_wlan program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/david/Dokumente/gnunet/src/transport; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/david/bin; export PATH; gcc -fno-strict-aliasing -Wall -g -O2 -o \$progdir/\$file test_transport_api.o -L/home/david/lib ../../src/transport/.libs/libgnunettransport.so /home/david/Dokumente/gnunet/src/hello/.libs/libgnunethello.so /home/david/Dokumente/gnunet/src/util/.libs/libgnunetutil.so ../../src/util/.libs/libgnunetutil.so -lgcrypt -lgpg-error -lltdl -lz -lm -ldl -Wl,-rpath -Wl,/home/david/Dokumente/gnunet/src/transport/.libs -Wl,-rpath -Wl,/home/david/Dokumente/gnunet/src/hello/.libs -Wl,-rpath -Wl,/home/david/Dokumente/gnunet/src/util/.libs -Wl,-rpath -Wl,/home/david/lib)"
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='2.2.6b'
+ notinst_deplibs=' ../../src/transport/libgnunettransport.la /home/david/Dokumente/gnunet/src/hello/libgnunethello.la /home/david/Dokumente/gnunet/src/util/libgnunetutil.la ../../src/util/libgnunetutil.la'
+else
+ # When we are sourced in execute mode, $file and $ECHO are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ ECHO="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+ # special case for '.'
+ if test "$thisdir" = "."; then
+ thisdir=`pwd`
+ fi
+ # remove .libs from thisdir
+ case "$thisdir" in
+ *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
+ .libs ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'test_transport_api_wlan'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" ||
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $ECHO "$0: cannot exec $program $*" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $ECHO "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi