• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get MAC Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: How to get MAC Address
      • From: Peter Sichel <email@hidden>
References: 
 >How to get MAC Address (From: "Mark's Studio" <email@hidden>)

  • Prev by Date: Re: Document based application with that auto-new-doc behaviour
  • Next by Date: Re: Document based application with that auto-new-doc behaviour
  • Previous by thread: How to get MAC Address
  • Next by thread: Re: How to get MAC Address
  • Index(es):
    • Date
    • Thread