SnmpKit.MIB.Resolver (snmpkit v2.0.1)

Pure functions over name->OID and OID->name maps: forward and reverse lookups (with instance suffixes), children, subtree walks and normalisation of parsed OID representations. SnmpKit.SnmpMgr.MIB holds the maps; this module never touches process state, so it is safe to call from anywhere.

Summary

Functions

build_reverse_map(name_to_oid_map)

find_children(parent_oid, name_to_oid_map)

find_partial_match(oid, oid_to_name_map, length)

find_partial_reverse_match(oid, oid_to_name_map)

normalize_name_to_oid(raw)

normalize_parsed_oid(oid)

parse_instance(instance_str)

resolve_definition_oids(definitions, known \\ %{})

@spec resolve_definition_oids([map()] | %{required(String.t()) => map()}, %{
  required(String.t()) => [integer()]
}) :: %{required(String.t()) => [integer()]}

Resolves the OIDs of a MIB's definitions (parsed maps or a compiled symbols table) to full integer lists.

Definitions carry either an absolute OID, a {parent_name, sub_ids} tuple, or (for OBJECT IDENTIFIER assignments) parent and sub_index fields. Parents are looked up in known (names already in the registry) and among the definitions themselves, iterating until nothing more resolves, so definition order does not matter. Returns %{name => oid_list}.

resolve_name(name, name_to_oid_map)

reverse_lookup_oid(oid, oid_to_name_map)

strip_instance_suffix(name)

walk_tree_from_root(root_oid, name_to_oid_map)