You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, im creating an arp broadcast packet like this:
import dpkt
import socket
import binascii
def eth_aton(buffer):
sp = buffer.split(':')
buffer = ''.join(sp)
return binascii.unhexlify(buffer)
arp = dpkt.arp.ARP()
arp.sha=eth_aton('00:24:8c:5b:11:ec')
arp.spa=socket.inet_aton('192.168.1.3')
arp.tha=eth_aton('00:00:00:00:00:00')
arp.tpa=socket.inet_aton('192.168.1.4')
arp.op=dpkt.arp.ARP_OP_REQUEST
eth=dpkt.ethernet.Ethernet()
eth.src=arp.sha
eth.dst=eth_aton('ff:ff:ff:ff:ff:ff')
eth.data=arp
eth.type=dpkt.ethernet.ETH_TYPE_ARP
And Im able to send the packet with a PF_PACKET RAW socket:
s = socket.socket(socket.PF_PACKET, socket.SOCK_RAW)
s.bind((device, dpkt.ethernet.ETH_TYPE_ARP))
s.send(str(eth))
Everyhting works great and Im able to get a reply, my question is How is
the network byte order handled? dpkt or the BSD socket handles it? I've
tried it in systems with different endiannesses and it works fine.
Original issue reported on code.google.com by rudebo...@gmail.com on 28 Mar 2010 at 10:18
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
rudebo...@gmail.com
on 28 Mar 2010 at 10:18The text was updated successfully, but these errors were encountered: