1. I have hierarchy of layers
dh = dpkt.dhcp.DHCP(udp.data)
I am trying to print a DHCP packet type how can I do it.( I didn't see any option to get it)
I tried print dh.opts
but not sure how can I decode it..?(my lack of experience with binary formats)
2. I saw few old examples from Jon Oberheide, he was able to print whole packet ethernet,IP or etc in almost readable format. for eg
>>> print eth
Ethernet(src='\x00\x1a\xa0kUf', dst='\x00\x13I\xae\x84,', data=IP(src='\xc0\xa8\n\n',
off=16384, dst='C\x17\x030', sum=25129, len=52, p=6, id=51105, data=TCP(seq=9632694,
off_x2=128, ack=3382015884, win=54, sum=65372, flags=17, dport=80, sport=56145)))
How can I print whole packet's data in readable format and then go layer by layer or data of perticular layer like I was trying
print dh //gives me unreadable(I believe binary formatted text)
Can you pls help me on this..Examples will be great