Documentation
¶
Overview ¶
Package mibc compiles SMIv1/SMIv2 MIB modules into the agent's SNMP manifests and trap profiles (INF-014, INF-015, gap G-20), so a vendor MIB can be polled and its traps named without hand-written YAML. It is our own small parser: it reads the subset of the MIB grammar that names objects (OBJECT IDENTIFIER, OBJECT-TYPE, NOTIFICATION-TYPE, TRAP-TYPE and the other macro invocations that assign an OID), textual conventions and type assignments. MACRO bodies are skipped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler resolves names across every module added to it.
func (*Compiler) Add ¶
Add registers parsed modules. A later definition of a name replaces an earlier one.
type Object ¶
type Object struct {
Name, Module string
Macro string // OBJECT-TYPE, NOTIFICATION-TYPE, TRAP-TYPE, OBJECT IDENTIFIER, ...
Parent string // first component of the OID value
Sub []int // the numeric components after Parent
Syntax string // base type name, e.g. Counter64, INTEGER, DisplayString
SequenceOf string // SYNTAX SEQUENCE OF <entry type>: this object is a table
Enum map[int]string
Units string
Access string
Index []string
Augments string
Objects []string // NOTIFICATION-TYPE OBJECTS, TRAP-TYPE VARIABLES
Enterprise string // TRAP-TYPE ENTERPRISE
Description string
Line int
}
Object is one named node of a module.