aboutsummaryrefslogtreecommitdiff
path: root/src/experimentation
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-05-23 11:28:50 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-05-23 11:28:50 +0000
commit1b838a4dd4cf51f93a925f3a8ca78d271a6f1ebd (patch)
tree1f967f539fd2a16c45824f6acb9e4a5f16c00270 /src/experimentation
parent5e23e614f5571f125493e5d7de9808fba42d1600 (diff)
documentation
Diffstat (limited to 'src/experimentation')
-rw-r--r--src/experimentation/gnunet-daemon-experimentation.c17
-rw-r--r--src/experimentation/gnunet-daemon-experimentation.h37
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_nodes.c20
3 files changed, 47 insertions, 27 deletions
diff --git a/src/experimentation/gnunet-daemon-experimentation.c b/src/experimentation/gnunet-daemon-experimentation.c
index 708a1f7eaa..5bcfe42758 100644
--- a/src/experimentation/gnunet-daemon-experimentation.c
+++ b/src/experimentation/gnunet-daemon-experimentation.c
@@ -31,10 +31,7 @@
#include "gnunet_statistics_service.h"
#include "gnunet-daemon-experimentation.h"
-#define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-
-
-static struct GNUNET_STATISTICS_Handle *stats;
+static struct GNUNET_STATISTICS_Handle *GSE_stats;
/**
* Task run during shutdown.
@@ -52,10 +49,12 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
/**
- * The main function for the experimentation daemon.
+ * Function starting all submodules of the experimentation daemon.
*
- * @param argc number of arguments from the command line
- * @param argv command line arguments
+ * @param cls always NULL
+ * @param args temaining command line arguments
+ * @param cfgfile configuration file used
+ * @param cfg configuration handle
*/
static void
run (void *cls, char *const *args, const char *cfgfile,
@@ -63,8 +62,8 @@ run (void *cls, char *const *args, const char *cfgfile,
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon starting ...\n"));
- stats = GNUNET_STATISTICS_create ("experimentation", cfg);
- if (NULL == stats)
+ GSE_stats = GNUNET_STATISTICS_create ("experimentation", cfg);
+ if (NULL == GSE_stats)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to create statistics!\n"));
return;
diff --git a/src/experimentation/gnunet-daemon-experimentation.h b/src/experimentation/gnunet-daemon-experimentation.h
index dda9c1dd34..3a4c9e1819 100644
--- a/src/experimentation/gnunet-daemon-experimentation.h
+++ b/src/experimentation/gnunet-daemon-experimentation.h
@@ -19,7 +19,7 @@
*/
/**
- * @file experimentation/gnunet-daemon-experimentation.c
+ * @file experimentation/gnunet-daemon-experimentation.h
* @brief experimentation daemon
* @author Christian Grothoff
* @author Matthias Wachs
@@ -30,25 +30,47 @@
#include "gnunet_core_service.h"
#include "gnunet_statistics_service.h"
+
+/**
+ * Timeout between request and expected response
+ */
#define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
+
+
/**
* A experimentation node
*/
struct Node
{
+ /**
+ * Peer id
+ */
struct GNUNET_PeerIdentity id;
+ /**
+ * Task for response timeout
+ */
GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ /**
+ * Core transmission handle
+ */
struct GNUNET_CORE_TransmitHandle *cth;
};
-
+/**
+ * Experimentation request message
+ * Used to detect experimentation capability
+ */
struct Experimentation_Request
{
struct GNUNET_MessageHeader msg;
};
+/**
+ * Experimentation response message
+ * Sent if peer is running the daemon
+ */
struct Experimentation_Response
{
struct GNUNET_MessageHeader msg;
@@ -56,15 +78,18 @@ struct Experimentation_Response
/**
- * The main function for the experimentation daemon.
+ * Start the nodes management
*
- * @param argc number of arguments from the command line
- * @param argv command line arguments
+ * @param cfg configuration handle
*/
void
GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cfg);
+
+/**
+ * Stop the nodes management
+ */
void
GNUNET_EXPERIMENTATION_nodes_stop ();
-/* end of gnunet-daemon-experimentation.c */
+/* end of gnunet-daemon-experimentation.h */
diff --git a/src/experimentation/gnunet-daemon-experimentation_nodes.c b/src/experimentation/gnunet-daemon-experimentation_nodes.c
index f2779cbe35..0b9b8d4478 100644
--- a/src/experimentation/gnunet-daemon-experimentation_nodes.c
+++ b/src/experimentation/gnunet-daemon-experimentation_nodes.c
@@ -19,8 +19,8 @@
*/
/**
- * @file experimentation/gnunet-daemon-experimentation.c
- * @brief experimentation daemon
+ * @file experimentation/gnunet-daemon-experimentation_nodes.c
+ * @brief experimentation daemon: node management
* @author Christian Grothoff
* @author Matthias Wachs
*/
@@ -31,8 +31,6 @@
#include "gnunet_statistics_service.h"
#include "gnunet-daemon-experimentation.h"
-#define EXP_RESPONSE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-
static struct GNUNET_CORE_Handle *ch;
static struct GNUNET_PeerIdentity me;
@@ -409,16 +407,13 @@ core_receive_handler (void *cls,
/**
- * The main function for the experimentation daemon.
+ * Start the nodes management
*
- * @param argc number of arguments from the command line
- * @param argv command line arguments
+ * @param cfg configuration handle
*/
void
GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon starting ...\n"));
-
stats = GNUNET_STATISTICS_create ("experimentation", cfg);
if (NULL == stats)
{
@@ -444,11 +439,12 @@ GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cf
nodes_inactive = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
}
-
+/**
+ * Stop the nodes management
+ */
void
GNUNET_EXPERIMENTATION_nodes_stop ()
{
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon shutting down ...\n"));
if (NULL != ch)
{
GNUNET_CORE_disconnect (ch);
@@ -492,4 +488,4 @@ GNUNET_EXPERIMENTATION_nodes_stop ()
}
}
-/* end of gnunet-daemon-experimentation.c */
+/* end of gnunet-daemon-experimentation_nodes.c */