Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2007 13:24:38 -0800
From:      Chuck Swiger <cswiger@mac.com>
To:        nocturnal <nocturnal@swehack.se>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Which file to request SIOCGIFMAC on?
Message-ID:  <AEC2C499-DC40-495A-9672-24BC2AA2CD0F@mac.com>
In-Reply-To: <45DB63B1.7050004@swehack.se>
References:  <45DB63B1.7050004@swehack.se>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Feb 20, 2007, at 1:10 PM, nocturnal wrote:
> I'm trying to get the ethernet address and from the manuals i  
> understand that i need the ifreq structure for this. So i'm trying  
> to request SIOCGIFMAC with ioctl on a socket of type SOCK_DGRAM.

If you're just targetting FreeBSD >= 5.x platforms, your current  
approach is reasonable (assuming you can fix whatever the problem  
is); if you're targetting other platforms such FreeBSD 4, Dfly, OS X,  
or SysV things like Solaris, try installing the libnet port and  
invoke libnet_get_hwaddr().

-- 
-Chuck




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?AEC2C499-DC40-495A-9672-24BC2AA2CD0F>