From c846780946fdbb691ab08750716b78fb962d19f1 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 22 Dec 2010 15:48:05 +0000 Subject: [PATCH] fixes --- src/transport/Makefile.am | 10 +++++++--- src/transport/gnunet-transport-wlan-helper.c | 8 ++++---- src/transport/plugin_transport_wlan.c | 11 +++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 5d766b7a9..1311a0851 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -36,6 +36,7 @@ if HAVE_PCAP if LINUX WANBIN = gnunet-transport-wlan-helper WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la + WLAN_API_TEST = test_transport_api_wlan endif endif @@ -200,6 +201,7 @@ libgnunet_plugin_transport_https_la_CFLAGS = \ $(CFLAGS) -DBUILD_HTTPS endif + check_PROGRAMS = \ test_transport_api_tcp \ test_transport_api_tcp_nat \ @@ -209,7 +211,7 @@ check_PROGRAMS = \ $(HTTP_API_TEST) \ $(HTTPS_PLUGIN_TEST) \ $(HTTPS_API_TEST) \ - test_transport_api_wlan \ + $(WLAN_API_TEST) \ test_transport_api_multi \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat \ @@ -331,11 +333,15 @@ test_transport_api_reliability_https_LDADD = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/util/libgnunetutil.la +if HAVE_PCAP +if LINUX test_transport_api_wlan_SOURCES = \ test_transport_api.c test_transport_api_wlan_LDADD = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/util/libgnunetutil.la +endif +endif test_quota_compliance_tcp_SOURCES = \ test_quota_compliance.c @@ -414,8 +420,6 @@ test_transport_api_multi_SOURCES = \ test_transport_api_multi_LDADD = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/util/libgnunetutil.la - - EXTRA_DIST = \ test_transport_api_data.conf \ test_transport_api_tcp_peer1.conf \ diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c index 48b628e94..6f8e3d4d1 100644 --- a/src/transport/gnunet-transport-wlan-helper.c +++ b/src/transport/gnunet-transport-wlan-helper.c @@ -595,11 +595,11 @@ testmode(int argc, char *argv[]) int main(int argc, char *argv[]) { - if ((argc==3) && (strstr(argv[2],"1"))) + if ((argc==2) && (strstr(argv[1],"1"))) { return testmode(argc, argv); } - +#if 0 u8 u8aSendBuffer[500]; char szErrbuf[PCAP_ERRBUF_SIZE]; int nCaptureHeaderLength = 0, n80211HeaderLength = 0, nLinkEncap = 0; @@ -697,7 +697,7 @@ main(int argc, char *argv[]) //get header type nLinkEncap = pcap_datalink(ppcap); - nCaptureHeaderLength = 0; + nCaptureHeaderLength = 0;home/mwachs/gnb/bin/ switch (nLinkEncap) { @@ -857,7 +857,7 @@ main(int argc, char *argv[]) } - +#endif return (0); } diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index d3c7d2150..aaa11b80a 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -49,7 +49,7 @@ #define FRAGMENT_QUEUE_SIZE 10 -#define DEBUG_wlan GNUNET_NO +#define DEBUG_wlan GNUNET_YES #define MESSAGE_LENGHT_UNKNOWN -1 #define NO_MESSAGE_OR_MESSAGE_FINISHED -2 @@ -1994,7 +1994,7 @@ wlan_plugin_helper_read (void *cls, static int wlan_transport_start_wlan_helper(struct Plugin *plugin, int testmode) { - + char * filename = "gnunet-transport-wlan-helper"; plugin->server_stdout = GNUNET_DISK_pipe(GNUNET_YES, GNUNET_NO, GNUNET_YES); if (plugin->server_stdout == NULL) return GNUNET_SYSERR; @@ -2005,12 +2005,12 @@ wlan_transport_start_wlan_helper(struct Plugin *plugin, int testmode) #if DEBUG_wlan GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Starting gnunet-wlan-helper process cmd: %s %s\n", "gnunet-wlan-helper", plugin->interface); + "Starting gnunet-wlan-helper process cmd: %s %s %i\n", filename, plugin->interface, testmode); #endif /* Start the server process */ + plugin->server_proc = GNUNET_OS_start_process(plugin->server_stdin, - plugin->server_stdout, "gnunet-transport-wlan-helper", - plugin->interface, testmode, NULL); + plugin->server_stdout, filename, plugin->interface, ((testmode==1)?"1":"0"), NULL); if (plugin->server_proc == NULL) { #if DEBUG_wlan @@ -2077,7 +2077,6 @@ libgnunet_plugin_transport_wlan_init (void *cls) GNUNET_assert(cls !=NULL); - fprintf(stderr,"HERE"); plugin = GNUNET_malloc (sizeof (struct Plugin)); plugin->env = env; plugin->pendingsessions = 0; -- 2.25.1