From owner-freebsd-net Wed Dec 6 18: 4:31 2000 From owner-freebsd-net@FreeBSD.ORG Wed Dec 6 18:04:29 2000 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 7940037B400 for ; Wed, 6 Dec 2000 18:04:28 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.1/8.11.1) with ESMTP id eB722Wx19107; Thu, 7 Dec 2000 02:02:32 GMT (envelope-from brian@lan.awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.1/8.11.1) with ESMTP id eB725Ft44208; Thu, 7 Dec 2000 02:05:15 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200012070205.eB725Ft44208@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: oscar@163.net Cc: freebsd-net@FreeBSD.ORG, brian@Awfulhak.org Subject: Re: get tun0's ip from my program C In-Reply-To: Message from oscar@163.net of "Thu, 07 Dec 2000 09:27:41 +0800." <3A2EE78D.29432@bjapp4.163.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Dec 2000 02:05:15 +0000 From: Brian Somers Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Thank for all replys from friends. > But I want to know use C program to get = > the ip address, not script. > it must use network-interface ioctl and SIOCSIFADDR > as param.But I do not know how to do this. > Can anyone write a small example function to do this? src/usr.sbin/ppp/iface.c does this sort of thing using sysctl(). > thanks a lot. > = > oscar -- = Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message