safety check
[oweals/gnunet.git] / src / transport / test_transport_api.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20 /**
21  * @file transport/test_transport_api.c
22  * @brief base test case for transport implementations
23  *
24  * This test case serves as a base for tcp, udp, and udp-nat
25  * transport test cases.  Based on the executable being run
26  * the correct test case will be performed.  Conservation of
27  * C code apparently.
28  */
29 #include "platform.h"
30 #include "gnunet_common.h"
31 #include "gnunet_hello_lib.h"
32 #include "gnunet_getopt_lib.h"
33 #include "gnunet_os_lib.h"
34 #include "gnunet_program_lib.h"
35 #include "gnunet_scheduler_lib.h"
36 #include "gnunet_transport_service.h"
37 #include "transport.h"
38
39 #define VERBOSE GNUNET_NO
40
41 #define VERBOSE_ARM GNUNET_NO
42
43 #define START_ARM GNUNET_YES
44
45 /**
46  * How long until we give up on transmitting the message?
47  */
48 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
49
50 /**
51  * How long until we give up on transmitting the message?
52  */
53 #define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
54
55 #define MTYPE 12345
56
57 struct PeerContext
58 {
59   struct GNUNET_CONFIGURATION_Handle *cfg;
60   struct GNUNET_TRANSPORT_Handle *th;
61   struct GNUNET_PeerIdentity id;
62 #if START_ARM
63   struct GNUNET_OS_Process *arm_proc;
64 #endif
65 };
66
67 static struct PeerContext p1;
68
69 static struct PeerContext p2;
70
71 static int ok;
72
73 static int is_tcp;
74
75 static int is_tcp_nat;
76
77 static int is_udp;
78
79 static int is_udp_nat;
80
81 static int is_http;
82
83 static int is_https;
84
85 static int is_multi_protocol;
86
87 static  GNUNET_SCHEDULER_TaskIdentifier die_task;
88
89 static char * key_file_p1;
90 static char * cert_file_p1;
91
92 static char * key_file_p2;
93 static char * cert_file_p2;
94
95 #if VERBOSE
96 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
97 #else
98 #define OKPP do { ok++; } while (0)
99 #endif
100
101
102 static void
103 end ()
104 {
105   /* do work here */
106   GNUNET_assert (ok == 6);
107   GNUNET_SCHEDULER_cancel (die_task);
108   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
109   GNUNET_TRANSPORT_disconnect (p1.th);
110   GNUNET_TRANSPORT_disconnect (p2.th);
111
112   die_task = GNUNET_SCHEDULER_NO_TASK;
113   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transports disconnected, returning success!\n");
114   ok = 0;
115 }
116
117 static void
118 stop_arm (struct PeerContext *p)
119 {
120 #if START_ARM
121   if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
122     GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
123   GNUNET_OS_process_wait (p->arm_proc);
124   GNUNET_OS_process_close (p->arm_proc);
125   p->arm_proc = NULL;
126 #endif
127   GNUNET_CONFIGURATION_destroy (p->cfg);
128 }
129
130
131 static void
132 end_badly ()
133 {
134   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
135   GNUNET_break (0);
136   GNUNET_TRANSPORT_disconnect (p1.th);
137   GNUNET_TRANSPORT_disconnect (p2.th);
138   ok = 1;
139 }
140
141 static void
142 notify_receive (void *cls,
143                 const struct GNUNET_PeerIdentity *peer,
144                 const struct GNUNET_MessageHeader *message,
145                 const struct GNUNET_TRANSPORT_ATS_Information *ats,
146                 uint32_t ats_count)
147 {
148   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok is (%d)!\n",
149               ok);
150
151   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %d from peer (%p)!\n",
152                 ntohs(message->type), cls);
153
154   GNUNET_assert (ok == 5);
155   OKPP;
156
157   GNUNET_assert (MTYPE == ntohs (message->type));
158   GNUNET_assert (sizeof (struct GNUNET_MessageHeader) ==
159                  ntohs (message->size));
160   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer (%p)!\n",
161               cls);
162   end ();
163 }
164
165
166 static size_t
167 notify_ready (void *cls, size_t size, void *buf)
168 {
169   struct GNUNET_MessageHeader *hdr;
170
171   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
172               "Transmitting message to peer (%p) - %u!\n", cls, sizeof (struct GNUNET_MessageHeader));
173   GNUNET_assert (size >= 256);
174   GNUNET_assert (ok == 4);
175   OKPP;
176
177   if (buf != NULL)
178   {
179     hdr = buf;
180     hdr->size = htons (sizeof (struct GNUNET_MessageHeader));
181     hdr->type = htons (MTYPE);
182   }
183
184   return sizeof (struct GNUNET_MessageHeader);
185 }
186
187 static size_t
188 notify_ready_connect (void *cls, size_t size, void *buf)
189 {
190   return 0;
191 }
192
193
194 static void
195 notify_connect (void *cls,
196                 const struct GNUNET_PeerIdentity *peer,
197                 const struct GNUNET_TRANSPORT_ATS_Information *ats,
198                 uint32_t ats_count)
199 {
200   if (cls == &p1)
201     {
202       GNUNET_SCHEDULER_cancel (die_task);
203       die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT_TRANSMIT,
204                                                &end_badly, NULL);
205
206       GNUNET_TRANSPORT_notify_transmit_ready (p1.th,
207                                               &p2.id,
208                                               256, 0, TIMEOUT, &notify_ready,
209                                               &p1);
210     }
211   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
212               "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls);
213 }
214
215
216 static void
217 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
218 {
219   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
220               "Peer `%4s' disconnected (%p)!\n",
221               GNUNET_i2s (peer), cls);
222 }
223
224
225 static void
226 setup_peer (struct PeerContext *p, const char *cfgname)
227 {
228   p->cfg = GNUNET_CONFIGURATION_create ();
229 #if START_ARM
230   p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
231                                         "gnunet-service-arm",
232 #if VERBOSE_ARM
233                                         "-L", "DEBUG",
234 #endif
235                                         "-c", cfgname, NULL);
236 #endif
237   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
238
239   if (is_https)
240   {
241           struct stat sbuf;
242           if (p==&p1)
243           {
244                   if (GNUNET_CONFIGURATION_have_value (p->cfg,
245                                                                                            "transport-https", "KEY_FILE"))
246                                 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p1);
247                   if (key_file_p1==NULL)
248                           GNUNET_asprintf(&key_file_p1,"https.key");
249                   if (0 == stat (key_file_p1, &sbuf ))
250                   {
251                           if (0 == remove(key_file_p1))
252                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p1);
253                           else
254                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p1);
255                   }
256                   if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
257                           GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p1);
258                   if (cert_file_p1==NULL)
259                           GNUNET_asprintf(&cert_file_p1,"https.cert");
260                   if (0 == stat (cert_file_p1, &sbuf ))
261                   {
262                           if (0 == remove(cert_file_p1))
263                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
264                           else
265                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p1);
266                   }
267           }
268           else if (p==&p2)
269           {
270                   if (GNUNET_CONFIGURATION_have_value (p->cfg,
271                                                                                            "transport-https", "KEY_FILE"))
272                                 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p2);
273                   if (key_file_p2==NULL)
274                           GNUNET_asprintf(&key_file_p2,"https.key");
275                   if (0 == stat (key_file_p2, &sbuf ))
276                   {
277                           if (0 == remove(key_file_p2))
278                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p2);
279                           else
280                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p2);
281                   }
282                   if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
283                           GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p2);
284                   if (cert_file_p2==NULL)
285                           GNUNET_asprintf(&cert_file_p2,"https.cert");
286                   if (0 == stat (cert_file_p2, &sbuf ))
287                   {
288                           if (0 == remove(cert_file_p2))
289                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
290                           else
291                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p2);
292                   }
293           }
294   }
295
296   p->th = GNUNET_TRANSPORT_connect (p->cfg,
297                                     NULL, p,
298                                     &notify_receive,
299                                     &notify_connect, &notify_disconnect);
300   GNUNET_assert (p->th != NULL);
301 }
302
303
304 static void
305 exchange_hello_last (void *cls,
306                      const struct GNUNET_MessageHeader *message)
307 {
308   struct PeerContext *me = cls;
309
310   GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me);
311   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
312               "Exchanging HELLO with peer (%p)!\n", cls);
313   GNUNET_assert (ok >= 3);
314   OKPP;
315   GNUNET_assert (message != NULL);
316   GNUNET_assert (GNUNET_OK ==
317                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
318                                       message, &me->id));
319
320   GNUNET_assert(NULL != GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
321                                           &p1.id,
322                                           sizeof (struct GNUNET_MessageHeader), 0,
323                                           TIMEOUT,
324                                           &notify_ready_connect,
325                                           NULL));
326
327   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
328               "Finished exchanging HELLOs, now waiting for transmission!\n");
329 }
330
331 static void
332 exchange_hello (void *cls,
333                 const struct GNUNET_MessageHeader *message)
334 {
335   struct PeerContext *me = cls;
336
337   GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me);
338   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
339               "Exchanging HELLO with peer (%p)!\n", cls);
340   GNUNET_assert (ok >= 2);
341   OKPP;
342   GNUNET_assert (message != NULL);
343   GNUNET_assert (GNUNET_OK ==
344                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
345                                       message, &me->id));
346
347   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
348               "Received HELLO size %d\n", GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message));
349
350   GNUNET_TRANSPORT_offer_hello (p2.th, message);
351   GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
352 }
353
354
355 static void
356 run (void *cls,
357      char *const *args,
358      const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
359 {
360   GNUNET_assert (ok == 1);
361   OKPP;
362   die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
363                                            &end_badly, NULL);
364
365   if (is_udp)
366     {
367       setup_peer (&p1, "test_transport_api_udp_peer1.conf");
368       setup_peer (&p2, "test_transport_api_udp_peer2.conf");
369     }
370   if (is_multi_protocol)
371     {
372       setup_peer (&p1, "test_transport_api_multi_peer1.conf");
373       setup_peer (&p2, "test_transport_api_multi_peer2.conf");
374     }
375   else if (is_tcp)
376     {
377       setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
378       setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
379     }
380   else if (is_tcp_nat)
381     {
382       setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
383       setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
384     }
385   else if (is_udp_nat)
386     {
387       setup_peer (&p1, "test_transport_api_udp_nat_peer1.conf");
388       setup_peer (&p2, "test_transport_api_udp_nat_peer2.conf");
389     }
390   else if (is_http)
391     {
392       setup_peer (&p1, "test_transport_api_http_peer1.conf");
393       setup_peer (&p2, "test_transport_api_http_peer2.conf");
394     }
395   else if (is_https)
396     {
397       setup_peer (&p1, "test_transport_api_https_peer1.conf");
398       setup_peer (&p2, "test_transport_api_https_peer2.conf");
399     }
400   GNUNET_assert(p1.th != NULL);
401   GNUNET_assert(p2.th != NULL);
402
403   GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
404 }
405
406 static int
407 check ()
408 {
409   static char *const argv[] = { "test-transport-api",
410     "-c",
411     "test_transport_api_data.conf",
412 #if VERBOSE
413     "-L", "DEBUG",
414 #endif
415     NULL
416   };
417   static struct GNUNET_GETOPT_CommandLineOption options[] = {
418     GNUNET_GETOPT_OPTION_END
419   };
420
421 #if WRITECONFIG
422   setTransportOptions("test_transport_api_data.conf");
423 #endif
424   ok = 1;
425   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
426                       argv, "test-transport-api", "nohelp",
427                       options, &run, &ok);
428   stop_arm (&p1);
429   stop_arm (&p2);
430
431   if (is_https)
432   {
433           struct stat sbuf;
434           if (0 == stat (cert_file_p1, &sbuf ))
435           {
436                   if (0 == remove(cert_file_p1))
437                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
438                   else
439                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
440           }
441
442           if (0 == stat (key_file_p1, &sbuf ))
443           {
444                   if (0 == remove(key_file_p1))
445                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
446                   else
447                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
448           }
449
450           if (0 == stat (cert_file_p2, &sbuf ))
451           {
452                   if (0 == remove(cert_file_p2))
453                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
454                   else
455                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
456           }
457
458           if (0 == stat (key_file_p2, &sbuf ))
459           {
460                   if (0 == remove(key_file_p2))
461                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
462                   else
463                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
464           }
465           GNUNET_free(key_file_p1);
466           GNUNET_free(key_file_p2);
467           GNUNET_free(cert_file_p1);
468           GNUNET_free(cert_file_p2);
469   }
470   return ok;
471 }
472
473 /**
474  * Return the actual path to a file found in the current
475  * PATH environment variable.
476  *
477  * @param binary the name of the file to find
478  */
479 static char *
480 get_path_from_PATH (char *binary)
481 {
482   char *path;
483   char *pos;
484   char *end;
485   char *buf;
486   const char *p;
487
488   p = getenv ("PATH");
489   if (p == NULL)
490     {
491       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
492                   _("PATH environment variable is unset.\n"));
493       return NULL;
494     }
495   path = GNUNET_strdup (p);     /* because we write on it */
496   buf = GNUNET_malloc (strlen (path) + 20);
497   pos = path;
498
499   while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
500     {
501       *end = '\0';
502       sprintf (buf, "%s/%s", pos, binary);
503       if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
504         {
505           GNUNET_free (path);
506           return buf;
507         }
508       pos = end + 1;
509     }
510   sprintf (buf, "%s/%s", pos, binary);
511   if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
512     {
513       GNUNET_free (path);
514       return buf;
515     }
516   GNUNET_free (buf);
517   GNUNET_free (path);
518   return NULL;
519 }
520
521 /**
522  * Check whether the suid bit is set on a file.
523  * Attempts to find the file using the current
524  * PATH environment variable as a search path.
525  *
526  * @param binary the name of the file to check
527  *
528  * @return GNUNET_YES if the binary is found and
529  *         can be run properly, GNUNET_NO otherwise
530  */
531 static int
532 check_gnunet_nat_binary(char *binary)
533 {
534   struct stat statbuf;
535   char *p;
536 #ifdef MINGW
537   SOCKET rawsock;
538 #endif
539
540 #ifdef MINGW
541   char *binaryexe;
542   GNUNET_asprintf (&binaryexe, "%s.exe", binary);
543   p = get_path_from_PATH (binaryexe);
544   free (binaryexe);
545 #else
546   p = get_path_from_PATH (binary);
547 #endif
548   if (p == NULL)
549     {
550       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
551                   _("Could not find binary `%s' in PATH!\n"),
552                   binary);
553       return GNUNET_NO;
554     }
555   if (0 != STAT (p, &statbuf))
556     {
557       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
558                   _("stat (%s) failed: %s\n"),
559                   p,
560                   STRERROR (errno));
561       GNUNET_free (p);
562       return GNUNET_SYSERR;
563     }
564   GNUNET_free (p);
565 #ifndef MINGW
566   if ( (0 != (statbuf.st_mode & S_ISUID)) &&
567        (statbuf.st_uid == 0) )
568     return GNUNET_YES;
569   return GNUNET_NO;
570 #else
571   rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
572   if (INVALID_SOCKET == rawsock)
573     {
574       DWORD err = GetLastError ();
575       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
576                   "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
577       return GNUNET_NO; /* not running as administrator */
578     }
579   closesocket (rawsock);
580   return GNUNET_YES;
581 #endif
582 }
583
584 int
585 main (int argc, char *argv[])
586 {
587   int ret;
588 #ifdef MINGW
589   return GNUNET_SYSERR;
590 #endif
591
592   GNUNET_log_setup ("test-transport-api",
593 #if VERBOSE
594                     "DEBUG",
595 #else
596                     "WARNING",
597 #endif
598                     NULL);
599
600   if (strstr(argv[0], "tcp_nat") != NULL)
601     {
602       is_tcp_nat = GNUNET_YES;
603       if (GNUNET_YES != check_gnunet_nat_binary("gnunet-nat-server"))
604         {
605           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
606                       "`%s' not properly installed, cannot run NAT test!\n",
607                       "gnunet-nat-server");
608           return 0;
609         }
610     }
611   else if (strstr(argv[0], "tcp") != NULL)
612     {
613       is_tcp = GNUNET_YES;
614     }
615   else if (strstr(argv[0], "udp_nat") != NULL)
616     {
617       is_udp_nat = GNUNET_YES;
618       if (GNUNET_YES != check_gnunet_nat_binary("gnunet-nat-server"))
619         {
620           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
621                       "`%s' not properly installed, cannot run NAT test!\n",
622                       "gnunet-nat-server");
623           return 0;
624         }
625     }
626   else if (strstr(argv[0], "udp") != NULL)
627     {
628       is_udp = GNUNET_YES;
629     }
630   else if (strstr(argv[0], "https") != NULL)
631     {
632       is_https = GNUNET_YES;
633     }
634   else if (strstr(argv[0], "http") != NULL)
635     {
636       is_http = GNUNET_YES;
637     }
638   else if (strstr(argv[0], "multi") != NULL)
639     {
640        is_multi_protocol = GNUNET_YES;
641     }
642
643
644   ret = check ();
645   if (is_multi_protocol)
646   {
647          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/");
648          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/");
649   }
650   else
651   {
652          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
653          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
654   }
655
656   return ret;
657 }
658
659 /* end of test_transport_api.c */