-code cleanup
authorChristian Grothoff <christian@grothoff.org>
Thu, 29 Oct 2015 14:44:56 +0000 (14:44 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 29 Oct 2015 14:44:56 +0000 (14:44 +0000)
21 files changed:
src/transport/test_quota_compliance.c
src/transport/test_transport_address_switch.c
src/transport/test_transport_api.c
src/transport/test_transport_api_bidirectional_connect.c
src/transport/test_transport_api_blacklisting.c
src/transport/test_transport_api_disconnect.c
src/transport/test_transport_api_limited_sockets.c
src/transport/test_transport_api_manipulation_cfg.c
src/transport/test_transport_api_manipulation_recv_tcp.c
src/transport/test_transport_api_manipulation_send_tcp.c
src/transport/test_transport_api_monitor_peers.c
src/transport/test_transport_api_monitor_validation.c
src/transport/test_transport_api_reliability.c
src/transport/test_transport_api_restart_1peer.c
src/transport/test_transport_api_restart_2peers.c
src/transport/test_transport_api_timeout.c
src/transport/test_transport_api_unreliability_constant.c
src/transport/test_transport_blacklisting.c
src/transport/test_transport_testing.c
src/transport/transport-testing.c
src/transport/transport-testing.h

index 7af8e139ed7e3b1654d0258e8dc4105cd127fd28..b53bda514e953c9b9fa2a668ec196a1a2cf6f196 100644 (file)
@@ -73,7 +73,7 @@ unsigned long long quota_out_p2;
 
 struct GNUNET_TRANSPORT_TESTING_handle *tth;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 
 /*
index 52d8c441fb04323785da37c2f61bee48b340c09f..69e83115c122d5445a659e98cc6766a3c7f7dfea 100644 (file)
@@ -108,7 +108,7 @@ static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
 static struct GNUNET_TRANSPORT_TESTING_handle *tth;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static int test_connected;
 
index 30f4bbbabe632aa93776dc02def02291b2a61e4b..17100420463ac04c3c458a9c1a8717a8af2d83bf 100644 (file)
@@ -66,7 +66,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 85925b1bf24254e50dffbfe0a428966f3d56f653..5c9ae36fe073ccf42a4d261c42746e9944b9e0df 100644 (file)
@@ -57,8 +57,8 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc1;
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc2;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc1;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc2;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 0ea99c3a6d996fbae9747a69c80c030b20e581d5..9c3a0c4607790a1c85ab2cae5be637236518f022 100644 (file)
@@ -32,7 +32,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index fe43b8e8c402b07babb05f95711827ea398115a0..7951c76782eba3eb97f56d1434007e13766c2d7c 100644 (file)
@@ -55,7 +55,7 @@ struct PeerContext *p1;
 
 struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 4bc0133cb75efc378dd145a7e2a08f4425ea3e4d..9223c3bf2dc6f4047c68a465e9ba88bf6aea9fb6 100644 (file)
@@ -63,7 +63,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index aa1f57a2a3b0a215cf1bc3566e3ee5f6224aa6c7..41ad7f68f37cd37ca653c70b53683ec8c0708703 100644 (file)
@@ -75,7 +75,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 7be1cfd3a6d884dcc7f5d310abdcdd2bede6a203..8a820fa162a433b79f24b9794b67d1d1f32b6a6d 100644 (file)
@@ -67,7 +67,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 4dae7e6aa116cd89337c50679eaaaff7a1b74949..0a52556abe7db4cf5813308b61fc9df36970521d 100644 (file)
@@ -67,7 +67,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 13a7baec8466323b085efca14e107e41cadf0a26..8cd952cc541a3962c751a402b6e8d93bc9405a30 100644 (file)
@@ -61,7 +61,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 0b2a730594a250cfefa8741dba81c85255832827..76fa66949bfce5c8aed3075b9fa416057ac5dc8d 100644 (file)
@@ -64,7 +64,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 0b80477bfbb330db921f3b8c6b4b88685cc88560..0561e1a100bd212f3b84ec76b716da3394c74cd3 100644 (file)
@@ -161,7 +161,7 @@ static int test_send_timeout;
  */
 static char bitmap[TOTAL_MSGS / 8];
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 /*
  * END Testcase specific declarations
index 5d51559b712279c2ac232704cc7924750d7cefd0..0e91fa68f4140fa867d73420bcb90090045694b7 100644 (file)
@@ -59,7 +59,7 @@ static struct PeerContext *p2;
 
 static int p2_connected;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index db1c0920d728a5fa12d9b77ff18e22f4d75a8055..5b47ee1d35bb5646de71d5dda0e1f030d1b54d0f 100644 (file)
@@ -54,7 +54,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 7ba74b2e9295f2baf5d31774152e5e165713860f..dd0d9a3440f39fa2373bf1e78db3c5593866973f 100644 (file)
@@ -58,7 +58,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
index 6f2ba91c07c63906c95cf212e8d1038a39564c85..a0720820d486418bd233bb8fef6355d07c277297 100644 (file)
@@ -66,7 +66,7 @@ char *cfg_file_p2;
 uint32_t max_bps_p1;
 uint32_t max_bps_p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 /*
  * Testcase specific declarations
index 2972e7dae894ec5afa72f9d80fcb5341eb3c0875..3d3d009dc36fd57147c5567b7260939b0915d04f 100644 (file)
@@ -58,7 +58,7 @@ struct PeerContext *p1;
 
 struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 struct GNUNET_TRANSPORT_TESTING_handle *tth;
 
index 727d6b78522c3d1b224471d966a39ed6b5476144..0c2043119c0ceb328755f038944f94eb9a2dc8e9 100644 (file)
@@ -40,7 +40,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 struct GNUNET_TRANSPORT_TESTING_handle *tth;
 
index 993103ac19bdd9fc4f8a6fc893e8220d91d54a1b..86c67a039c3b8208ae80aa084b99055e8869cff3 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2006, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006, 2009, 2015 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -48,12 +48,13 @@ find_peer_context (struct GNUNET_TRANSPORT_TESTING_handle *tth,
 }
 
 
-static struct ConnectingContext *
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest *
 find_connecting_context (struct GNUNET_TRANSPORT_TESTING_handle *tth,
-                         struct PeerContext *p1, struct PeerContext *p2)
+                         struct PeerContext *p1,
+                         struct PeerContext *p2)
 {
   GNUNET_assert (tth != NULL);
-  struct ConnectingContext *cc = tth->cc_head;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = tth->cc_head;
 
   while (cc != NULL)
   {
@@ -69,7 +70,8 @@ find_connecting_context (struct GNUNET_TRANSPORT_TESTING_handle *tth,
 
 
 static void
-notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
+notify_connect (void *cls,
+                const struct GNUNET_PeerIdentity *peer)
 {
   struct PeerContext *p = cls;
   char *p2_s;
@@ -93,7 +95,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
   GNUNET_free (p2_s);
 
   /* Find ConnectingContext */
-  struct ConnectingContext *cc = find_connecting_context (p->tth, p, p2);
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = find_connecting_context (p->tth, p, p2);
 
   if (cc == NULL)
     return;
@@ -113,7 +115,8 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
 
 
 static void
-notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
+notify_disconnect (void *cls,
+                   const struct GNUNET_PeerIdentity *peer)
 {
   struct PeerContext *p = cls;
 
@@ -149,7 +152,8 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
 
 
 static void
-notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
+notify_receive (void *cls,
+                const struct GNUNET_PeerIdentity *peer,
                 const struct GNUNET_MessageHeader *message)
 {
   struct PeerContext *p = cls;
@@ -162,7 +166,8 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 
 static void
-get_hello (void *cb_cls, const struct GNUNET_MessageHeader *message)
+get_hello (void *cb_cls,
+           const struct GNUNET_MessageHeader *message)
 {
   struct PeerContext *p = cb_cls;
   struct GNUNET_PeerIdentity hello_id;
@@ -187,9 +192,10 @@ get_hello (void *cb_cls, const struct GNUNET_MessageHeader *message)
 
 
 static void
-try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+try_connect (void *cls,
+             const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct ConnectingContext *cc = cls;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
   struct PeerContext *p1 = cc->p1;
   struct PeerContext *p2 = cc->p2;
 
@@ -477,18 +483,16 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth,
  * @param cls callback cls
  * @return a connect request handle
  */
-GNUNET_TRANSPORT_TESTING_ConnectRequest
+struct GNUNET_TRANSPORT_TESTING_ConnectRequest *
 GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle *tth,
                                         struct PeerContext *p1,
                                         struct PeerContext *p2,
                                         GNUNET_TRANSPORT_TESTING_connect_cb cb,
                                         void *cls)
 {
-  GNUNET_assert (tth != NULL);
-
-  struct ConnectingContext *cc =
-      GNUNET_new (struct ConnectingContext);
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = GNUNET_new (struct GNUNET_TRANSPORT_TESTING_ConnectRequest);
 
+  GNUNET_assert (tth != NULL);
   GNUNET_assert (p1 != NULL);
   GNUNET_assert (p2 != NULL);
   cc->p1 = p1;
@@ -502,7 +506,9 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle *
   cc->th_p2 = p2->th;
   GNUNET_assert (cc->th_p1 != NULL);
   GNUNET_assert (cc->th_p2 != NULL);
-  GNUNET_CONTAINER_DLL_insert (tth->cc_head, tth->cc_tail, cc);
+  GNUNET_CONTAINER_DLL_insert (tth->cc_head,
+                               tth->cc_tail,
+                               cc);
   cc->tct = GNUNET_SCHEDULER_add_now (&try_connect, cc);
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "New connect request %p\n",
@@ -517,17 +523,12 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle *
  * Tou MUST cancel the request if you stop the peers before the peers connected succesfully
  *
  * @param tth transport testing handle
- * @param ccr a connect request handle
+ * @param cc a connect request handle
  */
 void
-GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
-                                               GNUNET_TRANSPORT_TESTING_handle
-                                               *tth,
-                                               GNUNET_TRANSPORT_TESTING_ConnectRequest
-                                               ccr)
+GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct GNUNET_TRANSPORT_TESTING_handle *tth,
+                                               struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc)
 {
-  struct ConnectingContext *cc = ccr;
-
   GNUNET_assert (tth != NULL);
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -550,8 +551,8 @@ GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
 void
 GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle *tth)
 {
-  struct ConnectingContext *cc = tth->cc_head;
-  struct ConnectingContext *ct = NULL;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = tth->cc_head;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *ct = NULL;
   struct PeerContext *p = tth->p_head;
   struct PeerContext *t = NULL;
 
@@ -596,11 +597,14 @@ GNUNET_TRANSPORT_TESTING_init ()
   tth = GNUNET_new (struct GNUNET_TRANSPORT_TESTING_handle);
 
   /* Init testing the testing lib */
-  tth->tl_system = GNUNET_TESTING_system_create ("transport-testing", NULL,
-                                                 NULL, NULL);
+  tth->tl_system = GNUNET_TESTING_system_create ("transport-testing",
+                                                 NULL,
+                                                 NULL,
+                                                 NULL);
   if (NULL == tth->tl_system)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to initialize testing library!\n"));
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                _("Failed to initialize testing library!\n"));
     GNUNET_free (tth);
     return NULL;
   }
@@ -671,7 +675,8 @@ extract_filename (const char *file)
  * @param dest where to store result
  */
 void
-GNUNET_TRANSPORT_TESTING_get_test_name (const char *file, char **dest)
+GNUNET_TRANSPORT_TESTING_get_test_name (const char *file,
+                                        char **dest)
 {
   char *filename = extract_filename (file);
   char *backup = filename;
@@ -708,7 +713,8 @@ suc:
  * @param dest where to store result
  */
 void
-GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file, char **dest)
+GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file,
+                                               char **dest)
 {
   char *src = extract_filename (file);
   char *split;
@@ -732,7 +738,8 @@ GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file, char **dest)
  */
 void
 GNUNET_TRANSPORT_TESTING_get_test_plugin_name (const char *file,
-                                               const char *test, char **dest)
+                                               const char *test,
+                                               char **dest)
 {
   char *filename;
   char *dotexe;
@@ -776,7 +783,8 @@ suc:
  * @param count peer number
  */
 void
-GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **dest,
+GNUNET_TRANSPORT_TESTING_get_config_name (const char *file,
+                                          char **dest,
                                           int count)
 {
   char *filename = extract_filename (file);
index 0e84ac2368c67c5539cae47c816d1a4338fb4d8b..dcac29185097163f54f7025a59aafab5e5242bc6 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2006, 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006, 2009, 2015 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -31,7 +31,7 @@
 #include "gnunet_testing_lib.h"
 
 
-#define GNUNET_TRANSPORT_TESTING_ConnectRequest void *
+struct GNUNET_TRANSPORT_TESTING_ConnectRequest;
 
 
 /**
@@ -43,16 +43,18 @@ struct PeerContext;
  * Callback when two peers are connected and both have called the connect callback
  * to notify clients about a new peer
  */
-typedef void (*GNUNET_TRANSPORT_TESTING_start_cb) (struct PeerContext * p,
-                                                   void *cls);
+typedef void
+(*GNUNET_TRANSPORT_TESTING_start_cb) (struct PeerContext *p,
+                                      void *cls);
 
 /**
  * Callback when two peers are connected and both have called the connect callback
  * to notify clients about a new peer
  */
-typedef void (*GNUNET_TRANSPORT_TESTING_connect_cb) (struct PeerContext * p1,
-                                                     struct PeerContext * p2,
-                                                     void *cls);
+typedef void
+(*GNUNET_TRANSPORT_TESTING_connect_cb) (struct PeerContext *p1,
+                                        struct PeerContext *p2,
+                                        void *cls);
 
 
 /**
@@ -147,13 +149,13 @@ struct PeerContext
 };
 
 
-struct ConnectingContext
+struct GNUNET_TRANSPORT_TESTING_ConnectRequest
 {
-  struct ConnectingContext *next;
-  struct ConnectingContext *prev;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *next;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *prev;
   struct PeerContext *p1;
   struct PeerContext *p2;
-  struct GNUNET_SCHEDULER_Task * tct;
+  struct GNUNET_SCHEDULER_Task *tct;
   GNUNET_TRANSPORT_TESTING_connect_cb cb;
   void *cb_cls;
   struct GNUNET_TRANSPORT_Handle *th_p1;
@@ -172,12 +174,12 @@ struct GNUNET_TRANSPORT_TESTING_handle
   /**
    * head DLL of connect contexts
    */
-  struct ConnectingContext *cc_head;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc_head;
 
   /**
    * head DLL of connect contexts
    */
-  struct ConnectingContext *cc_tail;
+  struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc_tail;
 
   /**
    * head DLL of peers
@@ -192,20 +194,22 @@ struct GNUNET_TRANSPORT_TESTING_handle
 
 
 /**
-* Start a peer with the given configuration
-* @param tth the testing handle
-* @param cfgname configuration file
-* @param peer_id the peer_id
-* @param rec receive callback
-* @param nc connect callback
-* @param nd disconnect callback
-* @param start_cb start callback
-* @param cb_cls closure for callback
-* @return the peer context
-*/
+ * Start a peer with the given configuration
+ *
+ * @param tth the testing handle
+ * @param cfgname configuration file
+ * @param peer_id the peer_id
+ * @param rec receive callback
+ * @param nc connect callback
+ * @param nd disconnect callback
+ * @param start_cb start callback
+ * @param cb_cls closure for callback
+ * @return the peer context
+ */
 struct PeerContext *
-GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle
-                                     *tth, const char *cfgname, int peer_id,
+GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth,
+                                     const char *cfgname,
+                                     int peer_id,
                                      GNUNET_TRANSPORT_ReceiveCallback rec,
                                      GNUNET_TRANSPORT_NotifyConnect nc,
                                      GNUNET_TRANSPORT_NotifyDisconnect nd,
@@ -215,30 +219,32 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle
 
 /**
  * shutdown the given peer
+ *
  * @param tth the testing handle
  * @param p the peer
  */
-
 void
 GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth,
                                     struct PeerContext *pc);
 
 
 /**
-* Restart the given peer
-* @param tth testing handle
-* @param p the peer
-* @param cfgname the cfg file used to restart
-* @param restart_cb restart callback
-* @param cb_cls callback closure
-* @return GNUNET_OK in success otherwise GNUNET_SYSERR
-*/
+ * Restart the given peer
+ *
+ * @param tth testing handle
+ * @param p the peer
+ * @param cfgname the cfg file used to restart
+ * @param restart_cb restart callback
+ * @param cb_cls callback closure
+ * @return #GNUNET_OK in success otherwise #GNUNET_SYSERR
+ */
 int
-GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_handle
-                                       *tth, struct PeerContext *p,
+GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth,
+                                       struct PeerContext *p,
                                        const char *cfgname,
-                                       GNUNET_TRANSPORT_TESTING_start_cb
-                                       restart_cb, void *cb_cls);
+                                       GNUNET_TRANSPORT_TESTING_start_cb restart_cb,
+                                       void *cb_cls);
+
 
 /**
  * Connect the given peers and call the callback when both peers report the
@@ -252,25 +258,23 @@ GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_handle
  * @param cls callback cls
  * @return a connect request handle
  */
