31#define LOG(kind, ...) GNUNET_log_from (kind, "gnunet-testbed", __VA_ARGS__)
52 const unsigned int no)
63 "Configuration template `%s': file not found\n",
76 "Could not load template `%s'\n",
88 "Could not load template `%s'\n",
99 for (
unsigned int cur = 0; cur < no; cur++)
102 "Creating configuration no. %u \n",
117 "Could not create another configuration\n");
123 "Writing configuration no. %u to file `%s' \n",
131 "Failed to write configuration no. %u \n",
166 "Creating %u configuration files based on template `%s'\n",
175 "Missing arguments!\n");
189main (
int argc,
char *
const *argv)
196 gettext_noop (
"number of unique configuration files to create"),
214 "Command line tool to access the testing library"),
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
struct GNUNET_GETOPT_CommandLineOption options[]
#define gettext_noop(String)
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static void run_no_scheduler(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be running without scheduler.
static int ret
Final status code.
static unsigned int create_no
Number of config files to create.
int main(int argc, char *const *argv)
The main function.
static int create_unique_cfgs(const char *template, const unsigned int no)
static char * create_cfg_template
Filename of the config template to be written.
struct GNUNET_TESTBED_System * GNUNET_TESTBED_system_create(const char *testdir, const char *trusted_ip, const char *hostname)
Create a system handle.
void GNUNET_TESTBED_system_destroy(struct GNUNET_TESTBED_System *system, bool remove_paths)
Free system resources.
enum GNUNET_GenericReturnValue GNUNET_TESTBED_configuration_create(struct GNUNET_TESTBED_System *system, struct GNUNET_CONFIGURATION_Handle *cfg, uint16_t **ports, unsigned int *nports)
Create a new configuration using the given configuration as a template; ports and paths will be modif...
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(const struct GNUNET_OS_ProjectData *pd)
Create a new configuration object.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg)
Duplicate an existing configuration object.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Load configuration.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_write(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Write configuration file.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_free(ptr)
Wrapper around free.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run2(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls, int run_without_scheduler)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition of a command line option.
Handle for a system on which GNUnet peers are executed; a system is used for reserving unique paths a...