From owner-freebsd-hackers Mon Dec 4 4:19:31 2000 From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 4 04:19:29 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (beleriand.online.bg [195.138.137.181]) by hub.freebsd.org (Postfix) with SMTP id CF61137B400 for ; Mon, 4 Dec 2000 04:19:21 -0800 (PST) Received: (qmail 7866 invoked by uid 1000); 4 Dec 2000 12:18:41 -0000 Date: Mon, 4 Dec 2000 14:18:41 +0200 From: Peter Pentchev To: oscar@163.net Cc: freebsd-hackers@freebsd.org Subject: Re: get tun0's ip from my program Message-ID: <20001204141841.C614@ringworld.oblivion.bg> Mail-Followup-To: oscar@163.net, freebsd-hackers@freebsd.org References: <3A2B8A42.09234@bjapp6.163.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A2B8A42.09234@bjapp6.163.net>; from oscar@163.net on Mon, Dec 04, 2000 at 08:12:50PM +0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Dec 04, 2000 at 08:12:50PM +0800, oscar@163.net wrote: > I want to get tun0's two ip addresses. > and add ipfw rules to system at my program. > How can I do it?is there a function? or > have document describe it. someone please tell me! > thank you! See the tun(4) manpage, it describes the tun interface. It refers to 'the usual network-interface ioctl(2)s, such as SIOCSIFADDR and SIOCSIFNETMAS'. I think in this case you need something like SIOCGIFADDR. As usual when talking about network interfaces, my recommendation would be 'see the ifconfig(8) source, ifconfig usually knows how to do its job'. Hope that helps. G'luck, Peter -- If this sentence didn't exist, somebody would have invented it. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message