Documentation
¶
Index ¶
- type MySQL
- func (r *MySQL) DHCP(mac net.HardwareAddr) (conf *dhcp.NetConfig, err error)
- func (r *MySQL) Elect(uid string, expiration time.Duration) (elected bool, err error)
- func (r *MySQL) Exec(f func(ui.Transaction) error) error
- func (r *MySQL) GetARPTable() (result []announcer.ARPTableEntry, err error)
- func (r *MySQL) GetUndiscoveredHosts(expiration time.Duration) (result []net.IPNet, err error)
- func (r *MySQL) Location(mac net.HardwareAddr) (dpid string, port uint32, status network.LocationStatus, err error)
- func (r *MySQL) MAC(ip net.IP) (mac net.HardwareAddr, ok bool, err error)
- func (r *MySQL) MACAddrs() (result []net.HardwareAddr, err error)
- func (r *MySQL) RenewARPTable() error
- func (r *MySQL) ResetHostLocationsByDevice(swDPID uint64) error
- func (r *MySQL) ResetHostLocationsByPort(swDPID uint64, portNum uint16) error
- func (r *MySQL) ToggleDeviceVIP(swDPID uint64) (result []virtualip.Address, err error)
- func (r *MySQL) TogglePortVIP(swDPID uint64, portNum uint16) (result []virtualip.Address, err error)
- func (r *MySQL) UpdateHostLocation(mac net.HardwareAddr, ip net.IP, swDPID uint64, portNum uint16) (updated bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) Elect ¶
Elect selects a new master as uid if there is a no existing master that has been updated within expiration. elected will be true if this uid has been elected as the new master or was already elected.
func (*MySQL) Exec ¶
func (r *MySQL) Exec(f func(ui.Transaction) error) error
Exec executes all queries of f in a single transaction. f should return the error raised from the ui.Transaction without any change or wrapping it for deadlock protection.
func (*MySQL) GetARPTable ¶
func (r *MySQL) GetARPTable() (result []announcer.ARPTableEntry, err error)
func (*MySQL) GetUndiscoveredHosts ¶
GetUndiscoveredHosts returns IP addresses whose physical location is still undiscovered or staled more than expiration. result can be nil on empty result.
func (*MySQL) Location ¶
func (r *MySQL) Location(mac net.HardwareAddr) (dpid string, port uint32, status network.LocationStatus, err error)
func (*MySQL) MACAddrs ¶
func (r *MySQL) MACAddrs() (result []net.HardwareAddr, err error)
MACAddrs returns all the registered MAC addresses.
func (*MySQL) RenewARPTable ¶
func (*MySQL) ResetHostLocationsByDevice ¶
ResetHostLocationsByDevice sets NULL to the host locations that belong to the device specified by swDPID.
func (*MySQL) ResetHostLocationsByPort ¶
ResetHostLocationsByPort sets NULL to the host locations that belong to the port specified by swDPID and portNum.
func (*MySQL) ToggleDeviceVIP ¶
func (*MySQL) TogglePortVIP ¶
func (*MySQL) UpdateHostLocation ¶
func (r *MySQL) UpdateHostLocation(mac net.HardwareAddr, ip net.IP, swDPID uint64, portNum uint16) (updated bool, err 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.