aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_plugin_transport_udp.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_plugin_transport_udp.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/transport/test_plugin_transport_udp.c')
-rw-r--r--src/transport/test_plugin_transport_udp.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/transport/test_plugin_transport_udp.c b/src/transport/test_plugin_transport_udp.c
index b23d4eb67..8fbd2ab9c 100644
--- a/src/transport/test_plugin_transport_udp.c
+++ b/src/transport/test_plugin_transport_udp.c
@@ -89,20 +89,16 @@ static int ok;
89 * Initialize Environment for this plugin 89 * Initialize Environment for this plugin
90 */ 90 */
91static void 91static void
92receive (void *cls, 92receive (void *cls, const struct GNUNET_PeerIdentity *peer,
93 const struct GNUNET_PeerIdentity *peer, 93 const struct GNUNET_MessageHeader *message, uint32_t distance,
94 const struct GNUNET_MessageHeader *message,
95 uint32_t distance,
96 const char *sender_address, size_t sender_address_len) 94 const char *sender_address, size_t sender_address_len)
97{ 95{
98 /* do nothing */ 96 /* do nothing */
99} 97}
100 98
101void 99void
102notify_address (void *cls, 100notify_address (void *cls, const char *name, const void *addr, size_t addrlen,
103 const char *name, 101 struct GNUNET_TIME_Relative expires)
104 const void *addr,
105 size_t addrlen, struct GNUNET_TIME_Relative expires)
106{ 102{
107} 103}
108 104
@@ -168,9 +164,8 @@ setup_plugin_environment ()
168 * @param c configuration to use 164 * @param c configuration to use
169 */ 165 */
170static void 166static void
171run (void *cls, 167run (void *cls, char *const *args, const char *cfgfile,
172 char *const *args, 168 const struct GNUNET_CONFIGURATION_Handle *c)
173 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
174{ 169{
175 unsigned long long tneigh; 170 unsigned long long tneigh;
176 char *keyfile; 171 char *keyfile;
@@ -179,14 +174,11 @@ run (void *cls,
179 cfg = c; 174 cfg = c;
180 /* parse configuration */ 175 /* parse configuration */
181 if ((GNUNET_OK != 176 if ((GNUNET_OK !=
182 GNUNET_CONFIGURATION_get_value_number (c, 177 GNUNET_CONFIGURATION_get_value_number (c, "TRANSPORT", "NEIGHBOUR_LIMIT",
183 "TRANSPORT",
184 "NEIGHBOUR_LIMIT",
185 &tneigh)) || 178 &tneigh)) ||
186 (GNUNET_OK != 179 (GNUNET_OK !=
187 GNUNET_CONFIGURATION_get_value_filename (c, 180 GNUNET_CONFIGURATION_get_value_filename (c, "GNUNETD", "HOSTKEY",
188 "GNUNETD", 181 &keyfile)))
189 "HOSTKEY", &keyfile)))
190 { 182 {
191 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 183 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
192 _ 184 _
@@ -205,8 +197,8 @@ run (void *cls,
205 return; 197 return;
206 } 198 }
207 GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); 199 GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key);
208 GNUNET_CRYPTO_hash (&my_public_key, 200 GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key),
209 sizeof (my_public_key), &my_identity.hashPubKey); 201 &my_identity.hashPubKey);
210 202
211 /* load plugins... */ 203 /* load plugins... */
212 setup_plugin_environment (); 204 setup_plugin_environment ();
@@ -261,11 +253,10 @@ main (int argc, char *const *argv)
261#endif 253#endif
262 NULL); 254 NULL);
263 ok = 1; /* set to fail */ 255 ok = 1; /* set to fail */
264 ret = (GNUNET_OK == 256 ret =
265 GNUNET_PROGRAM_run (5, 257 (GNUNET_OK ==
266 argv_prog, 258 GNUNET_PROGRAM_run (5, argv_prog, "test-plugin-transport", "testcase",
267 "test-plugin-transport", 259 options, &run, NULL)) ? ok : 1;
268 "testcase", options, &run, NULL)) ? ok : 1;
269 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport"); 260 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport");
270 return ret; 261 return ret;
271} 262}