snmpMIBBrowserGetAdditionalInfos()

Returns the additional information for the specified OIDs of a MIB file.

Function is used in the SNMP driver.

Synopsis

int snmpMIBBrowserGetAdditionalInfos(string mib_filename, dyn_string oids, dyn_mapping &addInfos);

Parameters

Parameter Description
mib_filename Absolute path to the MIB file.
oids List with OIDs whose additional information should be returned.
addInfos

Return parameter.

Additional information as mapping for every specified OID. If one of the specified OIDs was not found an empty mapping is returned.

Return value

This function returns 0 when it was executed successfully and in case of error -1.

Errors

MIB file does not exist, invalid format, etc.

Description

Returns the additional information for the specified OIDs of a MIB file.

The additional information are stored as key/value pairs in the mapping. The following entries ("keys") always exist in the mapping table:

  • NAME - item name

  • SYNTAX - data type of the item

  • MAX-ACCESS - maximal access authorization

  • DESCRIPTION - description

The data type of an item (SYNTAX) can have one of the following values which are provided as CTRL constants:

Data type CTRL constant Integer value
UNKNOWN MIB_BROWSER_SYNTAX_UNKNOWN 0
Integer32/INTEGER MIB_BROWSER_SYNTAX_INTEGER32 1
OCTETSTRING MIB_BROWSER_SYNTAX_OCTETSTRING 2
OBJECTIDENTIFIER MIB_BROWSER_SYNTAX_OBJECTIDENTIFIER 3
Unsigned32 MIB_BROWSER_SYNTAX_UNSIGNED32 4
Integer64 MIB_BROWSER_SYNTAX_INTEGER64 5
Unsigned32 MIB_BROWSER_SYNTAX_UNSIGNED64 6
Float32 MIB_BROWSER_SYNTAX_FLOAT32 7
Float64 MIB_BROWSER_SYNTAX_FLOAT64 8
Float128 MIB_BROWSER_SYNTAX_FLOAT128 9
ENUM MIB_BROWSER_SYNTAX_ENUM 10
BITS MIB_BROWSER_SYNTAX_BITS 11
Pointer MIB_BROWSER_SYNTAX_POINTER 12

The maximal access authorization ( MAX-ACCESS) can have one of the following values:

Access authorization CTRL constant Integer value Description
unknown MIB_BROWSER_ACCESS_UNKNOWN 0 no specified access authorization
not-accessible MIB_BROWSER_ACCESS_NOT_ACCESSIBLE 2 no access
accessible-for-notify MIB_BROWSER_ACCESS_ACCESSIBLE_FOR_NOTIFY 3 No direct access, accessible when using traps
read-only MIB_BROWSER_ACCESS_READ_ONLY 4 read access only
read-write MIB_BROWSER_ACCESS_READ_WRITE 5 read and write access

Furthermore, the following entries ("keys") can appear in the mapping:

  • STATUS

  • REFERENCE - textual cross reference

  • UNITS - unit

  • DEFVAL - default value

  • SYNTAX-INFO - holds any information about the value range of the item type (e.g. 0..1024 in case of an INTEGER) or the values of an ENUM type (e.g. off(0), on(1)).

The STATUS entry can have one of the following values:

Status CTRL constant Integer value
unknown MIB_BROWSER_STATUS_UNKNOWN 0
current MIB_BROWSER_STATUS_CURRENT 1
deprecated MIB_BROWSER_STATUS_DEPRECATED 2
mandatory MIB_BROWSER_STATUS_MANDATORY 3
optional MIB_BROWSER_STATUS_OPTIONAL 4
obsolete MIB_BROWSER_STATUS_OBSOLETE 5

Example

#uses "CtrlMIBBrowser"
main()
{
  string mibfile = "C:\MIB_Files\mib_file.mib";
  dyn_string oids = makeDynString("1.3.6.1.4.1.12148.9.8.12",
  "1.3.6.1.4.1.12148.9.3.21.3.1.10");
  dyn_mapping addinfos;
  snmpMIBBrowserGetAdditionalInfos(mibfile, oids, addinfos);
  DebugN(addinfos);
  dyn_string itemnames, itemoids;
  snmpMIBBrowserGetHierarchyNames(mibfile, "1.3.6.1.4.1.12148.9",
  itemnames, itemoids);
  DebugN(itemnames, itemoids);
  dynClear(itemnames);
  dynClear(itemoids);
  snmpMIBBrowserGetHierarchyNames(mibfile, "1.3.6.1.4.1.12148.9",
  itemnames, itemoids, true);
  DebugN(itemnames, itemoids);
}

Assignment

Miscellaneous functions

Availability

CTRL