Re: Mac hardware addresses
Re: Mac hardware addresses
- Subject: Re: Mac hardware addresses
- From: mm w <email@hidden>
- Date: Wed, 15 Jul 2009 18:50:36 +0200
Hello,
hop various ways to do this:
http://code.google.com/p/le-depotoir/source/browse/trunk/user-set/get_ifaddrs.c
http://code.google.com/p/le-depotoir/source/browse/trunk/misc/SCNetworkAddition/SCNetworkAddition.c
http://code.google.com/p/system-info/source/browse/trunk/sysinfo-inet.c
if it helps noobs, those are samples so do your job improve them, +
what Michael pointed you,
+ it might be a good advice: read the ioctl header to know which calls
are allowed/supported/public and "extend" this concept.
Best
On Wed, Jul 15, 2009 at 9:53 AM, Michael Smith<email@hidden> wrote:
>
> On Jul 14, 2009, at 3:10 PM, Todd Heberlein wrote:
>
> Look at getifaddrs(2). It's far and away the easiest way to do this. Walk
> the list you get back looking for AF_LINK addresses (and anything else you
> want at the same time).
>
> Thanks. In case someone runs across this thread in the
> future when looking to solve a similar problem, here is some C++ test code
> that prints the ethernet addresses on my machine.
>
> You might want to look at link_ntoa(3) and addr2ascii(3), as either of these
> would trivialise your code.
> Also, you forgot to call freeifaddrs() at the end of your example.
> = Mike
> --
> The lyf so short, the craft so long to lerne -- Chaucer
>
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden