Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jun 2004 10:52:10 +0400 (MSD)
From:      Dmitry Morozovsky <marck@rinet.ru>
To:        Ivan Voras <ivoras@fer.hr>
Cc:        hackers@freebsd.org
Subject:   Re: Getting MAC address?
Message-ID:  <20040626104947.T93253@woozle.rinet.ru>
In-Reply-To: <40DCC57F.5090209@fer.hr>
References:  <40DCC57F.5090209@fer.hr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 26 Jun 2004, Ivan Voras wrote:

IV> How to get the MAC address for an (ethernet) interface? The linux code
IV> does this:
IV> 	retval = ioctl(thisint->sockInt, SIOCGIFHWADDR, &ifr);
IV>
IV> After some searching, I found SIOCSIFLLADDR ioctl, but it appears there
IV> isn't a "GET" counterpart.
IV>
IV> (I've got interface name & index available...)

Take a look at ifconfig(8) source.

getifaddrs(3), case when sa_family == AF_LINK

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040626104947.T93253>