v2

package
v0.0.0-...-a0c03a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2019 Cisco Systems, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() of.MIBRegistry

Return a new MIBRegistry pointer

Types

type MIBHandler

type MIBHandler struct {
	MapMIB map[string]of.MIB
}

func (*MIBHandler) LoadCacheFromFile

func (mh *MIBHandler) LoadCacheFromFile(path string) error

func (*MIBHandler) LoadJSONFromDir

func (mh *MIBHandler) LoadJSONFromDir(path string) error

func (*MIBHandler) LoadJSONFromFile

func (mh *MIBHandler) LoadJSONFromFile(path string) error

func (*MIBHandler) WriteCacheToFile

func (mh *MIBHandler) WriteCacheToFile(path string) error

type MIBHandlerer

type MIBHandlerer interface {
	// Load MIBs from a JSON file
	LoadJSONFromFile(path string) error
	// Load MIBs from JSON files placed in a dir
	LoadJSONFromDir(dir string) error
	// Load MIBs from cache
	LoadCacheFromFile(path string) error
	// Save MIBs cached into a file
	WriteCacheToFile(path string) error
}

Load MIBs from different inputs and write

type MIBRegistry

type MIBRegistry struct {
	// contains filtered or unexported fields
}

MIBRegistry keeps the data for building the (OID, strings) map

func (*MIBRegistry) Load

func (mib *MIBRegistry) Load(src map[string]of.MIB) error

Load given map[oid]MIB into registry.

func (*MIBRegistry) MIB

func (mib *MIBRegistry) MIB(oid string) *of.MIB

Return MIB for given OID.

func (*MIBRegistry) ShortString

func (mib *MIBRegistry) ShortString(oid string) string

Return the last node to its name. Ex: 1.3.6.1.2.1.11.19 -> snmpInTraps.

func (*MIBRegistry) String

func (mib *MIBRegistry) String(oid string) string

Return display string for given OID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL