|
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 |
|---|---|
SMIv1 MIB Data Types
| Data Type Name | Description |
|---|---|
|
Specifies a value whose range may include both positive
and negative numbers.
Examples:
| |
|
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:
| |
|
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. | |
|
Specifies a value which represents a count. The range is 0 to 4294967295. | |
|
Specifies the elapsed time between two events, in units of hundredth of a second. The range is 0 to 2e32 - 1. | |
|
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:
| |
|
Identifies a type that has an assigned Object Identifier value | |
|
Specifies an IPv4 address as a string of 4 octets. | |
|
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. | |
|
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:
|
SMIv2 MIB Data Types
| Data Type Name | Description |
|---|---|
|
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:
| |
|
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:
| |
|
Specifies a value whose range includes only non-negative integers (0 to 2e31 - 1).
Examples:
| |
|
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. | |
|
Specifies a value which represents a count. The range is 0 to 4294967295. | |
|
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. | |
|
Specifies the elapsed time between two events, in units of hundredth of a second. Range is 0 to 2e32 - 1. | |
|
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:
| |
|
Identifies a type that has an assigned Object Identifier value. | |
|
Specifies an IPv4 address as a string of 4 octets. | |
|
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:
| |
|
Specifies a collection of labeled bits. It provides a way to label individual bits in an octet (an extension of OCTET STRING type).
Example:
|
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[] |
|