diff options
author | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
---|---|---|
committer | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
commit | 740b30688bd745a527f96f9116c19acb3480971a (patch) | |
tree | 2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/testbed | |
parent | 2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff) |
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/Makefile.am | 39 | ||||
-rw-r--r-- | src/testbed/Makefile.in | 713 | ||||
-rw-r--r-- | src/testbed/testbed.conf | 0 | ||||
-rw-r--r-- | src/testbed/testbed.h | 535 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 150 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 200 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.h | 105 | ||||
-rw-r--r-- | src/testbed/testbed_api_operations.c | 194 | ||||
-rw-r--r-- | src/testbed/testbed_api_operations.h | 132 | ||||
-rw-r--r-- | src/testbed/testbed_api_peers.c | 297 | ||||
-rw-r--r-- | src/testbed/testbed_api_peers.h | 71 | ||||
-rw-r--r-- | src/testbed/testbed_api_services.c | 61 | ||||
-rw-r--r-- | src/testbed/testbed_api_test.c | 67 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 153 | ||||
-rw-r--r-- | src/testbed/testbed_api_topology.c | 127 |
15 files changed, 2844 insertions, 0 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am new file mode 100644 index 0000000..b7b9360 --- /dev/null +++ b/src/testbed/Makefile.am @@ -0,0 +1,39 @@ +INCLUDES = -I$(top_srcdir)/src/include + +if MINGW + WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols +endif + +if USE_COVERAGE + AM_CFLAGS = --coverage -O0 + XLIB = -lgcov +endif + +pkgcfgdir= $(pkgdatadir)/config.d/ + +dist_pkgcfg_DATA = \ + testbed.conf + +lib_LTLIBRARIES = \ + libgnunettestbed.la + +libgnunettestbed_la_SOURCES = \ + testbed_api.c testbed.h \ + testbed_api_hosts.c testbed_api_hosts.h \ + testbed_api_operations.c testbed_api_operations.h \ + testbed_api_peers.c testbed_api_peers.h \ + testbed_api_services.c \ + testbed_api_testbed.c \ + testbed_api_test.c \ + testbed_api_topology.c +libgnunettestbed_la_LIBADD = $(XLIB) \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + -lm \ + $(top_builddir)/src/util/libgnunetutil.la +libgnunettestbed_la_LDFLAGS = \ + $(GN_LIB_LDFLAGS) \ + -version-info 0:0:0 + diff --git a/src/testbed/Makefile.in b/src/testbed/Makefile.in new file mode 100644 index 0000000..3b08315 --- /dev/null +++ b/src/testbed/Makefile.in @@ -0,0 +1,713 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = src/testbed +DIST_COMMON = $(dist_pkgcfg_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/absolute-header.m4 \ + $(top_srcdir)/m4/align.m4 $(top_srcdir)/m4/argz.m4 \ + $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libcurl.m4 \ + $(top_srcdir)/m4/libgcrypt.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libunistring.m4 $(top_srcdir)/m4/ltdl.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/gnunet_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgcfgdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libgnunettestbed_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/util/libgnunetutil.la +am_libgnunettestbed_la_OBJECTS = testbed_api.lo testbed_api_hosts.lo \ + testbed_api_operations.lo testbed_api_peers.lo \ + testbed_api_services.lo testbed_api_testbed.lo \ + testbed_api_test.lo testbed_api_topology.lo +libgnunettestbed_la_OBJECTS = $(am_libgnunettestbed_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libgnunettestbed_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libgnunettestbed_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libgnunettestbed_la_SOURCES) +DIST_SOURCES = $(libgnunettestbed_la_SOURCES) +DATA = $(dist_pkgcfg_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +ARGZ_H = @ARGZ_H@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_INTERFACE = @DEFAULT_INTERFACE@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLDIR = @DLLDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXT_LIBS = @EXT_LIBS@ +EXT_LIB_PATH = @EXT_LIB_PATH@ +FGREP = @FGREP@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNUNETDNS_GROUP = @GNUNETDNS_GROUP@ +GN_DAEMON_CONFIG_DIR = @GN_DAEMON_CONFIG_DIR@ +GN_DAEMON_HOME_DIR = @GN_DAEMON_HOME_DIR@ +GN_INTLINCL = @GN_INTLINCL@ +GN_LIBINTL = @GN_LIBINTL@ +GN_LIB_LDFLAGS = @GN_LIB_LDFLAGS@ +GN_PLUGIN_LDFLAGS = @GN_PLUGIN_LDFLAGS@ +GN_USER_HOME_DIR = @GN_USER_HOME_DIR@ +GREP = @GREP@ +HAVE_LIBUNISTRING = @HAVE_LIBUNISTRING@ +INCLTDL = @INCLTDL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +JAVAPORT = @JAVAPORT@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ +LIBADD_DLOPEN = @LIBADD_DLOPEN@ +LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ +LIBCURL = @LIBCURL@ +LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ +LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ +LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ +LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBLTDL = @LIBLTDL@ +LIBOBJS = @LIBOBJS@ +LIBPREFIX = @LIBPREFIX@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNISTRING = @LIBUNISTRING@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTDLDEPS = @LTDLDEPS@ +LTDLINCL = @LTDLINCL@ +LTDLOPEN = @LTDLOPEN@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBUNISTRING = @LTLIBUNISTRING@ +LT_CONFIG_H = @LT_CONFIG_H@ +LT_DLLOADERS = @LT_DLLOADERS@ +LT_DLPREOPEN = @LT_DLPREOPEN@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MONKEYPREFIX = @MONKEYPREFIX@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@ +MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POSTGRES_CPPFLAGS = @POSTGRES_CPPFLAGS@ +POSTGRES_LDFLAGS = @POSTGRES_LDFLAGS@ +POSUB = @POSUB@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SQLITE_CPPFLAGS = @SQLITE_CPPFLAGS@ +SQLITE_LDFLAGS = @SQLITE_LDFLAGS@ +STRIP = @STRIP@ +SUDO_BINARY = @SUDO_BINARY@ +UNIXONLY = @UNIXONLY@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +_libcurl_config = @_libcurl_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_target = @build_target@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +ltdl_LIBOBJS = @ltdl_LIBOBJS@ +ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sys_symbol_underscore = @sys_symbol_underscore@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/src/include +@MINGW_TRUE@WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols +@USE_COVERAGE_TRUE@AM_CFLAGS = --coverage -O0 +@USE_COVERAGE_TRUE@XLIB = -lgcov +pkgcfgdir = $(pkgdatadir)/config.d/ +dist_pkgcfg_DATA = \ + testbed.conf + +lib_LTLIBRARIES = \ + libgnunettestbed.la + +libgnunettestbed_la_SOURCES = \ + testbed_api.c testbed.h \ + testbed_api_hosts.c testbed_api_hosts.h \ + testbed_api_operations.c testbed_api_operations.h \ + testbed_api_peers.c testbed_api_peers.h \ + testbed_api_services.c \ + testbed_api_testbed.c \ + testbed_api_test.c \ + testbed_api_topology.c + +libgnunettestbed_la_LIBADD = $(XLIB) \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + -lm \ + $(top_builddir)/src/util/libgnunetutil.la + +libgnunettestbed_la_LDFLAGS = \ + $(GN_LIB_LDFLAGS) \ + -version-info 0:0:0 + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/testbed/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/testbed/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libgnunettestbed.la: $(libgnunettestbed_la_OBJECTS) $(libgnunettestbed_la_DEPENDENCIES) + $(AM_V_CCLD)$(libgnunettestbed_la_LINK) -rpath $(libdir) $(libgnunettestbed_la_OBJECTS) $(libgnunettestbed_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_hosts.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_operations.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_peers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_services.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_test.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_testbed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testbed_api_topology.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_pkgcfgDATA: $(dist_pkgcfg_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgcfgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgcfgdir)" + @list='$(dist_pkgcfg_DATA)'; test -n "$(pkgcfgdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgcfgdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgcfgdir)" || exit $$?; \ + done + +uninstall-dist_pkgcfgDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgcfg_DATA)'; test -n "$(pkgcfgdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkgcfgdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkgcfgdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgcfgdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_pkgcfgDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_pkgcfgDATA uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-dist_pkgcfgDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-dist_pkgcfgDATA \ + uninstall-libLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/testbed/testbed.conf b/src/testbed/testbed.conf new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/testbed/testbed.conf diff --git a/src/testbed/testbed.h b/src/testbed/testbed.h new file mode 100644 index 0000000..b7b10ff --- /dev/null +++ b/src/testbed/testbed.h @@ -0,0 +1,535 @@ +/* + This file is part of GNUnet + (C) 2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed.h + * @brief IPC messages between testing API and service ("controller") + * @author Christian Grothoff + */ + +#ifndef NEW_TESTING_H +#define NEW_TESTING_H + +#include "gnunet_util_lib.h" + + +/** + * Initial message from a client to a testing control service. + */ +struct GNUNET_TESTBED_Message +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Host ID that the controller is either given + * (if this is the dominating client communicating + * via stdin) or assumed to have (for peer-connections + * between controllers). + */ + uint32_t host_id GNUNET_PACKED; + + /** + * Event mask that specifies which events this client + * is interested in. In NBO. + */ + uint64_t event_mask GNUNET_PACKED; + +}; + + +/** + * Notify the service about a host that we intend to use. + */ +struct GNUNET_TESTBED_AddHostMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the host (in NBO). + */ + uint32_t host_id GNUNET_PACKED; + + /** + * SSH port to use, 0 for default (in NBO). + */ + uint16_t ssh_port GNUNET_PACKED; + + /** + * Number of bytes in the user name that follows; + * 0 to use no user name; otherwise 'strlen (username)', + * excluding 0-termination! + */ + uint16_t user_name_length GNUNET_PACKED; + + /* followed by 0-terminated user name */ + + /* followed by 0-terminated host name */ + +}; + + +/** + * Confirmation from the service that adding a host + * worked (or failed). + */ +struct GNUNET_TESTBED_HostConfirmedMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the host (in NBO). + */ + uint32_t host_id GNUNET_PACKED; + + /* followed by the 0-terminated error message (on failure) + (typical errors include failure to login and + host-id already in use) */ + +}; + + +/** + * Message to testing service: configure service sharing + * at a host. + */ +struct GNUNET_TESTBED_ConfigureSharedServiceMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Host that is being configured. + */ + uint32_t host_id GNUNET_PACKED; + + /** + * Number of peers that should share a service instance; + * 1 for no sharing, 0 to forcefully disable the service. + */ + uint32_t num_peers GNUNET_PACKED; + + /* followed by 0-terminated name of the service */ + +}; + + +/** + * Client notifies controller that it should delegate + * requests for a particular client to a particular + * sub-controller. + */ +struct GNUNET_TESTBED_ControllerLinkMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * For which host should requests be delegated? NBO. + */ + uint32_t delegated_host_id GNUNET_PACKED; + + /** + * Which host is responsible for managing the delegation? NBO + */ + uint32_t slave_host_id GNUNET_PACKED; + + /** + * Is the receiving controller the master controller for + * the slave host (and thus responsible for starting it?). NBO. + */ + int32_t is_subordinate GNUNET_PACKED; + + /* followed by serialized slave configuration; + gzip'ed configuration file in INI format */ + +}; + + +/** + * Message sent from client to testing service to + * create (configure, but not start) a peer. + */ +struct GNUNET_TESTBED_PeerCreateMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * On which host should the peer be started? + */ + uint32_t host_id GNUNET_PACKED; + + /** + * Unique ID for the peer. + */ + uint32_t peer_id GNUNET_PACKED; + + /* followed by serialized peer configuration; + gzip'ed configuration file in INI format */ + +}; + + +/** + * Message sent from client to testing service to + * reconfigure a (stopped) a peer. + */ +struct GNUNET_TESTBED_PeerReconfigureMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the peer. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + + /* followed by serialized peer configuration; + gzip'ed configuration file in INI format */ + +}; + + +/** + * Message sent from client to testing service to + * start a peer. + */ +struct GNUNET_TESTBED_PeerStartMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the peer. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + + +/** + * Message sent from client to testing service to + * stop a peer. + */ +struct GNUNET_TESTBED_PeerStopMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the peer. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + + +/** + * Message sent from client to testing service to + * destroy a (stopped) peer. + */ +struct GNUNET_TESTBED_PeerDestroyMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the peer. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + + +/** + * Message sent from client to testing service to + * (re)configure a "physical" link between two peers. + */ +struct GNUNET_TESTBED_ConfigureUnderlayLinkMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * 'enum GNUNET_TESTBED_ConnectOption' of the option to change + */ + int32_t connect_option GNUNET_PACKED; + + /** + * Unique ID for the first peer. + */ + uint32_t peer1 GNUNET_PACKED; + + /** + * Unique ID for the second peer. + */ + uint32_t peer2 GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + + /* followed by option-dependent variable-size values */ + +}; + + +/** + * Message sent from client to testing service to + * connect two peers. + */ +struct GNUNET_TESTBED_OverlayConnectMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Unique ID for the first peer. + */ + uint32_t peer1 GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + + /** + * Unique ID for the second peer. + */ + uint32_t peer2 GNUNET_PACKED; + +}; + + +/** + * Event notification from a controller to a client. + */ +struct GNUNET_TESTBED_PeerEventMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * 'enum GNUNET_TESTBED_EventType' (in NBO); + * either GNUNET_TESTBED_ET_PEER_START or GNUNET_TESTBED_ET_PEER_STOP. + */ + int32_t event_type GNUNET_PACKED; + + /** + * Host where the peer is running. + */ + uint32_t host_id GNUNET_PACKED; + + /** + * Peer that was started or stopped. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + + +/** + * Event notification from a controller to a client. + */ +struct GNUNET_TESTBED_ConnectionEventMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * 'enum GNUNET_TESTBED_EventType' (in NBO); + * either GNUNET_TESTBED_ET_PEER_CONNECT or GNUNET_TESTBED_ET_PEER_DISCONNECT. + */ + int32_t event_type GNUNET_PACKED; + + /** + * First peer. + */ + uint32_t peer1 GNUNET_PACKED; + + /** + * Second peer. + */ + uint32_t peer2 GNUNET_PACKED; + + /** + * Operation ID that is used to identify this operation. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + + +/** + * Event notification from a controller to a client. + */ +struct GNUNET_TESTBED_OperationFailureEventMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * 'enum GNUNET_TESTBED_EventType' (in NBO); + * GNUNET_TESTBED_ET_OPERATION_FINISHED. + */ + int32_t event_type GNUNET_PACKED; + + /** + * Operation ID of the operation that created this event. + */ + uint64_t operation_id GNUNET_PACKED; + + /* followed by 0-terminated error message */ + +}; + + +/** + * Event notification from a controller to a client. + */ +struct GNUNET_TESTBED_PeerCreateSuccessEventMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * Peer identity of the peer that was created. + */ + uint32_t peer_id GNUNET_PACKED; + + /** + * Operation ID of the operation that created this event. + */ + uint64_t operation_id GNUNET_PACKED; + + /** + * Identity of the peer. + */ + struct GNUNET_PeerIdentity peer_id; + + /* followed by gzip-compressed configuration of the peer */ + +}; + + +/** + * Event notification from a controller to a client for + * a generic operational success where the operation does + * not return any data. + */ +struct GNUNET_TESTBED_GenericOperationSuccessEventMessage +{ + + /** + * Type is + */ + struct GNUNET_MessageHeader header; + + /** + * 'enum GNUNET_TESTBED_EventType' (in NBO); + * GNUNET_TESTBED_ET_OPERATION_FINISHED. + */ + int32_t event_type GNUNET_PACKED; + + /** + * Operation ID of the operation that created this event. + */ + uint64_t operation_id GNUNET_PACKED; + +}; + +#endif diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c new file mode 100644 index 0000000..5168081 --- /dev/null +++ b/src/testbed/testbed_api.c @@ -0,0 +1,150 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api.c + * @brief API for accessing the GNUnet testing service. + * This library is supposed to make it easier to write + * testcases and script large-scale benchmarks. + * @author Christian Grothoff + */ +#include "platform.h" +#include "gnunet_testbed_service.h" +#include "gnunet_core_service.h" +#include "gnunet_constants.h" +#include "gnunet_transport_service.h" +#include "gnunet_hello_lib.h" + + + + +/** + * Start a controller process using the given configuration at the + * given host. + * + * @param cfg configuration to use + * @param host host to run the controller on, NULL for 'localhost' + * @param event_mask bit mask with set of events to call 'cc' for; + * or-ed values of "1LL" shifted by the + * respective 'enum GNUNET_TESTBED_EventType' + * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) | ...") + * @param cc controller callback to invoke on events + * @param cc_cls closure for cc + * @return handle to the controller + */ +struct GNUNET_TESTBED_Controller * +GNUNET_TESTBED_controller_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TESTBED_Host *host, + uint64_t event_mask, + GNUNET_TESTBED_ControllerCallback cc, + void *cc_cls) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Configure shared services at a controller. Using this function, + * you can specify that certain services (such as "resolver") + * should not be run for each peer but instead be shared + * across N peers on the specified host. This function + * must be called before any peers are created at the host. + * + * @param controller controller to configure + * @param service_name name of the service to share + * @param num_peers number of peers that should share one instance + * of the specified service (1 for no sharing is the default), + * use 0 to disable the service + */ +void +GNUNET_TESTBED_controller_configure_sharing (struct GNUNET_TESTBED_Controller *controller, + const char *service_name, + uint32_t num_peers) +{ + GNUNET_break (0); +} + + +/** + * Stop the given controller (also will terminate all peers and + * controllers dependent on this controller). This function + * blocks until the testbed has been fully terminated (!). + * + * @param controller handle to controller to stop + */ +void +GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_Controller *controller) +{ + GNUNET_break (0); +} + + +/** + * Create a link from a 'master' controller to a slave controller. + * Whenever the master controller is asked to start a peer at the + * given 'delegated_host', it will delegate the request to the + * specified slave controller. Note that the slave controller runs at + * the 'slave_host', which may or may not be the same host as the + * 'delegated_host' (for hierarchical delegations). The configuration + * of the slave controller is given and to be used to either create + * the slave controller or to connect to an existing slave controller + * process. 'is_subordinate' specifies if the given slave controller + * should be started and managed by the master controller, or if the + * slave already has a master and this is just a secondary master that + * is also allowed to use the existing slave. + * + * @param master handle to the master controller who creates the association + * @param delegated_host requests to which host should be delegated + * @param slave_host which host is used to run the slave controller + * @param slave_cfg configuration to use for the slave controller + * @param is_subordinate GNUNET_YES if the slave should be started (and stopped) + * by the master controller; GNUNET_NO if we are just + * allowed to use the slave via TCP/IP + */ +void +GNUNET_TESTBED_controller_link (struct GNUNET_TESTBED_Controller *master, + struct GNUNET_TESTBED_Host *delegated_host, + struct GNUNET_TESTBED_Host *slave_host, + const struct GNUNET_CONFIGURATION_Handle *slave_cfg, + int is_subordinate) +{ + GNUNET_break (0); +} + + +/** + * Ask the testbed controller to write the current overlay topology to + * a file. Naturally, the file will only contain a snapshot as the + * topology may evolve all the time. + * + * @param controller overlay controller to inspect + * @param filename name of the file the topology should + * be written to. + */ +void +GNUNET_TESTBED_overlay_write_topology_to_file (struct GNUNET_TESTBED_Controller *controller, + const char *filename) +{ +} + + + +/* end of testbed_api.c */ diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c new file mode 100644 index 0000000..1b293b3 --- /dev/null +++ b/src/testbed/testbed_api_hosts.c @@ -0,0 +1,200 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_hosts.c + * @brief API for manipulating 'hosts' controlled by the GNUnet testing service; + * allows parsing hosts files, starting, stopping and communicating (via + * SSH/stdin/stdout) with the remote (or local) processes + * @author Christian Grothoff + */ +#include "platform.h" +#include "gnunet_testbed_service.h" +#include "gnunet_core_service.h" +#include "gnunet_constants.h" +#include "gnunet_transport_service.h" +#include "gnunet_hello_lib.h" + + + +/** + * Opaque handle to a host running experiments managed by the testing framework. + * The master process must be able to SSH to this host without password (via + * ssh-agent). + */ +struct GNUNET_TESTBED_Host +{ + + + const char *hostname; + + const char *username; + + /** + * Global ID we use to refer to a host on the network + */ + uint32_t unique_id; + + uint16_t port; +}; + + +/** + * Lookup a host by ID. + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_lookup_by_id_ (uint32_t id) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Create a host by ID; given this host handle, we could not + * run peers at the host, but we can talk about the host + * internally. + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_create_by_id_ (uint32_t id) +{ + return NULL; +} + + +/** + * Obtain a host's unique global ID. + * + * @param host handle to the host, NULL means 'localhost' + * @return id global host ID assigned to the host (0 is + * 'localhost', but then obviously not globally unique) + */ +uint32_t +GNUNET_TESTBED_host_get_id_ (struct GNUNET_TESTBED_Host *host) +{ + GNUNET_break (0); + return 0; +} + + +/** + * Create a host to run peers and controllers on. + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @param hostname name of the host, use "NULL" for localhost + * @param username username to use for the login; may be NULL + * @param port port number to use for ssh; use 0 to let ssh decide + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_create_with_id_ (uint32_t id, + const char *hostname, + const char *username, + uint16_t port) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Create a host to run peers and controllers on. + * + * @param hostname name of the host, use "NULL" for localhost + * @param username username to use for the login; may be NULL + * @param port port number to use for ssh; use 0 to let ssh decide + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_create (const char *hostname, + const char *username, + uint16_t port) +{ + static uint32_t uid_generator; + + return GNUNET_TESTBED_host_create_with_id_ (++uid_generator, + hostname, username, + port); +} + + +/** + * Load a set of hosts from a configuration file. + * + * @param filename file with the host specification + * @param hosts set to the hosts found in the file + * @return number of hosts returned in 'hosts', 0 on error + */ +unsigned int +GNUNET_TESTBED_hosts_load_from_file (const char *filename, + struct GNUNET_TESTBED_Host **hosts) +{ + GNUNET_break (0); + return 0; +} + + +/** + * Destroy a host handle. Must only be called once everything + * running on that host has been stopped. + * + * @param host handle to destroy + */ +void +GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host) +{ + GNUNET_break (0); +} + + +/** + * Run a given helper process at the given host. Communication + * with the helper will be via GNUnet messages on stdin/stdout. + * Runs the process via 'ssh' at the specified host, or locally. + * Essentially an SSH-wrapper around the 'gnunet_helper_lib.h' API. + * + * @param host host to use, use "NULL" for localhost + * @param binary_argv binary name and command-line arguments to give to the binary + * @param cb function to call for messages received from the binary + * @param cb_cls closure for cb + * @return handle to terminate the command, NULL on error + */ +struct GNUNET_HELPER_Handle * +GNUNET_TESTBED_host_run_ (struct GNUNET_TESTBED_Host *host, + char *const binary_argv[], + GNUNET_SERVER_MessageTokenizerCallback cb, void *cb_cls) +{ + /* FIXME: decide on the SSH command line, prepend it and + run GNUNET_HELPER_start with the modified binary_name and binary_argv! */ + GNUNET_break (0); + return NULL; +} + + +/* end of testbed_api_hosts.c */ diff --git a/src/testbed/testbed_api_hosts.h b/src/testbed/testbed_api_hosts.h new file mode 100644 index 0000000..401d4e0 --- /dev/null +++ b/src/testbed/testbed_api_hosts.h @@ -0,0 +1,105 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_hosts.h + * @brief internal API to access the 'hosts' subsystem + * @author Christian Grothoff + */ +#ifndef NEW_TESTING_API_HOSTS_H +#define NEW_TESTING_API_HOSTS_H + +#include "gnunet_testbed_service.h" +#include "gnunet_helper_lib.h" + + +/** + * Lookup a host by ID. + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_lookup_by_id_ (uint32_t id); + + +/** + * Create a host by ID; given this host handle, we could not + * run peers at the host, but we can talk about the host + * internally. + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_create_by_id_ (uint32_t id); + + +/** + * Create a host to run peers and controllers on. This function is used + * if a peer learns about a host via IPC between controllers (and thus + * some higher-level controller has already determined the unique IDs). + * + * @param id global host ID assigned to the host; 0 is + * reserved to always mean 'localhost' + * @param hostname name of the host, use "NULL" for localhost + * @param username username to use for the login; may be NULL + * @param port port number to use for ssh; use 0 to let ssh decide + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Host * +GNUNET_TESTBED_host_create_with_id_ (uint32_t id, + const char *hostname, + const char *username, + uint16_t port); + + +/** + * Obtain a host's unique global ID. + * + * @param host handle to the host, NULL means 'localhost' + * @return id global host ID assigned to the host (0 is + * 'localhost', but then obviously not globally unique) + */ +uint32_t +GNUNET_TESTBED_host_get_id_ (struct GNUNET_TESTBED_Host *host); + + +/** + * Run a given helper process at the given host. Communication + * with the helper will be via GNUnet messages on stdin/stdout. + * Runs the process via 'ssh' at the specified host, or locally. + * Essentially an SSH-wrapper around the 'gnunet_helper_lib.h' API. + * + * @param host host to use, use "NULL" for localhost + * @param binary_argv binary name and command-line arguments to give to the binary + * @param cb function to call for messages received from the binary + * @param cb_cls closure for cb + * @return handle to terminate the command, NULL on error + */ +struct GNUNET_HELPER_Handle * +GNUNET_TESTBED_host_run_ (struct GNUNET_TESTBED_Host *host, + char *const binary_argv[], + GNUNET_SERVER_MessageTokenizerCallback cb, void *cb_cls); + +#endif +/* end of testbed_api_hosts.h */ diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c new file mode 100644 index 0000000..c98998b --- /dev/null +++ b/src/testbed/testbed_api_operations.c @@ -0,0 +1,194 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_operations.c + * @brief functions to manage operation queues + * @author Christian Grothoff + */ +#include "platform.h" +#include "testbed_api_operations.h" + + +/** + * Opaque handle to an abstract operation to be executed by the testing framework. + */ +struct GNUNET_TESTBED_Operation +{ + /** + * Function to call when we have the resources to begin the operation. + */ + OperationStart start; + + /** + * Function to call to clean up after the operation (which may or may + * not have been started yet). + */ + OperationRelease release; + + /** + * Closure for callbacks. + */ + void *cb_cls; + + // FIXME! + +}; + + +/** + * Queue of operations where we can only support a certain + * number of concurrent operations of a particular type. + */ +struct OperationQueue +{ + + /** + * Maximum number of operationst that can be concurrently + * active in this queue. + */ + unsigned int max_active; + + // FIXME! + +}; + + +/** + * Create an operation queue. + * + * @param max_active maximum number of operations in this + * queue that can be active in parallel at the same time + * @return handle to the queue + */ +struct OperationQueue * +GNUNET_TESTBED_operation_queue_create_ (unsigned int max_active) +{ + struct OperationQueue *queue; + + queue = GNUNET_malloc (sizeof (struct OperationQueue)); + queue->max_active = max_active; + return queue; +} + + +/** + * Destroy an operation queue. The queue MUST be empty + * at this time. + * + * @param queue queue to destroy + */ +void +GNUNET_TESTBED_operation_queue_destroy_ (struct OperationQueue *queue) +{ + GNUNET_break (0); + GNUNET_free (queue); +} + + +/** + * Add an operation to a queue. An operation can be in multiple + * queues at once. Once all queues permit the operation to become + * active, the operation will be activated. The actual activation + * will occur in a separate task (thus allowing multiple queue + * insertions to be made without having the first one instantly + * trigger the operation if the first queue has sufficient + * resources). + * + * @param queue queue to add the operation to + * @param operation operation to add to the queue + */ +void +GNUNET_TESTBED_operation_queue_insert_ (struct OperationQueue *queue, + struct GNUNET_TESTBED_Operation *operation) +{ + GNUNET_break (0); +} + + +/** + * Remove an operation from a queue. This can be because the + * oeration was active and has completed (and the resources have + * been released), or because the operation was cancelled and + * thus scheduling the operation is no longer required. + * + * @param queue queue to add the operation to + * @param operation operation to add to the queue + */ +void +GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, + struct GNUNET_TESTBED_Operation *operation) +{ + GNUNET_break (0); +} + + +/** + * An operation is 'done' (was cancelled or finished); remove + * it from the queues and release associated resources. + * + * @param operation operation that finished + */ +static void +operation_release (struct GNUNET_TESTBED_Operation *operation) +{ + // call operation->release, remove from queues + GNUNET_break (0); +} + + +/** + * Cancel a pending operation. Releases all resources + * of the operation and will ensure that no event + * is generated for the operation. Does NOT guarantee + * that the operation will be fully undone (or that + * nothing ever happened). + * + * @param operation operation to cancel + */ +void +GNUNET_TESTBED_operation_cancel (struct GNUNET_TESTBED_Operation *operation) +{ + // test that operation had not yet generated an event + GNUNET_break (0); + operation_release (operation); +} + + +/** + * Signal that the information from an operation has been fully + * processed. This function MUST be called for each event + * of type 'operation_finished' to fully remove the operation + * from the operation queue. After calling this function, the + * 'op_result' becomes invalid (!). + * + * @param operation operation to signal completion for + */ +void +GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation) +{ + // test that operation was started and had generated an event + GNUNET_break (0); + operation_release (operation); +} + + + +/* end of testbed_api_operations.c */ diff --git a/src/testbed/testbed_api_operations.h b/src/testbed/testbed_api_operations.h new file mode 100644 index 0000000..4c888d5 --- /dev/null +++ b/src/testbed/testbed_api_operations.h @@ -0,0 +1,132 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_operations.h + * @brief internal API to access the 'operations' subsystem + * @author Christian Grothoff + */ +#ifndef NEW_TESTING_API_OPERATIONS_H +#define NEW_TESTING_API_OPERATIONS_H + +#include "gnunet_testbed_service.h" +#include "gnunet_helper_lib.h" + + +/** + * Queue of operations where we can only support a certain + * number of concurrent operations of a particular type. + */ +struct OperationQueue; + + +/** + * Create an operation queue. + * + * @param max_active maximum number of operations in this + * queue that can be active in parallel at the same time + * @return handle to the queue + */ +struct OperationQueue * +GNUNET_TESTBED_operation_queue_create_ (unsigned int max_active); + + +/** + * Destroy an operation queue. The queue MUST be empty + * at this time. + * + * @param queue queue to destroy + */ +void +GNUNET_TESTBED_operation_queue_destroy_ (struct OperationQueue *queue); + + +/** + * Add an operation to a queue. An operation can be in multiple + * queues at once. Once all queues permit the operation to become + * active, the operation will be activated. The actual activation + * will occur in a separate task (thus allowing multiple queue + * insertions to be made without having the first one instantly + * trigger the operation if the first queue has sufficient + * resources). + * + * @param queue queue to add the operation to + * @param operation operation to add to the queue + */ +void +GNUNET_TESTBED_operation_queue_insert_ (struct OperationQueue *queue, + struct GNUNET_TESTBED_Operation *operation); + + +/** + * Remove an operation from a queue. This can be because the + * oeration was active and has completed (and the resources have + * been released), or because the operation was cancelled and + * thus scheduling the operation is no longer required. + * + * @param queue queue to add the operation to + * @param operation operation to add to the queue + */ +void +GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, + struct GNUNET_TESTBED_Operation *operation); + + + +/** + * Function to call to start an operation once all + * queues the operation is part of declare that the + * operation can be activated. + */ +typedef void (*OperationStart)(void *cls); + + +/** + * Function to call to cancel an operation (release all associated + * resources). This can be because of a call to + * "GNUNET_TESTBED_operation_cancel" (before the operation generated + * an event) or AFTER the operation generated an event due to a call + * to "GNUNET_TESTBED_operation_done". Thus it is not guaranteed that + * a callback to the 'OperationStart' preceeds the call to + * 'OperationRelease'. Implementations of this function are expected + * to clean up whatever state is in 'cls' and release all resources + * associated with the operation. + */ +typedef void (*OperationRelease)(void *cls); + + +/** + * Create an 'operation' to be performed. + * + * @param cls closure for the callbacks + * @param start function to call to start the operation + * @param release function to call to close down the operation + * @param ... FIXME + * @return handle to the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_operation_create_ (void *cls, + OperationStart start, + OperationRelease release, + ...); + + +#endif +/* end of testbed_api_operations.h */ diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c new file mode 100644 index 0000000..7ee0dd1 --- /dev/null +++ b/src/testbed/testbed_api_peers.c @@ -0,0 +1,297 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_peers.c + * @brief management of the knowledge about peers in this library + * (we know the peer ID, its host, pending operations, etc.) + * @author Christian Grothoff + */ +#include "platform.h" +#include "testbed_api_peers.h" + + +/** + * Details about a peer; kept in a separate struct to avoid bloating + * memory consumption everywhere... + */ +struct PeerDetails +{ + /** + * Configuration of the peer; NULL if we are not sure what the peer's correct + * configuration actually is; non-NULL if this peer is controlled by this + * process. + */ + struct GNUNET_CONFIGURATION_Handle *cfg; + + /** + * If this process has started this peer's ARM process, this is the handle + * to the 'gnunet-service-arm' process of the peer. + */ + struct GNUNET_OS_Process *arm; + + // ... + +}; + + +/** + * A peer controlled by the testing framework. A peer runs + * at a particular host. + */ +struct GNUNET_TESTBED_Peer +{ + /** + * Our controller context (not necessarily the controller + * that is responsible for starting/running the peer!). + */ + struct GNUNET_TESTBED_Controller *controller; + + /** + * Which host does this peer run on? + */ + struct GNUENT_TESTING_Host *host; + + /** + * Globally unique ID of the peer. + */ + uint32_t unique_id; + + /** + * Internals of the peer for the controlling process; NULL if + * this process is not controlling this peer. + */ + struct PeerDetails *details; + +}; + + +/** + * Lookup a peer by ID. + * + * @param id global peer ID assigned to the peer + * @return handle to the host, NULL on error + */ +struct GNUNET_TESTBED_Peer * +GNUNET_TESTBED_peer_lookup_by_id_ (uint32_t id) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Create the given peer at the specified host using the given + * controller. If the given controller is not running on the target + * host, it should find or create a controller at the target host and + * delegate creating the peer. Explicit delegation paths can be setup + * using 'GNUNET_TESTBED_controller_link'. If no explicit delegation + * path exists, a direct link with a subordinate controller is setup + * for the first delegated peer to a particular host; the subordinate + * controller is then destroyed once the last peer that was delegated + * to the remote host is stopped. This function is used in particular + * if some other controller has already assigned a unique ID to the + * peer. + * + * Creating the peer only creates the handle to manipulate and further + * configure the peer; use "GNUNET_TESTBED_peer_start" and + * "GNUNET_TESTBED_peer_stop" to actually start/stop the peer's + * processes. + * + * Note that the given configuration will be adjusted by the + * controller to avoid port/path conflicts with other peers. + * The "final" configuration can be obtained using + * 'GNUNET_TESTBED_peer_get_information'. + * + * @param unique_id unique ID for this peer + * @param controller controller process to use + * @param host host to run the peer on + * @param cfg configuration to use for the peer + * @return handle to the peer (actual startup will happen asynchronously) + */ +struct GNUNET_TESTBED_Peer * +GNUNET_TESTBED_peer_create_with_id_ (uint32_t unique_id, + struct GNUNET_TESTBED_Controller *controller, + struct GNUNET_TESTBED_Host *host, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + // FIXME: create locally or delegate... + GNUNET_break (0); + return NULL; +} + + +/** + * Create the given peer at the specified host using the given + * controller. If the given controller is not running on the target + * host, it should find or create a controller at the target host and + * delegate creating the peer. Explicit delegation paths can be setup + * using 'GNUNET_TESTBED_controller_link'. If no explicit delegation + * path exists, a direct link with a subordinate controller is setup + * for the first delegated peer to a particular host; the subordinate + * controller is then destroyed once the last peer that was delegated + * to the remote host is stopped. + * + * Creating the peer only creates the handle to manipulate and further + * configure the peer; use "GNUNET_TESTBED_peer_start" and + * "GNUNET_TESTBED_peer_stop" to actually start/stop the peer's + * processes. + * + * Note that the given configuration will be adjusted by the + * controller to avoid port/path conflicts with other peers. + * The "final" configuration can be obtained using + * 'GNUNET_TESTBED_peer_get_information'. + * + * @param controller controller process to use + * @param host host to run the peer on + * @param cfg configuration to use for the peer + * @return handle to the peer (actual startup will happen asynchronously) + */ +struct GNUNET_TESTBED_Peer * +GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, + struct GNUNET_TESTBED_Host *host, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + static uint32_t id_gen; + + return GNUNET_TESTBED_peer_create_with_id_ (++id_gen, + controller, + host, + cfg); +} + + +/** + * Start the given peer. + * + * @param peer peer to start + * @return handle to the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_peer_start (struct GNUNET_TESTBED_Peer *peer) +{ + // FIXME: start locally or delegate... + GNUNET_break (0); + return NULL; +} + + +/** + * Stop the given peer. The handle remains valid (use + * "GNUNET_TESTBED_peer_destroy" to fully clean up the + * state of the peer). + * + * @param peer peer to stop + * @return handle to the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_peer_stop (struct GNUNET_TESTBED_Peer *peer) +{ + // FIXME: stop locally or delegate... + GNUNET_break (0); + return NULL; +} + + +/** + * Request information about a peer. + * + * @param peer peer to request information about + * @param pit desired information + * @return handle to the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer, + enum GNUNET_TESTBED_PeerInformationType pit) +{ + // FIXME: handle locally or delegate... + GNUNET_break (0); + return NULL; +} + + +/** + * Change peer configuration. Must only be called while the + * peer is stopped. Ports and paths cannot be changed this + * way. + * + * @param peer peer to change configuration for + * @param cfg new configuration (differences to existing + * configuration only) + * @return handle to the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + // FIXME: handle locally or delegate... + GNUNET_break (0); + return NULL; +} + + +/** + * Manipulate the P2P underlay topology by configuring a link + * between two peers. + * + * @param op_cls closure argument to give with the operation event + * @param p1 first peer + * @param p2 second peer + * @param co option to change + * @param ... option-specific values + * @return handle to the operation, NULL if configuring the link at this + * time is not allowed + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_underlay_configure_link (void *op_cls, + struct GNUNET_TESTBED_Peer *p1, + struct GNUNET_TESTBED_Peer *p2, + enum GNUNET_TESTBED_ConnectOption co, ...) +{ + GNUNET_break (0); + return NULL; +} + + + +/** + * Both peers must have been started before calling this function. + * This function then obtains a HELLO from 'p1', gives it to 'p2' + * and asks 'p2' to connect to 'p1'. + * + * @param op_cls closure argument to give with the operation event + * @param p1 first peer + * @param p2 second peer + * @return handle to the operation, NULL if connecting these two + * peers is fundamentally not possible at this time (peers + * not running or underlay disallows) + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_overlay_connect (void *op_cls, + struct GNUNET_TESTBED_Peer *p1, + struct GNUNET_TESTBED_Peer *p2) +{ + GNUNET_break (0); + return NULL; +} + + + +/* end of testbed_api_peers.c */ diff --git a/src/testbed/testbed_api_peers.h b/src/testbed/testbed_api_peers.h new file mode 100644 index 0000000..ea42c98 --- /dev/null +++ b/src/testbed/testbed_api_peers.h @@ -0,0 +1,71 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_peers.h + * @brief internal API to access the 'peers' subsystem + * @author Christian Grothoff + */ +#ifndef NEW_TESTING_API_PEERS_H +#define NEW_TESTING_API_PEERS_H + +#include "gnunet_testbed_service.h" +#include "gnunet_helper_lib.h" + + +/** + * Create the given peer at the specified host using the given + * controller. If the given controller is not running on the target + * host, it should find or create a controller at the target host and + * delegate creating the peer. Explicit delegation paths can be setup + * using 'GNUNET_TESTBED_controller_link'. If no explicit delegation + * path exists, a direct link with a subordinate controller is setup + * for the first delegated peer to a particular host; the subordinate + * controller is then destroyed once the last peer that was delegated + * to the remote host is stopped. This function is used in particular + * if some other controller has already assigned a unique ID to the + * peer. + * + * Creating the peer only creates the handle to manipulate and further + * configure the peer; use "GNUNET_TESTBED_peer_start" and + * "GNUNET_TESTBED_peer_stop" to actually start/stop the peer's + * processes. + * + * Note that the given configuration will be adjusted by the + * controller to avoid port/path conflicts with other peers. + * The "final" configuration can be obtained using + * 'GNUNET_TESTBED_peer_get_information'. + * + * @param unique_id unique ID for this peer + * @param controller controller process to use + * @param host host to run the peer on + * @param cfg configuration to use for the peer + * @return handle to the peer (actual startup will happen asynchronously) + */ +struct GNUNET_TESTBED_Peer * +GNUNET_TESTBED_peer_create_with_id_ (uint32_t unique_id, + struct GNUNET_TESTBED_Controller *controller, + struct GNUNET_TESTBED_Host *host, + const struct GNUNET_CONFIGURATION_Handle *cfg); + + + +#endif +/* end of testbed_api_peers.h */ diff --git a/src/testbed/testbed_api_services.c b/src/testbed/testbed_api_services.c new file mode 100644 index 0000000..34de0fd --- /dev/null +++ b/src/testbed/testbed_api_services.c @@ -0,0 +1,61 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_services.c + * @brief convenience functions for accessing services + * @author Christian Grothoff + */ +#include "platform.h" +#include "testbed_api_peers.h" + + +/** + * Connect to a service offered by the given peer. Will ensure that + * the request is queued to not overwhelm our ability to create and + * maintain connections with other systems. The actual service + * handle is then returned via the 'op_result' member in the event + * callback. The 'ca' callback is used to create the connection + * when the time is right; the 'da' callback will be used to + * destroy the connection (upon 'GNUNET_TESTBED_operation_done'). + * 'GNUNET_TESTBED_operation_cancel' can be used to abort this + * operation until the event callback has been called. + * + * @param op_cls closure to pass in operation event + * @param peer peer that runs the service + * @param service_name name of the service to connect to + * @param ca helper function to establish the connection + * @param da helper function to close the connection + * @param cada_cls closure for ca and da + * @return handle for the operation + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_service_connect (void *op_cls, + struct GNUNET_TESTBED_Peer *peer, + const char *service_name, + GNUNET_TESTBED_ConnectAdapter ca, + GNUNET_TESTBED_DisconnectAdapter da, + void *cada_cls) +{ + GNUNET_break (0); + return NULL; +} + +/* end of testbed_api_services.c */ diff --git a/src/testbed/testbed_api_test.c b/src/testbed/testbed_api_test.c new file mode 100644 index 0000000..38e189b --- /dev/null +++ b/src/testbed/testbed_api_test.c @@ -0,0 +1,67 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_test.c + * @brief high-level test function + * @author Christian Grothoff + */ +#include "platform.h" +#include "gnunet_testbed_service.h" + + + + +/** + * Convenience method for running a "simple" test on the local system + * with a single call from 'main'. Underlay and overlay topology are + * configured using the "UNDERLAY" and "OVERLAY" options in the + * "[testbed]" section of the configuration (with possible options + * given in "UNDERLAY_XXX" and/or "OVERLAY_XXX"). + * + * The test is to be terminated using a call to + * "GNUNET_SCHEDULER_shutdown". If starting the test fails, + * the program is stopped without 'master' ever being run. + * + * NOTE: this function should be called from 'main', NOT from + * within a GNUNET_SCHEDULER-loop. This function will initialze + * the scheduler loop, the testbed and then pass control to + * 'master'. + * + * @param testname name of the testcase (to configure logging, etc.) + * @param cfg_filename configuration filename to use + * (for testbed, controller and peers) + * @param num_peers number of peers to start + * @param test_master task to run once the test is ready + * @param test_master_cls closure for 'task'. + */ +void +GNUNET_TESTBED_test_run (const char *testname, + const char *cfg_filename, + unsigned int num_peers, + GNUNET_TESTBED_TestMaster test_master, + void *test_master_cls) +{ + GNUNET_break (0); +} + + + +/* end of testbed_api_test.c */ diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c new file mode 100644 index 0000000..6311806 --- /dev/null +++ b/src/testbed/testbed_api_testbed.c @@ -0,0 +1,153 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_testbed.c + * @brief high-level testbed management + * @author Christian Grothoff + */ +#include "platform.h" +#include "gnunet_testbed_service.h" + + +/** + * Opaque handle to an abstract operation to be executed by the testing framework. + */ +struct GNUNET_TESTBED_Testbed +{ + // FIXME! +}; + + +/** + * Configure and run a testbed using the given + * master controller on 'num_hosts' starting + * 'num_peers' using the given peer configuration. + * + * @param controller master controller for the testbed + * (must not be destroyed until after the + * testbed is destroyed). + * @param num_hosts number of hosts in 'hosts', 0 to only + * use 'localhost' + * @param hosts list of hosts to use for the testbed + * @param num_peers number of peers to start + * @param peer_cfg peer configuration template to use + * @param underlay_topology underlay topology to create + * @param va topology-specific options + * @return handle to the testbed + */ +struct GNUNET_TESTBED_Testbed * +GNUNET_TESTBED_create_va (struct GNUNET_TESTBED_Controller *controller, + unsigned int num_hosts, + struct GNUNET_TESTBED_Host **hosts, + unsigned int num_peers, + const struct GNUNET_CONFIGURATION_Handle *peer_cfg, + enum GNUNET_TESTBED_TopologyOption underlay_topology, + va_list va) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Configure and run a testbed using the given + * master controller on 'num_hosts' starting + * 'num_peers' using the given peer configuration. + * + * @param controller master controller for the testbed + * (must not be destroyed until after the + * testbed is destroyed). + * @param num_hosts number of hosts in 'hosts', 0 to only + * use 'localhost' + * @param hosts list of hosts to use for the testbed + * @param num_peers number of peers to start + * @param peer_cfg peer configuration template to use + * @param underlay_topology underlay topology to create + * @param ... topology-specific options + */ +struct GNUNET_TESTBED_Testbed * +GNUNET_TESTBED_create (struct GNUNET_TESTBED_Controller *controller, + unsigned int num_hosts, + struct GNUNET_TESTBED_Host **hosts, + unsigned int num_peers, + const struct GNUNET_CONFIGURATION_Handle *peer_cfg, + enum GNUNET_TESTBED_TopologyOption underlay_topology, + ...) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Destroy a testbed. Stops all running peers and then + * destroys all peers. Does NOT destroy the master controller. + * + * @param testbed testbed to destroy + */ +void +GNUNET_TESTBED_destroy (struct GNUNET_TESTBED_Testbed *testbed) +{ + GNUNET_break (0); +} + + + +/** + * Convenience method for running a testbed with + * a single call. Underlay and overlay topology + * are configured using the "UNDERLAY" and "OVERLAY" + * options in the "[testbed]" section of the configuration\ + * (with possible options given in "UNDERLAY_XXX" and/or + * "OVERLAY_XXX"). + * + * The testbed is to be terminated using a call to + * "GNUNET_SCHEDULER_shutdown". + * + * @param host_filename name of the file with the 'hosts', NULL + * to run everything on 'localhost' + * @param cfg configuration to use (for testbed, controller and peers) + * @param num_peers number of peers to start; FIXME: maybe put that ALSO into cfg? + * @param event_mask bit mask with set of events to call 'cc' for; + * or-ed values of "1LL" shifted by the + * respective 'enum GNUNET_TESTBED_EventType' + * (i.e. "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...") + * @param cc controller callback to invoke on events + * @param cc_cls closure for cc + * @param master task to run once the testbed is ready + * @param master_cls closure for 'task'. + */ +void +GNUNET_TESTBED_run (const char *host_filename, + const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int num_peers, + uint64_t event_mask, + GNUNET_TESTBED_ControllerCallback cc, + void *cc_cls, + GNUNET_SCHEDULER_Task master, + void *master_cls) +{ + GNUNET_break (0); +} + + + +/* end of testbed_api_testbed.c */ diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c new file mode 100644 index 0000000..c0e9f72 --- /dev/null +++ b/src/testbed/testbed_api_topology.c @@ -0,0 +1,127 @@ +/* + This file is part of GNUnet + (C) 2008--2012 Christian Grothoff (and other contributing authors) + + GNUnet 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. + + GNUnet 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 GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + */ + +/** + * @file testbed/testbed_api_topology.c + * @brief topology-generation functions + * @author Christian Grothoff + */ +#include "platform.h" +#include "gnunet_testbed_service.h" + + +/** + * Configure overall network topology to have a particular shape. + * + * @param op_cls closure argument to give with the operation event + * @param num_peers number of peers in 'peers' + * @param peers array of 'num_peers' with the peers to configure + * @param topo desired underlay topology to use + * @param ap topology-specific options + * @return handle to the operation, NULL if configuring the topology + * is not allowed at this time + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls, + unsigned int num_peers, + struct GNUNET_TESTBED_Peer **peers, + enum GNUNET_TESTBED_TopologyOption topo, + va_list ap) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * Configure overall network topology to have a particular shape. + * + * @param op_cls closure argument to give with the operation event + * @param num_peers number of peers in 'peers' + * @param peers array of 'num_peers' with the peers to configure + * @param topo desired underlay topology to use + * @param ... topology-specific options + * @return handle to the operation, NULL if configuring the topology + * is not allowed at this time + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_underlay_configure_topology (void *op_cls, + unsigned int num_peers, + struct GNUNET_TESTBED_Peer **peers, + enum GNUNET_TESTBED_TopologyOption topo, + ...) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * All peers must have been started before calling this function. + * This function then connects the given peers in the P2P overlay + * using the given topology. + * + * @param op_cls closure argument to give with the operation event + * @param num_peers number of peers in 'peers' + * @param peers array of 'num_peers' with the peers to configure + * @param topo desired underlay topology to use + * @param va topology-specific options + * @return handle to the operation, NULL if connecting these + * peers is fundamentally not possible at this time (peers + * not running or underlay disallows) + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, + unsigned int num_peers, + struct GNUNET_TESTBED_Peer *peers, + enum GNUNET_TESTBED_TopologyOption topo, + va_list va) +{ + GNUNET_break (0); + return NULL; +} + + +/** + * All peers must have been started before calling this function. + * This function then connects the given peers in the P2P overlay + * using the given topology. + * + * @param op_cls closure argument to give with the operation event + * @param num_peers number of peers in 'peers' + * @param peers array of 'num_peers' with the peers to configure + * @param topo desired underlay topology to use + * @param ... topology-specific options + * @return handle to the operation, NULL if connecting these + * peers is fundamentally not possible at this time (peers + * not running or underlay disallows) + */ +struct GNUNET_TESTBED_Operation * +GNUNET_TESTBED_overlay_configure_topology (void *op_cls, + unsigned int num_peers, + struct GNUNET_TESTBED_Peer *peers, + enum GNUNET_TESTBED_TopologyOption topo, + ...) +{ + GNUNET_break (0); + return NULL; +} + +/* end of testbed_api_topology.c */ |