[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21930 - in gnunet: . src/testbed
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21930 - in gnunet: . src/testbed |
Date: |
Tue, 12 Jun 2012 22:23:00 +0200 |
Author: harsha
Date: 2012-06-12 22:23:00 +0200 (Tue, 12 Jun 2012)
New Revision: 21930
Added:
gnunet/src/testbed/gnunet-service-testbed.c
gnunet/src/testbed/testbed.conf.in
Removed:
gnunet/src/testbed/testbed.conf
Modified:
gnunet/configure.ac
gnunet/src/testbed/
gnunet/src/testbed/Makefile.am
gnunet/src/testbed/testbed.h
Log:
testbed service build system
Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2012-06-12 19:36:29 UTC (rev 21929)
+++ gnunet/configure.ac 2012-06-12 20:23:00 UTC (rev 21930)
@@ -1091,6 +1091,7 @@
src/stream/Makefile
src/template/Makefile
src/testbed/Makefile
+src/testbed/testbed.conf
src/testing/Makefile
src/testing_old/Makefile
src/topology/Makefile
Property changes on: gnunet/src/testbed
___________________________________________________________________
Modified: svn:ignore
- Makefile.in
Makefile
.deps
+ Makefile.in
Makefile
.deps
gnunet-service-testbed
Modified: gnunet/src/testbed/Makefile.am
===================================================================
--- gnunet/src/testbed/Makefile.am 2012-06-12 19:36:29 UTC (rev 21929)
+++ gnunet/src/testbed/Makefile.am 2012-06-12 20:23:00 UTC (rev 21930)
@@ -11,6 +11,18 @@
pkgcfgdir= $(pkgdatadir)/config.d/
+pkgcfg_DATA = \
+ testbed.conf
+
+bin_PROGRAMS = \
+ gnunet-service-testbed
+
+gnunet_service_testbed_SOURCES = \
+ gnunet-service-testbed.c
+gnunet_service_testbed_LDADD = $(XLIB) \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(LTLIBINTL)
+
dist_pkgcfg_DATA = \
testbed.conf
Added: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c (rev 0)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-06-12 20:23:00 UTC (rev
21930)
@@ -0,0 +1,122 @@
+/*
+ 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 2, 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/gnunet-service-testbed.c
+ * @brief implementation of the TESTBED service
+ * @author Sree Harsha Totakura
+ */
+
+#include "platform.h"
+#include "gnunet_service_lib.h"
+#include "gnunet_server_lib.h"
+
+#include "testbed.h"
+
+
+#define LOG(kind,...) \
+ GNUNET_log (kind, __VA_ARGS__)
+
+
+/**
+ * Message handler for GNUNET_MESSAGE_TYPE_TESTBED_INIT messages
+ *
+ * @param cls NULL
+ * @param client identification of the client
+ * @param message the actual message
+ */
+static void
+handle_init (void *cls,
+ struct GNUNET_SERVER_Client *client,
+ const struct GNUNET_MessageHeader *message)
+{
+ GNUNET_break (0);
+}
+
+
+/**
+ * Callback for client disconnect
+ *
+ * @param cls NULL
+ * @param client the client which has disconnected
+ */
+static void
+client_disconnect_cb (void *cls, struct GNUNET_SERVER_Client *client)
+{
+ GNUNET_break (0);
+}
+
+
+/**
+ * Task to clean up and shutdown nicely
+ *
+ * @param cls NULL
+ * @param tc the TaskContext from scheduler
+ */
+static void
+shutdown_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ GNUNET_break (0);
+}
+
+
+/**
+ * Testbed setup
+ *
+ * @param cls closure
+ * @param server the initialized server
+ * @param cfg configuration to use
+ */
+static void
+testbed_run (void *cls,
+ struct GNUNET_SERVER_Handle * server,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+ static const struct GNUNET_SERVER_MessageHandler message_handlers[] =
+ {
+ {&handle_init, NULL, GNUNET_MESSAGE_TYPE_TESTBED_INIT, 0},
+ {NULL}
+ };
+ GNUNET_SERVER_add_handlers (server,
+ message_handlers);
+ GNUNET_SERVER_disconnect_notify (server,
+ &client_disconnect_cb,
+ NULL);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
+ NULL);
+}
+
+
+/**
+ * The starting point of execution
+ */
+int main (int argc, char *const *argv)
+{
+ return
+ (GNUNET_OK ==
+ GNUNET_SERVICE_run (argc,
+ argv,
+ "testbed",
+ GNUNET_SERVICE_OPTION_NONE,
+ &testbed_run,
+ NULL)) ? 0 : 1;
+}
Deleted: gnunet/src/testbed/testbed.conf
===================================================================
Added: gnunet/src/testbed/testbed.conf.in
===================================================================
--- gnunet/src/testbed/testbed.conf.in (rev 0)
+++ gnunet/src/testbed/testbed.conf.in 2012-06-12 20:23:00 UTC (rev 21930)
@@ -0,0 +1,12 @@
+[testbed]
+AUTOSTART = NO
address@hidden@ PORT = 2101
+HOSTNAME = localhost
+HOME = $SERVICEHOME
+CONFIG = $DEFAULTCONFIG
+BINARY = gnunet-service-testbed
+ACCEPT_FROM = 127.0.0.1;
+ACCEPT_FROM6 = ::1;
+UNIXPATH = /tmp/gnunet-service-testbed.sock
+UNIX_MATCH_UID = YES
+UNIX_MATCH_GID = YES
Modified: gnunet/src/testbed/testbed.h
===================================================================
--- gnunet/src/testbed/testbed.h 2012-06-12 19:36:29 UTC (rev 21929)
+++ gnunet/src/testbed/testbed.h 2012-06-12 20:23:00 UTC (rev 21930)
@@ -566,9 +566,9 @@
struct GNUNET_MessageHeader header;
/**
- * Peer identity of the peer that was created.
+ * Peer number of the peer that was created.
*/
- uint32_t peer_id GNUNET_PACKED;
+ uint32_t peer_number GNUNET_PACKED;
/**
* Operation ID of the operation that created this event.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21930 - in gnunet: . src/testbed,
gnunet <=