Skip to content
Snippets Groups Projects
Commit 48cd0564 authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

Merged in insomniacslk/scapy (pull request #71)

Converting explicitly the instance returned by pcap_next into a str
parents a3e6dc49 a30a79ee
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,12 @@ if conf.use_pcap: ...@@ -52,6 +52,12 @@ if conf.use_pcap:
return getattr(self.pcap, attr) return getattr(self.pcap, attr)
def __del__(self): def __del__(self):
warning("__del__: don't know how to close the file descriptor. Bugs ahead ! Please report this bug.") warning("__del__: don't know how to close the file descriptor. Bugs ahead ! Please report this bug.")
def next(self):
c = self.pcap.next()
if c is None:
return
ts, pkt = c
return ts, str(pkt)
open_pcap = lambda *args,**kargs: _PcapWrapper_pypcap(*args,**kargs) open_pcap = lambda *args,**kargs: _PcapWrapper_pypcap(*args,**kargs)
elif hasattr(pcap,"pcapObject"): # python-libpcap elif hasattr(pcap,"pcapObject"): # python-libpcap
class _PcapWrapper_libpcap: class _PcapWrapper_libpcap:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment