Search documentation of snmpkit

# SnmpKit.SnmpLib.MIB.Registry (snmpkit v1.3.17)

Standard SNMP MIB registry with name/OID resolution functions.

Provides the standard SNMP MIB objects and core resolution functionality that can be used by any SNMP application (managers, simulators, etc.).

# Summary

## Functions

children(parent_oid)

Find direct children of a parent OID.

resolve_name(name)

Resolve a MIB name to an OID list. Handles instance notation like "sysDescr.0".

reverse_lookup(oid)

Reverse lookup an OID to get the MIB name. Handles partial matches and instances.

standard_mibs()

Get the standard MIB registry map.

standard_mibs_reverse()

Get the reverse lookup map (OID -> name).

walk_tree(root_oid)

Walk the MIB tree from a root OID.

# Functions

# children(parent_oid)

Find direct children of a parent OID.

## Examples

    iex> SnmpKit.SnmpLib.MIB.Registry.children([1, 3, 6, 1, 2, 1, 1])
    {:ok, ["sysContact", "sysDescr", "sysLocation", "sysName", "sysObjectID", "sysServices", "sysUpTime"]}

# resolve_name(name)

Resolve a MIB name to an OID list. Handles instance notation like "sysDescr.0".

## Examples

    iex> SnmpKit.SnmpLib.MIB.Registry.resolve_name("sysDescr.0")
    {:ok, [1, 3, 6, 1, 2, 1, 1, 1, 0]}

    iex> SnmpKit.SnmpLib.MIB.Registry.resolve_name("sysDescr")
    {:ok, [1, 3, 6, 1, 2, 1, 1, 1]}

    iex> SnmpKit.SnmpLib.MIB.Registry.resolve_name("unknownName")
    {:error, :not_found}

# reverse_lookup(oid)

Reverse lookup an OID to get the MIB name. Handles partial matches and instances.

## Examples

    iex> SnmpKit.SnmpLib.MIB.Registry.reverse_lookup([1, 3, 6, 1, 2, 1, 1, 1, 0])
    {:ok, "sysDescr.0"}

    iex> SnmpKit.SnmpLib.MIB.Registry.reverse_lookup([1, 3, 6, 1, 2, 1, 1, 1])
    {:ok, "sysDescr"}

# standard_mibs()

Get the standard MIB registry map.

# standard_mibs_reverse()

Get the reverse lookup map (OID -> name).

# walk_tree(root_oid)

Walk the MIB tree from a root OID.

## Examples

    iex> SnmpKit.SnmpLib.MIB.Registry.walk_tree([1, 3, 6, 1, 2, 1, 1])
    {:ok, [{"sysDescr", [1, 3, 6, 1, 2, 1, 1, 1]}, {"sysObjectID", [1, 3, 6, 1, 2, 1, 1, 2]}, ...]}