high-level testbed management More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testbed_service.h"
#include "testbed_api.h"
#include "testbed_api_peers.h"
#include "testbed_api_hosts.h"
#include "testbed_api_topology.h"
Go to the source code of this file.
Data Structures | |
struct | RunContextOperation |
Context information for the operation we start. More... | |
struct | CompatibilityCheckContext |
Context for host compatibility checks. More... | |
struct | GNUNET_TESTBED_RunHandle |
Testbed Run Handle. More... | |
struct | SearchContext |
Context information to be used while searching for operation contexts. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "testbed-api-testbed", __VA_ARGS__) |
Generic loggins shorthand. More... | |
#define | DEBUG(...) LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) |
Debug logging shortcut. More... | |
#define | DEFAULT_SETUP_TIMEOUT 300 |
The default setup timeout in seconds. More... | |
#define | TESTBED_CONFIG_SECTION "testbed" |
Configuration section for testbed. More... | |
#define | SCALE_FREE_CAP "SCALE_FREE_TOPOLOGY_CAP" |
Option string for the maximum number of edges a peer is permitted to have while generating scale free topology. More... | |
#define | SCALE_FREE_M "SCALE_FREE_TOPOLOGY_M" |
Option string for the number of edges to be established when adding a new node to the scale free network. More... | |
Enumerations | |
enum | State { STATE_INIT = 0 , STATE_SLAVES_STARTING , STATE_PEERS_CREATING , STATE_PEERS_STARTING , STATE_PEERS_LINKING , STATE_SEARCH_REGEX , STATE_PEERS_DESTROYING , INIT , CFG_REQUEST_QUEUED , SERVICE_CONNECTED , RC_INIT = 0 , RC_LINKED , RC_PEERS_CREATED , RC_READY , RC_PEERS_SHUTDOWN } |
States of RunContext. More... | |
Functions | |
static uint32_t | rcop_key (void *rcop) |
Return a 32-bit key from a pointer. More... | |
static int | search_iterator (void *cls, uint32_t key, void *value) |
Iterator for searching over the elements matching a given query. More... | |
static struct RunContextOperation * | search_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct GNUNET_TESTBED_Operation *op) |
Initiate a search for the given operation in the rcop_map. More... | |
static void | insert_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop) |
Insert an RunContextOperation into the rcop_map of the given RunContext. More... | |
static void | remove_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop) |
Remove a RunContextOperation from the rcop_map of the given RunContext. More... | |
static void | cleanup (struct GNUNET_TESTBED_RunHandle *rc) |
Assuming all peers have been destroyed cleanup run handle. More... | |
static int | rcop_cleanup_iterator (void *cls, uint32_t key, void *value) |
Iterator for cleaning up elements from rcop_map. More... | |
static void | rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc) |
Cancels operations and tasks which are assigned to the given run context. More... | |
static void | cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc) |
Cancels the scheduled interrupt task. More... | |
static void | wait_op_completion (void *cls) |
This callback will be called when all the operations are completed (done/cancelled) More... | |
static void | interrupt (void *cls) |
Task run upon interrupts (SIGINT, SIGTERM) and upon scheduler shutdown. More... | |
static const char * | prof_time (struct GNUNET_TESTBED_RunHandle *rc) |
Function to return the string representation of the duration between current time and ‘pstart_time’ in ‘RunContext’. More... | |
static void | start_peers_task (void *cls) |
Task for starting peers. More... | |
static void | peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg) |
Functions of this signature are called when a peer has been successfully created. More... | |
static void | call_master (struct GNUNET_TESTBED_RunHandle *rc) |
call test master callback More... | |
static void | topology_completion_callback (void *cls, unsigned int nsuccess, unsigned int nfailures) |
Callbacks of this type are called when topology configuration is completed. More... | |
static void | create_peers (struct GNUNET_TESTBED_RunHandle *rc) |
Function to create peers. More... | |
static void | event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) |
Signature of the event handler function called by the respective event controller. More... | |
static void | register_hosts (void *cls) |
Task to register all hosts available in the global host list. More... | |
static void | host_registration_completion (void *cls, const char *emsg) |
Callback which will be called to after a host registration succeeded or failed. More... | |
static void | controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, int status) |
Callback to signal successful startup of the controller process. More... | |
static int | netint_proc (void *cls, const char *name, int isDefault, const struct sockaddr *addr, const struct sockaddr *broadcast_addr, const struct sockaddr *netmask, socklen_t addrlen) |
Callback function invoked for each interface found. More... | |
static void | host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, int status) |
Callbacks of this type are called by GNUNET_TESTBED_is_host_habitable to inform whether the given host is habitable or not. More... | |
static void | timeout_task (void *cls) |
Task run upon timeout while setting up the testbed. More... | |
void | GNUNET_TESTBED_run (const char *host_filename, const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int num_peers, uint64_t event_mask, GNUNET_TESTBED_ControllerCallback cc, void *cc_cls, GNUNET_TESTBED_TestMaster test_master, void *test_master_cls) |
Convenience method for running a testbed with a single call. More... | |
struct GNUNET_TESTBED_Controller * | GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h) |
Obtain handle to the master controller from a testbed run. More... | |
high-level testbed management
Definition in file testbed_api_testbed.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "testbed-api-testbed", __VA_ARGS__) |
Generic loggins shorthand.
Definition at line 39 of file testbed_api_testbed.c.
#define DEBUG | ( | ... | ) | LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) |
Debug logging shortcut.
Definition at line 45 of file testbed_api_testbed.c.
#define DEFAULT_SETUP_TIMEOUT 300 |
The default setup timeout in seconds.
Definition at line 51 of file testbed_api_testbed.c.
#define TESTBED_CONFIG_SECTION "testbed" |
Configuration section for testbed.
Definition at line 57 of file testbed_api_testbed.c.
#define SCALE_FREE_CAP "SCALE_FREE_TOPOLOGY_CAP" |
Option string for the maximum number of edges a peer is permitted to have while generating scale free topology.
Definition at line 63 of file testbed_api_testbed.c.
#define SCALE_FREE_M "SCALE_FREE_TOPOLOGY_M" |
Option string for the number of edges to be established when adding a new node to the scale free network.
Definition at line 69 of file testbed_api_testbed.c.
enum State |
States of RunContext.
Definition at line 96 of file testbed_api_testbed.c.
|
static |
Return a 32-bit key from a pointer.
rcop | the pointer |
Definition at line 338 of file testbed_api_testbed.c.
Referenced by insert_rcop(), remove_rcop(), and search_rcop().
|
static |
Iterator for searching over the elements matching a given query.
cls | the SearchContext |
key | the 32-bit key |
value | the RunContextOperation element |
Definition at line 370 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_NO, GNUNET_YES, RunContextOperation::op, sc, and value.
Referenced by search_rcop().
|
static |
Initiate a search for the given operation in the rcop_map.
rc | the RunContext whose rcop_map will be searched for the given operation |
op | the given operation to search for |
Definition at line 395 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap32_get_multiple(), GNUNET_SYSERR, op, rcop_key(), GNUNET_TESTBED_RunHandle::rcop_map, sc, and search_iterator().
Referenced by event_cb().
|
static |
Insert an RunContextOperation into the rcop_map of the given RunContext.
rc | the RunContext into whose map is to be used for insertion |
rcop | the RunContextOperation to insert |
Definition at line 422 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap32_put(), GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_OK, RunContextOperation::op, rcop_key(), and GNUNET_TESTBED_RunHandle::rcop_map.
Referenced by create_peers(), register_hosts(), start_peers_task(), and wait_op_completion().
|
static |
Remove a RunContextOperation from the rcop_map of the given RunContext.
rc | the RunContext from whose map the given RunContextOperaton has to be removed |
rcop | the RunContextOperation |
Definition at line 440 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap32_remove(), GNUNET_YES, RunContextOperation::op, rcop_key(), and GNUNET_TESTBED_RunHandle::rcop_map.
Referenced by event_cb(), peer_create_cb(), and rcop_cleanup_iterator().
|
static |
Assuming all peers have been destroyed cleanup run handle.
rc | the run context |
Definition at line 456 of file testbed_api_testbed.c.
References GNUNET_TESTBED_RunHandle::c, GNUNET_TESTBED_RunHandle::cfg, GNUNET_TESTBED_RunHandle::cproc, GNUNET_assert, GNUNET_CONFIGURATION_destroy(), GNUNET_CONTAINER_multihashmap32_destroy(), GNUNET_CONTAINER_multihashmap32_size(), GNUNET_free, GNUNET_TESTBED_controller_disconnect(), GNUNET_TESTBED_controller_stop(), GNUNET_TESTBED_host_destroy(), GNUNET_TESTBED_RunHandle::h, GNUNET_TESTBED_RunHandle::hclist, GNUNET_TESTBED_RunHandle::hosts, GNUNET_TESTBED_RunHandle::num_hosts, GNUNET_TESTBED_RunHandle::peers, RC_PEERS_SHUTDOWN, GNUNET_TESTBED_RunHandle::rcop_map, GNUNET_TESTBED_RunHandle::reg_handle, GNUNET_TESTBED_RunHandle::register_hosts_task, GNUNET_TESTBED_RunHandle::state, GNUNET_TESTBED_RunHandle::topo_file, and GNUNET_TESTBED_RunHandle::trusted_ip.
Referenced by wait_op_completion().
|
static |
Iterator for cleaning up elements from rcop_map.
cls | the RunContext |
key | the 32-bit key |
value | the RunContextOperation element |
Definition at line 493 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_free, GNUNET_TESTBED_operation_done(), GNUNET_YES, RunContextOperation::op, RunContextOperation::rc, remove_rcop(), and value.
Referenced by rc_cleanup_operations().
|
static |
Cancels operations and tasks which are assigned to the given run context.
rc | the RunContext |
Definition at line 512 of file testbed_api_testbed.c.
References GNUNET_assert, GNUNET_CONTAINER_multihashmap32_iterate(), GNUNET_free, GNUNET_SCHEDULER_cancel(), GNUNET_SYSERR, GNUNET_TESTBED_cancel_registration(), GNUNET_TESTBED_is_host_habitable_cancel(), GNUNET_TESTBED_operation_done(), CompatibilityCheckContext::h, GNUNET_TESTBED_RunHandle::hclist, GNUNET_TESTBED_RunHandle::num_hosts, CompatibilityCheckContext::rc, rcop_cleanup_iterator(), GNUNET_TESTBED_RunHandle::rcop_map, GNUNET_TESTBED_RunHandle::reg_handle, GNUNET_TESTBED_RunHandle::register_hosts_task, GNUNET_TESTBED_RunHandle::timeout_task, and GNUNET_TESTBED_RunHandle::topology_operation.
Referenced by interrupt().
|
static |
Cancels the scheduled interrupt task.
rc | the run context |
Definition at line 563 of file testbed_api_testbed.c.
References GNUNET_SCHEDULER_cancel(), GNUNET_TESTBED_RunHandle::interrupt_task, and CompatibilityCheckContext::rc.
Referenced by wait_op_completion().
|
static |
This callback will be called when all the operations are completed (done/cancelled)
cls | run context |
Definition at line 577 of file testbed_api_testbed.c.
References GNUNET_TESTBED_RunHandle::c, cancel_interrupt_task(), cleanup(), GNUNET_TESTBED_RunHandle::cproc, DEBUG, GNUNET_assert, GNUNET_free, GNUNET_new, GNUNET_TESTBED_shutdown_peers(), GNUNET_TIME_absolute_get(), GNUNET_YES, insert_rcop(), RunContextOperation::op, GNUNET_TESTBED_RunHandle::peers, GNUNET_TESTBED_RunHandle::pstart_time, RunContextOperation::rc, RC_PEERS_SHUTDOWN, GNUNET_TESTBED_RunHandle::shutdown, and GNUNET_TESTBED_RunHandle::state.
Referenced by interrupt().
|
static |
Task run upon interrupts (SIGINT, SIGTERM) and upon scheduler shutdown.
cls | the RunContext which has to be acted upon |
Definition at line 618 of file testbed_api_testbed.c.
References GNUNET_TESTBED_RunHandle::c, GNUNET_CONTAINER_multihashmap32_size(), GNUNET_ERROR_TYPE_WARNING, GNUNET_NO, GNUNET_SCHEDULER_add_shutdown(), GNUNET_TESTBED_RunHandle::interrupt_task, LOG, GNUNET_TESTBED_Controller::opc_map, GNUNET_TESTBED_Controller::opcq_empty_cb, GNUNET_TESTBED_Controller::opcq_empty_cls, rc_cleanup_operations(), GNUNET_TESTBED_RunHandle::shutdown, size, and wait_op_completion().
Referenced by GNUNET_TESTBED_run().
|
static |
Function to return the string representation of the duration between current time and ‘pstart_time’ in ‘RunContext’.
rc | the RunContext |
Definition at line 651 of file testbed_api_testbed.c.
References GNUNET_STRINGS_relative_time_to_string(), GNUNET_TIME_absolute_get_duration(), GNUNET_YES, and GNUNET_TESTBED_RunHandle::pstart_time.
Referenced by event_cb(), peer_create_cb(), and topology_completion_callback().
|
static |
Task for starting peers.
cls | the RunHandle |
Definition at line 666 of file testbed_api_testbed.c.
References RunContextOperation::cls, DEBUG, GNUNET_assert, GNUNET_new, GNUNET_TESTBED_peer_start(), GNUNET_TIME_absolute_get(), insert_rcop(), GNUNET_TESTBED_RunHandle::num_peers, RunContextOperation::op, peer, GNUNET_TESTBED_RunHandle::peer_count, GNUNET_TESTBED_RunHandle::peers, GNUNET_TESTBED_RunHandle::pstart_time, and RunContextOperation::rc.
Referenced by peer_create_cb().
|
static |
Functions of this signature are called when a peer has been successfully created.
cls | the closure from GNUNET_TESTBED_peer_create() |
peer | the handle for the created peer; NULL on any error during creation |
emsg | NULL if peer is not NULL; else MAY contain the error description |
Definition at line 697 of file testbed_api_testbed.c.
References RunContextOperation::cls, DEBUG, GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_operation_done(), LOG, GNUNET_TESTBED_RunHandle::num_peers, RunContextOperation::op, peer, GNUNET_TESTBED_RunHandle::peer_count, GNUNET_TESTBED_RunHandle::peers, prof_time(), RunContextOperation::rc, RC_PEERS_CREATED, remove_rcop(), start_peers_task(), and GNUNET_TESTBED_RunHandle::state.
Referenced by create_peers().
|
static |
call test master callback
rc | the RunContext |
Definition at line 731 of file testbed_api_testbed.c.
References GNUNET_SCHEDULER_cancel(), GNUNET_TESTBED_RunHandle::links_failed, GNUNET_TESTBED_RunHandle::links_succeeded, GNUNET_TESTBED_RunHandle::num_peers, GNUNET_TESTBED_RunHandle::peers, GNUNET_TESTBED_RunHandle::test_master, GNUNET_TESTBED_RunHandle::test_master_cls, and GNUNET_TESTBED_RunHandle::timeout_task.
Referenced by event_cb(), and topology_completion_callback().
|
static |
Callbacks of this type are called when topology configuration is completed.
cls | the operation closure given to GNUNET_TESTBED_overlay_configure_topology_va() and GNUNET_TESTBED_overlay_configure() calls |
nsuccess | the number of successful overlay connects |
nfailures | the number of overlay connects which failed |
Definition at line 751 of file testbed_api_testbed.c.
References call_master(), DEBUG, GNUNET_TESTBED_operation_done(), GNUNET_TESTBED_RunHandle::links_failed, GNUNET_TESTBED_RunHandle::links_succeeded, prof_time(), RC_READY, GNUNET_TESTBED_RunHandle::state, and GNUNET_TESTBED_RunHandle::topology_operation.
Referenced by event_cb().
|
static |
Function to create peers.
rc | the RunContext |
Definition at line 772 of file testbed_api_testbed.c.
References GNUNET_TESTBED_RunHandle::c, GNUNET_TESTBED_RunHandle::cfg, DEBUG, GNUNET_assert, GNUNET_malloc, GNUNET_new, GNUNET_TESTBED_peer_create(), GNUNET_TIME_absolute_get(), GNUNET_TESTBED_RunHandle::h, GNUNET_TESTBED_RunHandle::hosts, insert_rcop(), GNUNET_TESTBED_RunHandle::num_hosts, GNUNET_TESTBED_RunHandle::num_peers, RunContextOperation::op, peer, GNUNET_TESTBED_RunHandle::peer_count, peer_create_cb(), GNUNET_TESTBED_RunHandle::peers, GNUNET_TESTBED_RunHandle::pstart_time, and RunContextOperation::rc.
Referenced by controller_status_cb(), and event_cb().
|
static |
Signature of the event handler function called by the respective event controller.
cls | closure |
event | information about the event |
Definition at line 808 of file testbed_api_testbed.c.
References _, call_master(), GNUNET_TESTBED_RunHandle::cc, GNUNET_TESTBED_RunHandle::cc_cls, GNUNET_TESTBED_RunHandle::cfg, create_peers(), DEBUG, GNUNET_TESTBED_EventInformation::details, GNUNET_TESTBED_RunHandle::event_mask, GNUNET_assert, GNUNET_break, GNUNET_CONFIGURATION_get_value_number(), GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_NO, GNUNET_OK, GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_ET_OPERATION_FINISHED, GNUNET_TESTBED_ET_PEER_START, GNUNET_TESTBED_operation_done(), GNUNET_TESTBED_overlay_configure_topology(), GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, GNUNET_TESTBED_TOPOLOGY_FROM_FILE, GNUNET_TESTBED_TOPOLOGY_NONE, GNUNET_TESTBED_TOPOLOGY_OPTION_END, GNUNET_TESTBED_TOPOLOGY_SCALE_FREE, GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD, GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING, GNUNET_TIME_absolute_get(), GNUNET_YES, consensus-simulation::int, LOG, GNUNET_TESTBED_RunHandle::num_hosts, GNUNET_TESTBED_RunHandle::num_oc, GNUNET_TESTBED_RunHandle::num_peers, number, GNUNET_TESTBED_EventInformation::op, RunContextOperation::op, GNUNET_TESTBED_EventInformation::operation_finished, GNUNET_TESTBED_RunHandle::peer_count, GNUNET_TESTBED_RunHandle::peers, prof_time(), GNUNET_TESTBED_RunHandle::pstart_time, GNUNET_TESTBED_RunHandle::random_links, RunContextOperation::rc, RC_INIT, RC_LINKED, RC_PEERS_CREATED, RC_PEERS_SHUTDOWN, RC_READY, GNUNET_TESTBED_RunHandle::reg_hosts, remove_rcop(), SCALE_FREE_CAP, SCALE_FREE_M, search_rcop(), GNUNET_TESTBED_RunHandle::shutdown, GNUNET_TESTBED_RunHandle::state, TESTBED_CONFIG_SECTION, GNUNET_TESTBED_RunHandle::topo_file, GNUNET_TESTBED_RunHandle::topology, topology_completion_callback(), GNUNET_TESTBED_RunHandle::topology_operation, and GNUNET_TESTBED_EventInformation::type.
Referenced by controller_status_cb().
|
static |
Task to register all hosts available in the global host list.
cls | the RunContext |
Definition at line 1009 of file testbed_api_testbed.c.
References GNUNET_TESTBED_RunHandle::c, DEBUG, GNUNET_assert, GNUNET_new, GNUNET_TESTBED_controller_link(), GNUNET_TESTBED_register_host(), GNUNET_YES, GNUNET_TESTBED_RunHandle::h, host_registration_completion(), GNUNET_TESTBED_RunHandle::hosts, insert_rcop(), GNUNET_TESTBED_RunHandle::num_hosts, RunContextOperation::op, RunContextOperation::rc, GNUNET_TESTBED_RunHandle::reg_handle, GNUNET_TESTBED_RunHandle::reg_hosts, and GNUNET_TESTBED_RunHandle::register_hosts_task.
Referenced by controller_status_cb(), and host_registration_completion().
|
static |
Callback which will be called to after a host registration succeeded or failed.
cls | the closure |
emsg | the error message; NULL if host registration is successful |
Definition at line 991 of file testbed_api_testbed.c.
References _, GNUNET_ERROR_TYPE_WARNING, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), LOG, GNUNET_TESTBED_RunHandle::reg_handle, register_hosts(), and GNUNET_TESTBED_RunHandle::register_hosts_task.
Referenced by register_hosts().
|
static |
Callback to signal successful startup of the controller process.
cls | the closure from GNUNET_TESTBED_controller_start() |
cfg | the configuration with which the controller has been started; NULL if status is not GNUNET_OK |
status | GNUNET_OK if the startup is successful; GNUNET_SYSERR if not, GNUNET_TESTBED_controller_stop() shouldn't be called in this case |
Definition at line 1050 of file testbed_api_testbed.c.
References _, GNUNET_TESTBED_RunHandle::c, cfg, GNUNET_TESTBED_RunHandle::cfg, GNUNET_TESTBED_RunHandle::cproc, create_peers(), event_cb(), event_mask, GNUNET_TESTBED_RunHandle::event_mask, GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_dup(), GNUNET_ERROR_TYPE_ERROR, GNUNET_log, GNUNET_OK, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_shutdown(), GNUNET_TESTBED_controller_connect(), GNUNET_TESTBED_ET_CONNECT, GNUNET_TESTBED_ET_OPERATION_FINISHED, GNUNET_TESTBED_ET_PEER_START, GNUNET_TESTBED_TOPOLOGY_NONE, GNUNET_TESTBED_RunHandle::h, GNUNET_TESTBED_RunHandle::num_hosts, RC_LINKED, GNUNET_TESTBED_RunHandle::reg_hosts, register_hosts(), GNUNET_TESTBED_RunHandle::register_hosts_task, GNUNET_TESTBED_RunHandle::state, status, and GNUNET_TESTBED_RunHandle::topology.
Referenced by GNUNET_TESTBED_run(), and host_habitable_cb().
|
static |
Callback function invoked for each interface found.
cls | closure |
name | name of the interface (can be NULL for unknown) |
isDefault | is this presumably the default interface |
addr | address of this interface (can be NULL for unknown or unassigned) |
broadcast_addr | the broadcast address (can be NULL for unknown or unassigned) |
netmask | the network mask (can be NULL for unknown or unassigned)) |
addrlen | length of the address |
Definition at line 1097 of file testbed_api_testbed.c.
References buf, GNUNET_asprintf(), GNUNET_ERROR_TYPE_WARNING, GNUNET_free, GNUNET_log_strerror, GNUNET_OK, GNUNET_strdup, GNUNET_YES, and GNUNET_TESTBED_RunHandle::trusted_ip.
Referenced by host_habitable_cb().
|
static |
Callbacks of this type are called by GNUNET_TESTBED_is_host_habitable to inform whether the given host is habitable or not.
The Handle returned by GNUNET_TESTBED_is_host_habitable() is invalid after this callback is called
cls | NULL |
host | the host whose status is being reported; will be NULL if the host given to GNUNET_TESTBED_is_host_habitable() is NULL |
status | GNUNET_YES if it is habitable; GNUNET_NO if not |
Definition at line 1133 of file testbed_api_testbed.c.
References _, controller_status_cb(), GNUNET_TESTBED_RunHandle::cproc, GNUNET_assert, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_malloc, GNUNET_memcpy, GNUNET_NO, GNUNET_OS_network_interfaces_list(), GNUNET_SCHEDULER_shutdown(), GNUNET_strdup, GNUNET_TESTBED_controller_start(), GNUNET_TESTBED_host_get_hostname(), GNUNET_TESTBED_host_resolve_(), CompatibilityCheckContext::h, GNUNET_TESTBED_RunHandle::h, GNUNET_TESTBED_RunHandle::hclist, GNUNET_TESTBED_RunHandle::hosts, CompatibilityCheckContext::index, LOG, netint_proc(), GNUNET_TESTBED_RunHandle::num_hosts, CompatibilityCheckContext::rc, GNUNET_TESTBED_RunHandle::reg_hosts, status, and GNUNET_TESTBED_RunHandle::trusted_ip.
Referenced by GNUNET_TESTBED_run().
|
static |
Task run upon timeout while setting up the testbed.
cls | the RunContext |
Definition at line 1203 of file testbed_api_testbed.c.
References _, GNUNET_ERROR_TYPE_ERROR, GNUNET_SCHEDULER_shutdown(), LOG, GNUNET_TESTBED_RunHandle::test_master, GNUNET_TESTBED_RunHandle::test_master_cls, and GNUNET_TESTBED_RunHandle::timeout_task.
Referenced by GNUNET_TESTBED_run().