[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r20477 - in gnunet: contrib contrib/hellos src/peerinfo
From: |
gnunet |
Subject: |
[GNUnet-SVN] r20477 - in gnunet: contrib contrib/hellos src/peerinfo |
Date: |
Tue, 13 Mar 2012 14:57:50 +0100 |
Author: grothoff
Date: 2012-03-13 14:57:50 +0100 (Tue, 13 Mar 2012)
New Revision: 20477
Added:
gnunet/contrib/hellos/
gnunet/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O
gnunet/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0
gnunet/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G
gnunet/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28
gnunet/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG
gnunet/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G
gnunet/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO
gnunet/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0
gnunet/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0
gnunet/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG
gnunet/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70
gnunet/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8
gnunet/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0
Modified:
gnunet/contrib/Makefile.am
gnunet/src/peerinfo/gnunet-service-peerinfo.c
Log:
-adding capability to install static list of HELLOs with the original software
to avoid need for hostlist server accessibility
Modified: gnunet/contrib/Makefile.am
===================================================================
--- gnunet/contrib/Makefile.am 2012-03-13 12:15:30 UTC (rev 20476)
+++ gnunet/contrib/Makefile.am 2012-03-13 13:57:50 UTC (rev 20477)
@@ -45,3 +45,25 @@
test_gnunet_prefix_SOURCES = \
test_gnunet_prefix.c
+
+pkghellodir= $(pkgdatadir)/hellos
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(pkghellodir)
+ @$(NORMAL_INSTALL)
+ for hello in $(srcdir)/hellos/*; do \
+ if test -f $$hello; then \
+ $(INSTALL_DATA) $$hello $(DESTDIR)$(pkghellodir)/ ; \
+ fi \
+ done
+
+dist-hook:
+ if test -d $(srcdir)/hellos; then \
+ mkdir -p $(distdir)/hellos; \
+ for hello in $(srcdir)/hellos/*; do \
+ if test -f $$hello; then \
+ cp -p $$hello $(distdir)/hellos; \
+ fi \
+ done \
+ fi
+
Added:
gnunet/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/02UKDQ8B827SF4HR5D57BAIQA2A7IJ96EP15APKS08SE6EI90CDM35QAT4135KH7IPB4DMKVRNDJOUHOIBQ2JBIAIOHPSJHUGGBL30O
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/1G1MOK6389P2HV5DUK7RH3BLASHGMMVNUFFC2C26NO93SRSRQBQ9GALGBFMR1IC71608CPU0EB4FRFIDDI15S81G5UC00D7PQKI3JS0
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/7RAVI0QOIAVHL0TE0F54JQL4FUAEQ8V6PL8U1RNDRMRU33E2HU7D0IUBKUDQGTCIQTUEJSRJ9V0IU9TRVTLDUPLNEACRI5BOGQTPC4G
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/8B4TV9KRVBMHNPFIP8ISM4GRNR8EAJ39JBQNRRE1QRLTLPOQGEV9S9285D9GEMNCDUG1SST0HNF40IFEHVAUOVI7AME8T4QPD089H28
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/94CH5M5L43QCBDJBPVUA3SJT4L92P8IS3JQ0J3V0EE6QSG9P7OM03KGJD58LNB1HNNEE7Q830GQJSPM7LBKR1CP4KSMMPQ80M8GSPTG
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/ATF475IOUC8E9A6208VK1RP2STLI3J1E7NP1CKAL5O4L3KP65RM20SKTHEBHFI0TMOETLKQQN3K5PGBLKA1O6USS6CEOED75BOEFJ0G
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/F1GTBM1J301AEJNJCMOMGTR3DLRHFOUMOQ504SPSVTBS47AOD4H6GMN46J9UMFUU2OMV082E2VMCOR71ONQBB73IO296RCJHSK73MDO
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/KD9VVK7H5TJII7OEOMCK9AI5H6EKABCO85OHPPEO72T2K6QGE9IG0LUQTOKOSJSNR9I7HF0CVPJ6C464EM7LMPTVRPU75MP6OIRJQJ0
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/KUPL5G20GSVQQ29GOD7QMTC4IRQ67KGSQ1IOMOIQL7TE78L8UQ2V9SNJQTSIEQ29F7JGPV6VNKG509S048CH31NQH8VIH2T58K8PVM0
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/LJR8FV49LJJOCPJFS5894IVT9RU10TENLAM1D61J83BQN629NE1OU56GM54DMIAKS4DAE6UFJBO4BRKDLIOI2OVS6J480QLOGIEPRDG
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/R69QGJB2I9T359F3CLA5HDV9NQUDF87FQQH9F8DKIQUCRAQSPJ1FIF3GVL9QIJ8JDLQA5MS09EBVATKUKVFP8RK5Q8QA0LMRIIUTD70
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/R6OVGTG5M5EKRS0MBLGI5VEOG360RCJS2TCUU7OCTGKN5CSBIGCC7C75IU6J1P3F4OQC2D21203VECHCKQ95IBUMO6C46SH5MPAO9J8
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
gnunet/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0
===================================================================
(Binary files differ)
Property changes on:
gnunet/contrib/hellos/RL7P1AO4M4LOI3JPVER5FJKG6A847K3O86NS4Q07J1721371FO7RB6IFVMNI1NKLFTRCM7O5AGJPQ3UDD8MST8QQHLNOC4GUL6731O0
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: gnunet/src/peerinfo/gnunet-service-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-service-peerinfo.c 2012-03-13 12:15:30 UTC
(rev 20476)
+++ gnunet/src/peerinfo/gnunet-service-peerinfo.c 2012-03-13 13:57:50 UTC
(rev 20477)
@@ -32,12 +32,9 @@
*/
#include "platform.h"
-#include "gnunet_crypto_lib.h"
-#include "gnunet_container_lib.h"
-#include "gnunet_disk_lib.h"
+#include "gnunet_util_lib.h"
#include "gnunet_hello_lib.h"
#include "gnunet_protocols.h"
-#include "gnunet_service_lib.h"
#include "gnunet_statistics_service.h"
#include "peerinfo.h"
@@ -51,6 +48,7 @@
*/
#define DATA_HOST_CLEAN_FREQ GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MINUTES, 60)
+
/**
* In-memory cache of known hosts.
*/
@@ -95,6 +93,9 @@
/**
* Notify all clients in the notify list about the
* given host entry changing.
+ *
+ * @param he entry of the host for which we generate a notification
+ * @return generated notification message
*/
static struct InfoMessage *
make_info_message (const struct HostEntry *he)
@@ -141,6 +142,8 @@
/**
* Get the filename under which we would store the GNUNET_HELLO_Message
* for the given host and protocol.
+ *
+ * @param id peer for which we need the filename for the HELLO
* @return filename of the form DIRECTORY/HOSTID
*/
static char *
@@ -229,6 +232,8 @@
/**
* Remove a file that should not be there. LOG
* success or failure.
+ *
+ * @param fullname name of the file to remove
*/
static void
remove_garbage (const char *fullname)
@@ -244,6 +249,15 @@
}
+/**
+ * Function that is called on each HELLO file in a particular directory.
+ * Try to parse the file and add the HELLO to our list.
+ *
+ * @param cls pointer to 'unsigned int' to increment for each file, or NULL
+ * if the file is from a read-only, read-once resource directory
+ * @param fullname name of the file to parse
+ * @return GNUNET_OK (continue iteration)
+ */
static int
hosts_directory_scan_callback (void *cls, const char *fullname)
{
@@ -255,7 +269,8 @@
return GNUNET_OK; /* ignore non-files */
if (strlen (fullname) < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded))
{
- remove_garbage (fullname);
+ if (NULL != matched)
+ remove_garbage (fullname);
return GNUNET_OK;
}
filename =
@@ -263,16 +278,19 @@
sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1];
if (filename[-1] != DIR_SEPARATOR)
{
- remove_garbage (fullname);
+ if (NULL != matched)
+ remove_garbage (fullname);
return GNUNET_OK;
}
if (GNUNET_OK !=
GNUNET_CRYPTO_hash_from_string (filename, &identity.hashPubKey))
{
- remove_garbage (fullname);
+ if (NULL != matched)
+ remove_garbage (fullname);
return GNUNET_OK;
}
- (*matched)++;
+ if (NULL != matched)
+ (*matched)++;
add_host_to_known_hosts (&identity);
return GNUNET_OK;
}
@@ -280,6 +298,9 @@
/**
* Call this method periodically to scan data/hosts for new hosts.
+ *
+ * @param cls unused
+ * @param tc scheduler context, aborted if reason is shutdown
*/
static void
cron_scan_directory_data_hosts (void *cls,
@@ -362,7 +383,6 @@
}
-
/**
* Do transmit info about peer to given host.
*
@@ -401,6 +421,10 @@
/**
* @brief delete expired HELLO entries in data/hosts/
+ *
+ * @param cls pointer to current time (struct GNUNET_TIME_Absolute)
+ * @param fn filename to test to see if the HELLO expired
+ * @return GNUNET_OK (continue iteration)
*/
static int
discard_hosts_helper (void *cls, const char *fn)
@@ -442,7 +466,11 @@
/**
- * Call this method periodically to scan data/hosts for new hosts.
+ * Call this method periodically to scan data/hosts for ancient
+ * HELLOs to expire.
+ *
+ * @param cls unused
+ * @param tc scheduler context, aborted if reason is shutdown
*/
static void
cron_clean_data_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext
*tc)
@@ -541,6 +569,9 @@
}
+/**
+ * FIXME.
+ */
static int
do_notify_entry (void *cls, const GNUNET_HashCode * key, void *value)
{
@@ -576,6 +607,9 @@
}
+/**
+ * FIXME.
+ */
static int
free_host_entry (void *cls, const GNUNET_HashCode * key, void *value)
{
@@ -586,6 +620,7 @@
return GNUNET_YES;
}
+
/**
* Clean up our state. Called during shutdown.
*
@@ -608,7 +643,7 @@
/**
- * Process statistics requests.
+ * Start up peerinfo service.
*
* @param cls closure
* @param server the initialized server
@@ -628,6 +663,8 @@
sizeof (struct GNUNET_MessageHeader)},
{NULL, NULL, 0, 0}
};
+ char *peerdir;
+ char *ip;
hostmap = GNUNET_CONTAINER_multihashmap_create (1024);
stats = GNUNET_STATISTICS_create ("peerinfo", cfg);
@@ -644,11 +681,22 @@
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
NULL);
GNUNET_SERVER_add_handlers (server, handlers);
+ ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
+ GNUNET_asprintf (&peerdir,
+ "%shellos",
+ ip);
+ GNUNET_free (ip);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Importing HELLOs from `%s'\n"),
+ peerdir);
+ GNUNET_DISK_directory_scan (peerdir,
+ &hosts_directory_scan_callback, NULL);
+ GNUNET_free (peerdir);
}
/**
- * The main function for the statistics service.
+ * The main function for the peerinfo service.
*
* @param argc number of arguments from the command line
* @param argv command line arguments
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r20477 - in gnunet: contrib contrib/hellos src/peerinfo,
gnunet <=