aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/Makefile.am22
-rw-r--r--contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30Obin0 -> 312 bytes
-rw-r--r--contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0bin0 -> 312 bytes
-rw-r--r--contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4Gbin0 -> 292 bytes
-rw-r--r--contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28bin0 -> 292 bytes
-rw-r--r--contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTGbin0 -> 292 bytes
-rw-r--r--contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0Gbin0 -> 312 bytes
-rw-r--r--contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDObin0 -> 312 bytes
-rw-r--r--contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0bin0 -> 292 bytes
-rw-r--r--contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0bin0 -> 312 bytes
-rw-r--r--contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDGbin0 -> 312 bytes
-rw-r--r--contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70bin0 -> 292 bytes
-rw-r--r--contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8bin0 -> 312 bytes
-rw-r--r--contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0bin0 -> 312 bytes
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c72
15 files changed, 82 insertions, 12 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index df6bdc275..d5797adb4 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -45,3 +45,25 @@ check_PROGRAMS = \
45 45
46test_gnunet_prefix_SOURCES = \ 46test_gnunet_prefix_SOURCES = \
47 test_gnunet_prefix.c 47 test_gnunet_prefix.c
48
49pkghellodir= $(pkgdatadir)/hellos
50
51install-data-local:
52 $(mkinstalldirs) $(DESTDIR)$(pkghellodir)
53 @$(NORMAL_INSTALL)
54 for hello in $(srcdir)/hellos/*; do \
55 if test -f $$hello; then \
56 $(INSTALL_DATA) $$hello $(DESTDIR)$(pkghellodir)/ ; \
57 fi \
58 done
59
60dist-hook:
61 if test -d $(srcdir)/hellos; then \
62 mkdir -p $(distdir)/hellos; \
63 for hello in $(srcdir)/hellos/*; do \
64 if test -f $$hello; then \
65 cp -p $$hello $(distdir)/hellos; \
66 fi \
67 done \
68 fi
69
diff --git a/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O b/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O
new file mode 100644
index 000000000..2454b128a
--- /dev/null
+++ b/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O
Binary files differ
diff --git a/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0 b/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0
new file mode 100644
index 000000000..48d1b34d3
--- /dev/null
+++ b/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0
Binary files differ
diff --git a/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G b/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G
new file mode 100644
index 000000000..77c48987d
--- /dev/null
+++ b/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G
Binary files differ
diff --git a/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28 b/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28
new file mode 100644
index 000000000..c486e59e7
--- /dev/null
+++ b/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28
Binary files differ
diff --git a/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG b/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG
new file mode 100644
index 000000000..9a732bc1e
--- /dev/null
+++ b/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG
Binary files differ
diff --git a/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G b/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G
new file mode 100644
index 000000000..6947c4f3c
--- /dev/null
+++ b/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G
Binary files differ
diff --git a/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO b/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO
new file mode 100644
index 000000000..57e95b18d
--- /dev/null
+++ b/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO
Binary files differ
diff --git a/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0 b/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0
new file mode 100644
index 000000000..ca800ed6a
--- /dev/null
+++ b/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0
Binary files differ
diff --git a/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0 b/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0
new file mode 100644
index 000000000..c7b6a5dd2
--- /dev/null
+++ b/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0
Binary files differ
diff --git a/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG b/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG
new file mode 100644
index 000000000..1927951ad
--- /dev/null
+++ b/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG
Binary files differ
diff --git a/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70 b/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70
new file mode 100644
index 000000000..e901e056f
--- /dev/null
+++ b/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70
Binary files differ
diff --git a/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8 b/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8
new file mode 100644
index 000000000..8703e2745
--- /dev/null
+++ b/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8
Binary files differ
diff --git a/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0 b/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0
new file mode 100644
index 000000000..4341512fe
--- /dev/null
+++ b/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0
Binary files differ
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index d6e52d4b4..90ab6d5bf 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -32,12 +32,9 @@
32 */ 32 */
33 33
34#include "platform.h" 34#include "platform.h"
35#include "gnunet_crypto_lib.h" 35#include "gnunet_util_lib.h"
36#include "gnunet_container_lib.h"
37#include "gnunet_disk_lib.h"
38#include "gnunet_hello_lib.h" 36#include "gnunet_hello_lib.h"
39#include "gnunet_protocols.h" 37#include "gnunet_protocols.h"
40#include "gnunet_service_lib.h"
41#include "gnunet_statistics_service.h" 38#include "gnunet_statistics_service.h"
42#include "peerinfo.h" 39#include "peerinfo.h"
43 40
@@ -51,6 +48,7 @@
51 */ 48 */
52#define DATA_HOST_CLEAN_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 60) 49#define DATA_HOST_CLEAN_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 60)
53 50
51
54/** 52/**
55 * In-memory cache of known hosts. 53 * In-memory cache of known hosts.
56 */ 54 */
@@ -95,6 +93,9 @@ static struct GNUNET_STATISTICS_Handle *stats;
95/** 93/**
96 * Notify all clients in the notify list about the 94 * Notify all clients in the notify list about the
97 * given host entry changing. 95 * given host entry changing.
96 *
97 * @param he entry of the host for which we generate a notification
98 * @return generated notification message
98 */ 99 */
99static struct InfoMessage * 100static struct InfoMessage *
100make_info_message (const struct HostEntry *he) 101make_info_message (const struct HostEntry *he)
@@ -141,6 +142,8 @@ discard_expired (void *cls, const struct GNUNET_HELLO_Address *address,
141/** 142/**
142 * Get the filename under which we would store the GNUNET_HELLO_Message 143 * Get the filename under which we would store the GNUNET_HELLO_Message
143 * for the given host and protocol. 144 * for the given host and protocol.
145 *
146 * @param id peer for which we need the filename for the HELLO
144 * @return filename of the form DIRECTORY/HOSTID 147 * @return filename of the form DIRECTORY/HOSTID
145 */ 148 */
146static char * 149static char *
@@ -229,6 +232,8 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
229/** 232/**
230 * Remove a file that should not be there. LOG 233 * Remove a file that should not be there. LOG
231 * success or failure. 234 * success or failure.
235 *
236 * @param fullname name of the file to remove
232 */ 237 */
233static void 238static void
234remove_garbage (const char *fullname) 239remove_garbage (const char *fullname)
@@ -244,6 +249,15 @@ remove_garbage (const char *fullname)
244} 249}
245 250
246 251
252/**
253 * Function that is called on each HELLO file in a particular directory.
254 * Try to parse the file and add the HELLO to our list.
255 *
256 * @param cls pointer to 'unsigned int' to increment for each file, or NULL
257 * if the file is from a read-only, read-once resource directory
258 * @param fullname name of the file to parse
259 * @return GNUNET_OK (continue iteration)
260 */
247static int 261static int
248hosts_directory_scan_callback (void *cls, const char *fullname) 262hosts_directory_scan_callback (void *cls, const char *fullname)
249{ 263{
@@ -255,7 +269,8 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
255 return GNUNET_OK; /* ignore non-files */ 269 return GNUNET_OK; /* ignore non-files */
256 if (strlen (fullname) < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)) 270 if (strlen (fullname) < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded))
257 { 271 {
258 remove_garbage (fullname); 272 if (NULL != matched)
273 remove_garbage (fullname);
259 return GNUNET_OK; 274 return GNUNET_OK;
260 } 275 }
261 filename = 276 filename =
@@ -263,16 +278,19 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
263 sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1]; 278 sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1];
264 if (filename[-1] != DIR_SEPARATOR) 279 if (filename[-1] != DIR_SEPARATOR)
265 { 280 {
266 remove_garbage (fullname); 281 if (NULL != matched)
282 remove_garbage (fullname);
267 return GNUNET_OK; 283 return GNUNET_OK;
268 } 284 }
269 if (GNUNET_OK != 285 if (GNUNET_OK !=
270 GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey)) 286 GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey))
271 { 287 {
272 remove_garbage (fullname); 288 if (NULL != matched)
289 remove_garbage (fullname);
273 return GNUNET_OK; 290 return GNUNET_OK;
274 } 291 }
275 (*matched)++; 292 if (NULL != matched)
293 (*matched)++;
276 add_host_to_known_hosts (&identity); 294 add_host_to_known_hosts (&identity);
277 return GNUNET_OK; 295 return GNUNET_OK;
278} 296}
@@ -280,6 +298,9 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
280 298
281/** 299/**
282 * Call this method periodically to scan data/hosts for new hosts. 300 * Call this method periodically to scan data/hosts for new hosts.
301 *
302 * @param cls unused
303 * @param tc scheduler context, aborted if reason is shutdown
283 */ 304 */
284static void 305static void
285cron_scan_directory_data_hosts (void *cls, 306cron_scan_directory_data_hosts (void *cls,
@@ -362,7 +383,6 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
362} 383}
363 384
364 385
365
366/** 386/**
367 * Do transmit info about peer to given host. 387 * Do transmit info about peer to given host.
368 * 388 *
@@ -401,6 +421,10 @@ add_to_tc (void *cls, const GNUNET_HashCode * key, void *value)
401 421
402/** 422/**
403 * @brief delete expired HELLO entries in data/hosts/ 423 * @brief delete expired HELLO entries in data/hosts/
424 *
425 * @param cls pointer to current time (struct GNUNET_TIME_Absolute)
426 * @param fn filename to test to see if the HELLO expired
427 * @return GNUNET_OK (continue iteration)
404 */ 428 */
405static int 429static int
406discard_hosts_helper (void *cls, const char *fn) 430discard_hosts_helper (void *cls, const char *fn)
@@ -442,7 +466,11 @@ discard_hosts_helper (void *cls, const char *fn)
442 466
443 467
444/** 468/**
445 * Call this method periodically to scan data/hosts for new hosts. 469 * Call this method periodically to scan data/hosts for ancient
470 * HELLOs to expire.
471 *
472 * @param cls unused
473 * @param tc scheduler context, aborted if reason is shutdown
446 */ 474 */
447static void 475static void
448cron_clean_data_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 476cron_clean_data_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -541,6 +569,9 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
541} 569}
542 570
543 571
572/**
573 * FIXME.
574 */
544static int 575static int
545do_notify_entry (void *cls, const GNUNET_HashCode * key, void *value) 576do_notify_entry (void *cls, const GNUNET_HashCode * key, void *value)
546{ 577{
@@ -576,6 +607,9 @@ handle_notify (void *cls, struct GNUNET_SERVER_Client *client,
576} 607}
577 608
578 609
610/**
611 * FIXME.
612 */
579static int 613static int
580free_host_entry (void *cls, const GNUNET_HashCode * key, void *value) 614free_host_entry (void *cls, const GNUNET_HashCode * key, void *value)
581{ 615{
@@ -586,6 +620,7 @@ free_host_entry (void *cls, const GNUNET_HashCode * key, void *value)
586 return GNUNET_YES; 620 return GNUNET_YES;
587} 621}
588 622
623
589/** 624/**
590 * Clean up our state. Called during shutdown. 625 * Clean up our state. Called during shutdown.
591 * 626 *
@@ -608,7 +643,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
608 643
609 644
610/** 645/**
611 * Process statistics requests. 646 * Start up peerinfo service.
612 * 647 *
613 * @param cls closure 648 * @param cls closure
614 * @param server the initialized server 649 * @param server the initialized server
@@ -628,6 +663,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
628 sizeof (struct GNUNET_MessageHeader)}, 663 sizeof (struct GNUNET_MessageHeader)},
629 {NULL, NULL, 0, 0} 664 {NULL, NULL, 0, 0}
630 }; 665 };
666 char *peerdir;
667 char *ip;
631 668
632 hostmap = GNUNET_CONTAINER_multihashmap_create (1024); 669 hostmap = GNUNET_CONTAINER_multihashmap_create (1024);
633 stats = GNUNET_STATISTICS_create ("peerinfo", cfg); 670 stats = GNUNET_STATISTICS_create ("peerinfo", cfg);
@@ -644,11 +681,22 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
644 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, 681 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
645 NULL); 682 NULL);
646 GNUNET_SERVER_add_handlers (server, handlers); 683 GNUNET_SERVER_add_handlers (server, handlers);
684 ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
685 GNUNET_asprintf (&peerdir,
686 "%shellos",
687 ip);
688 GNUNET_free (ip);
689 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
690 _("Importing HELLOs from `%s'\n"),
691 peerdir);
692 GNUNET_DISK_directory_scan (peerdir,
693 &hosts_directory_scan_callback, NULL);
694 GNUNET_free (peerdir);
647} 695}
648 696
649 697
650/** 698/**
651 * The main function for the statistics service. 699 * The main function for the peerinfo service.
652 * 700 *
653 * @param argc number of arguments from the command line 701 * @param argc number of arguments from the command line
654 * @param argv command line arguments 702 * @param argv command line arguments