Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > getting a unique number corresponding to mac

getting a unique number corresponding to mac
Thread Tools
Fresh-Faced Recruit
Join Date: May 2001
Location: India
Status: Offline
Reply With Quote
Jul 30, 2001, 04:50 AM
 
hi,

I have to get a unique number corresponding to a MAC machine. i.e. i want to uniquely identify a MAC machine and get a integer corresponding to it.

How can i do this. Can anybody help?
Its urgent.

Regards
Rachna
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Monopoli, Bary, ITALY
Status: Offline
Reply With Quote
Jul 30, 2001, 11:03 AM
 
You can use the ethernet address as unique machine identifier.
Check:
GetEnetAddrDirect.ppc
GetHWEthernetAddr
GetMACAddressSample
at:
http://developer.apple.com/samplecod...Networking.htm

The last two examples work with MacOS X.

I have used this address in my structure analysis software 'SAP One' at: http://www.macsapone.net/index.htm
for free and commercial registrations

Sorry for my poor english

[ 07-30-2001: Message edited by: antofic ]
     
Rachna  (op)
Fresh-Faced Recruit
Join Date: May 2001
Location: India
Status: Offline
Reply With Quote
Jul 31, 2001, 01:27 AM
 
thanx very much for the reply.

i don't know much abt the hardware of the Mac machine, but i wonder what will happen if some body changes the Ethernet card of the machine. Then the new Ethernet card will have new ID corresponding to it.

Then how will we identify the machine to be the same as before?
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Monopoli, Bary, ITALY
Status: Offline
Reply With Quote
Jul 31, 2001, 02:12 AM
 
Macs have ethernet built-in on the mother-board. Only very old computers like the Powerbook 1400 dont have it.

Some users can install a new ethernet card (i.e. for speed reasons) so the computer can have two or more ethernet address. You should left the user choose what ethernet address use to register your product. This is what my software make in the registration dialog.

You can use Apple System Profiler to discover the enet address (in Network -> Appletalk)
     
Rachna  (op)
Fresh-Faced Recruit
Join Date: May 2001
Location: India
Status: Offline
Reply With Quote
Jul 31, 2001, 06:46 AM
 
Can you please tell me the format of the Ethernet adderss?
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Monopoli, Bary, ITALY
Status: Offline
Reply With Quote
Jul 31, 2001, 08:54 AM
 
You can store the ethernet address in an array of 6 chars, i.e.:
typedef char EnetAddress[6];
In you need to convert this code to an integer you can write a function like:
long enetAddressToLong( EnetAddress addr );
that make some (your defined) simple operations (sum, subtraction, or, and, etc...) on the array or that take only the last 4 characters:
unsigned long enetAddressToLong( EnetAddress addr ) {
return *(unsigned long *)&addr[2];
}

[ 07-31-2001: Message edited by: antofic ]
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 31, 2001, 02:53 PM
 
be warned that it's possible to fake your MAC address...
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Monopoli, Bary, ITALY
Status: Offline
Reply With Quote
Aug 1, 2001, 08:40 AM
 
Is ever possible to crack a software.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:47 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2