bottrap
< Prev Back to Table of Contents Next >

Determining Record Types

Given a search string, in particular an OID, it is often useful to determine what type of record it corresponds to. This information is available by way of the whatis database subcommand. The SDK also provides an API to perform the reverse action (seeing whether or not a record is of a specified type) using the is subcommand. See Built-in Pattern Matching for details.

Syntax:

% dbcmd whatis recordName

..where dbcmd is the name of the database and recordName is a record search string (name, OID, or combination of such) identifying the record in question. The response generally corresponds to the name of the macro used to define the record in normal SMI syntax.

Returns:

Value Meaning
undefined No record exists with the given search pattern.
file File Record.
module MIB Module.
moduleid MODULE-IDENTITY Statement.
typedef ASN.1 Type Assignment or TEXTUAL-CONVENTION.
valuedef ASN.1 Value Assignment (see note).
compliance MODULE-COMPLIANCE Statement.
capability AGENT-CAPABILITIES Statement.
conformance-module MODULE or SUPPORTS module reference ("conformance module") within an AGENT-CAPABILITIES or MODULE-COMPLIANCE statement.
conformance-group GROUP reference within MODULE-COMPLIANCE module reference.
variation OBJECT or VARIATION reference within an MODULE-COMPLIANCE or AGENT-CAPABILITIES module reference.
node OID Value Assignment or OBJECT-IDENTITY (see note).
object-group OBJECT-GROUP definition.
notify-group NOTIFICATION-GROUP definition.
notification NOTIFICATION-TYPE or TRAP-TYPE definition.
leaf OBJECT-TYPE definition (including tables/rows).
(*) ASN.1 value assignments of types other than OBJECT IDENTIFIER are forbidden by the SMI. The SDK treats OID value assignments as indistinguishable from OBJECT-IDENTITY statements without descriptions (although, strictly speaking, OBJECT-IDENTITY "registers" an OID while an OID value assignment does not according to the SMI rules). Therefore, when a module is loaded from file, this command will return "node" for OID value assignments as well as for OBJECT-IDENTITY statement. As well, the "node" record type should be used when creating either from Tcl.
< Prev Back to Table of Contents Next >