Daemon acting as a service for testing testbed barriers. More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testbed_service.h"
#include "test_testbed_api_barriers.h"
Go to the source code of this file.
Macros | |
#define | LOG(type, ...) GNUNET_log (type, __VA_ARGS__); |
logging short hand More... | |
Functions | |
static void | do_shutdown (void *cls) |
Dummy task callback to keep us running forever. More... | |
static void | barrier_wait_cb (void *cls, const char *name, int status) |
Functions of this type are to be given as acallback argument to GNUNET_TESTBED_barrier_wait(). More... | |
static void | do_wait (void *cls) |
Task to wait for the barrier. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *config) |
Main run function. More... | |
int | main (int argc, char **argv) |
Main. More... | |
Variables | |
static struct GNUNET_TESTBED_BarrierWaitHandle * | wh |
Our barrier wait handle. More... | |
static struct GNUNET_SCHEDULER_Task * | tt |
Daemon acting as a service for testing testbed barriers.
It is started as a peer service and waits for a barrier to be crossed.
Definition in file gnunet-service-test-barriers.c.
#define LOG | ( | type, | |
... | |||
) | GNUNET_log (type, __VA_ARGS__); |
logging short hand
Definition at line 36 of file gnunet-service-test-barriers.c.
|
static |
Dummy task callback to keep us running forever.
cls | NULL |
Definition at line 53 of file gnunet-service-test-barriers.c.
References GNUNET_SCHEDULER_cancel(), GNUNET_TESTBED_barrier_wait_cancel(), tt, and wh.
Referenced by run().
|
static |
Functions of this type are to be given as acallback argument to GNUNET_TESTBED_barrier_wait().
The callback will be called when the barrier corresponding given in GNUNET_TESTBED_barrier_wait() is crossed or cancelled.
cls | NULL |
name | the barrier name |
status | GNUNET_SYSERR in case of error while waiting for the barrier; GNUNET_OK if the barrier is crossed |
Definition at line 79 of file gnunet-service-test-barriers.c.
References GNUNET_break, GNUNET_OK, status, and wh.
Referenced by do_wait().
|
static |
Task to wait for the barrier.
cls | NULL |
Definition at line 96 of file gnunet-service-test-barriers.c.
References barrier_wait_cb(), GNUNET_break, GNUNET_TESTBED_barrier_wait(), tt, and wh.
Referenced by run().
|
static |
Main run function.
cls | NULL |
args | arguments passed to GNUNET_PROGRAM_run |
cfgfile | the path to configuration file |
config | the configuration file handle |
Definition at line 115 of file gnunet-service-test-barriers.c.
References do_shutdown(), do_wait(), GNUNET_CRYPTO_QUALITY_NONCE, GNUNET_CRYPTO_random_u32(), GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_TIME_relative_multiply(), GNUNET_TIME_UNIT_SECONDS, and tt.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main.
Definition at line 137 of file gnunet-service-test-barriers.c.
References GNUNET_GETOPT_OPTION_END, GNUNET_PROGRAM_run(), options, ret, and run().
|
static |
Our barrier wait handle.
Definition at line 42 of file gnunet-service-test-barriers.c.
Referenced by barrier_wait_cb(), copy_from_reader(), do_shutdown(), do_wait(), GNUNET_FS_download_sync_(), GNUNET_FS_file_information_sync_(), GNUNET_FS_publish_sync_(), GNUNET_FS_search_result_sync_(), GNUNET_FS_search_sync_(), GNUNET_FS_unindex_sync_(), save(), save_hostlist_file(), save_state(), write_download_request(), write_index_list(), write_item(), write_start_time(), and write_update_information_graph().
|
static |
Definition at line 44 of file gnunet-service-test-barriers.c.
Referenced by do_shutdown(), do_wait(), and run().