From owner-freebsd-net Wed Jul 3 8:46:39 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5AC037B40B for ; Wed, 3 Jul 2002 08:46:34 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 5620843E42 for ; Wed, 3 Jul 2002 08:46:27 -0700 (PDT) (envelope-from andreas-moeller@gmx.net) Received: (qmail 25987 invoked by uid 0); 3 Jul 2002 15:45:52 -0000 Received: from p5084ac7d.dip.t-dialin.net (HELO gmx.net) (80.132.172.125) by mail.gmx.net (mp011-rz3) with SMTP; 3 Jul 2002 15:45:52 -0000 Message-ID: <3D231C18.8020408@gmx.net> Date: Wed, 03 Jul 2002 17:45:28 +0200 From: =?ISO-8859-1?Q?Andreas_M=F6ller?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020702 X-Accept-Language: de, en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: How to determine the address of a network interface? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, I am trying to write a small program in C that just outputs the IP address of an arbitrary network interface (like ifconfig, but only the address). The problem is, I don't know how I can determine the address and my programming experience is too limited in order to fully understand the ifconfig source code (I think ifconfig determines the address through the function in_status() in ifconfig.c, though I don't comprehend it). It would be nice if anybody could point out how I should proceed or where I can find more information. Thanks a lot in advance, Andreas PS: I apologize if this is the wrong list for my questions. Please also excuse any language mistakes since English is not my native language. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message