vendor: add d2g/dhcp4server

This commit is contained in:
Dan Williams
2017-05-26 23:32:35 -05:00
parent 461d433911
commit 26ef6e312d
115 changed files with 13027 additions and 0 deletions

View File

@ -0,0 +1,49 @@
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.
GetLeaseForHardwareAddress(net.HardwareAddr) (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)
}