Re: How to get MAC Address
Re: How to get MAC Address
- Subject: Re: How to get MAC Address
- From: Georg Tuparev <email@hidden>
- Date: Mon, 25 Feb 2002 16:47:19 +0100
This will do it:
void getEthernetAddress()
{
InetInterfaceInfo myInetInterfaceInfo;
int i, adaptorInterface;
NSLog(@"Ethernet addresses: ");
adaptorInterface=0;
do {
OTInetGetInterfaceInfo(&myInetInterfaceInfo, adaptorInterface);
if (myInetInterfaceInfo.fHWAddrLen > 0) {
for(i=0; i<myInetInterfaceInfo.fHWAddrLen; i++) {
printf("x ",myInetInterfaceInfo.fHWAddr[i]);
}
printf("\n");
}
adaptorInterface++;
}
while (myInetInterfaceInfo.fHWAddrLen > 0);
}
gt
On Sunday, February 24, 2002, at 10:32 , Mark's Studio wrote:
Is there a simple way to get the MAC ethernet address?
I tried the Apple "GetHWEthernetAddr" example (carbon),
But there is a problem if im online with the modem it's not working?
BUG?
I think it's working if on the LAN( can't check now).
There is another Apple "GetPrimaryMACAddressSample" example
But that's to lo level for me.
Is there a simpler Cocoa way of getting the MAC Address?
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.