Because DISPLAY-HINTs are always reversible, object values returned by SNMP Get, Get-Next, and Get-Bulk requests are returned in raw form, unformatted for display. For example, OBJECT IDENTIFIER values are returned in dotted number form, enumerated integers in integer form, and OCTET STRINGs as raw binary strings (byte arrays in Tcl_Obj terms). With the exception of symbolic OIDs and enumerated integers these are also the only forms accepted for sending in a request.
MIB Smithy SDK does, however, provide limited facilities for inverting the formatting of values (where possible) to the raw form necessary for sending in a request. Inversion (scanning) is done according to the data type, enumerations, and DISPLAY-HINT, as applicable for a specified record and value.
The API can be called through either the SMI Database command or an SNMP Session command. In the latter case, the command is passed on to the SMI Database that is associated with the session.
% dbcmd scan ?options? record ?syntax? value
% dbcmd scan ?options? syntax value
% snmpcmd scan ?options? record ?syntax? value
% snmpcmd scan ?options? syntax value
dbcmd
snmpcmd
record
syntax
value
Using both record
and syntax
parameters is useful for applying default inversion rules for variables according to SNMP data type for which the OID.
6
for RowStatus's destroy
.$db get -fulloid
), such as 1.3.6.1.2.1.1.1.0
for sysDescr.0
.-enumformat format
-nocomplain
-oidformat format
-strformat format
-ticksformat format
% smilib scan RowStatus destroy 6
% smilib scan Hundredths 0.100 100
% smilib scan RowPointer sysDescr.0 1.3.6.1.2.1.1.1.0
% smilib scan DateAndTime 2005-11-1,12:0:0 "\x07\xd5\x0b\x01\x0c\x00\x00"
% smilib scan "OCTET STRING" "\x07\xd5\x0b\x01\x0c\x00\x00" "\x07\xd5\x0b\x01\x0c\x00\x00"