discovery

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProbeInterval = 5 * time.Minute
)

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.IP, 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