discovery

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: GPL-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ProbeInterval = 30 * time.Second
)

Variables

This section is empty.

Functions

func New

func New(db Database) app.Processor

Types

type Database

type Database interface {
	// GetUndiscoveredHosts returns IP addresses whose physical location is still
	// undiscovered or staled more than expiration.
	GetUndiscoveredHosts(expiration time.Duration) ([]net.IPNet, error)

	// UpdateHostLocation updates the physical location of a host, whose MAC and IP
	// addresses are matched with mac and ip, to the port identified by swDPID and
	// portNum. updated will be true if its location has been actually updated.
	UpdateHostLocation(mac net.HardwareAddr, ip net.IP, swDPID uint64, portNum uint16) (updated bool, err error)

	// ResetHostLocationsByPort sets NULL to the host locations that belong to the
	// port specified by swDPID and portNum.
	ResetHostLocationsByPort(swDPID uint64, portNum uint16) error

	// ResetHostLocationsByDevice sets NULL to the host locations that belong to the
	// device specified by swDPID.
	ResetHostLocationsByDevice(swDPID uint64) error
}

Jump to

Keyboard shortcuts

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