72 "Benchmarking done\n");
95 "Failed to connect peer 0 and %u\n",
174 return &top->
mps[c_p];
181 return &top->
sps[c_p];
211 "Unknown peer connected: `%s'\n",
219 "%s [%u] `%s' connected to %s [%u] %s\n",
237 "Master [%u] connected all slaves\n",
249 "All master peers connected all slave peers\n");
286 "%s disconnected from %s\n",
297 "%s disconnected from %s while benchmarking\n",
351 "Failed to create transport connection \n");
392 "Failed to create core connection \n");
420 _ (
"Connected master [%u] with slave [%u]\n"),
427 _ (
"Failed to connect master peer [%u] with slave [%u]\n"),
458 "Connecting peers on CORE level\n");
469 "Connecting master [%u] with slave [%u]\n",
483 "Could not connect master [%u] and slave [%u]\n",
501 static int comm_done = 0;
503 if ((NULL != emsg) || (NULL == ca_result))
506 "Initialization failed, shutdown\n");
516 "Connected to all %s services\n",
532 "Connecting to all %s services\n",
604 "Peer %u: ATS Service disconnected!\n",
628 "%s [%u] received ATS information: %s\n",
661 "Failed to create ATS performance handle \n");
683 static int op_done = 0;
685 if ((NULL != emsg) || (NULL == ca_result))
688 "Initialization failed, shutdown\n");
697 "Connected to all ATS services\n");
712 "Connecting to all ATS services\n");
754 "%s [%u] has peer id `%s'\n",
766 "Retrieved all peer ID, connect to ATS\n");
790 unsigned int links_succeeded,
791 unsigned int links_failed)
804 "Setting up %u masters and %u slaves\n",
812 top->
mps[c_m].
peer = peers_[c_m];
813 top->
mps[c_m].
no = c_m;
898 return &top->
mps[src];
928 unsigned int num_slaves,
929 unsigned int num_masters,
956 num_slaves + num_masters,
struct BenchmarkPeer * slave
The benchmarking slave to connect to.
static GNUNET_NETWORK_STRUCT_END struct GNUNET_PeerIdentity me
Our own peer identity.
static void connect_completion_callback(void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
static void peerinformation_cb(void *cb_cls, struct GNUNET_TESTBED_Operation *op, const struct GNUNET_TESTBED_PeerInformation *pinfo, const char *emsg)
int test_core
Test core (GNUNET_YES) or transport (GNUNET_NO)
struct GNUNET_TESTBED_Operation * comm_op
Testbed operation to connect to core.
int connected_CORE
Are we connected to all slave peers on CORE level: GNUNET_YES/NO.
static void ping(void *cls)
Send a ping to destination.
struct GNUNET_TESTBED_Operation * peer_id_op
Testbed operation to get peer information.
struct BenchmarkPeer * master
The benchmarking master initiating this connection.
Connect peers with testbed.
static void handle_pong(void *cls, const struct TestMessage *message)
uint32_t utilization_in
Actual traffic on this connection from the other peer to this peer.
static struct BenchmarkPartner * find_partner(struct BenchmarkPeer *me, const struct GNUNET_PeerIdentity *peer)
struct GNUNET_TESTBED_Operation * ats_perf_op
Testbed operation to connect to ATS performance service.
#define TEST_ATS_PREFERENCE_DEFAULT
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_overlay_connect(void *op_cls, GNUNET_TESTBED_OperationCompletionCallback cb, void *cb_cls, struct GNUNET_TESTBED_Peer *p1, struct GNUNET_TESTBED_Peer *p2)
Both peers must have been started before calling this function.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
int GNUNET_TESTBED_test_run(const char *testname, const char *cfg_filename, 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 "simple" test on the local system with a single call from 'main'...
#define TEST_MESSAGE_TYPE_PONG
Message type sent as response during traffic generation.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
static void * comm_connect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_MQ_Handle *mq)
Method called whenever a given peer connects.
static int op_result(struct GNUNET_OP_Handle *h, uint64_t op_id, int64_t result_code, const void *data, uint16_t data_size, void **ctx, uint8_t cancel)
Remove an operation, and call its result callback (unless it was cancelled).
struct GNUNET_CORE_Handle * ch
Core handle.
void GNUNET_ATS_TEST_traffic_handle_pong(struct BenchmarkPartner *p)
struct BenchmarkPartner * partners
Array of partners with num_slaves entries (if master) or num_master entries (if slave) ...
struct GNUNET_ATS_TEST_Topology * top
static void ats_performance_info_cb(void *cls, const struct GNUNET_HELLO_Address *address, int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *ats_prop)
struct GNUNET_TRANSPORT_CoreHandle * th
Transport handle.
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
void GNUNET_ATS_performance_done(struct GNUNET_ATS_PerformanceHandle *ph)
Client is done using the ATS performance subsystem, release resources.
#define TEST_MESSAGE_TYPE_PING
Message type sent for traffic generation.
static char * peer_id
Option –peer.
static void do_connect_ats(void *cls)
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_TRANSPORT_CoreHandle * GNUNET_TRANSPORT_core_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_PeerIdentity *self, const struct GNUNET_MQ_MessageHandler *handlers, void *cls, GNUNET_TRANSPORT_NotifyConnect nc, GNUNET_TRANSPORT_NotifyDisconnect nd)
Connect to the transport service.
int core_connections
Number of core connections.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
static void comm_disconnect_cb(void *cls, const struct GNUNET_PeerIdentity *peer, void *internal_cls)
ATS performance characteristics for an address.
static void handle_ping(void *cls, const struct TestMessage *message)
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Opaque handle to an abstract operation to be executed by the testing framework.
double pref_value
Masters only Progress task.
uint32_t value__
The actual value (bytes per second).
static void do_shutdown(void *cls)
Shutdown nicely.
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_service_connect(void *op_cls, struct GNUNET_TESTBED_Peer *peer, const char *service_name, GNUNET_TESTBED_ServiceConnectCompletionCallback cb, void *cb_cls, GNUNET_TESTBED_ConnectAdapter ca, GNUNET_TESTBED_DisconnectAdapter da, void *cada_cls)
Connect to a service offered by the given peer.
int num_partners
Number of partners.
int benchmarking
Are we connected to CORE service of all peers: GNUNET_YES/NO.
void GNUNET_ATS_TEST_traffic_handle_ping(struct BenchmarkPartner *p)
static struct GNUNET_OS_Process * p
Helper process we started.
void * cls
Closure for mv and cb.
static void main_run(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers_, unsigned int links_succeeded, unsigned int links_failed)
Signature of a main function for a testcase.
uint32_t bandwidth_in
Bandwidth assigned inbound.
Information we track for a peer in the testbed.
struct BenchmarkState state
Benchmark state.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
int master
Is this peer a measter: GNUNET_YES/GNUNET_NO.
A requested testbed operation has been completed.
#define GNUNET_new_array(n, type)
Allocate a size n array with structs or unions of the given type.
Information about a benchmarking partner.
struct GNUNET_TIME_Relative delay
Delay.
static void * core_connect_adapter(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
struct GNUNET_ATS_PerformanceHandle * ats_perf_handle
ATS performance handle.
uint32_t bandwidth_out
Bandwidth assigned outbound.
ats testing library: setup topology and provide logging to test ats
static const char * cfg_file
Configuration filename.
void GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation)
This function is used to signal that the event information (struct GNUNET_TESTBED_EventInformation) f...
int core_slave_connections
Masters only: Number of connections to slave peers.
Message handler for a specific message type.
static void * ats_perf_connect_adapter(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
struct GNUNET_TESTBED_Operation * GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer, enum GNUNET_TESTBED_PeerInformationType pit, GNUNET_TESTBED_PeerInfoCallback cb, void *cb_cls)
Request information about a peer.
void GNUNET_ATS_TEST_shutdown_topology(void)
Shutdown topology.
void(* GNUNET_ATS_AddressInformationCallback)(void *cls, const struct GNUNET_HELLO_Address *address, int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, const struct GNUNET_ATS_Properties *prop)
Signature of a function that is called with QoS information about an address.
static void pong(struct GNUNET_CADET_Channel *channel, const struct CadetPingMessage *ping)
Reply with a pong to origin.
uint64_t event_mask
Global event mask for all testbed events.
unsigned int num_slaves
Number slave peers.
struct GNUNET_TESTBED_Peer * peer
The peer associated with this model.
static void comm_connect_completion_cb(void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg)
struct GNUNET_CORE_Handle * GNUNET_CORE_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, GNUNET_CORE_StartupCallback init, GNUNET_CORE_ConnectEventHandler connects, GNUNET_CORE_DisconnectEventHandler disconnects, const struct GNUNET_MQ_MessageHandler *handlers)
Connect to the core service.
void GNUNET_CORE_disconnect(struct GNUNET_CORE_Handle *handle)
Disconnect from the core service.
int connected_PEERS
Are we connected to all peers: GNUNET_YES/NO.
struct BenchmarkPeer * sps
Array of slave peers.
struct BenchmarkPeer * mps
Array of master peers.
struct GNUNET_PeerIdentity peer
For which peer is this an address?
32-bit bandwidth used for network exchange by GNUnet, in bytes per second.
A connection between two peers was established.
static unsigned int num_peers
GNUNET_ATS_AddressInformationCallback ats_perf_cb
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
static void * transport_connect_adapter(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
enum GNUNET_NetworkType scope
Which network scope does the respective address belong to? This property does not change...
struct GNUNET_ATS_PerformanceHandle * GNUNET_ATS_performance_init(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ATS_AddressInformationCallback addr_info_cb, void *addr_info_cb_cls)
Get handle to access performance API of the ATS subsystem.
Handle to a message queue.
struct BenchmarkPartner * GNUNET_ATS_TEST_get_partner(int src, int dest)
struct GNUNET_SCHEDULER_Task * ats_task
Masters only Progress task.
The identity of the host (wraps the signing key of the peer).
struct GNUNET_MQ_Handle * mq
Message queue handle.
What is the identity of the peer? Returns a 'const struct GNUNET_PeerIdentity *'. ...
static void ats_perf_disconnect_adapter(void *cls, void *op_result)
static void do_connect_peers(void *cls)
struct BenchmarkPeer * GNUNET_ATS_TEST_get_peer(int src)
Topology related functions.
static void controller_event_cb(void *cls, const struct GNUNET_TESTBED_EventInformation *event)
Controller event callback.
An address for communicating with a peer.
void GNUNET_TRANSPORT_core_disconnect(struct GNUNET_TRANSPORT_CoreHandle *handle)
Disconnect from the transport service.
struct GNUNET_MQ_Handle * mq
#define GNUNET_log(kind,...)
int connected_ATS_service
Are we connected to ATS service of all peers: GNUNET_YES/NO.
struct BenchmarkPeer * pref_partner
Masters only: Peer to set ATS preferences for.
void GNUNET_ATS_TEST_generate_traffic_stop_all()
Stop all traffic generators.
void GNUNET_ATS_TEST_create_topology(char *name, char *cfg_file, unsigned int num_slaves, unsigned int num_masters, int test_core, GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, void *done_cb_cls, GNUNET_ATS_AddressInformationCallback log_request_cb)
Create a topology for ats testing.
struct GNUNET_ATS_Properties props
Current ATS properties.
static void do_comm_connect(void *cls)
struct TestbedConnectOperation * core_connect_ops
Masters only: Testbed connect operations to connect masters to slaves.
void(* GNUNET_ATS_TEST_TopologySetupDoneCallback)(void *cls, struct BenchmarkPeer *masters, struct BenchmarkPeer *slaves)
Callback to call when topology setup is completed.
int connected_COMM_service
Are we connected to CORE service of all peers: GNUNET_YES/NO.
static struct GNUNET_ARM_Operation * op
Current operation.
struct BenchmarkPeer * me
The peer itself this partner belongs to.
A peer controlled by the testing framework.
unsigned int distance
Distance on network layer (required for distance-vector routing) in hops.
GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb
static void core_disconnect_adapter(void *cls, void *op_result)
static char * address
GNS address for this phone.
unsigned int num_masters
Number master peers.
struct GNUNET_TESTBED_Operation * connect_op
Testbed operation to connect peers.
const char * GNUNET_i2s(const struct GNUNET_PeerIdentity *pid)
Convert a peer identity to a string (for printing debug messages).
struct BenchmarkPeer * dest
The partner peer.
struct GNUNET_TESTBED_Peer * peer
Handle with testbed.
struct GNUNET_PeerIdentity id
Peer ID.
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to our configuration.
#define GNUNET_free(ptr)
Wrapper around free.
uint32_t utilization_out
Actual traffic on this connection from this peer to the other peer.
static void transport_disconnect_adapter(void *cls, void *op_result)
static void ats_connect_completion_cb(void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg)
static struct BenchmarkPeer * find_peer(const struct GNUNET_PeerIdentity *peer)
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.