Michael Cambria 0af31fc4d0 Change dhcp plugin to send ClientID allowing container to have multiple CNI
interfaces using dhcp ipam.

Vendor latest dhcp4server, dhcp4client, dhcp4

Added additional tests for new functionality in dhcp2_test.go

Wrap d2g dhcp4client calls with our own which add clientID to packet.
2018-11-15 11:31:56 -05:00

50 lines
796 B
Go

package leasepool
import (
"net"
)
/*
* Lease.IP is the Key.
*/
type LeasePool interface {
//Add A Lease To The Pool
AddLease(Lease) error
//Remove
RemoveLease(net.IP) error
//Remove All Leases from the Pool (Required for Persistant LeaseManagers)
PurgeLeases() error
/*
* Get the Lease
* -Found
* -Copy Of the Lease
* -Any Error
*/
GetLease(net.IP) (bool, Lease, error)
//Get the lease already in use by that hardware address and/or client identifier.
GetLeaseForClient(net.HardwareAddr, []byte) (bool, Lease, error)
/*
* -Lease Available
* -Lease
* -Error
*/
GetNextFreeLease() (bool, Lease, error)
/*
* Return All Leases
*/
GetLeases() ([]Lease, error)
/*
* Update Lease
* - Has Updated
* - Error
*/
UpdateLease(Lease) (bool, error)
}