vendors

package
v0.0.0-...-3e46740 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Connect connects to the switch via SSH. The connection information is
	// provided via the first parameter. Keep in mind that the password is
	// not encrypted.
	Connect(cfg config.Connection) error
	// Disconnect disconnects from the switch.
	Disconnect() error

	// GetHardwareInfo returns the hardware information of the switch. The
	// HardwareInfo struct may contain not all information, depending on the
	// vendor.
	GetHardwareInfo() (*models.HardwareInfo, error)
	// ListArpTable returns the ARP table of the switch. The ARP table contains
	// all MAC addresses and the switch port they are connected to.
	ListArpTable() ([]models.ArpEntry, error)

	// ListInterfaces returns a list of all interfaces, build in the switch. The
	// interface list may contain not all information, depending on the vendor.
	ListInterfaces() ([]*models.Interface, error)
	// ConfigureInterface configures the interface with the given configuration.
	// Returns true if the interface was changed and false if not.
	ConfigureInterface(update *models.UpdateInterface) (bool, error)
	// GetInterface returns the interface with the given name. The interface
	// may contain not all information, depending on the vendor.
	GetInterface(name string) (*models.Interface, error)
	// ListLLDPNeighbors returns a list of neighbors, which are discovered
	// through LLDP. This information can be used to get insights about the
	// network topology or for debugging purposes.
	ListLLDPNeighbors() ([]models.LLDPNeighbor, error)

	// Logger returns the logger of the driver. This is a generic logger, which
	// can be overwritten by the vendor driver.
	Logger() *log.Logger
}

Driver is the interface, which all vendor drivers have to implement. The driver is responsible for connecting to the switch, getting information about the switch and configuring the switch. The driver can also overwrite the logger. Some vendors do not support all features, so some functions may return the "not implemented" error.

func New

func New(vendor Vendor) (Driver, error)

New returns a new driver for the given vendor. If the vendor is not supported, an error is returned.

type Vendor

type Vendor string

Vendor is the type for the vendor name. It is used to identify the vendor and to load the correct driver.

const (
	// VendorFSOSS3 FSComS3 (FiberStore), series S3XX
	VendorFSOSS3 Vendor = "fsos_s3"
	// VendorFSOSS5 FSComS3 (FiberStore), series S5XX
	VendorFSOSS5 Vendor = "fsos_s5"
	// VendorFSOSN5 FSComS3 (FiberStore), series N5XX
	VendorFSOSN5 Vendor = "fsos_n5"
	// VendorJuniper Juniper, up to version 15 (legacy)
	VendorJuniper Vendor = "juniper"
	// VendorJuniperELS Juniper, version 15.1 and higher with advanced
	// ELS (enhanced layer 2 software) features.
	VendorJuniperELS Vendor = "juniper_els"
)

func (Vendor) Valid

func (v Vendor) Valid() bool

Valid checks if this lib supports the given vendor.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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