From owner-freebsd-embedded@FreeBSD.ORG Fri Jun 1 20:56:31 2007 Return-Path: X-Original-To: freebsd-embedded@freebsd.org Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7341716A421; Fri, 1 Jun 2007 20:56:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 15B6813C457; Fri, 1 Jun 2007 20:56:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l51Kr4F6087261; Fri, 1 Jun 2007 14:53:04 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 01 Jun 2007 14:53:22 -0600 (MDT) Message-Id: <20070601.145322.1169729966.imp@bsdimp.com> To: bsenthil@adventnet.com From: "M. Warner Losh" In-Reply-To: <46607E95.4030409@adventnet.com> References: <46607E95.4030409@adventnet.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 01 Jun 2007 14:53:04 -0600 (MDT) Cc: freebsd-questions@freebsd.org, freebsd-embedded@freebsd.org Subject: Re: get/set ifconfig entries through by programmatically X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 20:56:31 -0000 In message: <46607E95.4030409@adventnet.com> bsenthil writes: : Is it possible to get/set ifconfig entries through by programmatically. : If yes, please send me the code snippet ... : : I am trying to get/set ipaddress by executing the command "ifconfig" . To get the addresses, use the ifconfig-in-a-box interface getifaddrs(3). To set the address, you'll need to use the functions described in networking(4), specifically the SIOCAIFADDR and SIOCDIFADDR ioctls. Warner