From owner-freebsd-hackers Thu Sep 14 22:56: 8 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from homer.softweyr.com (bsdconspiracy.net [208.187.122.220]) by hub.freebsd.org (Postfix) with ESMTP id 08DAA37B422 for ; Thu, 14 Sep 2000 22:56:07 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=softweyr.com ident=Fools trust ident!) by homer.softweyr.com with esmtp (Exim 3.16 #1) id 13ZocG-0000Pu-00; Fri, 15 Sep 2000 00:04:52 -0600 Message-ID: <39C1BC04.4A534A80@softweyr.com> Date: Fri, 15 Sep 2000 00:04:52 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.75 [en] (X11; U; FreeBSD 4.1-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: ptacek@dashmail.net Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Getting all the IP address for a machine from code... References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Chris Ptacek wrote: > > I am looking for a way to get all the IP addresses that are configured a > machine. I need to do this in c source code, and without using DNS services > (ie: gethostname/gethostbyname won't work). I am hoping there are some > system calls I can use to get this information. Thanks in advance for any > help. Look in /usr/src/sbin/ifconfig/*.c and cut out the parts you don't need. It's under a BSD license, so you are pretty much free to do as you wish. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message