Interface for the barrier initialisation handler routine. More...
Go to the source code of this file.
Interface for the barrier initialisation handler routine.
Definition in file gnunet-service-testbed_barriers.h.
void GST_barriers_init | ( | struct GNUNET_CONFIGURATION_Handle * | cfg | ) |
Function to initialise barriers component.
cfg | the configuration to use for initialisation |
Definition at line 467 of file gnunet-service-testbed_barriers.c.
References barrier_map, cfg, connect_cb(), ctx, disconnect_cb(), GNUNET_CONTAINER_multihashmap_create(), GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_SERVICE_start(), GNUNET_YES, and LOG_DEBUG.
Referenced by testbed_run().
void GST_barriers_destroy | ( | void | ) |
Function to stop the barrier service.
Definition at line 517 of file gnunet-service-testbed_barriers.c.
References barrier_destroy_iterator(), barrier_map, ctx, GNUNET_assert, GNUNET_CONTAINER_multihashmap_destroy(), GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_SERVICE_stop(), and GNUNET_SYSERR.
Referenced by shutdown_task().
int check_barrier_init | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierInit * | msg | ||
) |
Check GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.
cls | identification of the client |
msg | the actual message |
Definition at line 628 of file gnunet-service-testbed_barriers.c.
References GNUNET_OK.
void handle_barrier_init | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierInit * | msg | ||
) |
Message handler for GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.
This message should always come from a parent controller or the testbed API if we are the root controller.
This handler is queued in the main service and will handle the messages sent either from the testbed driver or from a high level controller
cls | identification of the client |
msg | the actual message |
Definition at line 647 of file gnunet-service-testbed_barriers.c.
References WBarrier::barrier, barrier_map, Context::client, WBarrier::controller, Slave::controller, fwd_tout_barrier_init(), GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST, GNUNET_CRYPTO_hash(), GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_new, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_TESTBED_barrier_init_(), GNUNET_TESTBED_BARRIERSTATUS_ERROR, GNUNET_TESTBED_BARRIERSTATUS_INITIALISED, GNUNET_YES, GST_context, GST_slave_list, GST_slave_list_size, Barrier::hash, WBarrier::hbarrier, LOG_DEBUG, Barrier::mc, MESSAGE_SEND_TIMEOUT, msg, name, Barrier::name, Barrier::num_wbarriers, Barrier::quorum, send_barrier_status_msg(), send_client_status_msg(), GNUNET_MessageHeader::size, Barrier::status, Barrier::tout_task, wbarrier_status_cb(), Barrier::whead, and Barrier::wtail.
int check_barrier_cancel | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierCancel * | msg | ||
) |
Check GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL messages.
cls | identification of the client |
msg | the actual message |
Definition at line 750 of file gnunet-service-testbed_barriers.c.
References GNUNET_OK.
void handle_barrier_cancel | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierCancel * | msg | ||
) |
Message handler for GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL messages.
This message should always come from a parent controller or the testbed API if we are the root controller.
This handler is queued in the main service and will handle the messages sent either from the testbed driver or from a high level controller
cls | identification of the client |
msg | the actual message |
Definition at line 769 of file gnunet-service-testbed_barriers.c.
References barrier_map, cancel_wrappers(), Context::client, GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CRYPTO_hash(), GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GST_context, LOG_DEBUG, msg, name, remove_barrier(), and GNUNET_MessageHeader::size.
int check_barrier_status | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierStatusMsg * | msg | ||
) |
Check GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS messages.
cls | identification of the client |
msg | the actual message |
Definition at line 829 of file gnunet-service-testbed_barriers.c.
References GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_TESTBED_BARRIERSTATUS_CROSSED, msg, name, GNUNET_MessageHeader::size, and status.
void handle_barrier_status | ( | void * | cls, |
const struct GNUNET_TESTBED_BarrierStatusMsg * | msg | ||
) |
Message handler for GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS messages.
This handler is queued in the main service and will handle the messages sent either from the testbed driver or from a high level controller
cls | identification of the client |
msg | the actual message |
The wrapper barriers do not echo the barrier status, so we have to do it here
Definition at line 870 of file gnunet-service-testbed_barriers.c.
References barrier_map, Context::client, ClientCtx::client, WBarrier::controller, env, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_get(), GNUNET_copy_message(), GNUNET_CRYPTO_hash(), GNUNET_MQ_msg_copy(), GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_client_get_mq(), GNUNET_TESTBED_queue_message_(), GST_context, Barrier::head, key, LOG_DEBUG, msg, name, ClientCtx::next, WBarrier::next, and Barrier::whead.