[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1121 - in GNUnet: contrib src/applications/fs/tools src/ap
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1121 - in GNUnet: contrib src/applications/fs/tools src/applications/topology_default src/server |
Date: |
Tue, 28 Jun 2005 13:51:29 -0700 (PDT) |
Author: grothoff
Date: 2005-06-28 13:51:22 -0700 (Tue, 28 Jun 2005)
New Revision: 1121
Modified:
GNUnet/contrib/config-daemon.in
GNUnet/contrib/gnunet.root
GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
GNUnet/src/applications/topology_default/topology.c
GNUnet/src/server/connection.c
Log:
use topology to determine blacklist interval -- also avoids need for user to
specify topology in config
Modified: GNUnet/contrib/config-daemon.in
===================================================================
--- GNUnet/contrib/config-daemon.in 2005-06-28 20:33:49 UTC (rev 1120)
+++ GNUnet/contrib/config-daemon.in 2005-06-28 20:51:22 UTC (rev 1121)
@@ -172,7 +172,7 @@
config APPLICATIONS
string "Which applications should gnunetd support?"
- default "advertising topology fs getoption stats traffic"
+ default "advertising fs getoption stats traffic"
depends on Meta::ADVANCED
help
Which applications should gnunetd support? Specify the name of
the
@@ -183,7 +183,6 @@
Currently, the available applications are:
advertising: always load this one
- topology: always load this one, too!
getoption: probably a good idea, too!
stats: statistics - for gnunet-stats
@@ -200,7 +199,7 @@
Using the fs tools for downloading may require the traffic
module
to be loaded!
- Default: APPLICATIONS = "advertising topology fs getoption
stats traffic"
+ Default: APPLICATIONS = "advertising fs getoption stats traffic"
config TRANSPORTS
string "Which transport mechanisms are available?"
Modified: GNUnet/contrib/gnunet.root
===================================================================
--- GNUnet/contrib/gnunet.root 2005-06-28 20:33:49 UTC (rev 1120)
+++ GNUnet/contrib/gnunet.root 2005-06-28 20:51:22 UTC (rev 1121)
@@ -30,7 +30,7 @@
HOSTLISTURL = "http://gnunet.org/hostlist http://mikael.karlsson.com/hostlist"
HTTP-PROXY = ""
HTTP-PROXY-PORT = 1080
-APPLICATIONS = "advertising topology fs getoption stats traffic"
+APPLICATIONS = "advertising fs getoption stats traffic"
TRANSPORTS = "udp tcp http nat"
#
Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-06-28 20:33:49 UTC
(rev 1120)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2005-06-28 20:51:22 UTC
(rev 1121)
@@ -445,7 +445,8 @@
}
FREE(keyword);
if (OK != FSUI_createNamespace(ctx,
- 0, /* FIXME: anonymity level! */
+ getConfigurationInt("FS",
+ "ANONYMITY-SEND"),
pname,
meta,
advertisement,
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-06-28 20:33:49 UTC
(rev 1120)
+++ GNUnet/src/applications/topology_default/topology.c 2005-06-28 20:51:22 UTC
(rev 1121)
@@ -280,7 +280,38 @@
}
static int estimateNetworkSize() {
- return 0; /* FIXME: implement this function! */
+ unsigned int active;
+ unsigned int known;
+
+ active = coreAPI->forAllConnectedNodes(NULL, NULL);
+ if (active == 0)
+ return 0;
+ known = identity->forEachHost(0,
+ NULL,
+ NULL);
+ if (active > known)
+ return active; /* should not be possible */
+ /* Assumption:
+ if we only connect to X% of all machines
+ that we know, we probably also only know X%
+ of all peers that exist;
+
+ Then the total number of machines is
+ 1/X * known, or known * known / active.
+
+ Of course, we may know more than X% of the
+ machines, in which case this estimate is too
+ high. Well, that is why it is an estimate :-).
+
+ Example:
+ - we connect to all machines we have ever heard
+ of => network size == # active
+ - we connect to only 1% of the machines we have
+ heard of => network size = 100 * # active
+ */
+ if (known * known / active < known)
+ return 0x7FFFFFFF; /* integer overflow, return max int */
+ return known * known / active;
}
static double estimateSaturation() {
Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c 2005-06-28 20:33:49 UTC (rev 1120)
+++ GNUnet/src/server/connection.c 2005-06-28 20:51:22 UTC (rev 1121)
@@ -51,6 +51,7 @@
#include "gnunet_identity_service.h"
#include "gnunet_session_service.h"
#include "gnunet_fragmentation_service.h"
+#include "gnunet_topology_service.h"
#include "connection.h"
#include "core.h"
#include "handler.h"
@@ -443,6 +444,11 @@
static Fragmentation_ServiceAPI * fragmentation;
/**
+ * Topology service
+ */
+static Topology_ServiceAPI * topology;
+
+/**
* The buffer containing all current connections.
*/
static BufferEntry ** CONNECTION_buffer_;
@@ -1685,7 +1691,7 @@
#endif
shutdownConnection(entries[u]);
identity->blacklistHost(&entries[u]->session.sender,
- 1, /* FIXME: 1? */
+ 1 / topology->estimateSaturation(),
YES);
activePeerCount--;
entries[u] = entries[activePeerCount];
@@ -2403,6 +2409,8 @@
GNUNET_ASSERT(session != NULL);
fragmentation = requestService("fragmentation");
GNUNET_ASSERT(fragmentation != NULL);
+ topology = requestService("topology");
+ GNUNET_ASSERT(topology != NULL);
transport->start(&core_receive);
}
@@ -2453,6 +2461,8 @@
session = NULL;
releaseService(fragmentation);
fragmentation = NULL;
+ releaseService(topology);
+ topology = NULL;
#if DEBUG_COLLECT_PRIO == YES
fclose(prioFile);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1121 - in GNUnet: contrib src/applications/fs/tools src/applications/topology_default src/server,
grothoff <=