Browse Source

Add support for bridges on IPv6 and clients using them.

No IPv6-only support atm.
Linus Nordberg 11 years ago
parent
commit
36cbc892d4
3 changed files with 27 additions and 2 deletions
  1. 9 2
      lib/chutney/TorNet.py
  2. 15 0
      networks/bridges+ipv6
  3. 3 0
      torrc_templates/bridge-v6.tmpl

+ 9 - 2
lib/chutney/TorNet.py

@@ -179,7 +179,8 @@ class LocalNodeBuilder(NodeBuilder):
     # tor_gencert -- path to tor_gencert binary
     # tor -- path to tor binary
     # auth_cert_lifetime -- lifetime of authority certs, in months.
-    # ip -- IP to listen on (used only if authority)
+    # ip -- IP to listen on (used only if authority or bridge)
+    # ipv6_addr -- IPv6 address to listen on (used only if ipv6 bridge)
     # orport, dirport -- (used only if authority)
     # fingerprint -- used only if authority
     # dirserver_flags -- used only if authority
@@ -343,7 +344,12 @@ class LocalNodeBuilder(NodeBuilder):
         if not self._env['bridge']:
             return ""
 
-        return "Bridge %s:%s\n" % (self._env['ip'], self._env['orport'])
+        bridgelines = "Bridge %s:%s\n" % (self._env['ip'],
+                                          self._env['orport'])
+        if self._env['ipv6_addr'] is not None:
+            bridgelines += "Bridge %s:%s\n" % (self._env['ipv6_addr'],
+                                               self._env['orport'])
+        return bridgelines
 
 class LocalNodeController(NodeController):
     def __init__(self, env):
@@ -466,6 +472,7 @@ DEFAULTS = {
     'tor' : 'tor',
     'auth_cert_lifetime' : 12,
     'ip' : '127.0.0.1',
+    'ipv6_addr' : None,
     'dirserver_flags' : 'no-v2',
     'chutney_dir' : '.',
     'torrc_fname' : '${dir}/torrc',

+ 15 - 0
networks/bridges+ipv6

@@ -0,0 +1,15 @@
+Authority = Node(tag="a", authority=1, relay=1, torrc="authority.tmpl")
+Relay = Node(tag="r", relay=1, torrc="relay.tmpl")
+Client = Node(tag="c", torrc="client.tmpl")
+
+BridgeAuthority = Node(tag="ba", authority=1, bridgeauthority=1,
+                       relay=1, torrc="bridgeauthority.tmpl")
+Bridge = Node(tag="br", bridge=1, relay=1, torrc="bridge.tmpl")
+BridgeIPv6 = Node(tag="br", bridge=1, relay=1, ipv6_addr="[::1]", torrc="bridge-v6.tmpl")
+BridgeClient = Node(tag="bc", torrc="bridgeclient.tmpl")
+
+NODES = Authority.getN(3) + BridgeAuthority.getN(1) + Relay.getN(5) + \
+    Bridge.getN(1) + BridgeIPv6.getN(1) + \
+    Client.getN(2) + BridgeClient.getN(1)
+
+ConfigureNodes(NODES)

+ 3 - 0
torrc_templates/bridge-v6.tmpl

@@ -0,0 +1,3 @@
+${include:bridge.tmpl}
+OrPort ${ipv6_addr}:${orport} IPv6Only
+