Ejemplo n.º 1
0
int
main (int argc, char **argv)
{
  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
    {'A', "asize", NULL,
     gettext_noop ("number of element in set A-B"), 1,
     &GNUNET_GETOPT_set_uint, &asize},
    {'B', "bsize", NULL,
     gettext_noop ("number of element in set B-A"), 1,
     &GNUNET_GETOPT_set_uint, &bsize},
    {'C', "csize", NULL,
     gettext_noop ("number of common elements in A and B"), 1,
     &GNUNET_GETOPT_set_uint, &csize},
    {'k', "hash-num", NULL,
     gettext_noop ("hash num"), 1,
     &GNUNET_GETOPT_set_uint, &hash_num},
    {'s', "ibf-size", NULL,
     gettext_noop ("ibf size"), 1,
     &GNUNET_GETOPT_set_uint, &ibf_size},
    GNUNET_GETOPT_OPTION_END
  };
  GNUNET_PROGRAM_run2 (argc, argv, "gnunet-consensus-ibf",
                      "help",
                      options, &run, NULL, GNUNET_YES);
  return 0;
}
int
main (int argc, char **argv)
{
   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
      { 'n', "num-peers", NULL,
        gettext_noop ("number of peers in consensus"),
        GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers },
      { 'D', "delay", NULL,
        gettext_noop ("dkg start delay"),
        GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &delay },
      { 't', "timeout", NULL,
        gettext_noop ("dkg timeout"),
        GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &timeout },
      { 'k', "threshold", NULL,
        gettext_noop ("threshold"),
        GNUNET_YES, &GNUNET_GETOPT_set_uint, &threshold },
      { 'd', "decrypt", NULL,
        gettext_noop ("also profile decryption"),
        GNUNET_NO, &GNUNET_GETOPT_set_one, &decrypt },
      { 'V', "verbose", NULL,
        gettext_noop ("be more verbose (print received values)"),
        GNUNET_NO, &GNUNET_GETOPT_set_one, &verbose },
      GNUNET_GETOPT_OPTION_END
  };
  delay = GNUNET_TIME_UNIT_ZERO;
  timeout = GNUNET_TIME_UNIT_MINUTES;
  GNUNET_PROGRAM_run2 (argc, argv, "gnunet-secretsharing-profiler",
		      "help",
		      options, &run, NULL, GNUNET_YES);
  return 0;
}
Ejemplo n.º 3
0
int
main (int argc, char **argv)
{
   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
      { 'n', "num-peers", NULL,
        gettext_noop ("number of peers in consensus"),
        GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers },
      { 'k', "value-replication", NULL,
        gettext_noop ("how many peers (random selection without replacement) receive one value?"),
        GNUNET_YES, &GNUNET_GETOPT_set_uint, &replication },
      { 'x', "num-values", NULL,
        gettext_noop ("number of values"),
        GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_values },
      { 't', "timeout", NULL,
        gettext_noop ("consensus timeout"),
        GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &conclude_timeout },
      { 'd', "delay", NULL,
        gettext_noop ("delay until consensus starts"),
        GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &consensus_delay },
      { 's', "statistics", NULL,
        gettext_noop ("write statistics to file"),
        GNUNET_YES, &GNUNET_GETOPT_set_filename, &statistics_filename },
      { 'V', "verbose", NULL,
        gettext_noop ("be more verbose (print received values)"),
        GNUNET_NO, &GNUNET_GETOPT_set_one, &verbose },
      GNUNET_GETOPT_OPTION_END
  };
  conclude_timeout = GNUNET_TIME_UNIT_SECONDS;
  GNUNET_PROGRAM_run2 (argc, argv, "gnunet-consensus-profiler",
		      "help",
		      options, &run, NULL, GNUNET_YES);
  return 0;
}
Ejemplo n.º 4
0
/**
 * Run a standard GNUnet command startup sequence (initialize loggers
 * and configuration, parse options).
 *
 * @param argc number of command line arguments
 * @param argv command line arguments
 * @param binaryName our expected name
 * @param binaryHelp help text for the program
 * @param options command line options
 * @param task main function to run
 * @param task_cls closure for task
 * @return GNUNET_SYSERR on error, GNUNET_OK on success
 */
int
GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName,
                    const char *binaryHelp,
                    const struct GNUNET_GETOPT_CommandLineOption *options,
                    GNUNET_PROGRAM_Main task, void *task_cls)
{
        return GNUNET_PROGRAM_run2 (argc, argv, binaryName, binaryHelp, options, task, task_cls, GNUNET_NO);
}