44 #define LOG(kind, ...) \
45 GNUNET_log (kind, __VA_ARGS__)
50 #define LOG_DEBUG(...) \
51 LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__)
56 #define LIST_GROW_STEP 10
473 #define VALID_HOST_ID(id) \
474 (((id) < GST_host_list_size) && (NULL != GST_host_list[id]))
479 #define VALID_PEER_ID(id) \
480 (((id) < GST_peer_list_size) && (NULL != GST_peer_list[id]))
494 #define GST_array_grow_large_enough(ptr, size, accommodate_size) \
497 unsigned int growth_size; \
498 GNUNET_assert (size <= accommodate_size); \
499 growth_size = size; \
500 while (growth_size <= accommodate_size) \
501 growth_size += LIST_GROW_STEP; \
502 GNUNET_array_grow (ptr, size, growth_size); \
503 GNUNET_assert (size > accommodate_size); \
597 uint64_t operation_id,
627 uint64_t operation_id);
struct GNUNET_MessageHeader * msg
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static char * peer_id
Option –peer.
const struct GNUNET_MessageHeader * GST_cache_lookup_hello(const unsigned int peer_id)
Looks up in the hello cache and returns the HELLO of the given peer.
void GST_forwarded_operation_reply_relay(void *cls, const struct GNUNET_MessageHeader *msg)
Callback to relay the reply msg of a forwarded operation back to the client.
void handle_overlay_connect(void *cls, const struct GNUNET_TESTBED_OverlayConnectMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT messages.
void GST_route_list_clear(void)
Cleans up the route list.
struct OperationQueue * GST_opq_openfds
Operation queue for open file descriptors.
void GST_free_mctxq(void)
Frees the ManageServiceContext queue.
int check_peer_reconfigure(void *cls, const struct GNUNET_TESTBED_PeerReconfigureMessage *msg)
Check #GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages.
unsigned int GST_num_local_peers
The current number of peers running locally under this controller.
struct ForwardedOperationContext * fopcq_head
DLL head for forwarded operation contexts.
int check_remote_overlay_connect(void *cls, const struct GNUNET_TESTBED_RemoteOverlayConnectMessage *msg)
Check GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT messages.
struct GNUNET_TESTBED_Host ** GST_host_list
Array of hosts.
void handle_peer_destroy(void *cls, const struct GNUNET_TESTBED_PeerDestroyMessage *msg)
Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER messages.
void GST_stats_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
Initialize logging CPU and IO statisticfs.
struct Context * GST_context
The master context; generated with the first INIT message.
void GST_notify_client_disconnect_peers(struct GNUNET_SERVICE_Client *client)
Notify peers subsystem that client disconnected.
struct GNUNET_TIME_Relative GST_timeout
Timeout for operations which may take some time.
struct Route * GST_find_dest_route(uint32_t host_id)
Finds the route with directly connected host as destination through which the destination host can be...
void GST_destroy_peers(void)
Stops and destroys all peers.
void handle_shutdown_peers(void *cls, const struct GNUNET_TESTBED_ShutdownPeersMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS messages.
unsigned int GST_host_list_size
The size of the host list.
void GST_send_operation_fail_msg(struct GNUNET_SERVICE_Client *client, uint64_t operation_id, const char *emsg)
Send operation failure message to client.
void handle_remote_overlay_connect(void *cls, const struct GNUNET_TESTBED_RemoteOverlayConnectMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_REMOTE_OVERLAY_CONNECT messages.
void GST_cache_clear(void)
Clear cache.
void GST_stats_destroy(void)
Shutdown the status calls module.
void handle_peer_get_config(void *cls, const struct GNUNET_TESTBED_PeerGetConfigurationMessage *msg)
Handler for #GNUNET_MESSAGE_TYPE_TESTBED_GETPEERCONFIG messages.
void GST_cleanup_focc(struct ForwardedOverlayConnectContext *focc)
Cleans up ForwardedOverlayConnectContext.
void handle_manage_peer_service(void *cls, const struct GNUNET_TESTBED_ManagePeerServiceMessage *msg)
Handler for GNUNET_MESSAGE_TYPE_TESTBED_MANAGE_PEER_SERVICE messages.
void GST_free_lcf(void)
Cleans up the queue used for forwarding link controllers requests.
void GST_destroy_peer(struct Peer *peer)
Function to destroy a peer.
unsigned int GST_peer_list_size
The size of the peer list.
struct GNUNET_CONFIGURATION_Handle * GST_config
Our configuration.
void GST_queue_host_registration(struct Slave *slave, GNUNET_TESTBED_HostRegistrationCompletion cb, void *cb_cls, struct GNUNET_TESTBED_Host *host)
Adds a host registration's request to a slave's registration queue.
void handle_peer_start(void *cls, const struct GNUNET_TESTBED_PeerStartMessage *msg)
Message handler for GNUNET_MESSAGE_TYPE_TESTBED_START_PEER messages.
void GST_free_roccq(void)
Clears all pending remote overlay connect contexts in queue.
void handle_peer_stop(void *cls, const struct GNUNET_TESTBED_PeerStopMessage *msg)
Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_DESTROYPEER messages.
struct ForwardedOperationContext * fopcq_tail
DLL tail for forwarded operation contexts.
void GST_process_next_focc(struct RegisteredHostContext *rhc)
Processes a forwarded overlay connect context in the queue of the given RegisteredHostContext.
void handle_peer_reconfigure(void *cls, const struct GNUNET_TESTBED_PeerReconfigureMessage *msg)
Handler for #GNUNET_MESSAGE_TYPDE_TESTBED_RECONFIGURE_PEER type messages.
void GST_notify_client_disconnect_oc(struct GNUNET_SERVICE_Client *client)
Notify OC subsystem that client disconnected.
void GST_forwarded_operation_timeout(void *cls)
Task to free resources when forwarded operation has been timed out.
int check_peer_create(void *cls, const struct GNUNET_TESTBED_PeerCreateMessage *msg)
Check #GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER messages.
void GST_clear_fopcq(void)
Clears the forwarded operations queue.
void GST_send_operation_success_msg(struct GNUNET_SERVICE_Client *client, uint64_t operation_id)
Function to send generic operation success message to given client.
struct Peer ** GST_peer_list
A list of peers we know about.
void GST_cache_init(unsigned int size)
Initializes the cache.
void GST_free_prcq(void)
Cleans up the Peer reconfigure context list.
void handle_peer_create(void *cls, const struct GNUNET_TESTBED_PeerCreateMessage *msg)
Handler for #GNUNET_MESSAGE_TYPE_TESTBED_CREATEPEER messages.
void GST_free_occq(void)
Clears all pending overlay connect contexts in queue.
char * GST_stats_dir
The directory where to store load statistics data.
void GST_cache_add_hello(const unsigned int peer_id, const struct GNUNET_MessageHeader *hello)
Caches the HELLO of the given peer.
int check_manage_peer_service(void *cls, const struct GNUNET_TESTBED_ManagePeerServiceMessage *msg)
Check GNUNET_MESSAGE_TYPE_TESTBED_MANAGE_PEER_SERVICE message.
TESTBED service components that deals with starting slave controllers and establishing lateral links ...
Core service; the main API for encrypted P2P communications.
API for writing tests and creating large-scale emulation testbeds for GNUnet.
Convenience API for writing testcases for GNUnet.
void(* GNUNET_TESTBED_HostRegistrationCompletion)(void *cls, const char *emsg)
Callback which will be called to after a host registration succeeded or failed.
static unsigned int size
Size of the "table".
Context to hold data of peer.
char * master_ip
The network address of the master controller.
struct GNUNET_SERVICE_Client * client
The client handle associated with this context.
uint32_t host_id
Our host id according to this context.
struct GNUNET_TESTING_System * system
The TESTING system handle for starting peers locally.
Context information for operations forwarded to subcontrollers.
struct GNUNET_SCHEDULER_Task * timeout_task
Task ID for the timeout task.
struct ForwardedOperationContext * prev
The prev pointer for DLL.
void * cls
Closure pointer.
enum OperationType type
The type of the operation which is forwarded.
struct OperationContext * opc
The generated operation context.
struct GNUNET_SERVICE_Client * client
The client to which we have to reply.
struct ForwardedOperationContext * next
The next pointer for DLL.
uint64_t operation_id
The id of the operation that has been forwarded.
Context information to used during operations which forward the overlay connect message.
struct RegisteredHostContext * rhc
Which host does this FOCC belong to?
uint32_t peer2
The id of peer 2.
uint64_t operation_id
The id of the operation which created this context information.
struct ForwardedOverlayConnectContext * next
next ForwardedOverlayConnectContext in the DLL
struct GNUNET_SERVICE_Client * client
The client handle.
uint32_t peer2_host_id
Id of the host where peer2 is running.
struct ForwardedOverlayConnectContext * prev
previous ForwardedOverlayConnectContext in the DLL
struct GNUNET_MessageHeader * orig_msg
A copy of the original overlay connect message.
uint32_t peer1
the id of peer 1
Entry in list of pending tasks.
Handle to a client that is connected to a service.
Opaque handle to a host running experiments managed by the testing framework.
Message to start/stop services of a peer.
Message sent from client to testing service to connect two peers.
Message sent from client to testing service to create (configure, but not start) a peer.
Message sent from client to testing service to destroy a (stopped) peer.
Message sent from client to testing service to obtain the configuration of a peer.
Message sent from client to testing service to start a peer.
Message sent from client to testing service to stop a peer.
Message sent from host controller of a peer(A) to the host controller of another peer(B) to request B...
Handle for a GNUnet peer controlled by testing.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...
Time for relative time used by GNUnet, in microseconds.
Context data for GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS handler.
int timeout
Did we observe a timeout with respect to this operation at any of the slaves.
unsigned int nslaves
The number of slave we expect to hear from since we forwarded the GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOW...
A DLL of host registrations to be made.
struct GNUNET_TESTBED_Host * host
The host that has to be registered.
struct HostRegistration * prev
previous registration in the DLL
struct HostRegistration * next
next registration in the DLL
GNUNET_TESTBED_HostRegistrationCompletion cb
The callback to call after this registration's status is available.
void * cb_cls
The closure for the above callback.
Context information used while linking controllers.
uint64_t operation_id
The ID of the operation.
struct GNUNET_SERVICE_Client * client
The client which initiated the link controller operation.
Context information for GNUNET_TESTBED_Operation.
Queue of operations where we can only support a certain number of concurrent operations of a particul...
struct Slave * slave
The slave this peer is started through.
struct GNUNET_CONFIGURATION_Handle * cfg
The modified (by GNUNET_TESTING_peer_configure) configuration this peer is configured with.
uint32_t remote_host_id
The id of the remote host this peer is running on.
int is_remote
Is this peer locally created?
uint32_t destroy_flag
While destroying a peer, due to the fact that there could be references to this peer,...
struct GNUNET_TESTING_Peer * peer
The peer handle from testing API.
uint32_t reference_cnt
References to peers are using in forwarded overlay contexts and remote overlay connect contexts.
int is_running
Is the peer running.
uint32_t id
Our local reference id for this peer.
struct Peer::@57::@58 local
struct Peer::@57::@59 remote
This context information will be created for each host that is registered at slave controllers during...
enum RegisteredHostContext::RHCState state
struct GNUNET_TESTBED_Host * host
The host of the controller which has to connect to the above rhost.
struct ForwardedOverlayConnectContext * focc_dll_tail
Tail of the ForwardedOverlayConnectContext DLL.
struct ForwardedOverlayConnectContext * focc_dll_head
Head of the ForwardedOverlayConnectContext DLL.
struct GNUNET_TESTBED_Host * reg_host
The host which is being registered.
RHCState
Enumeration of states for this context.
@ RHC_DONE
State where we attempt to do the overlay connection again.
@ RHC_INIT
The initial state.
uint32_t thru
The destination host is reachable thru.
uint32_t dest
destination host
The structure for identifying a shared service.
char * name
The name of the shared service.
uint32_t num_shared
Number of shared peers per instance of the shared service.
uint32_t num_sharing
Number of peers currently sharing the service.
Structure representing a connected(directly-linked) controller.
IPC messages between testing API and service ("controller")
Interface for functions internally exported from testbed_api.c.
internal API to access the 'hosts' subsystem
internal API to access the 'operations' subsystem
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.