TESTBED service components that deals with starting slave controllers and establishing lateral links between controllers. More...
Go to the source code of this file.
Data Structures | |
struct | Slave |
Structure representing a connected(directly-linked) controller. More... | |
Typedefs | |
typedef void(* | GST_NeighbourConnectNotifyCallback) (void *cls, struct GNUNET_TESTBED_Controller *controller) |
The notification callback to call when we are connect to neighbour. More... | |
Functions | |
void | GST_neighbour_list_clean (void) |
Cleans up the neighbour list. More... | |
struct Neighbour * | GST_get_neighbour (uint32_t id) |
Get a neighbour from the neighbour list. More... | |
void | GST_free_nccq (void) |
Function to cleanup the neighbour connect contexts. More... | |
struct NeighbourConnectNotification * | GST_neighbour_get_connection (struct Neighbour *n, GST_NeighbourConnectNotifyCallback cb, void *cb_cls) |
Try to open a connection to the given neighbour. More... | |
void | GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h) |
Cancel the request for opening a connection to the neighbour. More... | |
void | GST_neighbour_release_connection (struct Neighbour *n) |
Release the connection to the neighbour. More... | |
struct Neighbour * | GST_create_neighbour (struct GNUNET_TESTBED_Host *host) |
Function to create a neighbour and add it into the neighbour list. More... | |
void | handle_link_controllers (void *cls, const struct GNUNET_TESTBED_ControllerLinkRequest *msg) |
Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message. More... | |
void | GST_link_notify_disconnect (struct GNUNET_SERVICE_Client *client) |
Clean up client handle if we stored any via handle_link_controllers(), the given client disconnected. More... | |
void | GST_slave_list_clear (void) |
Cleans up the slave list. More... | |
Variables | |
struct Slave ** | GST_slave_list |
A list of directly linked neighbours. More... | |
unsigned int | GST_slave_list_size |
The size of directly linked neighbours list. More... | |
TESTBED service components that deals with starting slave controllers and establishing lateral links between controllers.
Definition in file gnunet-service-testbed_links.h.
typedef void(* GST_NeighbourConnectNotifyCallback) (void *cls, struct GNUNET_TESTBED_Controller *controller) |
The notification callback to call when we are connect to neighbour.
cls | the closure given to GST_neighbour_get_connection() |
controller | the controller handle to the neighbour |
Definition at line 131 of file gnunet-service-testbed_links.h.
void GST_neighbour_list_clean | ( | void | ) |
Cleans up the neighbour list.
Definition at line 1094 of file gnunet-service-testbed_links.c.
References Neighbour::conn_op, GNUNET_free, GNUNET_TESTBED_operation_release_(), id, neighbour_list, and neighbour_list_size.
Referenced by shutdown_task().
struct Neighbour* GST_get_neighbour | ( | uint32_t | id | ) |
Get a neighbour from the neighbour list.
id | the index of the neighbour in the neighbour list |
Definition at line 1120 of file gnunet-service-testbed_links.c.
References id, neighbour_list, and neighbour_list_size.
Referenced by handle_overlay_connect().
void GST_free_nccq | ( | void | ) |
Function to cleanup the neighbour connect contexts.
Definition at line 1132 of file gnunet-service-testbed_links.c.
References cleanup_ncc(), and ncc_head.
Referenced by shutdown_task().
struct NeighbourConnectNotification* GST_neighbour_get_connection | ( | struct Neighbour * | n, |
GST_NeighbourConnectNotifyCallback | cb, | ||
void * | cb_cls | ||
) |
Try to open a connection to the given neighbour.
If the connection is open already, then it is re-used. If not, the request is queued in the operation queues responsible for bounding the total number of file descriptors. The actual connection will happen when the operation queue marks the corresponding operation as active.
n | the neighbour to open a connection to |
cb | the notification callback to call when the connection is opened |
cb_cls | the closure for the above callback |
Definition at line 986 of file gnunet-service-testbed_links.c.
References NeighbourConnectNotification::cb, NeighbourConnectNotification::cb_cls, Neighbour::conn_op, Neighbour::controller, GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_new, GNUNET_TESTBED_operation_begin_wait_(), GNUNET_TESTBED_operation_create_(), GNUNET_TESTBED_operation_queue_insert_(), GST_opq_openfds, h, Neighbour::host_id, LOG_DEBUG, NeighbourConnectNotification::n, Neighbour::nl_head, Neighbour::nl_tail, oprelease_neighbour_conn(), opstart_neighbour_conn(), and trigger_notifications().
Referenced by handle_link_controllers(), and handle_overlay_connect().
void GST_neighbour_get_connection_cancel | ( | struct NeighbourConnectNotification * | h | ) |
Cancel the request for opening a connection to the neighbour.
h | the notification handle |
Definition at line 1020 of file gnunet-service-testbed_links.c.
References cleanup_task, Neighbour::conn_op, GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_NO, GNUNET_SCHEDULER_cancel(), GNUNET_TESTBED_operation_inactivate_(), GNUNET_YES, h, Neighbour::inactive, Neighbour::nl_head, Neighbour::nl_tail, Neighbour::notify_task, Neighbour::reference_cnt, and trigger_notifications().
Referenced by cleanup_ncc(), and cleanup_occ_rp2c().
void GST_neighbour_release_connection | ( | struct Neighbour * | n | ) |
Release the connection to the neighbour.
The actual connection will be closed if connections to other neighbour are waiting (to maintain a bound on the total number of connections that are open).
n | the neighbour whose connection can be closed |
Definition at line 1058 of file gnunet-service-testbed_links.c.
References Neighbour::conn_op, GNUNET_assert, GNUNET_TESTBED_operation_inactivate_(), Neighbour::inactive, and Neighbour::reference_cnt.
Referenced by cleanup_occ_rp2c(), and neighbour_connect_cb().
struct Neighbour* GST_create_neighbour | ( | struct GNUNET_TESTBED_Host * | host | ) |
Function to create a neighbour and add it into the neighbour list.
host | the host of the neighbour |
Definition at line 1188 of file gnunet-service-testbed_links.c.
References GNUNET_new, GNUNET_TESTBED_host_get_id_(), Neighbour::host_id, and neighbour_list_add().
Referenced by handle_link_controllers(), and handle_overlay_connect().
void handle_link_controllers | ( | void * | cls, |
const struct GNUNET_TESTBED_ControllerLinkRequest * | msg | ||
) |
Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_LCONTROLLERS message.
cls | identification of the client |
msg | the actual message |
Definition at line 1206 of file gnunet-service-testbed_links.c.
References LinkControllersContext::client, LCFContext::client, NeighbourConnectCtxt::client, Slave::controller_proc, LCFContext::delegated_host_id, Route::dest, LCFContext::gateway, GNUNET_assert, GNUNET_break, GNUNET_break_op, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_CONTAINER_multihashmap_create(), GNUNET_ERROR_TYPE_WARNING, GNUNET_new, GNUNET_NO, GNUNET_ntohll(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_now(), GNUNET_SERVICE_client_continue(), GNUNET_SERVICE_client_drop(), GNUNET_TESTBED_controller_start(), GST_context, GST_create_neighbour(), GST_find_dest_route(), GST_host_list, GST_host_list_size, GST_neighbour_get_connection(), GST_slave_list, GST_slave_list_size, GST_timeout, Context::host_id, Slave::host_id, INIT, LCFContext::is_subordinate, Slave::lcc, lcf_head, lcf_proc_task(), lcf_proc_task_id, lcf_tail, LOG, LOG_DEBUG, Context::master_ip, msg, NeighbourConnectCtxt::n, ncc_head, ncc_tail, neighbour_connect_cb(), neighbour_list, neighbour_list_size, NeighbourConnectCtxt::nh, NeighbourConnectCtxt::op_id, LinkControllersContext::operation_id, LCFContext::operation_id, Slave::reghost_map, route_list, route_list_add(), route_list_size, LCFContext::slave_host_id, slave_list_add(), slave_status_cb(), LCFContext::state, Route::thru, timeout_neighbour_connect(), and NeighbourConnectCtxt::timeout_task.
void GST_link_notify_disconnect | ( | struct GNUNET_SERVICE_Client * | client | ) |
Clean up client handle if we stored any via handle_link_controllers(), the given client disconnected.
client | the client that is history |
Definition at line 1391 of file gnunet-service-testbed_links.c.
References cleanup_ncc(), LinkControllersContext::client, LCFContext::client, NeighbourConnectCtxt::client, drop_client_entries(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multihashmap_iterate(), GNUNET_free, GNUNET_TESTBED_operation_done(), GST_slave_list, GST_slave_list_size, Slave::lcc, lcf_head, lcf_tail, ncc_head, LCFContext::next, NeighbourConnectCtxt::next, LCFContext::op, and Slave::reghost_map.
Referenced by client_disconnect_cb().
void GST_slave_list_clear | ( | void | ) |
Cleans up the slave list.
Definition at line 493 of file gnunet-service-testbed_links.c.
References destroy_slave(), GNUNET_free, GST_slave_list, GST_slave_list_size, id, and kill_slave().
Referenced by shutdown_task().
|
extern |
A list of directly linked neighbours.
Definition at line 283 of file gnunet-service-testbed_links.c.
Referenced by destroy_slave(), GST_link_notify_disconnect(), GST_slave_list_clear(), handle_barrier_init(), handle_link_controllers(), handle_peer_create(), handle_shutdown_peers(), handle_slave_get_config(), and slave_list_add().
|
extern |
The size of directly linked neighbours list.
Definition at line 288 of file gnunet-service-testbed_links.c.
Referenced by GST_link_notify_disconnect(), GST_slave_list_clear(), handle_barrier_init(), handle_link_controllers(), handle_shutdown_peers(), handle_slave_get_config(), and slave_list_add().