-GNUNET_TRANSPORT_TESTING_ConnectRequest
+struct GNUNET_TRANSPORT_TESTING_ConnectRequest *
 GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle *tth,
                                         struct PeerContext *p1,
                                         struct PeerContext *p2,
                                         GNUNET_TRANSPORT_TESTING_connect_cb cb,
                                         void *cls);
 
+
 /**
  * Cancel the request to connect two peers
  * Tou MUST cancel the request if you stop the peers before the peers connected succesfully
  * @param tth testing
- * @param ccr a connect request handle
+ * @param cc a connect request handle
  */
 void
-GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
-                                               GNUNET_TRANSPORT_TESTING_handle
-                                               *tth,
-                                               GNUNET_TRANSPORT_TESTING_ConnectRequest
-                                               ccr);
+GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct GNUNET_TRANSPORT_TESTING_handle *tth,
+                                               struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc);
 
 /**
  * Clean up the transport testing
@@ -284,7 +288,7 @@ GNUNET_TRANSPORT_TESTING_done (struct GNUNET_TRANSPORT_TESTING_handle *tth);
  * @return transport testing handle
  */
 struct GNUNET_TRANSPORT_TESTING_handle *
-GNUNET_TRANSPORT_TESTING_init ();
+GNUNET_TRANSPORT_TESTING_init (void);
 
 /*
  * Some utility functions
@@ -296,7 +300,8 @@ GNUNET_TRANSPORT_TESTING_init ();
  * @param dest where to store result
  */
 void
-GNUNET_TRANSPORT_TESTING_get_test_name (const char *file, char **dest);
+GNUNET_TRANSPORT_TESTING_get_test_name (const char *file,
+                                        char **dest);
 
 /**
  * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and
@@ -307,7 +312,8 @@ GNUNET_TRANSPORT_TESTING_get_test_name (const char *file, char **dest);
  * @param count peer number
  */
 void
-GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **dest,
+GNUNET_TRANSPORT_TESTING_get_config_name (const char *file,
+                                          char **dest,
                                           int count);