From owner-freebsd-hackers Tue Jun 18 13:42: 5 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from c000.snv.cp.net (h001.c000.snv.cp.net [209.228.32.65]) by hub.freebsd.org (Postfix) with SMTP id 5228F37B411 for ; Tue, 18 Jun 2002 13:41:03 -0700 (PDT) Received: (cpmta 14384 invoked from network); 18 Jun 2002 13:41:02 -0700 Received: from 63.114.153.104 (HELO wooten.com) by smtp.wooten.com (209.228.32.65) with SMTP; 18 Jun 2002 13:41:02 -0700 X-Sent: 18 Jun 2002 20:41:02 GMT Message-ID: <3D0F9ADE.8070103@wooten.com> Date: Tue, 18 Jun 2002 13:41:02 -0700 From: "Kevin D. Wooten" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Watson Cc: freebsd-hackers@freebsd.org Subject: Re: Retrieving interface MAC address References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Robert Watson wrote: >I tend to retrieve address information about interfaces using >getifaddrs(), which will (among other things) retrieve the link layer >addresses of an interface. It might be overkill for your application, >however. > >Robert N M Watson FreeBSD Core Team, TrustedBSD Projects >robert@fledge.watson.org Network Associates Laboratories > >On Tue, 18 Jun 2002, Kevin D. Wooten wrote: > > > >>How can I go about retrieving the MAC address for an interface? Since >>SIOCGHWADDR doesn't seem to be implemented. Can anyone help?? >> >>Thanks, >>Kevin Wooten >> >> >>To Unsubscribe: send mail to majordomo@FreeBSD.org >>with "unsubscribe freebsd-hackers" in the body of the message >> >> >> > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-hackers" in the body of the message > > > > Thanks getifaddrs() works great, just one more thing is there a simple way to tell the difference between "real" interfaces and virtual ones? I could obviously exclude the easy ones ( i.e. lo, lp, faith, ... ) by looking at the name, but I am not sure how many different virtual interfaces there are ( or will be ). Thanks Again, Kevin Wooten To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message