From owner-freebsd-questions@FreeBSD.ORG Sat Jun 2 00:16:37 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8237316A468 for ; Sat, 2 Jun 2007 00:16:37 +0000 (UTC) (envelope-from jhein@timing.com) Received: from Daffy.timing.com (mx2.timing.com [206.168.13.218]) by mx1.freebsd.org (Postfix) with ESMTP id 5103F13C458 for ; Sat, 2 Jun 2007 00:16:37 +0000 (UTC) (envelope-from jhein@timing.com) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by Daffy.timing.com (8.13.1/8.13.1) with ESMTP id l51NchN0076203; Fri, 1 Jun 2007 17:38:43 -0600 (MDT) (envelope-from jhein@timing.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.13.8/8.13.8) with ESMTP id l51NcaDj089611; Fri, 1 Jun 2007 17:38:36 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.1/8.14.1/Submit) id l51NcZ1r089608; Fri, 1 Jun 2007 17:38:35 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18016.44539.641157.324860@gromit.timing.com> Date: Fri, 1 Jun 2007 17:38:35 -0600 From: John E Hein To: bsenthil In-Reply-To: <46607E95.4030409@adventnet.com> References: <46607E95.4030409@adventnet.com> X-Mailer: VM 7.19 under Emacs 22.0.99.1 X-Spam-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_20, DK_POLICY_SIGNSOME autolearn=disabled version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on Daffy.timing.com Cc: freebsd-questions@freebsd.org Subject: Re: get/set ifconfig entries through by programmatically X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2007 00:16:37 -0000 bsenthil wrote at 01:46 +0530 on Jun 2, 2007: > 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" . - use SIOCAIFADDR ioctl; man netintro(4) - see source code in /usr/src/sbin/ifconfig - the hacky approach using system(3): system("ifconfig fxp0 1.2.3.4/24"); [cross-post to embedded@freebsd.org removed]