Matthew Stobbs
a78f001a41
- Make ipv4 reservations in kea by directly writing to the database - uses same configuration file as database configuration under the heading reservationV4
26 lines
443 B
Go
26 lines
443 B
Go
package reservation
|
|
|
|
import (
|
|
"git.staur.ca/stobbsm/kea-manage/lib/types"
|
|
)
|
|
|
|
type ReservationV4 struct {
|
|
Type int
|
|
SubnetID int
|
|
MacAddr string
|
|
Ipv4 string
|
|
Hostname string
|
|
}
|
|
|
|
func ReserveV4MacAddr(rtype string, mac string, addr string, hostname string, subnet int) *ReservationV4 {
|
|
r := &ReservationV4{
|
|
MacAddr: mac,
|
|
Type: types.Lookup(rtype),
|
|
SubnetID: subnet,
|
|
Ipv4: addr,
|
|
Hostname: hostname,
|
|
}
|
|
|
|
return r
|
|
}
|