Tuesday, April 07, 2009

SNMP DataTypes

SNMP version 1 uses this following datatypes :
    INTEGER : a whole number (number of interfaces on a system).
    OCTET STRING : a string of octets which is used to represent hexadecimal data (physical address of an interface).
    OBJECT IDENTIFIER : a string of numbers derived for a naming tree, used to identify an object.
    NULL : an empty placeholder.
    ENUMERATED : a limited set of integers with an assigned meaning.
    BOOLEAN : an integer with values true (1) or false (2).
For a BIT STRING that is 32 bits less, turn it into a 32-bit INTEGER (calculating the number represented by the bits). If there are more than 32 bits, turn it into an OCTET STRING.

A few primitive datatypes , specific to SNMP applications, were added to the built-in primitives. These included :
    Counter (integer which increases until a maximum value and goes back to zero)
    Gauge (integer which increases and decreases)
    TimeTicks
    IpAddress
    NetworkAddress
    ...
Simple datatypes added to SNMP v2 :
    BIT STRING : hold enumerated lists of flags
    Integer32 : identical to INTEGER, range is -2 31 to 2 31 -1
    Counter32 : identical to COUNTER, range is 0 to 2 32 -1
    Gauge32 : identical to GAUGE, range is 0 to 2 32 -1
    NsapAddress : for OSI addresses
    Counter64 : range is 0 to 2 64
    Uinteger32 : unsigned integer, range is 0 to 2 32 -1

No comments: