From owner-freebsd-questions@FreeBSD.ORG Tue Apr 10 19:23:15 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 C9B5016A401 for ; Tue, 10 Apr 2007 19:23:15 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.7]) by mx1.freebsd.org (Postfix) with ESMTP id A8DB713C48C for ; Tue, 10 Apr 2007 19:23:15 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 19709 invoked from network); 10 Apr 2007 19:23:15 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 10 Apr 2007 19:23:15 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id A4B5528434; Tue, 10 Apr 2007 15:23:14 -0400 (EDT) To: bsenthil References: <461B66F9.1060309@adventnet.com> From: Lowell Gilbert Date: Tue, 10 Apr 2007 15:23:14 -0400 In-Reply-To: <461B66F9.1060309@adventnet.com> (bsenthil@adventnet.com's message of "Tue\, 10 Apr 2007 15\:59\:13 +0530") Message-ID: <44r6qsqbj1.fsf@be-well.ilk.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: get/set ifconfig details X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 19:23:15 -0000 bsenthil writes: > Is there any 'C' method API to get/ set ip address of the interface card. > Is there any 'C' method API to get ifconfig details of the interface card. > Is there any 'C' method API to set ifconfig details of the interface card. > > I try to get through "sysctl()" ... Is there any c sample code to get > ifconfig details .... How about the source code for ifconfig? [/usr/src/sbin/ifconfig] It's not simple, because it does a lot of things, but it is the best example of "ifconfig" type information. Note that it deals with an IP interface abstraction, not with an interface card directly. There can be more (or less) than one address on an interface. You need to understand a little better what you are actually after.