[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [onionoo/master] Add v6 exit policy summary.



commit 667c75865c823a3d5954f527684d619f0bdab087
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Jan 6 09:43:11 2014 +0100

    Add v6 exit policy summary.
    
    Implements Onionoo part of #10523.
---
 src/org/torproject/onionoo/NodeDataWriter.java |   14 ++++++++++++++
 web/index.html                                 |   15 +++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/src/org/torproject/onionoo/NodeDataWriter.java b/src/org/torproject/onionoo/NodeDataWriter.java
index 72def10..290802c 100644
--- a/src/org/torproject/onionoo/NodeDataWriter.java
+++ b/src/org/torproject/onionoo/NodeDataWriter.java
@@ -355,6 +355,20 @@ public class NodeDataWriter implements DataWriter, DescriptorListener {
       }
       sb.append("\n]");
     }
+    if (descriptor.getIpv6DefaultPolicy() != null &&
+        (descriptor.getIpv6DefaultPolicy().equals("accept") ||
+        descriptor.getIpv6DefaultPolicy().equals("reject")) &&
+        descriptor.getIpv6PortList() != null) {
+      sb.append(",\n\"exit_policy_v6_summary\":{\""
+          + descriptor.getIpv6DefaultPolicy() + "\":[");
+      int portsWritten = 0;
+      for (String portOrPortRange :
+          descriptor.getIpv6PortList().split(",")) {
+        sb.append((portsWritten++ > 0 ? "," : "") + "\"" + portOrPortRange
+            + "\"");
+      }
+      sb.append("]}");
+    }
     detailsStatus = new DetailsStatus();
     detailsStatus.documentString = sb.toString();
     this.documentStore.store(detailsStatus, fingerprint);
diff --git a/web/index.html b/web/index.html
index d70a112..f59a433 100644
--- a/web/index.html
+++ b/web/index.html
@@ -935,6 +935,21 @@ rejects (accepts) all other ports.
 </li>
 
 <li>
+<font color="blue"><b>exit_policy_v6_summary</b></font>
+<code class="typeof">object</code>
+<span class="required-false">optional</span>
+<p>
+Summary version of the relay's IPv6 exit policy containing a dictionary
+with either an "accept" or a "reject" element.
+If there is an "accept" ("reject") element, the relay accepts (rejects)
+all TCP ports or port ranges in the given list for most IP addresses and
+rejects (accepts) all other ports.
+Missing if the relay rejects all connections to IPv6 addresses.
+<font color="blue">Added on January 6, 2013.</font>
+</p>
+</li>
+
+<li>
 <b>contact</b>
 <code class="typeof">string</code>
 <span class="required-false">optional</span>

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits