Home
You are not currently signed in.

MIB Smithy

  1. Up to Table of Contents

Default Object Values (DEFVAL)

Starting with RFC 1212 and later versions, the OBJECT-TYPE macro allows specification (via the DEFVAL clause) of a default value that an instance of the object will take during initialization or row creation. As well, Variations defined in an AGENT-CAPABILITIES statement allow specification of such defaults on a per-implementation basis where the OBJECT-TYPE doesn't specify a default, or where the implementation uses a different default. MIB Smithy allow specification of default values from the Defval page of the appropriate workspace.

Default Value

Figure - Default Value Property

Value Type

The allowed forms for default values depend on the data type for the object (for example, character, hex or binary strings for OCTET STRINGs, numeric values for Integer32). To specify a default value, you first need to select a Value Type so that MIB Smithy knows the proper syntax to use in the generated MIB module. The appropriate fields for the selected type will be activated and others disabled. To delete an existing default value from the record, select the No Default Value option. Other options are described further below.

String Value

The String Value option for the Value Type is used to indicate that the default value will be a simple quoted character string. You do not need to include the quotes in the specified value: MIB Smithy will add them for you. Leave the Value field blank for an empty string (i.e., "").

Hex Value

The Hex Value option for the Value Type is used to indicate that the default value will be a hexadecimal value. Hex string values are generally used for OCTET STRING and related data types such as the BITS construct, although they can also be used for integer types. BITS default values are also sometimes specified as an Identifier List. Hex strings are specified using two single-quote characters surrounding zero or more pairs of hex digits (0123456789ABCDEF) followed by the letter H. SMI rules require there to be an even number of hex digits. Examples:

  • ''H
  • '00'H
  • '7FFFFFFF'H

Binary Value

The Binary Value option for the Value Type is used to indicate that the default value will be a binary value. Binary strings are also generally used for OCTET STRING and other places where a Hex Value is also appropriate. They are specified using two single-quote characters surrounding zero or more octuplets of binary digits (01) followed by the letter B. SMI rules require a multiple of 8 bits digits. Examples:

  • ''B
  • '00000000'B
  • '0101010101010101'B
Although SMIv2 allows hex and binary strings to use lowercase letters, ASN.1 does not and some implementations cannot handle them. For compatibility, it is recommended that you use uppercase letters, both for hex digits and for the H and B suffixes.

Integer Value

The Integer Value option for the Value Type is used to indicate that the default value will be a simple integer value, used with objects of type INTEGER, Integer32, Unsigned32, Gauge32, TimeTicks, etc. Note that objects of type Counter, Counter32 and Counter64 may not have default values by SMI rules, as they would be somewhat semantically meaningless.

Identifier Value

The Identifier option for the Value Type is used to indicate that the default value will be a simple identifier (starting with a lowercase letter). This form is used for specifying a default by name for enumerated INTEGER objects or to reference a named OID for objects of type OBJECT IDENTIFIER. SMIv2 requires this form to be used for OBJECT IDENTIFIERs, rather than the multi-component OID Value form that SMIv1 accepts.

Identifier List Value

The Identifier List option for the Value Type is used to indicate that the default value will take the form of a list of list of bit names, used with objects of type BITS. This option is available as an alternative to a hex or binary string where a MIB author desires to represent the default value in a more symbolic form.

To add an identifier to the list, enter it into the Identifier field and press the "List Add" button. To remove an identifier from the list, select its name and press the "List Remove" button. The order that the identifiers appear is not significant, although it's suggested that they be listed in order of increasing bit value.

OID Value

The OID Value option for the Value Type is used to indicate that the default value will take the form of a multi-component OBJECT IDENTIFIER (such as { 0 0 }). The forms accepted are the same as those accepted elsewhere, as detailed in Object Identifier Values. This form is allowed only by SMIv1. SMIv2 requires that default values of this form be converted to a simple Identifier form when migrating a MIB module from SMIv1 to SMIv2.

NetworkAddress Value

The NetworkAddress Value option for the Value Type is used to indicate that the default value will be of a form acceptable to objects using the SMIv1 NetworkAddress type. Default values of this type consist of two parts: an Address Type (corresponding to the CHOICE syntax used to define NetworkAddress) and an Address Value containing the address in an appropriate form for the Address Type. Of course, NetworkAddress only ever defined an internet choice (for an IP Address), so normally the only options available will be internet and an allowed form for an IP Address, which takes an String style value (e.g. a hex string). It does not take a dotted numeric form like "255.255.255.0" -- this is invalid!

Also note that NetworkAddress is obsolete. It is not an allowed type in SMIv2 (which provides the IpAddress type instead), so neither is it legal to specify a default value of this type in SMIv2.

  1. Up to Table of Contents