summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-02-10 17:56:52 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-02-10 17:56:52 +0100
commit865bd196ff9c8e30ff3e035e6f423d3f7b043a6e (patch)
treea62489dbdbe14280037eed86183a77e6685b6620 /src/exchange-tools
parent7286b5f15fb5648206c03c9bde713eca495a7b8a (diff)
downloadexchange-865bd196ff9c8e30ff3e035e6f423d3f7b043a6e.tar.gz
exchange-865bd196ff9c8e30ff3e035e6f423d3f7b043a6e.tar.bz2
exchange-865bd196ff9c8e30ff3e035e6f423d3f7b043a6e.zip
4692. Skeleton.
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/Makefile.am10
-rw-r--r--src/exchange-tools/taler-wire.c104
2 files changed, 113 insertions, 1 deletions
diff --git a/src/exchange-tools/Makefile.am b/src/exchange-tools/Makefile.am
index 2c1ff0f4d..409c6bfdd 100644
--- a/src/exchange-tools/Makefile.am
+++ b/src/exchange-tools/Makefile.am
@@ -15,7 +15,15 @@ bin_PROGRAMS = \
taler-exchange-keyup \
taler-exchange-keycheck \
taler-exchange-wire \
- taler-exchange-dbinit
+ taler-exchange-dbinit \
+ taler-wire
+
+taler_wire_SOURCES = \
+ taler-wire.c
+taler_wire_LDADD = \
+ $(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/wire/libtalerwire.la \
+ -lgnunetutil
taler_exchange_keyup_SOURCES = \
taler-exchange-keyup.c
diff --git a/src/exchange-tools/taler-wire.c b/src/exchange-tools/taler-wire.c
index e69de29bb..dd32a3b3c 100644
--- a/src/exchange-tools/taler-wire.c
+++ b/src/exchange-tools/taler-wire.c
@@ -0,0 +1,104 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2014-2018 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with TALER; see the file COPYING. If not,
+ see <http://www.gnu.org/licenses/>
+*/
+
+/**
+ * @file taler-wire.c
+ * @brief Utility performing wire transfers.
+ * @author Marcello Stanisci
+ * @author Christian Grothoff
+ */
+
+#include <platform.h>
+#include <gnunet/gnunet_util_lib.h>
+
+/**
+ * Plugin name specified by the user.
+ */
+char *plugin;
+
+/**
+ * Global return code.
+ */
+unsigned int global_ret;
+
+
+/**
+ * Main function that will be run.
+ *
+ * @param cls closure
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used
+ * (for saving, can be NULL!)
+ * @param cfg configuration
+ */
+static void
+run (void *cls,
+ char *const *args,
+ const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+ if (NULL == plugin)
+ {
+ global_ret = 1;
+ return;
+ }
+}
+
+/**
+ * Main function of taler-wire. This tool is used to command the
+ * execution of wire transfers from the command line. Its main
+ * purpose is to test whether the bank and exchange can speak the
+ * same protocol of a certain wire plugin.
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, 1 on error
+ */
+int
+main (int argc,
+ char *const *argv)
+{
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_option_string ('p',
+ "plugin",
+ "PLUGIN",
+ "Wire plugin to use",
+ &plugin),
+
+ GNUNET_GETOPT_OPTION_END
+ };
+
+ GNUNET_assert
+ (GNUNET_OK == GNUNET_log_setup ("taler-wire",
+ NULL, /* takes default level */
+ NULL)); /* filename */
+
+ if (GNUNET_OK != GNUNET_PROGRAM_run
+ (argc,
+ argv,
+ "taler-wire",
+ "Perform wire transfers using plugin PLUGIN",
+ options,
+ &run,
+ NULL))
+ return 1;
+
+ return global_ret;
+}