detect pcap
authorChristian Grothoff <christian@grothoff.org>
Wed, 28 Jul 2010 11:20:36 +0000 (11:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 28 Jul 2010 11:20:36 +0000 (11:20 +0000)
configure.ac
src/dht/Makefile.am
src/transport/Makefile.am
src/transport/gnunet-transport-wlan-helper.c
src/transport/gnunet-transport-wlan-helper.h

index 19bdb5ee847a53f865b0389fdc0370da3ebb4ae3..fb6856314a6a6e2dd2e71dd65d8bbb3d124737d5 100644 (file)
@@ -346,6 +346,38 @@ AM_CONDITIONAL(HAVE_POSTGRES, test x$postgres = xtrue)
 AC_SUBST(POSTGRES_CPPFLAGS)
 AC_SUBST(POSTGRES_LDFLAGS)
 
+# test for pcap
+pcap=false
+AC_MSG_CHECKING(for libpcap)
+AC_ARG_WITH(pcap,
+  [  --with-pcap=PFX       base of pcap installation],
+  [AC_MSG_RESULT("$with_pcap")
+   case $with_pcap in
+   no)
+     ;;
+   yes)
+    AC_CHECK_HEADERS(pcap.h,
+     pcap=true)
+     ;;
+   *)
+    LDFLAGS="-L$with_pcap/lib $LDFLAGS"
+    CPPFLAGS="-I$with_pcap/include $CPPFLAGS"
+    AC_CHECK_HEADERS(pcap.h,
+     EXT_LIB_PATH="-L$with_pcap/lib $EXT_LIB_PATH"
+     PCAP_LDFLAGS="-L$with_pcap/lib"
+     PCAP_CPPFLAGS="-I$with_pcap/include"
+     pcap=true)
+    LDFLAGS=$SAVE_LDFLAGS
+    CPPFLAGS=$SAVE_CPPFLAGS
+    ;;
+   esac
+  ],
+  [AC_MSG_RESULT([--with-pcap not specified])
+    AC_CHECK_HEADERS(pcap.h, pcap=true)])
+AM_CONDITIONAL(HAVE_PCAP, test x$pcap = xtrue)
+AC_SUBST(PCAP_CPPFLAGS)
+AC_SUBST(PCAP_LDFLAGS)
+
 
 # test for libz (maybe required for linking mysql)
 zlib=1
index 8f4fec4a9cb9df2fba4ea17f9c8ddf1c8adabc79..21192f91c8950eafe7cfdbebe714f5ef8306a3ee 100644 (file)
@@ -20,7 +20,7 @@ endif
 
 lib_LTLIBRARIES = libgnunetdht.la \
  libgnunetdhtlog.la
+
 plugin_LTLIBRARIES = \
  libgnunet_plugin_dhtlog_dummy.la $(MYSQL_PLUGIN)
 
@@ -61,7 +61,12 @@ libgnunetdht_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
   -version-info 0:0:0
 
-bin_PROGRAMS = \
+STUD_PROGS =  gnunet-service-dht-can \
+ gnunet-service-dht-freenet \
+ gnunet-service-dht-kademlia \
+ gnunet-service-dht-koorde 
+
+bin_PROGRAMS = $(STUD_PROGS) \
  gnunet-service-dht \
  gnunet-dht-get \
  gnunet-dht-get-peer \
@@ -81,6 +86,58 @@ gnunet_service_dht_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(top_builddir)/src/dht/libgnunetdhtlog.la
 
