kea-manage/ipv4/reservation/reservation.go

26 lines
443 B
Go
Raw Normal View History

2024-09-14 04:21:14 +00:00
package reservation
import (
"git.staur.ca/stobbsm/kea-manage/lib/types"
)
type ReservationV4 struct {
Type int
SubnetID int
MacAddr string
2024-09-14 04:21:14 +00:00
Ipv4 string
Hostname string
}
func ReserveV4MacAddr(rtype string, mac string, addr string, hostname string, subnet int) *ReservationV4 {
2024-09-14 04:21:14 +00:00
r := &ReservationV4{
MacAddr: mac,
Type: types.Lookup(rtype),
2024-09-14 04:21:14 +00:00
SubnetID: subnet,
Ipv4: addr,
Hostname: hostname,
}
return r
}