Closed GoogleCodeExporter closed 9 years ago
Ok, figures this one out. Now I'm just trying to print all known attributes of
tcp or udp. It keeps failing because it finds a none IP based packet. I need
a one liner that prints everything except arp.
Original comment by rrpo...@gmail.com
on 3 Nov 2011 at 7:26
Not an issue with dpkt -- closing
Original comment by timur.al...@gmail.com
on 17 Mar 2012 at 11:37
i have a same error. how can i fix this ?
i m using python 2.7
my operating system , windows7 64bit
Original comment by engn...@gmail.com
on 2 Jul 2012 at 2:30
my error message is :
if tcp.dport == 80 and len(tcp.data)> 0 :
AttributeError : 'ICMP' object has no attribute 'dport'
Original comment by engn...@gmail.com
on 2 Jul 2012 at 2:32
I have a similar problem running the dpkt tutorial, but the error I get
involves tcp.dport and str object not having an attribute...
if tcp.dport == 80 and len(tcp.data) > 0:
AttributeError: 'str' object has no attribute 'dport'
Original comment by agruns...@gmail.com
on 29 Jul 2013 at 1:11
SAMPLE outputfor same issue:
62492
41325
42921
22
62493
41325
42922
22
42923
22
42924
22
Traceback (most recent call last):
File "C:\Users\aman\parse.py", line 8, in <mod
ule>
tcp = ip.data
AttributeError: 'str' object has no attribute 'data'
CODE:
import dpkt
import sys
f = open('cap1.pcap','rb')
pcap = dpkt.pcap.Reader(f)
for ts, buf in pcap:
eth = dpkt.ethernet.Ethernet(buf)
ip = eth.data
tcp = ip.data
print ip.id
print tcp.sport
Original comment by amanroya...@gmail.com
on 2 May 2014 at 5:50
Original issue reported on code.google.com by
rrpo...@gmail.com
on 3 Nov 2011 at 5:12