internal API to access the 'hosts' subsystem More...
#include "testbed.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_TESTBED_HostRegistrationHandle |
handle for host registration More... | |
Functions | |
struct GNUNET_TESTBED_Host * | GNUNET_TESTBED_host_lookup_by_id_ (uint32_t id) |
Lookup a host by ID. More... | |
struct GNUNET_TESTBED_Host * | GNUNET_TESTBED_host_create_by_id_ (uint32_t id, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Create a host by ID; given this host handle, we could not run peers at the host, but we can talk about the host internally. More... | |
uint32_t | GNUNET_TESTBED_host_get_id_ (const struct GNUNET_TESTBED_Host *host) |
Obtain a host's unique global ID. More... | |
const char * | GNUNET_TESTBED_host_get_username_ (const struct GNUNET_TESTBED_Host *host) |
Obtain the host's username. More... | |
uint16_t | GNUNET_TESTBED_host_get_ssh_port_ (const struct GNUNET_TESTBED_Host *host) |
Obtain the host's ssh port. More... | |
const struct GNUNET_CONFIGURATION_Handle * | GNUNET_TESTBED_host_get_cfg_ (const struct GNUNET_TESTBED_Host *host) |
Obtain the host's configuration template. More... | |
void | GNUNET_TESTBED_host_replace_cfg_ (struct GNUNET_TESTBED_Host *host, const struct GNUNET_CONFIGURATION_Handle *new_cfg) |
Function to replace host's configuration. More... | |
void | GNUNET_TESTBED_mark_host_registered_at_ (struct GNUNET_TESTBED_Host *host, const struct GNUNET_TESTBED_Controller *controller) |
Marks a host as registered with a controller. More... | |
void | GNUNET_TESTBED_deregister_host_at_ (struct GNUNET_TESTBED_Host *host, const struct GNUNET_TESTBED_Controller *const controller) |
Unmarks a host registered at a controller. More... | |
int | GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host, const struct GNUNET_TESTBED_Controller *controller) |
Checks whether a host has been registered with the given controller. More... | |
void | GNUNET_TESTBED_host_queue_oc_ (struct GNUNET_TESTBED_Host *h, struct GNUNET_TESTBED_Operation *op) |
Queues the given operation in the queue for parallel overlay connects of the given host. More... | |
void | GNUNET_TESTBED_controller_kill_ (struct GNUNET_TESTBED_ControllerProc *cproc) |
Sends termination signal to the controller's helper process. More... | |
void | GNUNET_TESTBED_controller_destroy_ (struct GNUNET_TESTBED_ControllerProc *cproc) |
Cleans-up the controller's helper process handle. More... | |
void | GNUNET_TESTBED_host_resolve_ (struct GNUNET_TESTBED_Host *host) |
Resolves the hostname of the host to an ip address. More... | |
void | GNUNET_TESTBED_extract_cfg (struct GNUNET_TESTBED_Host *host, const struct GNUNET_MessageHeader *message) |
internal API to access the 'hosts' subsystem
Definition in file testbed_api_hosts.h.
struct GNUNET_TESTBED_Host* GNUNET_TESTBED_host_lookup_by_id_ | ( | uint32_t | id | ) |
Lookup a host by ID.
id | global host ID assigned to the host; 0 is reserved to always mean 'localhost' |
id | global host ID assigned to the host; 0 is reserved to always mean 'localhost' |
Definition at line 189 of file testbed_api_hosts.c.
References host_list, host_list_size, and id.
Referenced by handle_link_controllers_result().
struct GNUNET_TESTBED_Host* GNUNET_TESTBED_host_create_by_id_ | ( | uint32_t | id, |
const struct GNUNET_CONFIGURATION_Handle * | cfg | ||
) |
Create a host by ID; given this host handle, we could not run peers at the host, but we can talk about the host internally.
id | global host ID assigned to the host; 0 is reserved to always mean 'localhost' |
cfg | the configuration to use as a template while starting a controller on this host. Operation queue sizes specific to a host are also read from this configuration handle |
Definition at line 210 of file testbed_api_hosts.c.
References cfg, and GNUNET_TESTBED_host_create_with_id().
uint32_t GNUNET_TESTBED_host_get_id_ | ( | const struct GNUNET_TESTBED_Host * | host | ) |
Obtain a host's unique global ID.
host | handle to the host, NULL means 'localhost' |
Definition at line 219 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::id.
Referenced by GNUNET_TESTBED_controller_connect(), GNUNET_TESTBED_controller_link(), GNUNET_TESTBED_controller_start(), GNUNET_TESTBED_get_next_op_id(), GNUNET_TESTBED_get_slave_config(), GNUNET_TESTBED_hosts_load_from_file(), GNUNET_TESTBED_register_host(), GST_create_neighbour(), GST_queue_host_registration(), handle_add_host_confirm(), host_list_add(), hr_completion(), opstart_overlay_connect(), opstart_peer_create(), and register_next_host().
const char* GNUNET_TESTBED_host_get_username_ | ( | const struct GNUNET_TESTBED_Host * | host | ) |
Obtain the host's username.
host | handle to the host, NULL means 'localhost' |
Definition at line 245 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::username.
Referenced by GNUNET_TESTBED_register_host().
uint16_t GNUNET_TESTBED_host_get_ssh_port_ | ( | const struct GNUNET_TESTBED_Host * | host | ) |
Obtain the host's ssh port.
host | handle to the host, NULL means 'localhost' |
Definition at line 258 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::port.
Referenced by GNUNET_TESTBED_register_host().
const struct GNUNET_CONFIGURATION_Handle* GNUNET_TESTBED_host_get_cfg_ | ( | const struct GNUNET_TESTBED_Host * | host | ) |
Obtain the host's configuration template.
host | handle to the host |
Definition at line 284 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::cfg.
Referenced by GNUNET_TESTBED_controller_connect(), GNUNET_TESTBED_controller_start(), handle_slave_get_config(), and slave_event_cb().
void GNUNET_TESTBED_host_replace_cfg_ | ( | struct GNUNET_TESTBED_Host * | host, |
const struct GNUNET_CONFIGURATION_Handle * | new_cfg | ||
) |
Function to replace host's configuration.
host | the host handle |
new_cfg | the new configuration to replace the old one |
Definition at line 297 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::cfg, GNUNET_CONFIGURATION_destroy(), and GNUNET_CONFIGURATION_dup().
Referenced by handle_link_controllers_result().
void GNUNET_TESTBED_mark_host_registered_at_ | ( | struct GNUNET_TESTBED_Host * | host, |
const struct GNUNET_TESTBED_Controller *const | controller | ||
) |
Marks a host as registered with a controller.
host | the host to mark |
controller | the controller at which this host is registered |
Definition at line 605 of file testbed_api_hosts.c.
References RegisteredController::controller, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_new, RegisteredController::next, GNUNET_TESTBED_Host::rc_head, and GNUNET_TESTBED_Host::rc_tail.
Referenced by GNUNET_TESTBED_controller_connect(), and handle_add_host_confirm().
void GNUNET_TESTBED_deregister_host_at_ | ( | struct GNUNET_TESTBED_Host * | host, |
const struct GNUNET_TESTBED_Controller *const | controller | ||
) |
Unmarks a host registered at a controller.
host | the host to unmark |
controller | the controller at which this host has to be unmarked |
Definition at line 632 of file testbed_api_hosts.c.
References RegisteredController::controller, GNUNET_break, GNUNET_CONTAINER_DLL_remove, GNUNET_free, RegisteredController::next, GNUNET_TESTBED_Host::rc_head, and GNUNET_TESTBED_Host::rc_tail.
Referenced by GNUNET_TESTBED_controller_disconnect().
int GNUNET_TESTBED_is_host_registered_ | ( | const struct GNUNET_TESTBED_Host * | host, |
const struct GNUNET_TESTBED_Controller *const | controller | ||
) |
Checks whether a host has been registered with the given controller.
host | the host to check |
controller | the controller at which host's registration is checked |
Checks whether a host has been registered with the given controller.
host | the host to check |
controller | the controller at which host's registration is checked |
Definition at line 659 of file testbed_api_hosts.c.
References RegisteredController::controller, GNUNET_NO, GNUNET_YES, RegisteredController::next, and GNUNET_TESTBED_Host::rc_head.
Referenced by GNUNET_TESTBED_controller_link(), GNUNET_TESTBED_get_slave_config(), GNUNET_TESTBED_register_host(), and lcf_proc_task().
void GNUNET_TESTBED_host_queue_oc_ | ( | struct GNUNET_TESTBED_Host * | h, |
struct GNUNET_TESTBED_Operation * | op | ||
) |
Queues the given operation in the queue for parallel overlay connects of the given host.
h | the host handle |
op | the operation to queue in the given host's parally overlay connect queue |
Definition at line 1489 of file testbed_api_hosts.c.
References GNUNET_TESTBED_operation_queue_insert_(), h, and op.
Referenced by GNUNET_TESTBED_overlay_connect().
void GNUNET_TESTBED_controller_kill_ | ( | struct GNUNET_TESTBED_ControllerProc * | cproc | ) |
Sends termination signal to the controller's helper process.
cproc | the handle to the controller's helper process |
Definition at line 1147 of file testbed_api_hosts.c.
References GNUNET_HELPER_kill(), GNUNET_HELPER_send_cancel(), GNUNET_YES, GNUNET_TESTBED_ControllerProc::helper, and GNUNET_TESTBED_ControllerProc::shandle.
Referenced by GNUNET_TESTBED_controller_stop(), and kill_slave().
void GNUNET_TESTBED_controller_destroy_ | ( | struct GNUNET_TESTBED_ControllerProc * | cproc | ) |
Cleans-up the controller's helper process handle.
cproc | the handle to the controller's helper process |
Definition at line 1162 of file testbed_api_hosts.c.
References GNUNET_TESTBED_Host::controller_started, free_argv(), GNUNET_break, GNUNET_free, GNUNET_HELPER_destroy(), GNUNET_HELPER_wait(), GNUNET_NO, GNUNET_OK, GNUNET_TESTBED_ControllerProc::helper, GNUNET_TESTBED_ControllerProc::helper_argv, GNUNET_TESTBED_ControllerProc::host, GNUNET_TESTBED_Host::locked, and GNUNET_TESTBED_ControllerProc::msg.
Referenced by destroy_slave(), and GNUNET_TESTBED_controller_stop().
void GNUNET_TESTBED_host_resolve_ | ( | struct GNUNET_TESTBED_Host * | host | ) |
Resolves the hostname of the host to an ip address.
host | the host whose hostname is to be resolved |
Definition at line 1504 of file testbed_api_hosts.c.
References GNUNET_break, GNUNET_free, GNUNET_strdup, hostname, GNUNET_TESTBED_Host::hostname, and simple_resolve().
Referenced by host_habitable_cb().
void GNUNET_TESTBED_extract_cfg | ( | struct GNUNET_TESTBED_Host * | host, |
const struct GNUNET_MessageHeader * | message | ||
) |