467,885 Members | 1,283 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,885 developers. It's quick & easy.

dealing with MAC address

Hello,
I am trying to fill a packet with source and destination mac address.
The first 6 bytes hold the destination mac address and the next six
bytes hold the source mac address. In the code i am filling in the
first six bytes to broadcast address for the destination.

# fill in the destination address
data = array('B', '\0' * 512)
for i in range(6):
data[i] = 0xFF

How do i fill in a command line passed mac address for source mac
address. The first six bytes of data[i] should contain destination mac
and the next six bytes of data[i] should contain the source mac
address.

Thanks,
Ashton

Jul 19 '05 #1
  • viewed: 1477
Share:
1 Reply
On 2005-05-20, as*****@gmail.com <do*****@gmail.com> wrote:
How do i fill in a command line passed mac address for source mac
address. The first six bytes of data[i] should contain destination mac
and the next six bytes of data[i] should contain the source mac
address.


Use the struct module.

--
Grant Edwards grante Yow! MMM-MM!! So THIS is
at BIO-NEBULATION!
visi.com
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Scot Hacker | last post: by
44 posts views Thread by flyingfred0 | last post: by
7 posts views Thread by Monty | last post: by
5 posts views Thread by Laurel | last post: by
11 posts views Thread by Noah Roberts | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.