From owner-freebsd-net@FreeBSD.ORG Tue Mar 5 15:53:43 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46BA846B for ; Tue, 5 Mar 2013 15:53:43 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1059F6 for ; Tue, 5 Mar 2013 15:53:42 +0000 (UTC) Received: from [209.249.190.124] (port=53951 helo=dhcp-10-2-210-24.hudson-trading.com) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80) (envelope-from ) id 1UCuBS-0005rG-Cu; Tue, 05 Mar 2013 10:53:42 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: how to get mac address info in kernel code? From: George Neville-Neil In-Reply-To: Date: Tue, 5 Mar 2013 10:53:42 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <8EB66934-D33C-425E-A076-66E31B618DCA@neville-neil.com> References: To: h bagade X-Mailer: Apple Mail (2.1499) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2013 15:53:43 -0000 On Mar 5, 2013, at 08:54 , h bagade wrote: > Hi all, >=20 > I need to get interface MAC address within the kernel code and I = couldn't > use "getifaddrs" because it's user-mode. How can I have the MAC = address > information within kernel code? >=20 > Any hints or comments are really appreciated. If you have access to the struct ifnet you can look at the if_addr = member, which is a struct ifaddr, defined in if_var.h . Best, George