diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-05-23 12:22:08 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-05-23 12:22:08 +0000 |
commit | 35075ac62588f57a7fa3823ea4ddc0c94607b6ab (patch) | |
tree | 5d4f2eaf4f9247541d5c863812e34c57aa9b95df /src | |
parent | 58e5c7938fdb5fee63151fb1ab598ae18388712d (diff) | |
download | gnunet-35075ac62588f57a7fa3823ea4ddc0c94607b6ab.tar.gz gnunet-35075ac62588f57a7fa3823ea4ddc0c94607b6ab.zip |
adding capabilities
Diffstat (limited to 'src')
5 files changed, 83 insertions, 8 deletions
diff --git a/src/experimentation/Makefile.am b/src/experimentation/Makefile.am index 50f148297..87ab8dfb9 100644 --- a/src/experimentation/Makefile.am +++ b/src/experimentation/Makefile.am | |||
@@ -28,7 +28,9 @@ libexec_PROGRAMS = \ | |||
28 | gnunet-daemon-experimentation | 28 | gnunet-daemon-experimentation |
29 | 29 | ||
30 | gnunet_daemon_experimentation_SOURCES = \ | 30 | gnunet_daemon_experimentation_SOURCES = \ |
31 | gnunet-daemon-experimentation.c gnunet-daemon-experimentation_nodes.c | 31 | gnunet-daemon-experimentation.c \ |
32 | gnunet-daemon-experimentation_capabilites.c \ | ||
33 | gnunet-daemon-experimentation_nodes.c | ||
32 | gnunet_daemon_experimentation_LDADD = \ | 34 | gnunet_daemon_experimentation_LDADD = \ |
33 | $(top_builddir)/src/core/libgnunetcore.la \ | 35 | $(top_builddir)/src/core/libgnunetcore.la \ |
34 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 36 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
diff --git a/src/experimentation/gnunet-daemon-experimentation.c b/src/experimentation/gnunet-daemon-experimentation.c index 1222b6ed5..824eab580 100644 --- a/src/experimentation/gnunet-daemon-experimentation.c +++ b/src/experimentation/gnunet-daemon-experimentation.c | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | struct GNUNET_STATISTICS_Handle *GSE_stats; | 34 | struct GNUNET_STATISTICS_Handle *GSE_stats; |
35 | 35 | ||
36 | struct GNUNET_CONFIGURATION_Handle *GSE_cfg; | ||
37 | |||
36 | /** | 38 | /** |
37 | * Task run during shutdown. | 39 | * Task run during shutdown. |
38 | * | 40 | * |
@@ -43,7 +45,8 @@ static void | |||
43 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 45 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
44 | { | 46 | { |
45 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon shutting down ...\n")); | 47 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon shutting down ...\n")); |
46 | GNUNET_EXPERIMENTATION_nodes_stop(); | 48 | GNUNET_EXPERIMENTATION_nodes_stop (); |
49 | GNUNET_EXPERIMENTATION_capabilities_stop (); | ||
47 | } | 50 | } |
48 | 51 | ||
49 | 52 | ||
@@ -62,6 +65,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
62 | { | 65 | { |
63 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon starting ...\n")); | 66 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon starting ...\n")); |
64 | 67 | ||
68 | GSE_cfg = (struct GNUNET_CONFIGURATION_Handle *) cfg; | ||
65 | GSE_stats = GNUNET_STATISTICS_create ("experimentation", cfg); | 69 | GSE_stats = GNUNET_STATISTICS_create ("experimentation", cfg); |
66 | if (NULL == GSE_stats) | 70 | if (NULL == GSE_stats) |
67 | { | 71 | { |
@@ -69,7 +73,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
69 | return; | 73 | return; |
70 | } | 74 | } |
71 | 75 | ||
72 | GNUNET_EXPERIMENTATION_nodes_start (cfg); | 76 | GNUNET_EXPERIMENTATION_capabilities_start(); |
77 | GNUNET_EXPERIMENTATION_nodes_start (); | ||
73 | 78 | ||
74 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 79 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
75 | NULL); | 80 | NULL); |
diff --git a/src/experimentation/gnunet-daemon-experimentation.h b/src/experimentation/gnunet-daemon-experimentation.h index 8c657cbec..1b0ef1ead 100644 --- a/src/experimentation/gnunet-daemon-experimentation.h +++ b/src/experimentation/gnunet-daemon-experimentation.h | |||
@@ -38,6 +38,8 @@ | |||
38 | 38 | ||
39 | extern struct GNUNET_STATISTICS_Handle *GSE_stats; | 39 | extern struct GNUNET_STATISTICS_Handle *GSE_stats; |
40 | 40 | ||
41 | extern struct GNUNET_CONFIGURATION_Handle *GSE_cfg; | ||
42 | |||
41 | /** | 43 | /** |
42 | * A experimentation node | 44 | * A experimentation node |
43 | */ | 45 | */ |
@@ -80,11 +82,9 @@ struct Experimentation_Response | |||
80 | 82 | ||
81 | /** | 83 | /** |
82 | * Start the nodes management | 84 | * Start the nodes management |
83 | * | ||
84 | * @param cfg configuration handle | ||
85 | */ | 85 | */ |
86 | void | 86 | void |
87 | GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cfg); | 87 | GNUNET_EXPERIMENTATION_nodes_start (); |
88 | 88 | ||
89 | 89 | ||
90 | /** | 90 | /** |
@@ -93,4 +93,18 @@ GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cf | |||
93 | void | 93 | void |
94 | GNUNET_EXPERIMENTATION_nodes_stop (); | 94 | GNUNET_EXPERIMENTATION_nodes_stop (); |
95 | 95 | ||
96 | |||
97 | /** | ||
98 | * Start the detecting capabilities | ||
99 | */ | ||
100 | void | ||
101 | GNUNET_EXPERIMENTATION_capabilities_start (); | ||
102 | |||
103 | /** | ||
104 | * Stop the detecting capabilities | ||
105 | */ | ||
106 | void | ||
107 | GNUNET_EXPERIMENTATION_capabilities_stop (); | ||
108 | |||
109 | |||
96 | /* end of gnunet-daemon-experimentation.h */ | 110 | /* end of gnunet-daemon-experimentation.h */ |
diff --git a/src/experimentation/gnunet-daemon-experimentation_capabilites.c b/src/experimentation/gnunet-daemon-experimentation_capabilites.c new file mode 100644 index 000000000..c989b5870 --- /dev/null +++ b/src/experimentation/gnunet-daemon-experimentation_capabilites.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2009 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file experimentation/gnunet-daemon-experimentation_capabilities.c | ||
23 | * @brief experimentation daemon: capabilities management | ||
24 | * @author Christian Grothoff | ||
25 | * @author Matthias Wachs | ||
26 | */ | ||
27 | #include "platform.h" | ||
28 | #include "gnunet_getopt_lib.h" | ||
29 | #include "gnunet_util_lib.h" | ||
30 | #include "gnunet_core_service.h" | ||
31 | #include "gnunet_statistics_service.h" | ||
32 | #include "gnunet-daemon-experimentation.h" | ||
33 | |||
34 | /** | ||
35 | * Start the detecting capabilities | ||
36 | * | ||
37 | * @param cfg configuration handle | ||
38 | */ | ||
39 | void | ||
40 | GNUNET_EXPERIMENTATION_capabilities_start () | ||
41 | { | ||
42 | |||
43 | } | ||
44 | |||
45 | /** | ||
46 | * Stop the detecting capabilities | ||
47 | */ | ||
48 | void | ||
49 | GNUNET_EXPERIMENTATION_capabilities_stop () | ||
50 | { | ||
51 | |||
52 | } | ||
53 | |||
54 | /* end of gnunet-daemon-experimentation_capabilities.c */ | ||
diff --git a/src/experimentation/gnunet-daemon-experimentation_nodes.c b/src/experimentation/gnunet-daemon-experimentation_nodes.c index d2b9909a3..5f1db8383 100644 --- a/src/experimentation/gnunet-daemon-experimentation_nodes.c +++ b/src/experimentation/gnunet-daemon-experimentation_nodes.c | |||
@@ -410,10 +410,10 @@ core_receive_handler (void *cls, | |||
410 | * @param cfg configuration handle | 410 | * @param cfg configuration handle |
411 | */ | 411 | */ |
412 | void | 412 | void |
413 | GNUNET_EXPERIMENTATION_nodes_start (const struct GNUNET_CONFIGURATION_Handle *cfg) | 413 | GNUNET_EXPERIMENTATION_nodes_start () |
414 | { | 414 | { |
415 | /* Connecting to core service to find partners */ | 415 | /* Connecting to core service to find partners */ |
416 | ch = GNUNET_CORE_connect (cfg, NULL, | 416 | ch = GNUNET_CORE_connect (GSE_cfg, NULL, |
417 | &core_startup_handler, | 417 | &core_startup_handler, |
418 | &core_connect_handler, | 418 | &core_connect_handler, |
419 | &core_disconnect_handler, | 419 | &core_disconnect_handler, |