aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-tng.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-15 13:56:40 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-15 13:56:40 +0100
commit478a4c062b7d12b5d75d10667aa7739bd15b6405 (patch)
tree2fb3c5474a510d242fadeae772114343313b1f5d /src/transport/gnunet-service-tng.c
parentad1244d958b76cb249028c7ad87ff84df49293ff (diff)
downloadgnunet-478a4c062b7d12b5d75d10667aa7739bd15b6405.tar.gz
gnunet-478a4c062b7d12b5d75d10667aa7739bd15b6405.zip
get gnunet-service-tng to build
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r--src/transport/gnunet-service-tng.c59
1 files changed, 3 insertions, 56 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c
index d92964654..73b295442 100644
--- a/src/transport/gnunet-service-tng.c
+++ b/src/transport/gnunet-service-tng.c
@@ -233,7 +233,6 @@ handle_client_start (void *cls,
233 const struct StartMessage *start) 233 const struct StartMessage *start)
234{ 234{
235 struct TransportClient *tc = cls; 235 struct TransportClient *tc = cls;
236 const struct GNUNET_MessageHeader *hello;
237 uint32_t options; 236 uint32_t options;
238 237
239 options = ntohl (start->options); 238 options = ntohl (start->options);
@@ -255,46 +254,6 @@ handle_client_start (void *cls,
255 return; 254 return;
256 } 255 }
257 tc->type = CT_CORE; 256 tc->type = CT_CORE;
258#if 0
259 hello = GST_hello_get ();
260 if (NULL != hello)
261 unicast (tc,
262 hello,
263 GNUNET_NO);
264#endif
265 GNUNET_SERVICE_client_continue (tc->client);
266}
267
268
269/**
270 * Client sent us a HELLO. Check the request.
271 *
272 * @param cls the client
273 * @param message the HELLO message
274 */
275static int
276check_client_hello (void *cls,
277 const struct GNUNET_MessageHeader *message)
278{
279 (void) cls;
280 return GNUNET_OK; /* FIXME: check here? */
281}
282
283
284/**
285 * Client sent us a HELLO. Process the request.
286 *
287 * @param cls the client
288 * @param message the HELLO message
289 */
290static void
291handle_client_hello (void *cls,
292 const struct GNUNET_MessageHeader *message)
293{
294 struct TransportClient *tc = cls;
295
296 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
297 "Received HELLO message\n");
298 GNUNET_SERVICE_client_continue (tc->client); 257 GNUNET_SERVICE_client_continue (tc->client);
299} 258}
300 259
@@ -395,7 +354,7 @@ handle_communicator_available (void *cls,
395 tc->type = CT_COMMUNICATOR; 354 tc->type = CT_COMMUNICATOR;
396 size = ntohs (cam->header.size) - sizeof (*cam); 355 size = ntohs (cam->header.size) - sizeof (*cam);
397 if (0 == size) 356 if (0 == size)
398 return GNUNET_OK; /* receive-only communicator */ 357 return; /* receive-only communicator */
399 tc->details.address_prefix = GNUNET_strdup ((const char *) &cam[1]); 358 tc->details.address_prefix = GNUNET_strdup ((const char *) &cam[1]);
400 GNUNET_SERVICE_client_continue (tc->client); 359 GNUNET_SERVICE_client_continue (tc->client);
401} 360}
@@ -421,7 +380,7 @@ check_add_address (void *cls,
421 GNUNET_break (0); 380 GNUNET_break (0);
422 return GNUNET_SYSERR; 381 return GNUNET_SYSERR;
423 } 382 }
424 addr = (const char *) &cam[1]; 383 addr = (const char *) &aam[1];
425 if ('\0' != addr[size-1]) 384 if ('\0' != addr[size-1])
426 { 385 {
427 GNUNET_break (0); 386 GNUNET_break (0);
@@ -651,15 +610,7 @@ run (void *cls,
651{ 610{
652 /* setup globals */ 611 /* setup globals */
653 GST_cfg = c; 612 GST_cfg = c;
654 if (GNUNET_OK != 613 GST_my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (GST_cfg);
655 GNUNET_CONFIGURATION_get_value_time (c,
656 "transport",
657 "HELLO_EXPIRATION",
658 &hello_expiration))
659 {
660 hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION;
661 }
662 GST_my_private_key = GNUNET_CRYPTO_eddsa_key_create_from_configuration (cfg);
663 if (NULL == GST_my_private_key) 614 if (NULL == GST_my_private_key)
664 { 615 {
665 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 616 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
@@ -696,10 +647,6 @@ GNUNET_SERVICE_MAIN
696 GNUNET_MESSAGE_TYPE_TRANSPORT_START, 647 GNUNET_MESSAGE_TYPE_TRANSPORT_START,
697 struct StartMessage, 648 struct StartMessage,
698 NULL), 649 NULL),
699 GNUNET_MQ_hd_var_size (client_hello,
700 GNUNET_MESSAGE_TYPE_HELLO,
701 struct GNUNET_MessageHeader,
702 NULL),
703 GNUNET_MQ_hd_var_size (client_send, 650 GNUNET_MQ_hd_var_size (client_send,
704 GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 651 GNUNET_MESSAGE_TYPE_TRANSPORT_SEND,
705 struct OutboundMessage, 652 struct OutboundMessage,