- coverity
[oweals/gnunet.git] / src / transport / Makefile.am
index 6447b115297696a1705c28f25dffca0edab78aa8..b8d220e7281d81116259eba7c6f2dffb22995618 100644 (file)
@@ -12,30 +12,32 @@ if HAVE_MHD
  GN_LIBMHD = -lmicrohttpd
  HTTP_SERVER_PLUGIN_LA = libgnunet_plugin_transport_http_server.la
  HTTPS_SERVER_PLUGIN_LA = libgnunet_plugin_transport_https_server.la
+ HTTP_SERVER_PLUGIN_TEST = test_plugin_http_server
+ HTTPS_SERVER_PLUGIN_TEST = test_plugin_https_server
 endif
 
-HTTP_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_http_client.la
-HTTPS_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_https_client.la
-
+if HAVE_LIBCURL
+ HTTP_CLIENT_PLUGIN_TEST = test_plugin_http_client
+ HTTPS_CLIENT_PLUGIN_TEST = test_plugin_https_client
+ HTTP_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_http_client.la
+ HTTPS_CLIENT_PLUGIN_LA = libgnunet_plugin_transport_https_client.la
+endif
 
-if FALSE 
+if HAVE_MHD 
+if HAVE_LIBCURL
  HTTP_API_TEST = test_transport_api_http
- HTTP_NAT_API_TEST = test_transport_api_http_nat
+ HTTP_REVERSE_API_TEST = test_transport_api_http_reverse
  HTTP_API_TIMEOUT_TEST = test_transport_api_timeout_http
  HTTP_REL_TEST = test_transport_api_reliability_http
- HTTP_NAT_REL_TEST = test_transport_api_reliability_http_nat
  HTTP_QUOTA_TEST = test_quota_compliance_http \
                   test_quota_compliance_http_asymmetric
-
  HTTPS_API_TEST = test_transport_api_https
- HTTPS_NAT_API_TEST = test_transport_api_https_nat
  HTTPS_API_TIMEOUT_TEST = test_transport_api_timeout_https
  HTTPS_REL_TEST = test_transport_api_reliability_https
- HTTPS_NAT_REL_TEST = test_transport_api_reliability_https_nat
  HTTPS_QUOTA_TEST = test_quota_compliance_https \
-               test_quota_compliance_https_asymmetric
+               test_quota_compliance_https_asymmetric 
 endif
-
+endif 
 
 if USE_COVERAGE
   AM_CFLAGS = --coverage -O0
@@ -46,6 +48,7 @@ if LINUX
  WLAN_BIN_DUMMY = gnunet-helper-transport-wlan-dummy
  WLAN_BIN_SENDER = gnunet-transport-wlan-sender
  WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la
+ WLAN_PLUGIN_TEST = test_plugin_wlan
  WLAN_API_TEST = test_transport_api_wlan
  WLAN_REL_TEST = test_transport_api_reliability_wlan
  WLAN_UREL_TEST = test_transport_api_unreliability_wlan
@@ -64,6 +67,7 @@ endif
 if !MINGW
 UNIX_PLUGIN_LA = libgnunet_plugin_transport_unix.la
 UNIX_PLUGIN_TEST = test_transport_api_unix 
+UNIX_TEST = test_plugin_unix
 UNIX_PLUGIN_TIMEOUT_TEST = test_transport_api_timeout_unix
 UNIX_REL_TEST = test_transport_api_unreliability_unix
 UNIX_QUOTA_TEST = test_quota_compliance_unix \
@@ -158,6 +162,9 @@ gnunet_service_transport_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
   $(GN_GLPK) \
   $(GN_LIBINTL)
+gnunet_service_transport_CFLAGS = \
+  $(CFLAGS)
+# -DANALYZE
 
 plugin_LTLIBRARIES = \
   libgnunet_plugin_transport_tcp.la \
@@ -225,10 +232,10 @@ libgnunet_plugin_transport_unix_la_LIBADD = \
   $(LTLIBINTL)
 libgnunet_plugin_transport_unix_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
