pdu

package
v0.0.0-...-2d9b47a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndexValueByName

func IndexValueByName(mibStore smi.Store, pdu *gosnmp.SnmpPDU,
	indexName string) (string, error)

IndexValueByName returns the value of the index specified by indexName in the OID of the provided PDU.

func IndexValues

func IndexValues(mibStore smi.Store, pdu *gosnmp.SnmpPDU) ([]string, error)

IndexValues returns the index portion of the OID of the specified PDU.

Types

type Index

type Index struct {
	Name  string
	Value string
}

Index represents a constraint on a PDU query. It consists of a name/OID indicating an index, and the value of that index.

type Store

type Store interface {
	Add(p *gosnmp.SnmpPDU) error
	Clear() error
	GetScalar(oid string) (*gosnmp.SnmpPDU, error)
	GetTabular(oid string, indexes ...Index) ([]*gosnmp.SnmpPDU, error)
}

Store is an interface for adding SNMP PDUs and flexibly querying those stored PDUs.

func NewStore

func NewStore(mibStore smi.Store) (Store, error)

NewStore returns a new Store.

Jump to

Keyboard shortcuts

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