473,698 Members | 2,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
1 1658
On 2005-05-20, as*****@gmail.c om <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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3323
by: Scot Hacker | last post by:
I have a database that has been populated with content pasted out of MS Word, and is full of special characters -- em dashes, curly quotes, curly apostrophes, etc. Now I'm generating plain text email summaries out of the database and of course those special chars appear as garbage chars in the emails. How can I filter the extracted text and transform these characters into plain text equivalents? Is there a builtin function for this,...
44
3754
by: flyingfred0 | last post by:
A small software team (developers, leads and even the manager when he's had time) has been using (wx)Python/PostgreSQL for over 2 years and developed a successful 1.0 release of a client/server product. A marketing/product manager has brought in additional management and "architecture" experts to propose moving the entire thing to a Java (application server) platform for the next release. They want a "scalable, enterprise solution"...
7
12448
by: Monty | last post by:
I've written a simple e-newsletter app using the PHP mail() command. I want to be able to deal with bounce-backs if a member's email is no longer working or is using an old account. I'm using a Red Hat Linux server with Sendmail and Apache. I've seen mention of using Procmail or filtering mail to a certain account through a PHP script, but, can't find detailed instructions on how this is done. Can anyone let me know or point me toward...
11
9051
by: Steve Jorgensen | last post by:
I just came up with a really tidy little solution to the VB/VBA circular reference issue. It only works with Access 2000 or newer, but that's about the only down-side. The issue... You need an object model that includes a container object, and the object in the container need to interact with the container itself. The problem is that, to access the container, each item needs a reference to the container, and that constitutes a...
0
1220
by: jhhbr549 | last post by:
Need to write a class called Sales that is extends from a super class called Employee. I feel like I am going in the wrong direction. look at this: Here are the specs: static double field values - BEST_COMMISSION, HIGH_COMMISSION, HIGH_SALES, LOW_COMMISSION,LOW_SALES, QUOTA_COMMISION, QUOTA_SALES. I believe I have the main constructor correct? Method - getCommissionRate( )
5
6773
by: Laurel | last post by:
I've written a function that might return multiple e-mail addresses. I've been returning them in an XML string, and parsing it using ReadString, but I get the error below. (Code for ReadString is also included). Does anyone have any advice as to the best way to proceed? 1 - See if there's a way to "protect" the @ in the string - I've read the documentation about using @ instead of quotes, but it will take some time and effort to figure...
11
1250
by: Noah Roberts | last post by:
I'm looking for ideas on approaches to dealing with a type of problem... Say you have a project with several thousands of lines of code that uses a certain C API for GUI work (really doesn't matter which one, the problem is across the board). You of course have much code in which you are casting objects to void* in order that they can be passed through the API into some callback function, where you will be casting from void* back into...
1
1614
by: Slain | last post by:
I am a beginner and have some confusion with respect to pointers and strings. It seems that the pointers with dealing with integer arrays behave differently, as opposed to strings. Can some one explain me the difference? Sample Program: int main() { int array={1,2,3,4,5};
6
2588
by: Yas | last post by:
Hello, Suppose I have the following table... name employeeId email -------------------------------------------- Tom 12345 tom@localhost.com Hary 54321 Hary 54321 hary@localhost.com
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.