Index: /sample/pingpong/Makefile.am
===================================================================
--- /sample/pingpong/Makefile.am	(revision 2410)
+++ /sample/pingpong/Makefile.am	(revision 2410)
@@ -0,0 +1,60 @@
+# sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+if OMNET
+lib_LTLIBRARIES = libpingpong.la
+else
+bin_PROGRAMS 	= pingpong
+endif
+
+# compiler flags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AM_CPPFLAGS     = -DLINUX -D_LINUX -I../../source -D_REENTRANT
+AM_CPPFLAGS    += $(BOOST_CPPFLAGS)
+
+if DEBUG
+AM_CPPFLAGS    += -ggdb -DDEBUG -D_DEBUG -O0
+endif
+
+if PROFILING
+AM_CPPFLAGS    += -pg
+endif
+
+if OMNET
+AM_CPPFLAGS    += -fPIC -DUNDERLAY_OMNET
+endif
+
+# linker flags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AM_LDFLAGS      = -L../../source/ariba -lariba
+
+if PROFILING
+AM_LDFLAGS     += -pg
+endif
+
+if OMNET
+AM_LDFLAGS     += -shared -rdynamic
+endif
+
+# sources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+if OMNET
+
+libpingpong_la_SOURCES = \
+  PingPong.cpp \
+  PingPong.h \
+  PingPongMessage.cpp \
+  PingPongMessage.h
+
+else
+
+#needed to fix autotools bug
+pingpong_CPPFLAGS = $(AM_CPPFLAGS)
+
+pingpong_SOURCES = \
+  PingPongMessage.cpp \
+  PingPongMessage.h \
+  PingPong.cpp \
+  PingPong.h \
+  main.cpp
+
+endif
Index: /sample/pingpong/PingPong.cpp
===================================================================
--- /sample/pingpong/PingPong.cpp	(revision 2410)
+++ /sample/pingpong/PingPong.cpp	(revision 2410)
@@ -0,0 +1,138 @@
+
+#include "PingPong.h"
+#include "ariba/utility/configuration/Configuration.h"
+
+using ariba::utility::Configuration;
+using namespace ariba;
+
+namespace ariba {
+namespace application {
+namespace pingpong {
+
+// logging
+use_logging_cpp( PingPong);
+
+// the service id of the ping pong service
+ServiceID PingPong::PINGPONG_ID = ServiceID(111);
+
+// construction
+PingPong::PingPong() : pingId( 0 ) {
+}
+
+// destruction
+PingPong::~PingPong() {
+}
+
+// implementation of the startup interface
+void PingPong::startup() {
+
+	// create ariba module
+	logging_info("Creating ariba underlay module ... ");
+	ariba = new AribaModule();
+
+	logging_info("Starting up PingPong service ... ");
+
+	// --- get config ---
+	Configuration& config = Configuration::instance();
+
+	// generate spovnet name
+	Name spovnetName("pingpong");
+
+	// get initiator flag
+	this->isInitiator = Configuration::instance().read<bool> ("node.initiator");
+
+	// get node name
+	Name nodeName = Name::UNSPECIFIED;
+	if (config.exists("node.name")) nodeName
+			= config.read<string> ("node.name");
+
+	// configure ariba module
+	if (config.exists("ariba.ip.addr")) ariba->setProperty("ip.addr",
+			config.read<string> ("ariba.ip.addr"));
+	if (config.exists("ariba.tcp.port")) ariba->setProperty("tcp.port",
+			config.read<string> ("ariba.tcp.port"));
+	if (config.exists("ariba.udp.port")) ariba->setProperty("udp.port",
+			config.read<string> ("ariba.udp.port"));
+	if (config.exists("ariba.bootstrap.hints")) ariba->setProperty("bootstrap.hints",
+			config.read<string> ("ariba.bootstrap.hints"));
+
+	// start ariba module
+	ariba->start();
+
+	// create node and join
+	node = new Node(*ariba, nodeName);
+
+	// start node module
+	node->start();
+
+	if (!isInitiator) {
+		node->join(spovnetName);
+	} else {
+		node->initiate(spovnetName);
+	}
+
+	// bind communication and node listener
+	node->bind(this);
+	node->bind(this, PingPong::PINGPONG_ID);
+
+	// ping pong started up...
+	logging_info("PingPong started up");
+}
+
+// implementation of the startup interface
+void PingPong::shutdown() {
+	logging_info("PingPong service starting shutdown sequence ...");
+
+	// stop timer
+	Timer::stop();
+
+	// leave spovnet
+	node->leave();
+
+	// unbind listeners
+	node->unbind( this );
+	node->unbind( this, PingPong::PINGPONG_ID );
+
+	logging_info("PingPong service shut down!");
+}
+
+// node listener interface
+void PingPong::onJoinCompleted( const SpoVNetID& vid ) {
+	logging_info("PingPong node join completed, spovnetid=" << vid.toString() );
+}
+
+void PingPong::onJoinFailed( const SpoVNetID& vid ) {
+	logging_info("PingPong node join failed, spovnetid=" << vid.toString() );
+}
+
+// communication listener
+bool PingPong::onLinkRequest(const NodeID& remote, Message* msg) {
+	return false;
+}
+
+void PingPong::onMessage(Message* msg, const NodeID& remote, const LinkID& lnk =
+		LinkID::UNSPECIFIED) {
+	PingPongMessage* incoming = msg->decapsulate<PingPongMessage> ();
+
+	logging_info("received ping message on link " << lnk.toString()
+			<< " from node with id " << (int) incoming->getid());
+}
+
+// timer event
+void PingPong::eventFunction() {
+
+ 	logging_info("pinging our remote nodes");
+// 	RemoteNodes::iterator i = remoteNodes.begin();
+// 	RemoteNodes::iterator iend = remoteNodes.end();
+//
+// 	pingid++;
+//
+// 	for (; i != iend; i++) {
+// 		logging_info("     -> pinging " << i->first);
+//
+// 		PingPongMessage pingmsg(pingid);
+// 		overlay->sendMessage(&pingmsg, i->second);
+// 	}
+}
+
+}}} // namespace ariba, application, pingpong
Index: /sample/pingpong/PingPong.h
===================================================================
--- /sample/pingpong/PingPong.h	(revision 2410)
+++ /sample/pingpong/PingPong.h	(revision 2410)
@@ -0,0 +1,75 @@
+#ifndef __PINGPONG_H_
+#define __PINGPONG_H_
+
+#include "ariba/ariba.h"
+#include "PingPongMessage.h"
+
+using namespace ariba;
+
+#include "ariba/utility/system/StartupInterface.h"
+#include "ariba/utility/system/Timer.h"
+using ariba::utility::StartupInterface;
+using ariba::utility::Timer;
+
+namespace ariba {
+namespace application {
+namespace pingpong {
+
+/**
+/* The PingPong main class
+/* This class implements an example service for demonstration purposes
+/* The pingpong class sends and receives messages between two SpoVNet
+/* instances
+**/
+class PingPong :
+	public NodeListener,
+	public CommunicationListener,
+	public StartupInterface,
+	public Timer {
+
+	use_logging_h(PingPong);
+
+public:
+	PingPong();
+	virtual ~PingPong();
+
+protected:
+	// communication listener interface
+	virtual bool onLinkRequest(const NodeID& remote, Message* msg);
+	virtual void onMessage(Message* msg, const NodeID& remote, const LinkID& lnk);
+
+	// node listener interface
+	virtual void onJoinCompleted( const SpoVNetID& vid );
+	virtual void onJoinFailed( const SpoVNetID& vid );
+
+	// startup wrapper interface
+	virtual void startup();
+	virtual void shutdown();
+
+	// timer events
+ 	virtual void eventFunction();
+
+private:
+	// the ariba module and a node
+	AribaModule* ariba;
+	Node* node;
+
+	// flag, wheter this node is the initiator of this spovnet
+	bool isInitiator;
+
+ 	// the ping pong service id
+ 	static ServiceID PINGPONG_ID;
+
+ 	// the current ping id
+ 	unsigned long pingId;
+
+// 	// the known remote nodes
+// 	typedef map<NodeID, LinkID> RemoteNodes;
+// 	RemoteNodes remoteNodes;
+};
+
+//ARIBA_SIMULATION_SERVICE(PingPong);
+
+}}} // namespace ariba, application, pingpong
+
+#endif // __PINGPONG_H_
Index: /sample/pingpong/PingPongMessage.cpp
===================================================================
--- /sample/pingpong/PingPongMessage.cpp	(revision 2410)
+++ /sample/pingpong/PingPongMessage.cpp	(revision 2410)
@@ -0,0 +1,26 @@
+#include "PingPongMessage.h"
+
+namespace ariba {
+namespace application {
+namespace pingpong {
+
+vsznDefault(PingPongMessage);
+
+PingPongMessage::PingPongMessage() : id(0) {
+}
+
+PingPongMessage::PingPongMessage(uint8_t _id) : id(_id) {
+}
+
+PingPongMessage::~PingPongMessage(){
+}
+
+string PingPongMessage::info(){
+	return "ping pong message id " + ariba::utility::Helper::ultos(id);
+}
+
+uint8_t PingPongMessage::getid(){
+	return id;
+}
+
+}}} // namespace ariba, appplication, pingpong
Index: /sample/pingpong/PingPongMessage.h
===================================================================
--- /sample/pingpong/PingPongMessage.h	(revision 2410)
+++ /sample/pingpong/PingPongMessage.h	(revision 2410)
@@ -0,0 +1,40 @@
+#ifndef PINGPONGMESSAGES_H_
+#define PINGPONGMESSAGES_H_
+
+// #include "ariba/utility/messages.h"
+// #include "ariba/utility/serialization.h"
+// #include "ariba/utility/misc/Helper.h"
+// using ariba::utility::Message;
+
+#include <string>
+#include "ariba/ariba.h"
+
+using namespace ariba;
+using std::string;
+
+namespace ariba {
+namespace application {
+namespace pingpong {
+
+using_serialization;
+
+class PingPongMessage : public Message {
+	VSERIALIZEABLE;
+public:
+	PingPongMessage();
+	PingPongMessage( uint8_t _id );
+	virtual ~PingPongMessage();
+
+	string info();
+	uint8_t getid();
+private:
+	uint8_t id;
+};
+
+}}} // namespace ariba, appplication , pingpong
+
+sznBeginDefault( ariba::application::pingpong::PingPongMessage, X ) {
+	X && id;
+} sznEnd();
+
+#endif /* PINGPONGMESSAGES_H_ */
Index: /sample/pingpong/main.cpp
===================================================================
--- /sample/pingpong/main.cpp	(revision 2410)
+++ /sample/pingpong/main.cpp	(revision 2410)
@@ -0,0 +1,25 @@
+#include <string>
+#include "ariba/utility/system/StartupWrapper.h"
+#include "TidyPingPong.h"
+
+using std::string;
+using ariba::utility::StartupWrapper;
+using ariba::application::pingpong::PingPong;
+
+int main( int argc, char** argv ) {
+
+	// get config file
+	string config = "../etc/settings.cnf";
+	if (argc >= 2) config = argv[1];
+
+	StartupWrapper::initConfig( config );
+	StartupWrapper::initSystem();
+
+	// this will do the main functionality and block
+	PingPong ping;
+	StartupWrapper::startup(&ping, true);
+
+	// this will run blocking until <enter> is hit
+	StartupWrapper::shutdown();
+	return 0;
+}
Index: /sample/pingpong/pingpong
===================================================================
--- /sample/pingpong/pingpong	(revision 2410)
+++ /sample/pingpong/pingpong	(revision 2410)
@@ -0,0 +1,147 @@
+#! /bin/bash
+
+# pingpong - temporary wrapper script for .libs/pingpong
+# Generated by ltmain.sh (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4
+#
+# The pingpong program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /local/SpoVNet-ka/entwicklung/ariba/trunk/sample/tidy_pingpong; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons; export LD_LIBRARY_PATH; PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; export PATH; g++ -g -O2 -o \$progdir/\$file pingpong-TidyPingPongMessage.o pingpong-TidyPingPong.o pingpong-main.o  -L/local/SpoVNet-ka/entwicklung/ariba/trunk/source/ariba /local/SpoVNet-ka/entwicklung/ariba/trunk/source/ariba/.libs/libariba.so -L/usr/lib -lboost_thread-mt -lboost_system-mt -lboost_regex-mt /usr/lib/libgmp.so /usr/lib/liblog4cxx.so /usr/lib/libaprutil-1.so -lldap -llber /usr/lib/libdb-4.6.so -lpq /usr/lib/libmysqlclient_r.so -lnsl -lz /usr/lib/libsqlite3.so /usr/lib/libexpat.so /usr/lib/libapr-1.so -luuid -lrt -lcrypt -lpthread -ldl -Wl,-rpath -Wl,/local/SpoVNet-ka/entwicklung/ariba/trunk/source/ariba/.libs -Wl,-rpath -Wl,/local/SpoVNet-ka/entwicklung/ariba/trunk/build/lib)"
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='2.2.4'
+  notinst_deplibs=' /local/SpoVNet-ka/entwicklung/ariba/trunk/source/ariba/libariba.la'
+else
+  # When we are sourced in execute mode, $file and $ECHO are already set.
+  if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+    ECHO="echo"
+    file="$0"
+    # Make sure echo works.
+    if test "X$1" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+      # Yippee, $ECHO works!
+      :
+    else
+      # Restart under the correct shell, and then maybe $ECHO will work.
+      exec /bin/bash "$0" --no-reexec ${1+"$@"}
+    fi
+  fi
+
+  # Find the directory that this script lives in.
+  thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+  test "x$thisdir" = "x$file" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+  while test -n "$file"; do
+    destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+    # If there was a directory component, then change thisdir.
+    if test "x$destdir" != "x$file"; then
+      case "$destdir" in
+      [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+      *) thisdir="$thisdir/$destdir" ;;
+      esac
+    fi
+
+    file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
+    file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+  if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+    # special case for '.'
+    if test "$thisdir" = "."; then
+      thisdir=`pwd`
+    fi
+    # remove .libs from thisdir
+    case "$thisdir" in
+    *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
+    .libs )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=`cd "$thisdir" && pwd`
+  test -n "$absdir" && thisdir="$absdir"
+
+  program=lt-'pingpong'
+  progdir="$thisdir/.libs"
+
+  if test ! -f "$progdir/$program" ||
+     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+       test "X$file" != "X$progdir/$program"; }; then
+
+    file="$$-$program"
+
+    if test ! -d "$progdir"; then
+      mkdir "$progdir"
+    else
+      rm -f "$progdir/$file"
+    fi
+
+    # relink executable if necessary
+    if test -n "$relink_command"; then
+      if relink_command_output=`eval $relink_command 2>&1`; then :
+      else
+	echo "$relink_command_output" >&2
+	rm -f "$progdir/$file"
+	exit 1
+      fi
+    fi
+
+    mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+    { rm -f "$progdir/$program";
+      mv -f "$progdir/$file" "$progdir/$program"; }
+    rm -f "$progdir/$file"
+  fi
+
+  if test -f "$progdir/$program"; then
+    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+      # Run the actual program with our arguments.
+
+      exec "$progdir/$program" ${1+"$@"}
+
+      $ECHO "$0: cannot exec $program $*" 1>&2
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
+    $ECHO "This script is just a wrapper for $program." 1>&2
+    echo "See the libtool documentation for more information." 1>&2
+    exit 1
+  fi
+fi
