From owner-freebsd-questions@FreeBSD.ORG Tue Feb 20 21:24:43 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AA5E16CA2E for ; Tue, 20 Feb 2007 21:24:40 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.freebsd.org (Postfix) with ESMTP id 0233913C478 for ; Tue, 20 Feb 2007 21:24:39 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay7.apple.com (a17-128-113-37.apple.com [17.128.113.37]) by mail-out3.apple.com (8.13.8/8.13.8) with ESMTP id l1KLOdMt020956; Tue, 20 Feb 2007 13:24:39 -0800 (PST) Received: from relay7.apple.com (unknown [127.0.0.1]) by relay7.apple.com (Symantec Mail Security) with ESMTP id 6BA783007C; Tue, 20 Feb 2007 13:24:39 -0800 (PST) X-AuditID: 11807125-a2306bb0000007df-a4-45db6717db80 Received: from [17.214.13.96] (cswiger1.apple.com [17.214.13.96]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay7.apple.com (Apple SCV relay) with ESMTP id 56DA030003; Tue, 20 Feb 2007 13:24:39 -0800 (PST) In-Reply-To: <45DB63B1.7050004@swehack.se> References: <45DB63B1.7050004@swehack.se> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Tue, 20 Feb 2007 13:24:38 -0800 To: nocturnal X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-questions@freebsd.org Subject: Re: Which file to request SIOCGIFMAC on? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2007 21:24:45 -0000 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