+
+
 libgnunet_plugin_transport_http_client_la_SOURCES = \
-  plugin_transport_http_client.c
+  plugin_transport_http_client.c plugin_transport_http_common.c
 libgnunet_plugin_transport_http_client_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
@@ -236,16 +243,16 @@ libgnunet_plugin_transport_http_client_la_LIBADD = \
   @LIBCURL@ \
   $(top_builddir)/src/nat/libgnunetnat.la \
   $(top_builddir)/src/util/libgnunetutil.la 
-libgnunet_plugin_transport_http_client_laLDFLAGS = \
+libgnunet_plugin_transport_http_client_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_http_client_la_CFLAGS = \
  $(CFLAGS) 
 libgnunet_plugin_transport_http_client_la_CPPFLAGS = \
  @LIBCURL_CPPFLAGS@
+
+
 libgnunet_plugin_transport_http_server_la_SOURCES = \
-  plugin_transport_http_server.c
+  plugin_transport_http_server.c plugin_transport_http_common.c
 libgnunet_plugin_transport_http_server_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
@@ -259,7 +266,7 @@ libgnunet_plugin_transport_http_server_la_CFLAGS = \
  $(CFLAGS) 
 
 libgnunet_plugin_transport_https_client_la_SOURCES = \
-  plugin_transport_http_client.c
+  plugin_transport_http_client.c plugin_transport_http_common.c
 libgnunet_plugin_transport_https_client_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
@@ -267,16 +274,16 @@ libgnunet_plugin_transport_https_client_la_LIBADD = \
   @LIBCURL@ \
   $(top_builddir)/src/nat/libgnunetnat.la \
   $(top_builddir)/src/util/libgnunetutil.la 
-libgnunet_plugin_transport_https_client_laLDFLAGS = \
+libgnunet_plugin_transport_https_client_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_https_client_la_CFLAGS = \
- $(CFLAGS) 
+ $(CFLAGS) -DBUILD_HTTPS 
 libgnunet_plugin_transport_https_client_la_CPPFLAGS = \
  @LIBCURL_CPPFLAGS@
+
+
 libgnunet_plugin_transport_https_server_la_SOURCES = \
-  plugin_transport_http_server.c
+  plugin_transport_http_server.c plugin_transport_http_common.c
 libgnunet_plugin_transport_https_server_la_LIBADD = \
   $(top_builddir)/src/hello/libgnunethello.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
@@ -287,13 +294,21 @@ libgnunet_plugin_transport_https_server_la_LDFLAGS = \
  $(GN_LIBMHD) \
  $(GN_PLUGIN_LDFLAGS)
 libgnunet_plugin_transport_https_server_la_CFLAGS = \
- $(CFLAGS) 
+ $(CFLAGS) -DBUILD_HTTPS 
 
 check_PROGRAMS = \
  test_transport_testing_startstop \
  test_transport_testing_restart \
  test_transport_testing \
  test_transport_startonly \
+ test_plugin_tcp \
+ test_plugin_udp \
+ $(UNIX_TEST) \
+ $(WLAN_PLUGIN_TEST) \
+ $(HTTP_CLIENT_PLUGIN_TEST) \
+ $(HTTPS_CLIENT_PLUGIN_TEST) \
+ $(HTTP_SERVER_PLUGIN_TEST) \
+ $(HTTPS_SERVER_PLUGIN_TEST) \
  test_transport_api_blacklisting \
  test_transport_api_disconnect_tcp \
  test_transport_api_bidirectional_connect \
@@ -309,10 +324,9 @@ check_PROGRAMS = \
  $(UNIX_PLUGIN_TIMEOUT_TEST) \
  test_transport_api_udp_nat \
  $(HTTP_API_TEST) \
- $(HTTP_NAT_API_TEST) \
+ $(HTTP_REVERSE_API_TEST) \
  $(HTTP_API_TIMEOUT_TEST) \
  $(HTTPS_API_TEST) \
