diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-06-12 00:34:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-06-12 00:34:47 +0000 |
commit | 4c72fa477ad226660df116c6275283833a3f5214 (patch) | |
tree | 9bab2c50101a44dc37c1f908a0488c58edbaf734 /src | |
parent | 42c8b584e6e8554329ca6282545b775b63af9c39 (diff) | |
download | gnunet-4c72fa477ad226660df116c6275283833a3f5214.tar.gz gnunet-4c72fa477ad226660df116c6275283833a3f5214.zip |
removing dead code / unused variables
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 9 | ||||
-rw-r--r-- | src/arm/gnunet-service-arm.c | 23 | ||||
-rw-r--r-- | src/core/Makefile.am | 2 | ||||
-rw-r--r-- | src/hostlist/Makefile.am | 29 | ||||
-rw-r--r-- | src/hostlist/gnunet-daemon-hostlist.c | 137 | ||||
-rw-r--r-- | src/topology/Makefile.am | 19 | ||||
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 87 |
7 files changed, 280 insertions, 26 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index c8852ad04..4f3d7995a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -2,6 +2,11 @@ | |||
2 | # INTLEMU_SUBDIRS = intlemu | 2 | # INTLEMU_SUBDIRS = intlemu |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | |||
6 | if HAVE_MHD | ||
7 | HOSTLIST_DIR = hostlist | ||
8 | endif | ||
9 | |||
5 | SUBDIRS = \ | 10 | SUBDIRS = \ |
6 | include $(INTLEMU_SUBDIRS) \ | 11 | include $(INTLEMU_SUBDIRS) \ |
7 | util \ | 12 | util \ |
@@ -13,5 +18,7 @@ SUBDIRS = \ | |||
13 | statistics \ | 18 | statistics \ |
14 | template \ | 19 | template \ |
15 | transport \ | 20 | transport \ |
16 | core | 21 | core \ |
22 | $(HOSTLIST_DIR) \ | ||
23 | topology | ||
17 | 24 | ||
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 9c302d1de..9643273cf 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -183,28 +183,6 @@ signal_result (struct GNUNET_SERVER_Client *client, | |||
183 | 183 | ||
184 | 184 | ||
185 | /** | 185 | /** |
186 | * Find the process with the given PID in the | ||
187 | * given list. | ||
188 | * | ||
189 | * @return NULL if it was not found | ||
190 | */ | ||
191 | static struct ServiceList * | ||
192 | find_pid (pid_t pid) | ||
193 | { | ||
194 | struct ServiceList *pos; | ||
195 | |||
196 | pos = running; | ||
197 | while (pos != NULL) | ||
198 | { | ||
199 | if (pos->pid == pid) | ||
200 | return pos; | ||
201 | pos = pos->next; | ||
202 | } | ||
203 | return NULL; | ||
204 | } | ||
205 | |||
206 | |||
207 | /** | ||
208 | * Find the process with the given service | 186 | * Find the process with the given service |
209 | * name in the given list, remove it and return it. | 187 | * name in the given list, remove it and return it. |
210 | * | 188 | * |
@@ -548,7 +526,6 @@ static void | |||
548 | maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 526 | maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
549 | { | 527 | { |
550 | struct ServiceList *pos; | 528 | struct ServiceList *pos; |
551 | pid_t pid; | ||
552 | const char *statstr; | 529 | const char *statstr; |
553 | int statcode; | 530 | int statcode; |
554 | struct stat sbuf; | 531 | struct stat sbuf; |
diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 55ef757c2..4dba41b69 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am | |||
@@ -1,7 +1,5 @@ | |||
1 | INCLUDES = -I$(top_srcdir)/src/include | 1 | INCLUDES = -I$(top_srcdir)/src/include |
2 | 2 | ||
3 | plugindir = $(libdir)/gnunet | ||
4 | |||
5 | if MINGW | 3 | if MINGW |
6 | WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols | 4 | WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols |
7 | endif | 5 | endif |
diff --git a/src/hostlist/Makefile.am b/src/hostlist/Makefile.am new file mode 100644 index 000000000..565cb2e9a --- /dev/null +++ b/src/hostlist/Makefile.am | |||
@@ -0,0 +1,29 @@ | |||
1 | INCLUDES = -I$(top_srcdir)/src/include | ||
2 | |||
3 | if USE_COVERAGE | ||
4 | AM_CFLAGS = -fprofile-arcs -ftest-coverage | ||
5 | endif | ||
6 | |||
7 | |||
8 | bin_PROGRAMS = \ | ||
9 | gnunet-daemon-hostlist | ||
10 | |||
11 | gnunet_daemon_hostlist_SOURCES = \ | ||
12 | gnunet-daemon-hostlist.c | ||
13 | # | ||
14 | # hostlist-server.c hostlist-server.h | ||
15 | # hostlist-client.c hostlist-client.h | ||
16 | gnunet_daemon_hostlist_LDADD = \ | ||
17 | $(top_builddir)/src/core/libgnunetcore.la \ | ||
18 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
19 | $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ | ||
20 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
21 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
22 | -lmicrohttpd \ | ||
23 | @LIBCURL@ \ | ||
24 | $(GN_LIBINTL) | ||
25 | |||
26 | gnunet_daemon_hostlist_CPPFLAGS = \ | ||
27 | @LIBCURL_CPPFLAGS@ | ||
28 | |||
29 | |||
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c new file mode 100644 index 000000000..0fb77ecbd --- /dev/null +++ b/src/hostlist/gnunet-daemon-hostlist.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2007, 2008, 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 2, 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 hostlist/gnunet-daemon-hostlist.c | ||
23 | * @brief code for bootstrapping via hostlist servers | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | |||
27 | #include <stdlib.h> | ||
28 | #include "platform.h" | ||
29 | #include "gnunet_getopt_lib.h" | ||
30 | #include "gnunet_protocols.h" | ||
31 | #include "gnunet_program_lib.h" | ||
32 | #include "gnunet_statistics_service.h" | ||
33 | #include "gnunet_strings_lib.h" | ||
34 | #include "gnunet_time_lib.h" | ||
35 | |||
36 | |||
37 | /** | ||
38 | * Set if we are allowed to learn about peers by accessing | ||
39 | * hostlist servers. | ||
40 | */ | ||
41 | static int bootstrapping; | ||
42 | |||
43 | /** | ||
44 | * Set if the user allows us to learn about new hostlists | ||
45 | * from the network. | ||
46 | */ | ||
47 | static int learning; | ||
48 | |||
49 | /** | ||
50 | * Set if the user wants us to run a hostlist server. | ||
51 | */ | ||
52 | static int provide_hostlist; | ||
53 | |||
54 | |||
55 | /** | ||
56 | * gnunet-daemon-hostlist command line options. | ||
57 | */ | ||
58 | static struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
59 | { 'b', "bootstrap", NULL, gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"), | ||
60 | GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping }, | ||
61 | { 'e', "enable-learning", NULL, gettext_noop ("enable learning about hostlist servers from other peers"), | ||
62 | GNUNET_NO, &GNUNET_GETOPT_set_one, &learning}, | ||
63 | { 'p', "provide-hostlist", NULL, gettext_noop ("provide a hostlist server"), | ||
64 | GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist}, | ||
65 | GNUNET_GETOPT_OPTION_END | ||
66 | }; | ||
67 | |||
68 | |||
69 | |||
70 | /** | ||
71 | * Main function that will be run. | ||
72 | * | ||
73 | * @param cls closure | ||
74 | * @param sched the scheduler to use | ||
75 | * @param args remaining command-line arguments | ||
76 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | ||
77 | * @param cfg configuration | ||
78 | */ | ||
79 | static void | ||
80 | run (void *cls, | ||
81 | struct GNUNET_SCHEDULER_Handle * sched, | ||
82 | char *const *args, | ||
83 | const char *cfgfile, | ||
84 | struct GNUNET_CONFIGURATION_Handle * cfg) | ||
85 | { | ||
86 | if ( (! bootstrapping) && | ||
87 | (! learning) && | ||
88 | (! provide_hostlist) ) | ||
89 | { | ||
90 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
91 | _("None of the functions for the hostlist daemon were enabled. I have no reason to run!\n")); | ||
92 | return; | ||
93 | } | ||
94 | if (learning) | ||
95 | { | ||
96 | // FIXME! | ||
97 | // (register handler with core for hostlist ads) | ||
98 | } | ||
99 | if (bootstrapping) | ||
100 | { | ||
101 | // FIXME! | ||
102 | // (register handler with core to monitor number of active | ||
103 | // connections; trigger hostlist download via CURL if | ||
104 | // number is low) | ||
105 | } | ||
106 | if (provide_hostlist) | ||
107 | { | ||
108 | // FIXME! | ||
109 | // (initialize MHD server and run using scheduler; | ||
110 | // use peerinfo to gather HELLOs) | ||
111 | } | ||
112 | } | ||
113 | |||
114 | |||
115 | /** | ||
116 | * The main function for the hostlist daemon. | ||
117 | * | ||
118 | * @param argc number of arguments from the command line | ||
119 | * @param argv command line arguments | ||
120 | * @return 0 ok, 1 on error | ||
121 | */ | ||
122 | int | ||
123 | main (int argc, char *const *argv) | ||
124 | { | ||
125 | int ret; | ||
126 | |||
127 | ret = (GNUNET_OK == | ||
128 | GNUNET_PROGRAM_run (argc, | ||
129 | argv, | ||
130 | "hostlist", | ||
131 | _("GNUnet hostlist server and client"), | ||
132 | options, | ||
133 | &run, NULL)) ? 0 : 1; | ||
134 | return ret; | ||
135 | } | ||
136 | |||
137 | /* end of gnunet-daemon-hostlist.c */ | ||
diff --git a/src/topology/Makefile.am b/src/topology/Makefile.am new file mode 100644 index 000000000..775db33e9 --- /dev/null +++ b/src/topology/Makefile.am | |||
@@ -0,0 +1,19 @@ | |||
1 | INCLUDES = -I$(top_srcdir)/src/include | ||
2 | |||
3 | if USE_COVERAGE | ||
4 | AM_CFLAGS = -fprofile-arcs -ftest-coverage | ||
5 | endif | ||
6 | |||
7 | |||
8 | bin_PROGRAMS = \ | ||
9 | gnunet-daemon-topology | ||
10 | |||
11 | gnunet_daemon_topology_SOURCES = \ | ||
12 | gnunet-daemon-topology.c | ||
13 | gnunet_daemon_topology_LDADD = \ | ||
14 | $(top_builddir)/src/core/libgnunetcore.la \ | ||
15 | $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ | ||
16 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
17 | $(GN_LIBINTL) | ||
18 | |||
19 | |||
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c new file mode 100644 index 000000000..5d8c92523 --- /dev/null +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2007, 2008, 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 2, 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 topology/gnunet-daemon-topology.c | ||
23 | * @brief code for bootstrapping via topology servers | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | |||
27 | #include <stdlib.h> | ||
28 | #include "platform.h" | ||
29 | #include "gnunet_getopt_lib.h" | ||
30 | #include "gnunet_protocols.h" | ||
31 | #include "gnunet_program_lib.h" | ||
32 | #include "gnunet_statistics_service.h" | ||
33 | #include "gnunet_strings_lib.h" | ||
34 | #include "gnunet_time_lib.h" | ||
35 | |||
36 | |||
37 | /** | ||
38 | * gnunet-daemon-topology command line options. | ||
39 | */ | ||
40 | static struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
41 | GNUNET_GETOPT_OPTION_END | ||
42 | }; | ||
43 | |||
44 | |||
45 | |||
46 | /** | ||
47 | * Main function that will be run. | ||
48 | * | ||
49 | * @param cls closure | ||
50 | * @param sched the scheduler to use | ||
51 | * @param args remaining command-line arguments | ||
52 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | ||
53 | * @param cfg configuration | ||
54 | */ | ||
55 | static void | ||
56 | run (void *cls, | ||
57 | struct GNUNET_SCHEDULER_Handle * sched, | ||
58 | char *const *args, | ||
59 | const char *cfgfile, | ||
60 | struct GNUNET_CONFIGURATION_Handle * cfg) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | |||
65 | /** | ||
66 | * The main function for the topology daemon. | ||
67 | * | ||
68 | * @param argc number of arguments from the command line | ||
69 | * @param argv command line arguments | ||
70 | * @return 0 ok, 1 on error | ||
71 | */ | ||
72 | int | ||
73 | main (int argc, char *const *argv) | ||
74 | { | ||
75 | int ret; | ||
76 | |||
77 | ret = (GNUNET_OK == | ||
78 | GNUNET_PROGRAM_run (argc, | ||
79 | argv, | ||
80 | "topology", | ||
81 | _("GNUnet topology control (maintaining P2P mesh and F2F constraints)"), | ||
82 | options, | ||
83 | &run, NULL)) ? 0 : 1; | ||
84 | return ret; | ||
85 | } | ||
86 | |||
87 | /* end of gnunet-daemon-topology.c */ | ||