Added testcases for asymmetric quotas
[oweals/gnunet.git] / src / transport / Makefile.am
1 INCLUDES = -I$(top_srcdir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 if MINGW
6   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
7   NATBIN = gnunet-nat-server gnunet-nat-client
8   NATSERVER = gnunet-nat-server-windows.c
9   NATCLIENT = gnunet-nat-client-windows.c
10 else
11   NATSERVER = gnunet-nat-server.c
12   NATCLIENT = gnunet-nat-client.c
13 endif
14
15 if HAVE_MHD
16  GN_LIBMHD = -lmicrohttpd
17  HTTP_PLUGIN_LA = libgnunet_plugin_transport_http.la
18  HTTP_PLUGIN_TEST = test_plugin_transport_http
19  HTTP_API_TEST = test_transport_api_http
20  HTTP_REL_TEST = test_transport_api_reliability_http
21  HTTP_QUOTA_TEST = test_quota_compliance_http
22
23  HTTPS_PLUGIN_LA = libgnunet_plugin_transport_https.la
24  HTTPS_PLUGIN_TEST = test_plugin_transport_https
25  HTTPS_API_TEST = test_transport_api_https
26  HTTPS_REL_TEST = test_transport_api_reliability_https
27  HTTPS_QUOTA_TEST = test_quota_compliance_https                      
28 endif
29
30 if USE_COVERAGE
31   AM_CFLAGS = --coverage -O0
32 endif
33
34 if HAVE_PCAP
35 if LINUX
36  WANBIN = gnunet-transport-wlan-helper
37  WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la
38 endif
39 endif
40
41 if LINUX
42 NATBIN = gnunet-nat-server gnunet-nat-client
43 install-exec-hook:
44         chown root $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
45         chmod u+s $(bindir)/gnunet-nat-server $(bindir)/gnunet-nat-client $(bindir)/gnunet-wlan || true
46 else
47 install-exec-hook:
48 endif
49
50 #noinst_PROGRAMS = ${check_PROGRAMS}
51
52 lib_LTLIBRARIES = \
53   libgnunettransport.la
54
55 libgnunettransport_la_SOURCES = \
56   transport_api.c transport.h \
57   transport_api_blacklist.c \
58   transport_api_address_lookup.c 
59 libgnunettransport_la_LIBADD = \
60   $(top_builddir)/src/hello/libgnunethello.la \
61   $(top_builddir)/src/util/libgnunetutil.la \
62   $(GN_LIBINTL) 
63 libgnunettransport_la_LDFLAGS = \
64   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
65   -version-info 0:0:0
66
67
68 bin_PROGRAMS = \
69  gnunet-transport \
70  $(WANBIN) \
71  gnunet-service-transport $(NATBIN)
72
73 bin_SCRIPTS = \
74  gnunet-transport-certificate-creation
75
76 gnunet_nat_server_SOURCES = \
77  $(NATSERVER)
78
79 gnunet_transport_wlan_helper_SOURCES = \
80  gnunet-transport-wlan-helper.c         
81 gnunet_transport_wlan_helper_LDADD = \
82  -lpcap
83
84 gnunet_nat_client_SOURCES = \
85  $(NATCLIENT)         
86
87 gnunet_transport_SOURCES = \
88  gnunet-transport.c         
89 gnunet_transport_LDADD = \
90   $(top_builddir)/src/transport/libgnunettransport.la \
91   $(top_builddir)/src/util/libgnunetutil.la \
92   $(GN_LIBINTL)
93
94 gnunet_service_transport_SOURCES = \
95  gnunet-service-transport.c plugin_transport.h 
96 gnunet_service_transport_LDADD = \
97   $(top_builddir)/src/hello/libgnunethello.la \
98   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
99   $(top_builddir)/src/statistics/libgnunetstatistics.la \
100   $(top_builddir)/src/util/libgnunetutil.la \
101   $(GN_LIBINTL)
102
103
104 plugin_LTLIBRARIES = \
105   libgnunet_plugin_transport_tcp.la \
106   libgnunet_plugin_transport_udp.la \
107   $(HTTP_PLUGIN_LA) \
108   $(HTTPS_PLUGIN_LA) \
109   $(WLAN_PLUGIN_LA) \
110   libgnunet_plugin_transport_template.la
111 # TODO: add nat, etc.
112
113 libgnunet_plugin_transport_tcp_la_SOURCES = \
114   plugin_transport_tcp.c
115 libgnunet_plugin_transport_tcp_la_LIBADD = \
116   $(top_builddir)/src/hello/libgnunethello.la \
117   $(top_builddir)/src/statistics/libgnunetstatistics.la \
118   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
119   $(top_builddir)/src/util/libgnunetutil.la 
120 libgnunet_plugin_transport_tcp_la_LDFLAGS = \
121  $(GN_PLUGIN_LDFLAGS)
122
123 libgnunet_plugin_transport_template_la_SOURCES = \
124   plugin_transport_template.c
125 libgnunet_plugin_transport_template_la_LIBADD = \
126   $(top_builddir)/src/util/libgnunetutil.la 
127 libgnunet_plugin_transport_template_la_LDFLAGS = \
128  $(GN_PLUGIN_LDFLAGS)
129
130 if HAVE_PCAP
131 if LINUX
132 libgnunet_plugin_transport_wlan_la_SOURCES = \
133         plugin_transport_wlan.c
134 libgnunet_plugin_transport_wlan_la_LIBADD = \
135         $(top_builddir)/src/hello/libgnunethello.la \
136         $(top_builddir)/src/statistics/libgnunetstatistics.la \
137         $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
138         $(top_builddir)/src/util/libgnunetutil.la 
139 libgnunet_plugin_transport_wlan_la_LDFLAGS = \
140         $(GN_PLUGIN_LDFLAGS)
141 endif
142 endif
143
144 libgnunet_plugin_transport_udp_la_SOURCES = \
145   plugin_transport_udp.c
146 libgnunet_plugin_transport_udp_la_LIBADD = \
147   $(top_builddir)/src/hello/libgnunethello.la \
148   $(top_builddir)/src/statistics/libgnunetstatistics.la \
149   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
150   $(top_builddir)/src/util/libgnunetutil.la 
151 libgnunet_plugin_transport_udp_la_LDFLAGS = \
152  $(GN_PLUGIN_LDFLAGS)
153
154 #libgnunet_plugin_transport_udp_nat_la_SOURCES = \
155 #  plugin_transport_udp_nat.c
156 #libgnunet_plugin_transport_udp_nat_la_LIBADD = \
157 #  $(top_builddir)/src/hello/libgnunethello.la \
158 #  $(top_builddir)/src/statistics/libgnunetstatistics.la \
159 #  $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
160 #  $(top_builddir)/src/util/libgnunetutil.la 
161 #libgnunet_plugin_transport_udp_nat_la_LDFLAGS = \
162 # $(GN_PLUGIN_LDFLAGS)
163
164 if HAVE_MHD 
165 libgnunet_plugin_transport_http_la_SOURCES = \
166   plugin_transport_http.c
167 libgnunet_plugin_transport_http_la_LIBADD = \
168   $(top_builddir)/src/hello/libgnunethello.la \
169   $(top_builddir)/src/statistics/libgnunetstatistics.la \
170   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
171   @LIBCURL@ \
172   $(top_builddir)/src/util/libgnunetutil.la 
173 libgnunet_plugin_transport_http_la_LDFLAGS = \
174  $(GN_LIBMHD) \
175  $(GN_PLUGIN_LDFLAGS)
176  
177 libgnunet_plugin_transport_https_la_SOURCES = \
178   plugin_transport_http.c
179 libgnunet_plugin_transport_https_la_LIBADD = \
180   $(top_builddir)/src/hello/libgnunethello.la \
181   $(top_builddir)/src/statistics/libgnunetstatistics.la \
182   $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \
183   @LIBCURL@ \
184   $(top_builddir)/src/util/libgnunetutil.la 
185 libgnunet_plugin_transport_https_la_LDFLAGS = \
186  $(GN_LIBMHD) \
187  $(GN_PLUGIN_LDFLAGS)
188 libgnunet_plugin_transport_https_la_CFLAGS = \
189  $(CFLAGS) -DBUILD_HTTPS  
190 endif
191
192 check_PROGRAMS = \
193  test_transport_api_tcp \
194  test_transport_api_tcp_nat \
195  test_transport_api_udp \
196  test_transport_api_udp_nat \
197  $(HTTP_PLUGIN_TEST) \
198  $(HTTP_API_TEST) \
199  $(HTTPS_PLUGIN_TEST) \
200  $(HTTPS_API_TEST) \
201  test_transport_api_reliability_tcp \
202  test_transport_api_reliability_tcp_nat \
203  test_transport_api_reliability_udp \
204  $(HTTP_REL_TEST) \
205  $(HTTPS_REL_TEST) \
206  test_quota_compliance_tcp \
207  test_quota_compliance_tcp_asymmetric_recv_constant \
208  test_quota_compliance_tcp_asymmetric_send_constant \
209  test_quota_compliance_udp \
210  $(HTTP_QUOTA_TEST) \
211  $(HTTPS_QUOTA_TEST)
212 # TODO: add tests for nat, etc.
213
214 if !DISABLE_TEST_RUN
215 TESTS = \
216  test_transport_api_tcp \
217  test_transport_api_tcp_nat \
218  test_transport_api_udp \
219  test_transport_api_udp_nat \
220  $(HTTP_PLUGIN_TEST) \
221  $(HTTP_API_TEST) \
222  $(HTTPS_PLUGIN_TEST) \
223  $(HTTPS_API_TEST) \
224  test_transport_api_reliability_tcp \
225  test_transport_api_reliability_tcp_nat \
226  $(HTTP_REL_TEST) \
227  $(HTTPS_REL_TEST) \
228  test_quota_compliance_tcp \
229  test_quota_compliance_tcp_asymmetric_recv_constant \
230  test_quota_compliance_tcp_asymmetric_send_constant \
231  test_quota_compliance_udp \
232  $(HTTP_QUOTA_TEST) \
233  $(HTTPS_QUOTA_TEST)
234 endif
235
236 test_transport_api_tcp_SOURCES = \
237  test_transport_api.c
238 test_transport_api_tcp_LDADD = \
239  $(top_builddir)/src/transport/libgnunettransport.la \
240  $(top_builddir)/src/util/libgnunetutil.la  
241
242 test_transport_api_tcp_nat_SOURCES = \
243  test_transport_api.c
244 test_transport_api_tcp_nat_LDADD = \
245  $(top_builddir)/src/transport/libgnunettransport.la \
246  $(top_builddir)/src/util/libgnunetutil.la  
247
248 test_transport_api_reliability_tcp_SOURCES = \
249  test_transport_api_reliability.c
250 test_transport_api_reliability_tcp_LDADD = \
251  $(top_builddir)/src/transport/libgnunettransport.la \
252  $(top_builddir)/src/util/libgnunetutil.la  
253
254 test_transport_api_reliability_tcp_nat_SOURCES = \
255  test_transport_api_reliability.c
256 test_transport_api_reliability_tcp_nat_LDADD = \
257  $(top_builddir)/src/transport/libgnunettransport.la \
258  $(top_builddir)/src/util/libgnunetutil.la 
259
260 test_transport_api_reliability_udp_SOURCES = \
261  test_transport_api_reliability.c
262 test_transport_api_reliability_udp_LDADD = \
263  $(top_builddir)/src/transport/libgnunettransport.la \
264  $(top_builddir)/src/util/libgnunetutil.la   
265
266 test_transport_api_udp_SOURCES = \
267  test_transport_api.c
268 test_transport_api_udp_LDADD = \
269  $(top_builddir)/src/transport/libgnunettransport.la \
270  $(top_builddir)/src/util/libgnunetutil.la  
271
272 test_transport_api_udp_nat_SOURCES = \
273  test_transport_api.c
274 test_transport_api_udp_nat_LDADD = \
275  $(top_builddir)/src/transport/libgnunettransport.la \
276  $(top_builddir)/src/util/libgnunetutil.la  
277
278 if HAVE_MHD
279
280 test_plugin_transport_http_SOURCES = \
281  test_plugin_transport_http.c
282 test_plugin_transport_http_LDADD = \
283  $(top_builddir)/src/transport/libgnunettransport.la \
284  $(top_builddir)/src/statistics/libgnunetstatistics.la \
285  @LIBCURL@ \
286  $(top_builddir)/src/util/libgnunetutil.la  
287
288 test_transport_api_http_SOURCES = \
289  test_transport_api.c
290 test_transport_api_http_LDADD = \
291  $(top_builddir)/src/transport/libgnunettransport.la \
292  $(top_builddir)/src/util/libgnunetutil.la  
293
294 test_transport_api_reliability_http_SOURCES = \
295  test_transport_api_reliability.c
296 test_transport_api_reliability_http_LDADD = \
297  $(top_builddir)/src/transport/libgnunettransport.la \
298  $(top_builddir)/src/util/libgnunetutil.la
299  
300 test_plugin_transport_https_SOURCES = \
301  test_plugin_transport_https.c
302 test_plugin_transport_https_LDADD = \
303  $(top_builddir)/src/transport/libgnunettransport.la \
304  $(top_builddir)/src/statistics/libgnunetstatistics.la \
305  @LIBCURL@ \
306  $(top_builddir)/src/util/libgnunetutil.la  
307
308 test_transport_api_https_SOURCES = \
309  test_transport_api.c
310 test_transport_api_https_LDADD = \
311  $(top_builddir)/src/transport/libgnunettransport.la \
312  $(top_builddir)/src/util/libgnunetutil.la  
313
314 test_transport_api_reliability_https_SOURCES = \
315  test_transport_api_reliability.c
316 test_transport_api_reliability_https_LDADD = \
317  $(top_builddir)/src/transport/libgnunettransport.la \
318  $(top_builddir)/src/util/libgnunetutil.la
319
320 test_quota_compliance_tcp_SOURCES = \
321  test_quota_compliance.c
322 test_quota_compliance_tcp_LDADD = \
323  $(top_builddir)/src/transport/libgnunettransport.la \
324  $(top_builddir)/src/util/libgnunetutil.la
325
326 test_quota_compliance_tcp_asymmetric_recv_constant_SOURCES = \
327  test_quota_compliance.c
328 test_quota_compliance_tcp_asymmetric_recv_constant_LDADD = \
329  $(top_builddir)/src/transport/libgnunettransport.la \
330  $(top_builddir)/src/util/libgnunetutil.la
331  
332  test_quota_compliance_tcp_asymmetric_send_constant_SOURCES = \
333  test_quota_compliance.c
334 test_quota_compliance_tcp_asymmetric_send_constant_LDADD = \
335  $(top_builddir)/src/transport/libgnunettransport.la \
336  $(top_builddir)/src/util/libgnunetutil.la
337
338 test_quota_compliance_http_SOURCES = \
339  test_quota_compliance.c
340 test_quota_compliance_http_LDADD = \
341  $(top_builddir)/src/transport/libgnunettransport.la \
342  $(top_builddir)/src/util/libgnunetutil.la
343
344 test_quota_compliance_https_SOURCES = \
345  test_quota_compliance.c
346 test_quota_compliance_https_LDADD = \
347  $(top_builddir)/src/transport/libgnunettransport.la \
348  $(top_builddir)/src/util/libgnunetutil.la
349
350 test_quota_compliance_udp_SOURCES = \
351  test_quota_compliance.c
352 test_quota_compliance_udp_LDADD = \
353  $(top_builddir)/src/transport/libgnunettransport.la \
354  $(top_builddir)/src/util/libgnunetutil.la
355
356 endif
357
358
359 EXTRA_DIST = \
360   test_transport_api_data.conf \
361   test_transport_api_tcp_peer1.conf \
362   test_transport_api_tcp_peer2.conf \
363   test_transport_api_udp_peer1.conf \
364   test_transport_api_udp_peer2.conf \
365   test_transport_api_udp_nat_peer1.conf \
366   test_transport_api_udp_nat_peer2.conf \
367   test_transport_api_tcp_nat_peer1.conf \
368   test_transport_api_tcp_nat_peer2.conf \
369   test_plugin_transport_data.conf \
370   test_transport_api_http_peer1.conf \
371   test_transport_api_http_peer2.conf \
372   test_transport_api_https_peer1.conf \
373   test_transport_api_https_peer2.conf \
374   test_transport_api_rel_http_peer1.conf \
375   test_transport_api_rel_http_peer2.conf \
376   test_transport_api_rel_https_peer1.conf \
377   test_transport_api_rel_https_peer2.conf \
378   test_plugin_transport_data_http.conf \
379   test_plugin_transport_data.conf \
380   test_quota_compliance_data.conf \
381   test_quota_compliance_tcp_peer1.conf \
382   test_quota_compliance_tcp_peer2.conf \
383   test_quota_compliance_http_peer1.conf \
384   test_quota_compliance_http_peer2.conf \
385   test_quota_compliance_https_peer1.conf \
386   test_quota_compliance_https_peer2.conf \
387   test_quota_compliance_udp_peer1.conf \
388   test_quota_compliance_udp_peer2.conf