![]() |
GNUnet
0.11.x
|
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 barrriers component.
cfg | the configuration to use for initialisation |
Definition at line 466 of file gnunet-service-testbed_barriers.c.
References connect_cb(), 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 516 of file gnunet-service-testbed_barriers.c.
References barrier_destroy_iterator(), 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 627 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 646 of file gnunet-service-testbed_barriers.c.
References ClientCtx::barrier, WBarrier::barrier, ClientCtx::client, Context::client, Slave::controller, WBarrier::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, GNUNET_TESTBED_BarrierInit::header, LOG_DEBUG, Barrier::mc, MESSAGE_SEND_TIMEOUT, Barrier::name, name, GNUNET_TESTBED_BarrierInit::name, Barrier::num_wbarriers, Barrier::quorum, GNUNET_TESTBED_BarrierInit::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 749 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 768 of file gnunet-service-testbed_barriers.c.
References ClientCtx::barrier, cancel_wrappers(), ClientCtx::client, Context::client, GNUNET_assert, GNUNET_break_op, GNUNET_CONTAINER_multihashmap_contains(), GNUNET_CONTAINER_multihashmap_get(), GNUNET_CRYPTO_hash(), GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GST_context, GNUNET_TESTBED_BarrierCancel::header, LOG_DEBUG, name, GNUNET_TESTBED_BarrierCancel::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 826 of file gnunet-service-testbed_barriers.c.
References GNUNET_TESTBED_BarrierStatusMsg::data, GNUNET_break_op, GNUNET_OK, GNUNET_SYSERR, GNUNET_TESTBED_BARRIERSTATUS_CROSSED, GNUNET_TESTBED_BarrierStatusMsg::header, name, GNUNET_TESTBED_BarrierStatusMsg::name_len, GNUNET_MessageHeader::size, status, and GNUNET_TESTBED_BarrierStatusMsg::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 867 of file gnunet-service-testbed_barriers.c.
References ClientCtx::barrier, ClientCtx::client, Context::client, WBarrier::controller, GNUNET_TESTBED_BarrierStatusMsg::data, 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, GNUNET_TESTBED_BarrierStatusMsg::header, LOG_DEBUG, name, GNUNET_TESTBED_BarrierStatusMsg::name_len, ClientCtx::next, WBarrier::next, and Barrier::whead.