2 This file is part of GNUnet.
3 (C) 2010, 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file fs/fs_test_lib.h
23 * @brief library routines for testing FS publishing and downloading;
24 * this code is limited to flat files
25 * and no keywords (those functions can be tested with
26 * single-peer setups; this is for testing routing).
27 * @author Christian Grothoff
32 #include "gnunet_util_lib.h"
33 #include "gnunet_fs_service.h"
34 #include "gnunet_testbed_service.h"
40 * @param cls closure (user defined)
41 * @param uri a URI, NULL for errors
43 typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls,
44 const struct GNUNET_FS_Uri *
49 * Publish a file at the given daemon.
51 * @param peer where to publish
52 * @param timeout if this operation cannot be completed within the
53 * given period, call the continuation with an error code
54 * @param anonymity option for publication
55 * @param do_index GNUNET_YES for index, GNUNET_NO for insertion,
56 * GNUNET_SYSERR for simulation
57 * @param size size of the file to publish
58 * @param seed seed to use for file generation
59 * @param verbose how verbose to be in reporting
60 * @param cont function to call when done
61 * @param cont_cls closure for cont
64 GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer,
65 struct GNUNET_TIME_Relative timeout, uint32_t anonymity,
66 int do_index, uint64_t size, uint32_t seed,
68 GNUNET_FS_TEST_UriContinuation cont, void *cont_cls);
72 * Perform test download.
74 * @param peer which peer to download from
75 * @param timeout if this operation cannot be completed within the
76 * given period, call the continuation with an error code
77 * @param anonymity option for download
78 * @param seed used for file validation
79 * @param uri URI of file to download (CHK/LOC only)
80 * @param verbose how verbose to be in reporting
81 * @param cont function to call when done
82 * @param cont_cls closure for cont
85 GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
86 struct GNUNET_TIME_Relative timeout,
87 uint32_t anonymity, uint32_t seed,
88 const struct GNUNET_FS_Uri *uri, unsigned int verbose,
89 GNUNET_SCHEDULER_Task cont, void *cont_cls);