From owner-freebsd-hackers Fri Sep 15 20:15:26 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from Awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id 443AE37B42C for ; Fri, 15 Sep 2000 20:15:24 -0700 (PDT) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.0/8.11.0) with ESMTP id e8G3BEv32249; Sat, 16 Sep 2000 04:11:14 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.0/8.11.0) with ESMTP id e8G3BAn15495; Sat, 16 Sep 2000 04:11:11 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200009160311.e8G3BAn15495@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: ptacek@dashmail.net Cc: freebsd-hackers@FreeBSD.org, brian@Awfulhak.org Subject: Re: Getting all the IP address for a machine from code... In-Reply-To: Message from "Chris Ptacek" of "Wed, 13 Sep 2000 20:12:47 PDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 16 Sep 2000 04:11:10 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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. This is a bit late.... I'd favour copying src/usr.sbin/portmap/from_local.c (a reasonably recent version of the code). It can be built as a main program that literally just outputs a list of local IP numbers. > - Chris -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message