aboutsummaryrefslogtreecommitdiff
path: root/src/hostlist/gnunet-daemon-hostlist.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-06-13 06:10:10 +0000
committerChristian Grothoff <christian@grothoff.org>2009-06-13 06:10:10 +0000
commit256e783449308d848bb687f5e9e79fde1c5fe03d (patch)
tree34a005c38c8b7b6e6a9cc5d16968cd7ededa9bf8 /src/hostlist/gnunet-daemon-hostlist.c
parenta2355334e0a5116144f2588ddf1e37f596c520bd (diff)
downloadgnunet-256e783449308d848bb687f5e9e79fde1c5fe03d.tar.gz
gnunet-256e783449308d848bb687f5e9e79fde1c5fe03d.zip
server draft
Diffstat (limited to 'src/hostlist/gnunet-daemon-hostlist.c')
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index f11bcd87d..da2553238 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -27,6 +27,7 @@
27#include <stdlib.h> 27#include <stdlib.h>
28#include "platform.h" 28#include "platform.h"
29#include "hostlist-client.h" 29#include "hostlist-client.h"
30#include "hostlist-server.h"
30#include "gnunet_core_service.h" 31#include "gnunet_core_service.h"
31#include "gnunet_getopt_lib.h" 32#include "gnunet_getopt_lib.h"
32#include "gnunet_protocols.h" 33#include "gnunet_protocols.h"
@@ -38,6 +39,11 @@
38 39
39 40
40/** 41/**
42 * Set if we are allowed to advertise our hostlist to others.
43 */
44static int advertising;
45
46/**
41 * Set if we are allowed to learn about peers by accessing 47 * Set if we are allowed to learn about peers by accessing
42 * hostlist servers. 48 * hostlist servers.
43 */ 49 */
@@ -63,6 +69,8 @@ static struct GNUNET_STATISTICS_Handle *stats;
63 * gnunet-daemon-hostlist command line options. 69 * gnunet-daemon-hostlist command line options.
64 */ 70 */
65static struct GNUNET_GETOPT_CommandLineOption options[] = { 71static struct GNUNET_GETOPT_CommandLineOption options[] = {
72 { 'a', "advertise", NULL, gettext_noop ("advertise our hostlist to other peers"),
73 GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising },
66 { 'b', "bootstrap", NULL, gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"), 74 { 'b', "bootstrap", NULL, gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"),
67 GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping }, 75 GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping },
68 { 'e', "enable-learning", NULL, gettext_noop ("enable learning about hostlist servers from other peers"), 76 { 'e', "enable-learning", NULL, gettext_noop ("enable learning about hostlist servers from other peers"),
@@ -82,7 +90,10 @@ core_init (void *cls,
82 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded * 90 GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *
83 publicKey) 91 publicKey)
84{ 92{
85 /* TODO: provide "server" to 'hostlist' module (if applicable) */ 93 if (advertising && (NULL != server))
94 {
95 /* TODO: provide "server" to 'hostlist' module */
96 }
86} 97}
87 98
88 99
@@ -145,9 +156,7 @@ run (void *cls,
145 } 156 }
146 if (provide_hostlist) 157 if (provide_hostlist)
147 { 158 {
148 // FIXME! 159 GNUNET_HOSTLIST_server_start (cfg, sched, stats);
149 // (initialize MHD server and run using scheduler;
150 // use peerinfo to gather HELLOs)
151 } 160 }
152 GNUNET_CORE_connect (sched, cfg, 161 GNUNET_CORE_connect (sched, cfg,
153 GNUNET_TIME_UNIT_FOREVER_REL, 162 GNUNET_TIME_UNIT_FOREVER_REL,