diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-05 18:48:18 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-05 18:48:18 +0000 |
commit | daa1608a8c4cfe8b8510656cd233c4642db20d04 (patch) | |
tree | 728d107f96ace50d17561c450822c1a2d129cb63 /src/testbed/gnunet-service-testbed.h | |
parent | 843f898e3d1391aba7003e6e7c9ec0d7b3530fac (diff) | |
download | gnunet-daa1608a8c4cfe8b8510656cd233c4642db20d04.tar.gz gnunet-daa1608a8c4cfe8b8510656cd233c4642db20d04.zip |
- simplify on-demand linking in overlay connects
Diffstat (limited to 'src/testbed/gnunet-service-testbed.h')
-rw-r--r-- | src/testbed/gnunet-service-testbed.h | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h index b17c3d781..149a1ad77 100644 --- a/src/testbed/gnunet-service-testbed.h +++ b/src/testbed/gnunet-service-testbed.h | |||
@@ -318,6 +318,11 @@ struct ForwardedOverlayConnectContext | |||
318 | struct GNUNET_MessageHeader *orig_msg; | 318 | struct GNUNET_MessageHeader *orig_msg; |
319 | 319 | ||
320 | /** | 320 | /** |
321 | * The client handle | ||
322 | */ | ||
323 | struct GNUNET_SERVER_Client *client; | ||
324 | |||
325 | /** | ||
321 | * The id of the operation which created this context information | 326 | * The id of the operation which created this context information |
322 | */ | 327 | */ |
323 | uint64_t operation_id; | 328 | uint64_t operation_id; |
@@ -363,11 +368,6 @@ enum ClosureType | |||
363 | struct RegisteredHostContext | 368 | struct RegisteredHostContext |
364 | { | 369 | { |
365 | /** | 370 | /** |
366 | * The type of this data structure. Set this to CLOSURE_TYPE_RHC | ||
367 | */ | ||
368 | enum ClosureType type; | ||
369 | |||
370 | /** | ||
371 | * The host which is being registered | 371 | * The host which is being registered |
372 | */ | 372 | */ |
373 | struct GNUNET_TESTBED_Host *reg_host; | 373 | struct GNUNET_TESTBED_Host *reg_host; |
@@ -378,26 +378,6 @@ struct RegisteredHostContext | |||
378 | struct GNUNET_TESTBED_Host *host; | 378 | struct GNUNET_TESTBED_Host *host; |
379 | 379 | ||
380 | /** | 380 | /** |
381 | * The gateway to which this operation is forwarded to | ||
382 | */ | ||
383 | struct Slave *gateway; | ||
384 | |||
385 | /** | ||
386 | * The gateway through which peer2's controller can be reached | ||
387 | */ | ||
388 | struct Slave *gateway2; | ||
389 | |||
390 | /** | ||
391 | * Handle for sub-operations | ||
392 | */ | ||
393 | struct GNUNET_TESTBED_Operation *sub_op; | ||
394 | |||
395 | /** | ||
396 | * The client which initiated the link controller operation | ||
397 | */ | ||
398 | struct GNUNET_SERVER_Client *client; | ||
399 | |||
400 | /** | ||
401 | * Head of the ForwardedOverlayConnectContext DLL | 381 | * Head of the ForwardedOverlayConnectContext DLL |
402 | */ | 382 | */ |
403 | struct ForwardedOverlayConnectContext *focc_dll_head; | 383 | struct ForwardedOverlayConnectContext *focc_dll_head; |
@@ -419,20 +399,9 @@ struct RegisteredHostContext | |||
419 | RHC_INIT = 0, | 399 | RHC_INIT = 0, |
420 | 400 | ||
421 | /** | 401 | /** |
422 | * State where we attempt to get peer2's controller configuration | ||
423 | */ | ||
424 | RHC_GET_CFG, | ||
425 | |||
426 | /** | ||
427 | * State where we attempt to link the controller of peer 1 to the controller | ||
428 | * of peer2 | ||
429 | */ | ||
430 | RHC_LINK, | ||
431 | |||
432 | /** | ||
433 | * State where we attempt to do the overlay connection again | 402 | * State where we attempt to do the overlay connection again |
434 | */ | 403 | */ |
435 | RHC_OL_CONNECT | 404 | RHC_DONE |
436 | } state; | 405 | } state; |
437 | 406 | ||
438 | }; | 407 | }; |
@@ -512,6 +481,18 @@ extern unsigned int GST_host_list_size; | |||
512 | */ | 481 | */ |
513 | extern char *GST_stats_dir; | 482 | extern char *GST_stats_dir; |
514 | 483 | ||
484 | /** | ||
485 | * Condition to check if host id is invalid | ||
486 | */ | ||
487 | #define INVALID_HOST_ID(id) \ | ||
488 | ( ((id) >= GST_host_list_size) || (NULL == GST_host_list[id]) ) | ||
489 | |||
490 | /** | ||
491 | * Condition to check if peer id is invalid | ||
492 | */ | ||
493 | #define INVALID_PEER_ID(id) \ | ||
494 | ( ((id) >= GST_peer_list_size) || (NULL == GST_peer_list[id]) ) | ||
495 | |||
515 | 496 | ||
516 | /** | 497 | /** |
517 | * Similar to GNUNET_array_grow(); however instead of calling GNUNET_array_grow() | 498 | * Similar to GNUNET_array_grow(); however instead of calling GNUNET_array_grow() |