• 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: Problem with getting Buitin Ethernet Address on OSX using OT
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with getting Buitin Ethernet Address on OSX using OT


  • Subject: Re: Problem with getting Buitin Ethernet Address on OSX using OT
  • From: Quinn <email@hidden>
  • Date: Thu, 7 Aug 2003 09:29:20 +0100

At 17:06 +1200 7/8/03, Pavan Vyas wrote:
I am using the
OTInetGetInterfaceInfo( &myInetInterfaceInfo, kDefaultInetInterface);

Code to get the buitin ethernet address of a computer running on OSX.

What confuses me is that sometimes this method returns an empty
myInetInterfaceInfo.

This is surely the case when I for example add a new Location using
networking control panel under system preferences and just leave the
configuration empty and click on apply now.

[...]

Is this the way it is supposed to be or am I missing something....or
worse...is this a OSX BUG ?

Well, it's not ideal behaviour, but I don't think it's a bug. OTInetGetInterfaceInfo reports information about all of the active TCP/IP interfaces on the machine. During interface reconfiguration, or if you configure an empty interface, there are no active TCP/IP interface, so the call returns nothing.

Why are you trying to get the built-in Ethernet address? There are usually two reasons for this.

1. You want to do something weird on the network, like do raw Ethernet communications. In this case, OTInetGetInterfaceInfo may be the right choice.

2. You're trying to do some sort of copy protection or licence management, and you're looking for a unique machine ID. In this case, OTInetGetInterfaceInfo is not the right solution, for the reason explained above (and other reasons, like there's no guarantee that the user is using their built-in interface to do networking).

In the latter case, you should get the built-in Ethernet address using the technique demonstrated in the GetPrimaryMACAddress sample.

<http://developer.apple.com/samplecode/Sample_Code/Networking/GetPrimaryMACAddress.htm>

S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Problem with getting Buitin Ethernet Address on OSX using OT
      • From: Pavan Vyas <email@hidden>
References: 
 >Problem with getting Buitin Ethernet Address on OSX using OT (From: Pavan Vyas <email@hidden>)

  • Prev by Date: Problem with getting Buitin Ethernet Address on OSX using OT
  • Next by Date: RE: Adding ports to the firewall from an Installer?
  • Previous by thread: Problem with getting Buitin Ethernet Address on OSX using OT
  • Next by thread: Re: Problem with getting Buitin Ethernet Address on OSX using OT
  • Index(es):
    • Date
    • Thread