Re: [tkined] Is `BITS' a good datatype?

Juergen Schoenwaelder (schoenw@ibr.cs.tu-bs.de)
Wed, 8 Jul 1998 17:01:23 +0200

>>>>> Vincent Qing Yin writes:

Vincent> I'm implementing an SNMP agent on scotty for RFC2006 (Mobile
Vincent> IP.) I try to implement the following variable:

[snip]

Vincent> The scotty agent should read in a value "0" (or "0x0" from a
Vincent> text file to assign it to the instance variable. When
Vincent> issuing a GET from the manager, I get the following: % $s get
Vincent> mipEntities.0 genErr 0 {1.3.6.1.2.1.44.1.1.1.0 NULL {}}

Vincent> On the agent side, I get % unknown asn1 type 0x00 (snmp send
Vincent> reply)

Vincent> Does that mean the agent doesn't support `BITS' datatype, or
Vincent> does it mean I used the wrong representation ("0" or "0x00")
Vincent> for BITS?

There is a problem with BITS in 2.1.X. Below is a simple patch which
will tell the MIB parser to map the BITS data type to the underlying
OCTET STRING. The agent will accept values in the form of an OCTET
STRING value, e.g. 01. Support for labelled bits will very likely show
up in Tnm 3.0.0. The change below will go into the next patch.

Juergen

*** tnm/snmp/tnmMibParser.c.orig Thu Nov 13 12:04:33 1997
--- tnm/snmp/tnmMibParser.c Wed Jul 8 16:33:28 1998
***************
*** 143,150 ****
{ "OCTET", CONTINUE, 0 },
{ "OBJECTIDENTIFIER", ASN1_OBJECT_IDENTIFIER, 0 },
{ "OBJECT", CONTINUE, 0 },
! { "BIT", CONTINUE, 0 },
! { "BITSTRING", ASN1_BIT_STRING, 0 },
{ "NULL", ASN1_NULL, 0 },
{ "SEQUENCE", ASN1_SEQUENCE, 0 },
{ "OF", ASN1_SEQUENCE_OF, 0 },
--- 143,149 ----
{ "OCTET", CONTINUE, 0 },
{ "OBJECTIDENTIFIER", ASN1_OBJECT_IDENTIFIER, 0 },
{ "OBJECT", CONTINUE, 0 },
! { "BITS", ASN1_OCTET_STRING, 0 },
{ "NULL", ASN1_NULL, 0 },
{ "SEQUENCE", ASN1_SEQUENCE, 0 },
{ "OF", ASN1_SEQUENCE_OF, 0 },

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.