• 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: Pavan Vyas <email@hidden>
  • Date: Fri, 08 Aug 2003 09:46:52 +1200

Hi Quin,

Yes you are correct,

I am trying to design some sort of copy protection for our software. I did
look at the GetPrimaryMacAddress.c example. It seems very straight forward
in terms of the code complexity, however I could not figure out how to get
that compiled on CodeWarrior since it uses the following:

#include <CoreFoundation/CoreFoundation.h>

#include <IOKit/IOKitLib.h>
#include <IOKit/network/IOEthernetInterface.h>
#include <IOKit/network/IONetworkInterface.h>
#include <IOKit/network/IOEthernetController.h>


Any ideas how to get it to work on CodeWarrior since the sample is a Project
Builder project?

Thanks

Pavan


On 8/7/03 8:29 PM, "Quinn" <email@hidden> wrote:

> 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/GetPrimaryMACAdd
> ress.htm>
>
> S+E
_______________________________________________
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: Tomas Zahradnicky <email@hidden>
References: 
 >Re: Problem with getting Buitin Ethernet Address on OSX using OT (From: Quinn <email@hidden>)

  • Prev by Date: RE: Adding ports to the firewall from an Installer?
  • Next by Date: Problems with Open Transport on MacOS X
  • Previous by thread: Re: 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