Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Obtaining Ethernet MAC address



Allan-

I've downloaded almost all the opensource from Darwin, but when I do a
search for SCNetworkInterfaceGetLocalizedDisplayName I find nothing. Is
this function not in the download source? Is it just in some library
when one installs 10.4?

Thanks
Carl
 

-----Original Message-----
From: Allan Nathanson [mailto:email@hidden] 
Sent: Friday, May 06, 2005 10:17 AM
To: Carl Smith
Cc: Darwin Drivers Mailing List
Subject: Re: Obtaining Ethernet MAC address

We introduced some new APIs (in Tiger) which should provide most of  
the information you are seeking.  In <SystemConfiguration/ 
SCNetworkConfiguration.h> you will find :

     SCNetworkInterfaceCopyAll()
         returns an array of network capable devices

     SCNetworkInterfaceGetHardwareAddressString()
         returns the hardware (MAC) address for an interface

     SCNetworkInterfaceGetLocalizedDisplayName()
         returns the display name (e.g. "Built-in Ethernet") for an  
interface

- Allan


On May 5, 2005, at 9:02 PM, Dean Reece wrote:

> On May 5, 2005, at 5:45 PM, Carl Smith wrote:
>
>> Is it possible using the classes in the example link below to also
>> obtain the 'Name' of the ethernet card, i.e. as in the Systems/ 
>> Network
>> panel as "Airport",
>> "Built-in Ethernet" and so on?
>>
>> And in conjunction, is there some way, to distiguish between the  
>> cards
>> and if they are wireless or not?
>>
>
> Unfortunately, there isn't a good one-stop-shopping approach to  
> present an interface selector (which is what it sounds like you  
> want to do).  The same is true for wired-vs-wireless.  As for  
> builtin-vs-addin, you can look for the "IOBuiltin" property in any  
> instance of IONetworkInterface (The constant is defined in  
> Kernel.framework/Headers/IOKit/network/IONetworkInterface.h)
>
> Our UI has some of the details hardwired, and has to collect the  
> rest from a variety of APIs.  Human-readable device names is  
> something we hope to address in a future release, but for now,  
> you'll probably have to use hard-coded logic to assign a name to  
> each device you find.  I do not believe we have a sample of that,  
> but I'm sure I'll be corrected if I'm wrong ;-)
>  - Dean
>
>> Thanks
>> Carl
>>
>> -----Original Message-----
>> From: darwin-drivers-bounces+csmith=email@hidden
>> [mailto:darwin-drivers-bounces 
>> +csmith=email@hidden]
>> On Behalf Of Carl Smith
>> Sent: Thursday, May 05, 2005 8:35 PM
>> To: Dean Reece
>> Cc: email@hidden
>> Subject: RE: Obtaining Ethernet MAC address
>>
>> Wow that was fast. Great Thanks Dean,
>>
>> "> Is the code for the Systems/Network panel open code?
>> Nope, sorry." :((
>>
>> Carl
>>
>> -----Original Message-----
>> From: Dean Reece [mailto:email@hidden]
>> Sent: Thursday, May 05, 2005 8:34 PM
>> To: Carl Smith
>> Cc: Darwin Drivers Mailing List
>> Subject: Re: Obtaining Ethernet MAC address
>>
>> On May 5, 2005, at 5:29 PM, Carl Smith wrote:
>>
>>
>>> I wonder if someone could point me in the right direction as to be
>>> able to add code to my userland or driver, if need be, apps to be
>>> able to obtain the hardware MAC address of the inserted Ethernet
>>> cards. Pretty much the same way it is done from Systems/Network
>>> panel in the OS X?
>>>
>>>
>> Have a look at http://developer.apple.com/samplecode/
>> GetPrimaryMACAddress/listing1.html
>> It does exactly what you want.
>>
>>
>>> Is the code for the Systems/Network panel open code?
>>>
>>>
>> Nope, sorry.
>>
>> Cheers,
>>   - Dean

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.