- $(HTTPS_NAT_API_TEST) \
  $(HTTPS_API_TIMEOUT_TEST) \
  $(WLAN_API_TEST) \
  test_transport_api_multi \
@@ -322,9 +336,7 @@ check_PROGRAMS = \
  test_transport_api_unreliability_constant_udp \
  $(UNIX_REL_TEST) \
  $(HTTP_REL_TEST) \
- $(HTTP_NAT_REL_TEST) \
  $(HTTPS_REL_TEST) \
- $(HTTPS_NAT_REL_TEST) \
  $(WLAN_REL_TEST) \
  $(WLAN_UREL_TEST) \
  test_quota_compliance_tcp \
@@ -341,6 +353,10 @@ TESTS = \
  test_transport_testing_restart \
  test_transport_testing \
  test_transport_startonly \
+ test_plugin_tcp \
+ test_plugin_udp \
+ $(UNIX_TEST) \
+ $(WLAN_PLUGIN_TEST) \
  test_transport_api_blacklisting \
  test_transport_api_disconnect_tcp \
  test_transport_api_bidirectional_connect \
@@ -356,10 +372,8 @@ TESTS = \
  $(UNIX_PLUGIN_TIMEOUT_TEST) \
  test_transport_api_udp_nat \
  $(HTTP_API_TEST) \
- $(HTTP_NAT_API_TEST) \
  $(HTTP_API_TIMEOUT_TEST) \
  $(HTTPS_API_TEST) \
- $(HTTPS_NAT_API_TEST) \
  $(HTTPS_API_TIMEOUT_TEST) \
  $(WLAN_API_TEST) \
  test_transport_api_multi \
@@ -369,9 +383,7 @@ TESTS = \
  test_transport_api_unreliability_constant_udp \
  $(UNIX_REL_TEST) \
  $(HTTP_REL_TEST) \
- $(HTTP_NAT_REL_TEST) \
  $(HTTPS_REL_TEST) \
- $(HTTPS_NAT_REL_TEST) \
  $(WLAN_REL_TEST) \
  $(WLAN_UREL_TEST) \
  test_quota_compliance_tcp \
@@ -434,6 +446,78 @@ test_transport_startonly_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/transport/libgnunettransporttesting.la 
 
+test_plugin_tcp_SOURCES = \
+ test_plugin_transport.c
+test_plugin_tcp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+test_plugin_udp_SOURCES = \
+ test_plugin_transport.c
+test_plugin_udp_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+
+test_plugin_unix_SOURCES = \
+ test_plugin_transport.c
+test_plugin_unix_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+
+test_plugin_wlan_SOURCES = \
+ test_plugin_transport.c
+test_plugin_wlan_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
+
+test_plugin_http_server_SOURCES = \
+ test_plugin_transport.c
+test_plugin_http_server_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
+
+test_plugin_https_server_SOURCES = \
+ test_plugin_transport.c
+test_plugin_https_server_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
+
+test_plugin_http_client_SOURCES = \
+ test_plugin_transport.c
+test_plugin_http_client_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
+
+test_plugin_https_client_SOURCES = \
+ test_plugin_transport.c
+test_plugin_https_client_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la  
+
 test_transport_api_tcp_SOURCES = \
  test_transport_api.c
 test_transport_api_tcp_LDADD = \
@@ -564,85 +648,34 @@ test_transport_api_unix_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/transport/libgnunettransporttesting.la 
 
-# HTTP/S tests
-if FALSE
-
-test_transport_api_timeout_http_SOURCES = \
- test_transport_api_timeout.c
-test_transport_api_timeout_http_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-test_transport_api_timeout_https_SOURCES = \
- test_transport_api_timeout.c
-test_transport_api_timeout_https_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-
+# HTTP tests
 test_transport_api_http_SOURCES = \
  test_transport_api.c
 test_transport_api_http_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-test_transport_api_http_nat_SOURCES = \
