@dbus.service.method(NAME,
in_signature='', out_signature='')
- def Start(self):
+ def Start(self, filename=None):
# FIXME: Prevent double Start()
- self.setup_monitor(self.device):
+ if filename is None: # Then we do *not* want to read from a PCap file but rather a monitor device
+ self.setup_monitor(self.device)
self.is_running = True
try:
self.cap = pcap.pcap(device)
self.cap.setfilter('dst port 80')
cap_fileno = self.cap.fileno()
self.source_id = gobject.io_add_watch(cap_fileno, gobject.IO_IN, self.cap_readable_callback, device)
+
+ @dbus.service.method(NAME,
+ in_signature='s', out_signature='')
+ def StartFromFile(self, filename):
+ return self.Start(filename=filename)
+
def cap_readable_callback(self, source, condition, device):
return self.pwn(device, self.MessageSent)