djhenderson / dpkt

Automatically exported from code.google.com/p/dpkt
Other
1 stars 0 forks source link

Packet from dpkt.ethernet.Ethernet constructor is unparsed. #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
### Begin sample code ###
from dpkt import ethernet
from dpkt import arp

arp_pkt = arp.ARP(sha='123456', spa='abcd', tha='7890ab', tpa='wxyz')
eth_pkt = ethernet.Ethernet(data=str(arp_pkt), type=ethernet.ETH_TYPE_ARP,
                src='ABCDEF', dst='PQRSTU')
print "Is .arp in eth_pkt? %s" % ('arp' in eth_pkt.__dict__)
eth_pkt.unpack(str(eth_pkt))
print "Is .arp in eth_pkt? %s" % ('arp' in eth_pkt.__dict__)
### End sample code ###

What is the expected output? What do you see instead?
Expect .arp in the constructed Ethernet packet, without a need to call
.unpack on its own str().  Actual .arp is not in constructed Ethernet packet, 
but .unpack on its own str() will generate it.

What version of the product are you using? On what operating system?
dpkt 1.6 on Ubuntu 10.10 (package 1.6+svn54-1)

Please provide any additional information below.

Original issue reported on code.google.com by googa...@jlm.ofb.net on 9 Dec 2010 at 10:16