Ethereal-dev: Re: [ethereal-dev] packet-snmp.c and libsmi

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Thu, 29 Jun 2000 02:46:37 -0700
On Wed, Jun 28, 2000 at 03:10:38PM +0200, Juergen Schoenwaelder wrote:
> Looking further at the patch, I think it is necessary to first get
> agreement what the desirable out is. I think there are two different
> things one can display:
> 
> (a) The plain data as it is contained in the SNMP packet.
> 
> (b) The semantically more meaningful data according to the MIB
>     definition.
> 
> An example to make things clearer:
> 
> (a)
> 
> 1.3.6.1.2.1.2.2.1.7.1 = [INTEGER] 1
> 1.3.6.1.2.1.25.3.8.1.8.769 = [OCTET STRING] 00:00:01:01:00:00:00:00
> 1.3.6.1.2.1.25.5.1.1.2.222 = [INTEGER] 44
> 
> (b)
> 
> IF-MIB::ifAdminStatus.1 = [Enumeration] up(1)
> HOST-RESOURCES-MIB::hrFSLastFullBackupDate.769 = [DateAndTime] 0-1-1,0:0:0.0
> HOST-RESOURCES-MIB::hrSWRunPerfMem.222 = [Integer32] 44 KBytes

Well, the current code should display the first of those as:

	Object identifier 1: 1.3.6.1.2.1.2.2.1.7.1 (IF-MIB::ifAdminStatus.1)
	Value: up(1)

I.e., it displays *both* the OID as a string of subids *and* as
Module:subid-within-module, and displays enumerated types both as the
enumerated value *and* the raw numeric value; this is similar to what
Ethereal (and at least some other dissectors) do for a number of other
fields that can be interpreted symbolically, i.e.  displays both the
symbolic value and the raw numeric value.

The libsmi version would display the OID the same way, and would display
the value as

	Value: INTEGER: up(1)

again showing both the symbolic and numeric value.

That's what I think is the correct way to handle this.

As for the "DateAndTime" and "KBytes" values, I don't see anything in
the MIB file that would tell Ethereal that they should be displayed as
anything other than a bunch of octets and a number, respectively (there
are comments, but those tell a human bout the string) - how are you
proposing to teach a dissector about those definitions in the
HOST-RESOURCES-MIB, and the proper way to display variables of those
types?