dealing with MAC address

A

ashtonn

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 = 0xFF

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

Thanks,
Ashton
 
G

Grant Edwards

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


Use the struct module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,239
Messages
2,571,200
Members
47,840
Latest member
Tiffany471

Latest Threads

Top