3 #include <gnunet/platform.h>
4 #include <gnunet/gnunet_util_lib.h>
5 #include <gnunet/gnunet_testbed_service.h>
6 #include <gnunet/gnunet_dht_service.h>
75 unsigned int links_succeeded,
76 unsigned int links_failed)
80 (NULL,
peers[0],
"dht",
88 main (
int argc,
char **argv)
94 (
"awesome-test",
"template.conf",
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
static int ret
Return value of the commandline.
static struct GNUNET_ARM_Operation * op
Current operation.
static struct GNUNET_ARM_Handle * h
Connection with ARM.
static struct CadetPeer * peers
Operation to get peer ids.
static unsigned int num_peers
struct GNUNET_DHT_Handle * GNUNET_DHT_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, unsigned int ht_len)
Initialize the connection with the DHT service.
void GNUNET_DHT_disconnect(struct GNUNET_DHT_Handle *handle)
Shutdown connection with the DHT service.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
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,...
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 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'.
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.
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).
Connection to the DHT service.
Opaque handle to an abstract operation to be executed by the testing framework.
A peer controlled by the testing framework.
int main(int argc, char **argv)
static void test_master(void *cls, struct GNUNET_TESTBED_RunHandle *h, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, unsigned int links_succeeded, unsigned int links_failed)
static void shutdown_task(void *cls)
static struct GNUNET_DHT_Handle * dht_handle
static void dht_da(void *cls, void *op_result)
static void service_connect_comp(void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, const char *emsg)
static void * dht_ca(void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
static struct GNUNET_TESTBED_Operation * dht_op