Overview

 

AdventNet SNMP API provides separate classes for all the base data types, such as Integer, Counter, and so on. Moreover, the textual convention objects do not need separate classes because they are resolved into base data types. The textual convention objects are handled internally in the mibs package. AdventNet SNMP API supports the TAddress, MacAddress, and DateAndTime, according to their definitions.

 

SNMP API supports the standard RFC's SMIv1 and SMIv2. The various data types for management information are given in the following table.

 

Data Types

 

SMIv1 Data Types SMIv2 Data Types

INTEGER
INTEGER (Enumerated)

Gauge

Counter

TimeTicks

OCTET STRING

OBJECT IDENTIFIER

IpAddress

NetworkAddress

Opaque

Integer32

INTEGER (Enumerated)

Unsigned32

Gauge32

Counter32

Counter64

TimeTicks

OCTET STRING

OBJECT IDENTIFIER

IpAddress

Opaque

BITS

 

SMIv1 MIB Data Types

 

Data Type Name Description

INTEGER

Specifies a value whose range may include both positive and negative numbers.
Range = -2e31 to 2e31 - 1 (SMIv1 does not specify minimum or maximum values for the range).

 

Examples:

  • INTEGER (0..127) -- corresponds to an unsigned 8-bit integer

  • INTEGER (0..40 | 50 | 65 | 90..100)

  • INTEGER (-2147483648..2147483647) -- corresponds to a signed 32-bit integer

INTEGER (Enumerated)

Specifies a list of labeled integer values. In SMIv1, the values should be greater than 0, whereas SMIv2 allows any values in the range (-2e31 to 2e31- 1)

 

Example:

  • INTEGER { true(1), false(2) }

Gauge

Represents a non-negative integer, which holds at the maximum or minimum value specified in the range when the actual value goes over or below the range, respectively.

Counter

Specifies a value which represents a count. The range is 0 to 4294967295.

TimeTicks

Specifies the elapsed time between two events, in units of hundredth of a second. The range is 0 to 2e32 - 1.

OCTET STRING

Specifies octets of binary or textual information. While SMIv1 doesn't limit the number of octets, SMIv2 specifies a limit of 65535 octets. A size may be specified which can be fixed, varying, or of multiple ranges.

 

Examples:

  • OCTET STRING -- length can vary from 0 to 65535 bytes

  • OCTET STRING (SIZE(0..255))

  • OCTET STRING (SIZE(4)) -- fixed length of 4 bytes.

  • OCTET STRING (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

OBJECT IDENTIFIER

Identifies a type that has an assigned Object Identifier value

IpAddress

Specifies an IPv4 address as a string of 4 octets.

NetworkAddress

Allows a network address of any type to be specified. However, it is now obsolete. A value of this type is an IPv4 address. SMIv2 supports this type through the IpAddress type.

Opaque

Specifies octets of binary information. SMIv2 specifies a limit of 65535 octets while there is no limit in SMIv1. A size may be specified which can be fixed, varying, or of multiple ranges. A value of this type must be an encapsulation of ASN.1 BER encoded value.

 

Examples:

  • Opaque -- length can vary from 0 to 65535 bytes

  • Opaque (SIZE(0..255))

  • Opaque (SIZE(4)) -- fixed length of 4 bytes.

  • Opaque (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

 

SMIv2 MIB Data Types

 

Data Type Name Description

Integer32

Specifies a value whose range may include both positive and negative numbers. Range is 2e31 to 2e31 - 1 (SMIv1 doesn't specify minimum or maximum values for the range).

 

Examples:

  • Integer32(0..127) -- corresponds to an unsigned 8-bit integer

  • Integer32 -- same as -- Integer32 (-2147483648..2147483647)

  • Integer32(0..40 | 50 | 65 | 90..100)

INTEGER (Enumerated)

Specifies a list of labeled integer values. In SMIv1 the values should be greater than 0, whereas SMIv2 allows any value in the range

( -2e31 to 2e31- 1).

 

Examples:

  • INTEGER { true(1), false(2) }

  • INTEGER { lessThan(-1), equal(0), greaterThan(1) }

Unsigned32

Specifies a value whose range includes only non-negative integers (0 to 2e31 - 1).

 

Examples:

  • Unsigned32 -- same as Unsigned32(0..4294967295)

  • Unsigned32(0..65535) -- corresponds to an unsigned 16 bit integer

  • Unsigned32(0..10 | 50 | 65 | 90..100)

Gauge32

Represents a non-negative integer, which holds at the maximum or minimum value specified in the range when the actual value goes over or below the range, respectively.

Counter32

Specifies a value which represents a count. The range is 0 to 4294967295.

Counter64

Similar to Counter32, except that the range is now (0 to 2e64 -1). This type may only be used when a 32-bit counter rollover could occur in less than an hour. Otherwise, the Counter32 type must be used.

It may only be used when backwards compatibility is not a requirement because this type is not available in SNMPv1.

TimeTicks

Specifies the elapsed time between two events, in units of hundredth of a second. Range is 0 to 2e32 - 1.

OCTET STRING

Specifies octets of binary or textual information. While SMIv1 doesn't limit the number of octets, SMIv2 specifies a limit of 65535 octets. A size may be specified which can be fixed, varying, or of multiple ranges.

 

Examples:

  • OCTET STRING -- length can vary from 0 to 65535 bytes.

  • OCTET STRING (SIZE(0..255))

  • OCTET STRING (SIZE(4)) -- fixed length of 4 bytes.

  • OCTET STRING (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

OBJECT IDENTIFIER

Identifies a type that has an assigned Object Identifier value.

IpAddress

Specifies an IPv4 address as a string of 4 octets.

Opaque

Specifies octets of binary information. SMIv2 specifies a limit of 65535 octets while there is no limit in SMIv1. A size may be specified which can be fixed, varying, or of multiple ranges. A value of this type must be an encapsulation of ASN.1 BER encoded value.

 

Examples:

  • Opaque -- length can vary from 0 to 65535 bytes.

  • Opaque (SIZE(0..255))

  • Opaque (SIZE(4)) -- fixed length of 4 bytes.

  • Opaque (SIZE(0 | 4 | 6)) -- varying with 0, 4, or 6 bytes

BITS

Specifies a collection of labeled bits. It provides a way to label individual bits in an octet (an extension of OCTET STRING type).

 

Example:

  • BITS {0 (tcp), 1(netware), 2(netbios)}

 

The following table lists all the various syntax supported in our SNMP API and their equivalent data type in Java.

 

S.No. MIB Syntax

Equivalent Data Type in Java

1

INTEGER

Integer

2

Integer32

Integer

3

Unsigned32

Long

4

Gauge/Gauge32

Long

5

Counter/Counter32

Long

6

Counter64

long[2]

7

TimeTicks

Long

8

OCTET STRING/BITS

byte[]

9

OBJECT IDENTIFIER

int[]

10

NULL

Null

11

IpAddress

byte[4]

12

Opaque

byte[]



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.