ARP request/reply by Python?

Adam Langley usenet at imperialviolet.org
Sat Nov 23 08:55:36 EST 2002


On Sat, 23 Nov 2002 14:36:33 +0900, Brian Lee wrote:

> Can I read and write ARP packets by Python? I found that 
> type number for IP datagram is 0x0800 and 0x0806 for ARP request/reply
> in ethernet frame header. How can I set type number(0x0806) to ethernet
> frame header in Python socket? Any site link on this?

Your best bet is wrapping something like libnet in Python. Libnet is a
library for building weird and wonderful packets and a quick google search
turns up:
	http://sourceforge.net/projects/pylibnet
which looks like it's just what you need. The homepage even has a code
example for building arp packets.




More information about the Python-list mailing list