- test_transport_api.c
-test_transport_api_http_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-test_transport_api_reliability_http_SOURCES = \
- test_transport_api_reliability.c
-test_transport_api_reliability_http_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-test_transport_api_reliability_http_nat_SOURCES = \
- test_transport_api_reliability.c
-test_transport_api_reliability_http_nat_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
-
-test_transport_api_https_SOURCES = \
- test_transport_api.c
-test_transport_api_https_LDADD = \
- $(top_builddir)/src/transport/libgnunettransport.la \
- $(top_builddir)/src/hello/libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la  \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
 
-test_transport_api_https_nat_SOURCES = \
+test_transport_api_http_reverse_SOURCES = \
  test_transport_api.c
-test_transport_api_https_nat_LDADD = \
+test_transport_api_http_reverse_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
+ $(top_builddir)/src/transport/libgnunettransporttesting.la
 
-test_transport_api_reliability_https_SOURCES = \
- test_transport_api_reliability.c
-test_transport_api_reliability_https_LDADD = \
+test_transport_api_timeout_http_SOURCES = \
+ test_transport_api_timeout.c
+test_transport_api_timeout_http_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/transport/libgnunettransporttesting.la 
+ $(top_builddir)/src/transport/libgnunettransporttesting.la  
 
-test_transport_api_reliability_https_nat_SOURCES = \
+test_transport_api_reliability_http_SOURCES = \
  test_transport_api_reliability.c
-test_transport_api_reliability_https_nat_LDADD = \
+test_transport_api_reliability_http_LDADD = \
  $(top_builddir)/src/transport/libgnunettransport.la \
  $(top_builddir)/src/hello/libgnunethello.la \
  $(top_builddir)/src/util/libgnunetutil.la \
@@ -680,8 +713,31 @@ test_quota_compliance_https_asymmetric_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/transport/libgnunettransporttesting.la
 
+# HTTPS tests
+test_transport_api_https_SOURCES = \
+ test_transport_api.c
+test_transport_api_https_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la  \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
 
-endif
+test_transport_api_timeout_https_SOURCES = \
+ test_transport_api_timeout.c
+test_transport_api_timeout_https_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la  
+
+
+test_transport_api_reliability_https_SOURCES = \
+ test_transport_api_reliability.c
+test_transport_api_reliability_https_LDADD = \
+ $(top_builddir)/src/transport/libgnunettransport.la \
+ $(top_builddir)/src/hello/libgnunethello.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/transport/libgnunettransporttesting.la 
 
 test_transport_api_unreliability_unix_SOURCES = \
  test_transport_api_unreliability.c
@@ -783,6 +839,7 @@ test_transport_api_multi_LDADD = \
 
 
 EXTRA_DIST = \
+test_plugin_hostkey \
 gnunet-transport-certificate-creation \
 template_cfg_peer1.conf\
 template_cfg_peer2.conf\
@@ -856,18 +913,11 @@ test_transport_defaults.conf\
 test_transport_startonly.conf\
 test_transport_api_disconnect_tcp_peer1.conf\
 test_transport_api_disconnect_tcp_peer2.conf\
-test_transport_api_http_nat_peer1.conf\
-test_transport_api_http_nat_peer2.conf\
-test_transport_api_https_nat_peer1.conf\
-test_transport_api_https_nat_peer2.conf\
-test_transport_api_reliability_http_nat_peer1.conf\
-test_transport_api_reliability_http_nat_peer2.conf\
-test_transport_api_reliability_https_nat_peer1.conf\
-test_transport_api_reliability_https_nat_peer2.conf\
 test_transport_api_timeout_http_peer1.conf\
 test_transport_api_timeout_http_peer2.conf\
 test_transport_api_timeout_https_peer1.conf\
 test_transport_api_timeout_https_peer2.conf\
 test_transport_api_unreliability_constant_udp_peer1.conf\
 test_transport_api_unreliability_constant_udp_peer2.conf\
-test_transport_api_http_reverse_proxy.conf
\ No newline at end of file
+test_transport_api_http_reverse_peer1.conf \
+test_transport_api_http_reverse_peer2.conf