diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-07-28 11:20:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-07-28 11:20:36 +0000 |
commit | 7b7cee05d26d1fe61c8803a454a1d52b502edd4a (patch) | |
tree | b11a68a9f676ca771e982624e289203641a41231 | |
parent | 5b74643793db765f308eb522856954ab81ef8ead (diff) | |
download | gnunet-7b7cee05d26d1fe61c8803a454a1d52b502edd4a.tar.gz gnunet-7b7cee05d26d1fe61c8803a454a1d52b502edd4a.zip |
detect pcap
-rw-r--r-- | configure.ac | 32 | ||||
-rw-r--r-- | src/dht/Makefile.am | 62 | ||||
-rw-r--r-- | src/transport/Makefile.am | 13 | ||||
-rw-r--r-- | src/transport/gnunet-transport-wlan-helper.c | 2 | ||||
-rw-r--r-- | src/transport/gnunet-transport-wlan-helper.h | 3 |
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) | |||
346 | AC_SUBST(POSTGRES_CPPFLAGS) | 346 | AC_SUBST(POSTGRES_CPPFLAGS) |
347 | AC_SUBST(POSTGRES_LDFLAGS) | 347 | AC_SUBST(POSTGRES_LDFLAGS) |
348 | 348 | ||
349 | # test for pcap | ||
350 | pcap=false | ||
351 | AC_MSG_CHECKING(for libpcap) | ||
352 | AC_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)]) | ||
377 | AM_CONDITIONAL(HAVE_PCAP, test x$pcap = xtrue) | ||
378 | AC_SUBST(PCAP_CPPFLAGS) | ||
379 | AC_SUBST(PCAP_LDFLAGS) | ||
380 | |||
349 | 381 | ||
350 | # test for libz (maybe required for linking mysql) | 382 | # test for libz (maybe required for linking mysql) |
351 | zlib=1 | 383 | zlib=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 | ||
21 | lib_LTLIBRARIES = libgnunetdht.la \ | 21 | lib_LTLIBRARIES = libgnunetdht.la \ |
22 | libgnunetdhtlog.la | 22 | libgnunetdhtlog.la |
23 | 23 | ||
24 | plugin_LTLIBRARIES = \ | 24 | plugin_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 | ||
64 | bin_PROGRAMS = \ | 64 | STUD_PROGS = gnunet-service-dht-can \ |
65 | gnunet-service-dht-freenet \ | ||
66 | gnunet-service-dht-kademlia \ | ||
67 | gnunet-service-dht-koorde | ||
68 | |||
69 | bin_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 | ||
89 | gnunet_service_dht_can_SOURCES = \ | ||
90 | dht_can.c dht_can_helper.c dht_can_helper.h | ||
91 | gnunet_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 | |||
99 | gnunet_service_dht_freenet_SOURCES = \ | ||
100 | dht_freenet.c | ||
101 | gnunet_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 | |||
110 | gnunet_service_dht_kademlia_SOURCES = \ | ||
111 | dht_kademlia.c dht_kademlia.h | ||
112 | gnunet_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 | |||
120 | gnunet_service_dht_koorde_SOURCES = \ | ||
121 | dht_koorde.c dht_koorde.h | ||
122 | gnunet_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 | |||
84 | gnunet_dht_get_SOURCES = \ | 141 | gnunet_dht_get_SOURCES = \ |
85 | gnunet-dht-get.c | 142 | gnunet-dht-get.c |
86 | gnunet_dht_get_LDADD = \ | 143 | gnunet_dht_get_LDADD = \ |
@@ -121,7 +178,6 @@ check_PROGRAMS = \ | |||
121 | test_dhtlog | 178 | test_dhtlog |
122 | 179 | ||
123 | TESTS = test_dht_api $(check_SCRIPTS) \ | 180 | TESTS = 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 |
24 | endif | 24 | endif |
25 | 25 | ||
26 | if HAVE_PCAP | ||
27 | WANBIN = gnunet-transport-wlan-helper | ||
28 | endif | ||
29 | |||
26 | if LINUX | 30 | if LINUX |
27 | NATBIN = gnunet-nat-server gnunet-nat-client | 31 | NATBIN = gnunet-nat-server gnunet-nat-client |
28 | WANBIN = gnunet-wlan | ||
29 | install-exec-hook: | 32 | install-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 | ||
58 | bin_SCRIPTS = \ | 61 | bin_SCRIPTS = \ |
59 | gnunet-transport-certificate-creation | 62 | gnunet-transport-certificate-creation |
60 | 63 | ||
61 | gnunet_nat_server_SOURCES = \ | 64 | gnunet_nat_server_SOURCES = \ |
62 | gnunet-nat-server.c | 65 | gnunet-nat-server.c |
63 | 66 | ||
64 | gnunet_wlan_SOURCES = \ | 67 | gnunet_transport_wlan_helper_SOURCES = \ |
65 | gnunet-transport-wlan-helper.c | 68 | gnunet-transport-wlan-helper.c |
66 | gnunet_wlan_LDADD = \ | 69 | gnunet_transport_wlan_helper_LDADD = \ |
67 | -lpcap | 70 | -lpcap |
68 | 71 | ||
69 | gnunet_nat_client_SOURCES = \ | 72 | gnunet_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 */ |
318 | static inline int ieee80211_get_radiotap_len(unsigned char *data) | 319 | static 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 | ||