commit 3fb8b8150c1e9da4d9f0e7e1b8614db45146e265 Author: Arturo Filastò art@torproject.org Date: Sat Jul 21 13:39:00 2012 +0200
Rename super long function do something more human. --- ooni/plugins/daphn3.py | 2 +- ooni/protocols/daphn3.py | 2 +- oonib/backends/daphn3.py | 4 ++++ oonib/oonibackend.conf | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ooni/plugins/daphn3.py b/ooni/plugins/daphn3.py index 6dd9da2..82a3331 100644 --- a/ooni/plugins/daphn3.py +++ b/ooni/plugins/daphn3.py @@ -70,7 +70,7 @@ class daphn3Test(OONITest): return #pass self.factory = Daphn3ClientFactory() - self.steps = daphn3.get_daphn3_dictionary_from_pcap(self.local_options['pcap']) + self.steps = daphn3.read_pcap(self.local_options['pcap'])
def control(self, exp_res, args): mutation = self.factory.mutator.get_mutation(0) diff --git a/ooni/protocols/daphn3.py b/ooni/protocols/daphn3.py index d8290e6..093929b 100644 --- a/ooni/protocols/daphn3.py +++ b/ooni/protocols/daphn3.py @@ -8,7 +8,7 @@ import sys from scapy.all import * import yaml
-def get_daphn3_dictionary_from_pcap(filename): +def read_pcap(filename): """ @param filename: Filesystem path to the pcap.
diff --git a/oonib/backends/daphn3.py b/oonib/backends/daphn3.py index a8290e3..59bdeea 100644 --- a/oonib/backends/daphn3.py +++ b/oonib/backends/daphn3.py @@ -1,8 +1,11 @@ from twisted.internet import protocol from twisted.internet.error import ConnectionDone
+from oonib.common import config + from ooni.plugoo import reports from ooni.protocols.daphn3 import Mutator, Daphn3Protocol +from ooni.protocols.daphn3 import read_pcap
class Daphn3Server(protocol.ServerFactory): """ @@ -18,6 +21,7 @@ class Daphn3Server(protocol.ServerFactory): def buildProtocol(self, addr): p = self.protocol() p.factory = self + p.factory.steps = read_pcap(config.daphn3.pcap_file)
if addr.host not in self.mutations: self.mutations[addr.host] = Mutator(p.steps) diff --git a/oonib/oonibackend.conf b/oonib/oonibackend.conf index 3ccfdef..5265045 100644 --- a/oonib/oonibackend.conf +++ b/oonib/oonibackend.conf @@ -5,4 +5,4 @@ dns_tcp_port = 8002 daphn3_port = 9666 server_version = Apache [daphn3] -pcap_file = server.pcap +pcap_file = /Users/y/Documents/workspace/ooni-probe.new/oonib/server.pcap
tor-commits@lists.torproject.org