Get the Mac address programmatically
Get the Mac address programmatically
- Subject: Get the Mac address programmatically
- From: "Jerry" <email@hidden>
- Date: Thu, 10 May 2007 17:50:12 -0700
Hi,
Is there a way to directly retrieve the MAC address programmatically without
using the System Configuration Framework?
I was using the system configuration dynamic store to get the Mac address in
my application, however, a client told me that the Mac address show in my
application was incorrect. In other words, the Mac address they saw by using
"ifconfig" is different from what they got using "scutil" in Terminal (my
application shows the same wrong Mac address as in the scutil tool).
Ex.
Using "ifconfig en0" ==>> ether 00:03:93:c0:b1:08
Then "scutil" with query "show Setup:/Network/Service/0/Ethernet" ==>>
MACAddress : 00:0d:93:6c:1a:14
The customer said all of their Macs have the same issue because they have
all been imaged from the same MacOSX image. When they used ifconfig on each
Mac, they all got the correct Mac address. But when they use scutil to query
the dynamic store, all Macs show the same value which is 00:0d:93:6c:1a:14.
Since they have confirmed the issue, I believe the same Mac address was
copied to many Mac machines and somehow the dynamic store did refresh its
network state.
According to the document:
"In a running Mac OS X system, the dynamic store contains a snapshot of the
current network state..." link
<http://developer.apple.com/documentation/Networking/Conceptual/SystemConfig
Fram> and
"The System Configuration framework communicates with a system-level daemon,
configd, to manage network configuration..."
<http://developer.apple.com/documentation/Networking/Conceptual/SystemConfig
Fram> link
I think the configd is running on their Macs. Thus, the dynamic store should
have the latest network status and the Mac address in the dynamic store
should match the actual network card on each Mac machine. How come the
dynamic store did not have the up-to-date information regarding the network
status? If system configuration framework is not reliable, is there another
way that I can get the accurate Mac address programmatically?
Thanks,
Jerry
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden