wip
[oweals/gnunet.git] / src / transport / test_transport_api.c
index c115d1e5d742cc2ace660d1e83872a20e7669372..d78e3264bb3e85294c727a923b93a41e1f011ef6 100644 (file)
@@ -76,6 +76,8 @@ static int is_tcp_nat;
 
 static int is_udp;
 
+static int is_unix;
+
 static int is_udp_nat;
 
 static int is_http;
@@ -84,6 +86,8 @@ static int is_https;
 
 static int is_multi_protocol;
 
+static int is_wlan;
+
 static  GNUNET_SCHEDULER_TaskIdentifier die_task;
 
 static char * key_file_p1;
@@ -347,7 +351,7 @@ exchange_hello (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received HELLO size %d\n", GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message));
 
-  GNUNET_TRANSPORT_offer_hello (p2.th, message);
+  GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
   GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
 }
 
@@ -367,6 +371,12 @@ run (void *cls,
       setup_peer (&p1, "test_transport_api_udp_peer1.conf");
       setup_peer (&p2, "test_transport_api_udp_peer2.conf");
     }
+  if (is_unix)
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Using unix domain socket transport\n");
+      setup_peer (&p1, "test_transport_api_unix_peer1.conf");
+      setup_peer (&p2, "test_transport_api_unix_peer2.conf");
+    }
   if (is_multi_protocol)
     {
       setup_peer (&p1, "test_transport_api_multi_peer1.conf");
@@ -397,6 +407,11 @@ run (void *cls,
       setup_peer (&p1, "test_transport_api_https_peer1.conf");
       setup_peer (&p2, "test_transport_api_https_peer2.conf");
     }
+  else if (is_wlan)
+    {
+      setup_peer (&p1, "test_transport_api_wlan_peer1.conf");
+      setup_peer (&p2, "test_transport_api_wlan_peer2.conf");
+    }
   GNUNET_assert(p1.th != NULL);
   GNUNET_assert(p2.th != NULL);
 
@@ -627,6 +642,10 @@ main (int argc, char *argv[])
     {
       is_udp = GNUNET_YES;
     }
+  else if (strstr(argv[0], "unix") != NULL)
+    {
+      is_unix = GNUNET_YES;
+    }
   else if (strstr(argv[0], "https") != NULL)
     {
       is_https = GNUNET_YES;
@@ -635,12 +654,15 @@ main (int argc, char *argv[])
     {
       is_http = GNUNET_YES;
     }
+  else if (strstr(argv[0], "wlan") != NULL)
+    {
+       is_wlan = GNUNET_YES;
+    }
   else if (strstr(argv[0], "multi") != NULL)
     {
        is_multi_protocol = GNUNET_YES;
     }
 
-
   ret = check ();
   if (is_multi_protocol)
   {