38 #define HELPER_TESTBED_BINARY "gnunet-helper-testbed"
415 uint64_t operation_id,
482 uint32_t slave_host_id);
struct GNUNET_MessageHeader * msg
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static int echo
Request echo service.
static char * hostname
Our hostname; we give this to all the peers we start.
static const struct GNUNET_CONFIGURATION_Handle * config
API for writing tests and creating large-scale emulation testbeds for GNUnet.
void(* GNUNET_MQ_MessageCallback)(void *cls, const struct GNUNET_MessageHeader *msg)
Called when a message has been received.
void(* GNUNET_TESTBED_ControllerCallback)(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Signature of the event handler function called by the respective event controller.
void(* GNUNET_TESTBED_barrier_status_cb)(void *cls, const char *name, struct GNUNET_TESTBED_Barrier *barrier, enum GNUNET_TESTBED_BarrierStatus status, const char *emsg)
Functions of this type are to be given as callback argument to GNUNET_TESTBED_barrier_init().
static unsigned int size
Size of the "table".
Internal representation of the hash map.
Internal representation of the hash map.
Handle to a message queue.
GNUNET_TESTBED_barrier_status_cb cb
The continuation callback to call when we have a status update on this.
struct GNUNET_TESTBED_Controller * c
The controller handle given while initialising this barrier.
struct GNUNET_HashCode key
hashcode identifying this barrier in the hashmap
char * name
The name of the barrier.
int echo
Should the barrier crossed status message be echoed back to the controller?
void * cls
the closure for the above callback
Handle to interact with a GNUnet testbed controller.
uint32_t operation_counter
The operation id counter.
void * opcq_empty_cls
Closure for the above task.
uint64_t event_mask
The controller event mask.
struct GNUNET_CONTAINER_MultiHashMap32 * opc_map
The map of active operation contexts.
void * cc_cls
The closure for controller callback.
struct OperationQueue * opq_parallel_topology_config_operations
Operation queue for simultaneous topology configuration operations.
struct OperationQueue * opq_parallel_service_connections
Operation queue for simultaneous service connections.
struct GNUNET_MQ_Handle * mq
The message queue to the controller service.
TESTBED_opcq_empty_cb opcq_empty_cb
If this callback is not NULL, schedule it as a task when opc_map gets empty.
struct GNUNET_TESTBED_Host * host
The host where the controller is running.
GNUNET_TESTBED_ControllerCallback cc
The controller callback.
struct GNUNET_TESTBED_HostRegistrationHandle * rh
The host registration handle; NULL if no current registration requests are present.
struct OperationQueue * opq_parallel_operations
Operation queue for simultaneous operations.
struct GNUNET_CONFIGURATION_Handle * cfg
The configuration to use while connecting to controller.
struct GNUNET_CONTAINER_MultiHashMap * barrier_map
handle for hashtable of barrier handles, values are of type struct GNUNET_TESTBED_Barrier.
Initialization message for gnunet-helper-testbed to start testbed service.
handle for host registration
Opaque handle to a host running experiments managed by the testing framework.
Event notification from a controller to a client.
Opaque handle to an abstract operation to be executed by the testing framework.
Context information for GNUNET_TESTBED_Operation.
void * op_cls
The operation closure.
enum OperationContextState state
The state of the operation.
enum OperationType type
The type of operation.
uint64_t id
The id of the operation.
struct GNUNET_TESTBED_Operation * op
The operation.
struct GNUNET_TESTBED_Controller * c
The controller to which this operation context belongs to.
void * data
Data relevant to the operation.
Queue of operations where we can only support a certain number of concurrent operations of a particul...
IPC messages between testing API and service ("controller")
void GNUNET_TESTBED_queue_message_(struct GNUNET_TESTBED_Controller *controller, struct GNUNET_MessageHeader *msg)
Queues a message in send queue for sending to the service.
void(* TESTBED_opcq_empty_cb)(void *cls)
Operation empty callback.
struct GNUNET_TESTBED_Barrier * GNUNET_TESTBED_barrier_init_(struct GNUNET_TESTBED_Controller *controller, const char *name, unsigned int quorum, GNUNET_TESTBED_barrier_status_cb cb, void *cls, int echo)
Initialise a barrier and call the given callback when the required percentage of peers (quorum) reach...
void GNUNET_TESTBED_remove_opc_(const struct GNUNET_TESTBED_Controller *c, struct OperationContext *opc)
Removes the given operation context from the operation context map of the given controller.
char * GNUNET_TESTBED_compress_cfg_(const struct GNUNET_CONFIGURATION_Handle *cfg, size_t *size, size_t *xsize)
Function to serialize and compress using zlib a configuration through a configuration handle.
struct GNUNET_TESTBED_HelperInit * GNUNET_TESTBED_create_helper_init_msg_(const char *cname, const char *hostname, const struct GNUNET_CONFIGURATION_Handle *cfg)
Creates a helper initialization message.
const char * GNUNET_TESTBED_parse_error_string_(const struct GNUNET_TESTBED_OperationFailureEventMessage *msg)
Checks the integrity of the OpeationFailureEventMessage and if good returns the error message it cont...
void GNUNET_TESTBED_barrier_remove_(struct GNUNET_TESTBED_Barrier *barrier)
Remove a barrier and it was the last one in the barrier hash map, destroy the hash map.
void GNUNET_TESTBED_forward_operation_msg_cancel_(struct OperationContext *opc)
Function to cancel an operation created by simply forwarding an operation message.
uint64_t GNUNET_TESTBED_get_next_op_id(struct GNUNET_TESTBED_Controller *controller)
Function to return the operation id for a controller.
@ OP_GET_SLAVE_CONFIG
Get slave config operation.
@ OP_PEER_RECONFIGURE
Reconfigure a peer.
@ OP_FORWARDED
Forwarded operation.
@ OP_PEER_START
Peer start operation.
@ OP_PEER_INFO
Get peer information operation.
@ OP_SHUTDOWN_PEERS
Stop and destroy all peers.
@ OP_MANAGE_SERVICE
Start/stop service at a peer.
@ OP_PEER_DESTROY
Peer destroy operation.
@ OP_OVERLAY_CONNECT
Overlay connection operation.
@ OP_LINK_CONTROLLERS
Link controllers operation.
@ OP_PEER_STOP
Peer stop operation.
@ OP_PEER_CREATE
Peer create operation.
OperationContextState
Enumeration of states of OperationContext.
@ OPC_STATE_INIT
The initial state where the associated operation has just been created and is waiting in the operatio...
@ OPC_STATE_STARTED
The operation has been started.
@ OPC_STATE_FINISHED
The operation has finished.
struct GNUNET_CONFIGURATION_Handle * GNUNET_TESTBED_extract_config_(const struct GNUNET_MessageHeader *msg)
Generates configuration by uncompressing configuration in given message.
struct OperationContext * GNUNET_TESTBED_forward_operation_msg_(struct GNUNET_TESTBED_Controller *controller, uint64_t operation_id, const struct GNUNET_MessageHeader *msg, GNUNET_MQ_MessageCallback cc, void *cc_cls)
Sends the given message as an operation.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_get_slave_config_(void *op_cls, struct GNUNET_TESTBED_Controller *master, uint32_t slave_host_id)
Like GNUNET_TESTBED_get_slave_config(), however without the host registration check.
void GNUNET_TESTBED_insert_opc_(struct GNUNET_TESTBED_Controller *c, struct OperationContext *opc)
Inserts the given operation context into the operation context map of the given controller.
size_t GNUNET_TESTBED_compress_config_(const char *config, size_t size, char **xconfig)
Compresses given configuration using zlib compress.
Message formats for communication between testbed api and gnunet-helper-testbed process.