snmp_utilities

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OIDAuthFailure string = "1.3.6.1.6.3.15.1.1.5.0"

OID returned if an authentication fialure occurs.

View Source
var OIDMACAddressesNoVLAN = "1.3.6.1.2.1.17.4.3.1.2"

The OID for NON-VLAN mac address table. Only valid if the switch is configured with "enable-dot1d-mibwalk" first!

View Source
var OIDMacAddressSourceNoVLAN = "1.3.6.1.2.1.17.4.3.1.3"

The OID for non-VLAN learned-mac sources. Also only valid if configured with "enable-dot1d-mibwalk".

View Source
var OIDMacAddressSourceWithVLAN string = "1.3.6.1.2.1.17.7.1.2.2.1.3"

The OID for the source information for VLANs

View Source
var OIDMacAddressesWithVLAN string = "1.3.6.1.2.1.17.7.1.2.2.1.2"

The OID for the mac address table (with VLANs - should be there on all switches)

View Source
var OIDModelNumber string = "1.3.6.1.2.1.47.1.1.1.1.13.2"

The OID which has the model number of the switch

View Source
var OIDPortNumberifIndex string = "1.3.6.1.2.1.17.1.4.1.2"

The OID which maps physical port numbers to ifIndexes

View Source
var OIDSysDescr string = "1.3.6.1.2.1.1.1.0"

OID for querying the full name and version identification of a switches software operating-system and networking software.

View Source
var OIDifIndexPortNameMap string = "1.3.6.1.2.1.31.1.1.1.1"

The OID which maps ifIndexes to human-readable names

Functions

func GetSNMPOjbect

func GetSNMPOjbect(managementSwitch switches.ManagementSwitch) (snmp *snmpgo.SNMP, err error)

func MacAddressFromOID

func MacAddressFromOID(OID string) (macAddress string, err error)

Types

type MockSNMP

type MockSNMP struct {
	SwitchXname string
}

Generic mock interface for testing.

func (MockSNMP) GetMACPortNameTable

func (snmpInterface MockSNMP) GetMACPortNameTable(map[int]int, map[int]string) (macPortMap map[string]string,
	err error)

func (MockSNMP) GetPortMap

func (snmpInterface MockSNMP) GetPortMap() (portMap map[int]string, err error)

func (MockSNMP) GetPortNumberMap

func (snmpInterface MockSNMP) GetPortNumberMap() (portNumberMap map[int]int, err error)

type RealSNMP

type RealSNMP struct {
	SNMP *snmpgo.SNMP
}

Real interface.

func (RealSNMP) GetMACPortNameTable

func (snmpInterface RealSNMP) GetMACPortNameTable(portNumberIfIndexMap map[int]int,
	ifIndexPortNameMap map[int]string) (macPortMap map[string]string, err error)

func (RealSNMP) GetPortMap

func (snmpInterface RealSNMP) GetPortMap() (portMap map[int]string, err error)

func (RealSNMP) GetPortNumberMap

func (snmpInterface RealSNMP) GetPortNumberMap() (portNumberMap map[int]int, err error)

type SNMPInterface

type SNMPInterface interface {
	GetPortMap() (portMap map[int]string, err error)
	GetPortNumberMap() (portNumberMap map[int]int, err error)
	GetMACPortNameTable(portNumberIfIndexMap map[int]int, ifIndexPortNameMap map[int]string) (
		macPortMap map[string]string, err error)
}

Jump to

Keyboard shortcuts

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