library routines for testing FS publishing and downloading; this code is limited to flat files and no keywords (those functions can be tested with single-peer setups; this is for testing routing). More...
Go to the source code of this file.
Typedefs | |
typedef void(* | GNUNET_FS_TEST_UriContinuation) (void *cls, const struct GNUNET_FS_Uri *uri, const char *fn) |
Function signature. More... | |
Functions | |
void | GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, struct GNUNET_TIME_Relative timeout, uint32_t anonymity, int do_index, uint64_t size, uint32_t seed, unsigned int verbose, GNUNET_FS_TEST_UriContinuation cont, void *cont_cls) |
Publish a file at the given daemon. More... | |
void | GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer, struct GNUNET_TIME_Relative timeout, uint32_t anonymity, uint32_t seed, const struct GNUNET_FS_Uri *uri, unsigned int verbose, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls) |
Perform test download. More... | |
library routines for testing FS publishing and downloading; this code is limited to flat files and no keywords (those functions can be tested with single-peer setups; this is for testing routing).
Definition in file fs_test_lib.h.
typedef void(* GNUNET_FS_TEST_UriContinuation) (void *cls, const struct GNUNET_FS_Uri *uri, const char *fn) |
Function signature.
cls | closure (user defined) |
uri | a URI, NULL for errors |
fn | name of the file on disk to be removed upon completion, or NULL for inserted files (also NULL on error) |
Definition at line 45 of file fs_test_lib.h.
void GNUNET_FS_TEST_publish | ( | struct GNUNET_TESTBED_Peer * | peer, |
struct GNUNET_TIME_Relative | timeout, | ||
uint32_t | anonymity, | ||
int | do_index, | ||
uint64_t | size, | ||
uint32_t | seed, | ||
unsigned int | verbose, | ||
GNUNET_FS_TEST_UriContinuation | cont, | ||
void * | cont_cls | ||
) |
Publish a file at the given daemon.
peer | where to publish |
timeout | if this operation cannot be completed within the given period, call the continuation with an error code |
anonymity | option for publication |
do_index | GNUNET_YES for index, GNUNET_NO for insertion, GNUNET_SYSERR for simulation |
size | size of the file to publish |
seed | seed to use for file generation |
verbose | how verbose to be in reporting |
cont | function to call when done |
cont_cls | closure for cont |
Definition at line 433 of file fs_test_lib.c.
References TestPublishOperation::anonymity, anonymity, TestPublishOperation::do_index, fs_disconnect_adapter(), TestPublishOperation::fs_op, GNUNET_new, GNUNET_SCHEDULER_add_delayed(), GNUNET_TESTBED_service_connect(), peer, publish_connect_adapter(), TestPublishOperation::publish_cont, TestPublishOperation::publish_cont_cls, publish_fs_connect_complete_cb(), TestPublishOperation::publish_seed, publish_timeout(), TestPublishOperation::publish_timeout_task, TestPublishOperation::size, size, timeout, verbose, and TestPublishOperation::verbose.
void GNUNET_FS_TEST_download | ( | struct GNUNET_TESTBED_Peer * | peer, |
struct GNUNET_TIME_Relative | timeout, | ||
uint32_t | anonymity, | ||
uint32_t | seed, | ||
const struct GNUNET_FS_Uri * | uri, | ||
unsigned int | verbose, | ||
GNUNET_SCHEDULER_TaskCallback | cont, | ||
void * | cont_cls | ||
) |
Perform test download.
peer | which peer to download from |
timeout | if this operation cannot be completed within the given period, call the continuation with an error code |
anonymity | option for download |
seed | used for file validation |
uri | URI of file to download (CHK/LOC only) |
verbose | how verbose to be in reporting |
cont | function to call when done |
cont_cls | closure for cont |
Definition at line 600 of file fs_test_lib.c.
References TestDownloadOperation::anonymity, anonymity, download_connect_adapter(), TestDownloadOperation::download_cont, TestDownloadOperation::download_cont_cls, download_fs_connect_complete_cb(), TestDownloadOperation::download_seed, download_timeout(), TestDownloadOperation::download_timeout_task, fs_disconnect_adapter(), TestDownloadOperation::fs_op, GNUNET_FS_uri_chk_get_file_size(), GNUNET_FS_uri_dup(), GNUNET_new, GNUNET_SCHEDULER_add_delayed(), GNUNET_TESTBED_service_connect(), peer, TestDownloadOperation::size, timeout, TestDownloadOperation::uri, uri, verbose, and TestDownloadOperation::verbose.