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<maxIndex;i++))
(not all languages have a "forall objects of this class" construct),
and other similar advantages. As far as how to display to a human,
you are absolutely correct that ifName is more interpretable, but
ifNumber has broader functional applicability.
--
Clark K. Gaylord
Blacksburg, Virginia USA
[EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message