From owner-freebsd-net Fri May 18 4:39:13 2001 Delivered-To: freebsd-net@freebsd.org Received: from e028121.vtacs.vt.edu (e028121.vtacs.vt.edu [63.164.28.121]) by hub.freebsd.org (Postfix) with ESMTP id A238037B643 for ; Fri, 18 May 2001 04:39:08 -0700 (PDT) (envelope-from gaylord@e028121.vtacs.vt.edu) Received: by e028121.vtacs.vt.edu (Postfix, from userid 1000) id A3EF12F; Fri, 18 May 2001 07:39:10 -0400 (EDT) Date: Fri, 18 May 2001 07:39:10 -0400 From: Clark Gaylord To: vishwanath pargaonkar Cc: freebsd-net@freebsd.org Subject: Re: ifindex Message-ID: <20010518073910.A74590@e028121.vtacs.vt.edu> References: <20010518050655.12153.qmail@web5301.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010518050655.12153.qmail@web5301.mail.yahoo.com>; from vishubp@yahoo.com on Fri, May 18, 2001 at 06:06:55AM +0100 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: X-Loop: FreeBSD.org On Fri, May 18, 2001 at 06:06:55AM +0100, vishwanath pargaonkar wrote: > why is ifindex used for an interface.i know it is said > itz for unique identification of device.Can we not do > that using interfac name ?what is significance of > ifindex for an interface. itz just a number associated > with an interface. You really haven't given enough context to understand where you want to use ifName rather than ifIndex, but the use of ifIndex is partly historical and partly practical. In the original MIB-II specification, there was no ifName, just ifDescription. As a desciptive label, ifName need not be defined on all pollable devices, so more general SNMP code can be written using ifIndex (which must exist). But also the ordinal ifNumber is natural for indexing arrays, walking tables, looping over indices (for (i=0;i