aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_testing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/transport/test_transport_testing.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/transport/test_transport_testing.c')
-rw-r--r--src/transport/test_transport_testing.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/transport/test_transport_testing.c b/src/transport/test_transport_testing.c
index cd5d7ed2c..85c05df4b 100644
--- a/src/transport/test_transport_testing.c
+++ b/src/transport/test_transport_testing.c
@@ -86,15 +86,14 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
86{ 86{
87 char *p1_c = strdup (GNUNET_i2s (&p1->id)); 87 char *p1_c = strdup (GNUNET_i2s (&p1->id));
88 88
89 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers connected: %s <-> %s\n", 89 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers connected: %s <-> %s\n", p1_c,
90 p1_c, GNUNET_i2s (&p2->id)); 90 GNUNET_i2s (&p2->id));
91 GNUNET_free (p1_c); 91 GNUNET_free (p1_c);
92 end (); 92 end ();
93} 93}
94 94
95static void 95static void
96notify_connect (void *cls, 96notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
97 const struct GNUNET_PeerIdentity *peer,
98 const struct GNUNET_TRANSPORT_ATS_Information *ats, 97 const struct GNUNET_TRANSPORT_ATS_Information *ats,
99 uint32_t ats_count) 98 uint32_t ats_count)
100{ 99{
@@ -111,8 +110,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
111} 110}
112 111
113static void 112static void
114notify_receive (void *cls, 113notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
115 const struct GNUNET_PeerIdentity *peer,
116 const struct GNUNET_MessageHeader *message, 114 const struct GNUNET_MessageHeader *message,
117 const struct GNUNET_TRANSPORT_ATS_Information *ats, 115 const struct GNUNET_TRANSPORT_ATS_Information *ats,
118 uint32_t ats_count) 116 uint32_t ats_count)
@@ -122,22 +120,19 @@ notify_receive (void *cls,
122 120
123 121
124static void 122static void
125run (void *cls, 123run (void *cls, char *const *args, const char *cfgfile,
126 char *const *args, 124 const struct GNUNET_CONFIGURATION_Handle *cfg)
127 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
128{ 125{
129 timeout_task = 126 timeout_task =
130 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &end_badly, NULL); 127 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &end_badly, NULL);
131 128
132 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); 129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n");
133 p1 = GNUNET_TRANSPORT_TESTING_start_peer ("test_transport_api_tcp_peer1.conf", 130 p1 = GNUNET_TRANSPORT_TESTING_start_peer ("test_transport_api_tcp_peer1.conf",
134 &notify_receive, 131 &notify_receive, &notify_connect,
135 &notify_connect,
136 &notify_disconnect, p1); 132 &notify_disconnect, p1);
137 133
138 p2 = GNUNET_TRANSPORT_TESTING_start_peer ("test_transport_api_tcp_peer2.conf", 134 p2 = GNUNET_TRANSPORT_TESTING_start_peer ("test_transport_api_tcp_peer2.conf",
139 &notify_receive, 135 &notify_receive, &notify_connect,
140 &notify_connect,
141 &notify_disconnect, p2); 136 &notify_disconnect, p2);
142 137
143 if (p1 != NULL) 138 if (p1 != NULL)
@@ -185,9 +180,8 @@ main (int argc, char *argv[])
185 GNUNET_GETOPT_OPTION_END 180 GNUNET_GETOPT_OPTION_END
186 }; 181 };
187 182
188 GNUNET_PROGRAM_run ((sizeof (argv_1) / sizeof (char *)) - 1, 183 GNUNET_PROGRAM_run ((sizeof (argv_1) / sizeof (char *)) - 1, argv_1,
189 argv_1, "test_transport_testing", "nohelp", 184 "test_transport_testing", "nohelp", options, &run, &ret);
190 options, &run, &ret);
191 185
192 return ret; 186 return ret;
193} 187}