+gnunet_service_dht_can_SOURCES = \
+ dht_can.c dht_can_helper.c dht_can_helper.h
+gnunet_service_dht_can_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/core/libgnunetcore.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/datacache/libgnunetdatacache.la \
+  $(top_builddir)/src/util/libgnunetutil.la 
+
+gnunet_service_dht_freenet_SOURCES = \
+ dht_freenet.c 
+gnunet_service_dht_freenet_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/core/libgnunetcore.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/datacache/libgnunetdatacache.la \
+  $(top_builddir)/src/util/libgnunetutil.la 
+
+gnunet_service_dht_kademlia_SOURCES = \
+ dht_kademlia.c dht_kademlia.h
+gnunet_service_dht_kademlia_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/core/libgnunetcore.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/datacache/libgnunetdatacache.la \
+  $(top_builddir)/src/util/libgnunetutil.la 
+
+gnunet_service_dht_koorde_SOURCES = \
+ dht_koorde.c dht_koorde.h
+gnunet_service_dht_koorde_LDADD = \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/core/libgnunetcore.la \
+  $(top_builddir)/src/transport/libgnunettransport.la \
+  $(top_builddir)/src/hello/libgnunethello.la \
+  $(top_builddir)/src/datacache/libgnunetdatacache.la \
+  $(top_builddir)/src/util/libgnunetutil.la 
+
+#gnunet_service_dht_new_SOURCES = \
+# gnunet-service-dht-new.c         
+#gnunet_service_dht_new_LDADD = \
+#  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+#  $(top_builddir)/src/core/libgnunetcore.la \
+#  $(top_builddir)/src/transport/libgnunettransport.la \
+#  $(top_builddir)/src/hello/libgnunethello.la \
+#  $(top_builddir)/src/datacache/libgnunetdatacache.la \
+#  $(top_builddir)/src/util/libgnunetutil.la \
+#  $(top_builddir)/src/dht/libgnunetdhtlog.la
+
 gnunet_dht_get_SOURCES = \
  gnunet-dht-get.c         
 gnunet_dht_get_LDADD = \
@@ -121,7 +178,6 @@ check_PROGRAMS = \
  test_dhtlog
 
 TESTS = test_dht_api $(check_SCRIPTS) \
- test_dhtlog \
  test_dht_twopeer \
  test_dht_twopeer_put_get
 
index fb6095fc1b25ded6aa659b8045ea6738bc4cd02b..2ec29bb9b4868356beaabd5ce1b2a746f13cca0c 100644 (file)
@@ -12,7 +12,7 @@ if HAVE_MHD
  HTTP_PLUGIN_TEST = test_plugin_transport_http
  HTTP_API_TEST = test_transport_api_http
  HTTP_REL_TEST = test_transport_api_reliability_http
-                     
+
  HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
  HTTPS_PLUGIN_TEST = test_plugin_transport_https
  HTTPS_API_TEST = test_transport_api_https
@@ -23,9 +23,12 @@ if USE_COVERAGE
   AM_CFLAGS = --coverage -O0
 endif
 
+if HAVE_PCAP
+WANBIN = gnunet-transport-wlan-helper
+endif
+
 if LINUX
 NATBIN = gnunet-nat-server gnunet-nat-client
-WANBIN = gnunet-wlan
 install-exec-hook:
        chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
        chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
@@ -54,16 +57,16 @@ bin_PROGRAMS = \
  gnunet-transport \
  $(WANBIN) \
  gnunet-service-transport $(NATBIN)
+
 bin_SCRIPTS = \
  gnunet-transport-certificate-creation
 
 gnunet_nat_server_SOURCES = \
  gnunet-nat-server.c         
 
-gnunet_wlan_SOURCES = \
+gnunet_transport_wlan_helper_SOURCES = \
  gnunet-transport-wlan-helper.c         
-gnunet_wlan_LDADD = \
+gnunet_transport_wlan_helper_LDADD = \
  -lpcap
 
 gnunet_nat_client_SOURCES = \
index 6ae31a647d01f0cbdbbcdca12e32126d87011c3c..47bea007efaca19983ce3ef5a70566448451ec98 100644 (file)
@@ -28,7 +28,7 @@
  * gnunet 
  */
  
-#include "gnunet_wlan.h"
+#include "gnunet-transport-wlan-helper.h"
 #include <pcap/pcap.h>
 
 //#include "radiotap.h"
index f8fa145f2e1dd8d125cc8258dfb47d986e2c31b5..2988d76e72d5f3b12199c1868b77de4237a4647f 100644 (file)
@@ -314,6 +314,7 @@ enum ieee80211_radiotap_type {
        (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
        ((x) + 1000) * 5)
 
+#if BROKEN
 /* helpers */
 static inline int ieee80211_get_radiotap_len(unsigned char *data)
 {
@@ -322,7 +323,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data)
 
        return get_unaligned_le16(&hdr->it_len);
 }
-
+#endif
 #endif                         /* IEEE80211_RADIOTAP_H */