[tor-commits] [bridgedb/develop] Update documentation on IPBasedDistributor area mapping.

isis at torproject.org isis at torproject.org
Thu Jun 25 07:10:54 UTC 2015


commit 33cb6c45d12d83c441595ff0fc2bf6cc21e46623
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sat Apr 11 02:52:31 2015 +0000

    Update documentation on IPBasedDistributor area mapping.
---
 lib/bridgedb/Dist.py |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
index ab7ae6e..129bc7c 100644
--- a/lib/bridgedb/Dist.py
+++ b/lib/bridgedb/Dist.py
@@ -151,9 +151,12 @@ class IPBasedDistributor(Distributor):
 
         :type areaMapper: callable
         :param areaMapper: A function that maps IP addresses arbitrarily to
-            strings, such that addresses which map to identical strings are
-            considered to be in the same "area" (for some arbitrary definition
-            of "area"). See :func:`bridgedb.Dist.uniformMap` for an example.
+            strings, such that IP addresses which map to identical strings are
+            considered to be in the same "area".  The default **areaMapper**
+            is :func:`bridgedb.Dist.uniformMap`, which maps all IPv4 addresses
+            within the same /16 and all IPv6 addresses within the same /32 to
+            the same area.  Areas are then grouped into the number of rings
+            specified by the ``N_IP_CLUSTERS`` configuration option.
         :param integer numberOfClusters: The number of clusters to group IP addresses
             into. Note that if PROXY_LIST_FILES is set in bridgedb.conf, then
             the actual number of clusters is one higher than ``numberOfClusters``,
@@ -327,8 +330,6 @@ class IPBasedDistributor(Distributor):
         # based upon the client's area (i.e. the /16 of the client's IP
         # address):
         else:
-            # Areas (i.e. /16s) are grouped into the number of rings specified
-            # by the N_IP_CLUSTERS configuration option.
             area = self.areaMapper(bridgeRequest.client)
             cluster = (int(self.areaClusterHmac(area)[:8], 16)
                        % (self.numberOfClusters - 1))





More information about the tor-commits mailing list