aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-07-28 11:20:36 +0000
committerChristian Grothoff <christian@grothoff.org>2010-07-28 11:20:36 +0000
commit7b7cee05d26d1fe61c8803a454a1d52b502edd4a (patch)
treeb11a68a9f676ca771e982624e289203641a41231
parent5b74643793db765f308eb522856954ab81ef8ead (diff)
downloadgnunet-7b7cee05d26d1fe61c8803a454a1d52b502edd4a.tar.gz
gnunet-7b7cee05d26d1fe61c8803a454a1d52b502edd4a.zip
detect pcap
-rw-r--r--configure.ac32
-rw-r--r--src/dht/Makefile.am62
-rw-r--r--src/transport/Makefile.am13
-rw-r--r--src/transport/gnunet-transport-wlan-helper.c2
-rw-r--r--src/transport/gnunet-transport-wlan-helper.h3
5 files changed, 102 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 19bdb5ee8..fb6856314 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,6 +346,38 @@ AM_CONDITIONAL(HAVE_POSTGRES, test x$postgres = xtrue)
346AC_SUBST(POSTGRES_CPPFLAGS) 346AC_SUBST(POSTGRES_CPPFLAGS)
347AC_SUBST(POSTGRES_LDFLAGS) 347AC_SUBST(POSTGRES_LDFLAGS)
348 348
349# test for pcap
350pcap=false
351AC_MSG_CHECKING(for libpcap)
352AC_ARG_WITH(pcap,
353 [ --with-pcap=PFX base of pcap installation],
354 [AC_MSG_RESULT("$with_pcap")
355 case $with_pcap in
356 no)
357 ;;
358 yes)
359 AC_CHECK_HEADERS(pcap.h,
360 pcap=true)
361 ;;
362 *)
363 LDFLAGS="-L$with_pcap/lib $LDFLAGS"
364 CPPFLAGS="-I$with_pcap/include $CPPFLAGS"
365 AC_CHECK_HEADERS(pcap.h,
366 EXT_LIB_PATH="-L$with_pcap/lib $EXT_LIB_PATH"
367 PCAP_LDFLAGS="-L$with_pcap/lib"
368 PCAP_CPPFLAGS="-I$with_pcap/include"
369 pcap=true)
370 LDFLAGS=$SAVE_LDFLAGS
371 CPPFLAGS=$SAVE_CPPFLAGS
372 ;;
373 esac
374 ],
375 [AC_MSG_RESULT([--with-pcap not specified])
376 AC_CHECK_HEADERS(pcap.h, pcap=true)])
377AM_CONDITIONAL(HAVE_PCAP, test x$pcap = xtrue)
378AC_SUBST(PCAP_CPPFLAGS)
379AC_SUBST(PCAP_LDFLAGS)
380
349 381
350# test for libz (maybe required for linking mysql) 382# test for libz (maybe required for linking mysql)
351zlib=1 383zlib=1
diff --git a/src/dht/Makefile.am b/src/dht/Makefile.am
index 8f4fec4a9..21192f91c 100644
--- a/src/dht/Makefile.am
+++ b/src/dht/Makefile.am
@@ -20,7 +20,7 @@ endif
20 20
21lib_LTLIBRARIES = libgnunetdht.la \ 21lib_LTLIBRARIES = libgnunetdht.la \
22 libgnunetdhtlog.la 22 libgnunetdhtlog.la
23 23
24plugin_LTLIBRARIES = \ 24plugin_LTLIBRARIES = \
25 libgnunet_plugin_dhtlog_dummy.la $(MYSQL_PLUGIN) 25 libgnunet_plugin_dhtlog_dummy.la $(MYSQL_PLUGIN)
26 26
@@ -61,7 +61,12 @@ libgnunetdht_la_LDFLAGS = \
61 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 61 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
62 -version-info 0:0:0 62 -version-info 0:0:0
63 63
64bin_PROGRAMS = \ 64STUD_PROGS = gnunet-service-dht-can \
65 gnunet-service-dht-freenet \
66 gnunet-service-dht-kademlia \
67 gnunet-service-dht-koorde
68
69bin_PROGRAMS = $(STUD_PROGS) \
65 gnunet-service-dht \ 70 gnunet-service-dht \
66 gnunet-dht-get \ 71 gnunet-dht-get \
67 gnunet-dht-get-peer \ 72 gnunet-dht-get-peer \
@@ -81,6 +86,58 @@ gnunet_service_dht_LDADD = \
81 $(top_builddir)/src/util/libgnunetutil.la \ 86 $(top_builddir)/src/util/libgnunetutil.la \
82 $(top_builddir)/src/dht/libgnunetdhtlog.la 87 $(top_builddir)/src/dht/libgnunetdhtlog.la
83 88
89gnunet_service_dht_can_SOURCES = \
90 dht_can.c dht_can_helper.c dht_can_helper.h
91gnunet_service_dht_can_LDADD = \
92 $(top_builddir)/src/statistics/libgnunetstatistics.la \
93 $(top_builddir)/src/core/libgnunetcore.la \
94 $(top_builddir)/src/transport/libgnunettransport.la \
95 $(top_builddir)/src/hello/libgnunethello.la \
96 $(top_builddir)/src/datacache/libgnunetdatacache.la \
97 $(top_builddir)/src/util/libgnunetutil.la
98
99gnunet_service_dht_freenet_SOURCES = \
100 dht_freenet.c
101gnunet_service_dht_freenet_LDADD = \
102 $(top_builddir)/src/statistics/libgnunetstatistics.la \
103 $(top_builddir)/src/core/libgnunetcore.la \
104 $(top_builddir)/src/transport/libgnunettransport.la \
105 $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
106 $(top_builddir)/src/hello/libgnunethello.la \
107 $(top_builddir)/src/datacache/libgnunetdatacache.la \
108 $(top_builddir)/src/util/libgnunetutil.la
109
110gnunet_service_dht_kademlia_SOURCES = \
111 dht_kademlia.c dht_kademlia.h
112gnunet_service_dht_kademlia_LDADD = \
113 $(top_builddir)/src/statistics/libgnunetstatistics.la \
114 $(top_builddir)/src/core/libgnunetcore.la \
115 $(top_builddir)/src/transport/libgnunettransport.la \
116 $(top_builddir)/src/hello/libgnunethello.la \
117 $(top_builddir)/src/datacache/libgnunetdatacache.la \
118 $(top_builddir)/src/util/libgnunetutil.la
119
120gnunet_service_dht_koorde_SOURCES = \
121 dht_koorde.c dht_koorde.h
122gnunet_service_dht_koorde_LDADD = \
123 $(top_builddir)/src/statistics/libgnunetstatistics.la \
124 $(top_builddir)/src/core/libgnunetcore.la \
125 $(top_builddir)/src/transport/libgnunettransport.la \
126 $(top_builddir)/src/hello/libgnunethello.la \
127 $(top_builddir)/src/datacache/libgnunetdatacache.la \
128 $(top_builddir)/src/util/libgnunetutil.la
129
130#gnunet_service_dht_new_SOURCES = \
131# gnunet-service-dht-new.c
132#gnunet_service_dht_new_LDADD = \
133# $(top_builddir)/src/statistics/libgnunetstatistics.la \
134# $(top_builddir)/src/core/libgnunetcore.la \
135# $(top_builddir)/src/transport/libgnunettransport.la \
136# $(top_builddir)/src/hello/libgnunethello.la \
137# $(top_builddir)/src/datacache/libgnunetdatacache.la \
138# $(top_builddir)/src/util/libgnunetutil.la \
139# $(top_builddir)/src/dht/libgnunetdhtlog.la
140
84gnunet_dht_get_SOURCES = \ 141gnunet_dht_get_SOURCES = \
85 gnunet-dht-get.c 142 gnunet-dht-get.c
86gnunet_dht_get_LDADD = \ 143gnunet_dht_get_LDADD = \
@@ -121,7 +178,6 @@ check_PROGRAMS = \
121 test_dhtlog 178 test_dhtlog
122 179
123TESTS = test_dht_api $(check_SCRIPTS) \ 180TESTS = test_dht_api $(check_SCRIPTS) \
124 test_dhtlog \
125 test_dht_twopeer \ 181 test_dht_twopeer \
126 test_dht_twopeer_put_get 182 test_dht_twopeer_put_get
127 183
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index fb6095fc1..2ec29bb9b 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -12,7 +12,7 @@ if HAVE_MHD
12 HTTP_PLUGIN_TEST = test_plugin_transport_http 12 HTTP_PLUGIN_TEST = test_plugin_transport_http
13 HTTP_API_TEST = test_transport_api_http 13 HTTP_API_TEST = test_transport_api_http
14 HTTP_REL_TEST = test_transport_api_reliability_http 14 HTTP_REL_TEST = test_transport_api_reliability_http
15 15
16 HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la 16 HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
17 HTTPS_PLUGIN_TEST = test_plugin_transport_https 17 HTTPS_PLUGIN_TEST = test_plugin_transport_https
18 HTTPS_API_TEST = test_transport_api_https 18 HTTPS_API_TEST = test_transport_api_https
@@ -23,9 +23,12 @@ if USE_COVERAGE
23 AM_CFLAGS = --coverage -O0 23 AM_CFLAGS = --coverage -O0
24endif 24endif
25 25
26if HAVE_PCAP
27WANBIN = gnunet-transport-wlan-helper
28endif
29
26if LINUX 30if LINUX
27NATBIN = gnunet-nat-server gnunet-nat-client 31NATBIN = gnunet-nat-server gnunet-nat-client
28WANBIN = gnunet-wlan
29install-exec-hook: 32install-exec-hook:
30 chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true 33 chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
31 chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true 34 chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
@@ -54,16 +57,16 @@ bin_PROGRAMS = \
54 gnunet-transport \ 57 gnunet-transport \
55 $(WANBIN) \ 58 $(WANBIN) \
56 gnunet-service-transport $(NATBIN) 59 gnunet-service-transport $(NATBIN)
57 60
58bin_SCRIPTS = \ 61bin_SCRIPTS = \
59 gnunet-transport-certificate-creation 62 gnunet-transport-certificate-creation
60 63
61gnunet_nat_server_SOURCES = \ 64gnunet_nat_server_SOURCES = \
62 gnunet-nat-server.c 65 gnunet-nat-server.c
63 66
64gnunet_wlan_SOURCES = \ 67gnunet_transport_wlan_helper_SOURCES = \
65 gnunet-transport-wlan-helper.c 68 gnunet-transport-wlan-helper.c
66gnunet_wlan_LDADD = \ 69gnunet_transport_wlan_helper_LDADD = \
67 -lpcap 70 -lpcap
68 71
69gnunet_nat_client_SOURCES = \ 72gnunet_nat_client_SOURCES = \
diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c
index 6ae31a647..47bea007e 100644
--- a/src/transport/gnunet-transport-wlan-helper.c
+++ b/src/transport/gnunet-transport-wlan-helper.c
@@ -28,7 +28,7 @@
28 * gnunet 28 * gnunet
29 */ 29 */
30 30
31#include "gnunet_wlan.h" 31#include "gnunet-transport-wlan-helper.h"
32#include <pcap/pcap.h> 32#include <pcap/pcap.h>
33 33
34//#include "radiotap.h" 34//#include "radiotap.h"
diff --git a/src/transport/gnunet-transport-wlan-helper.h b/src/transport/gnunet-transport-wlan-helper.h
index f8fa145f2..2988d76e7 100644
--- a/src/transport/gnunet-transport-wlan-helper.h
+++ b/src/transport/gnunet-transport-wlan-helper.h
@@ -314,6 +314,7 @@ enum ieee80211_radiotap_type {
314 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ 314 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
315 ((x) + 1000) * 5) 315 ((x) + 1000) * 5)
316 316
317#if BROKEN
317/* helpers */ 318/* helpers */
318static inline int ieee80211_get_radiotap_len(unsigned char *data) 319static inline int ieee80211_get_radiotap_len(unsigned char *data)
319{ 320{
@@ -322,7 +323,7 @@ static inline int ieee80211_get_radiotap_len(unsigned char *data)
322 323
323 return get_unaligned_le16(&hdr->it_len); 324 return get_unaligned_le16(&hdr->it_len);
324} 325}
325 326#endif
326#endif /* IEEE80211_RADIOTAP_H */ 327#endif /* IEEE80211_RADIOTAP_H */
327 328
328 329