Re: Get mac address of physical NIC card from firmware
Re: Get mac address of physical NIC card from firmware
- Subject: Re: Get mac address of physical NIC card from firmware
- From: "Justin C. Walker" <email@hidden>
- Date: Wed, 27 Apr 2011 13:19:29 -0700
On Apr 27, 2011, at 05:43 , Prashant Saxena wrote:
> Hi,
>
> I made this new tool to get various info of all the ethernet adapters available.
> The source code as well as an executable is attached here with. I have few
> questions:
Sounds like your code is tightly bound to Linux, which Mac OS X is not.
Two possible options to explore (in addition to rolling your own somehow):
- use getifaddrs(3) - see the man page; it returns a linked list of structures that describe the various adaptors in the system (or, at least, the ones that admit to being network interfaces).
- use the SystemConfiguration framework, which is a "higher level" API to manage network configurations.
There is source available for ifconfig, which uses getifaddrs; netstat, which uses the underlying BSD apis; and scutil, which uses the SystemConfiguration framework. The first two are (essentially) BSD code; the latter is Mac OS X.
You can browse/download the code at
<http://opensource.apple.com>
It requires a developer account, for which you register. You can do it for free, or sign up for real money (and more stuff).
HTH
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden