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
|
2024-09-20 15:21:18 +00:00
|
|
|
MacAddr string
|
2024-09-14 04:21:14 +00:00
|
|
|
Ipv4 string
|
|
|
|
Hostname string
|
|
|
|
}
|
|
|
|
|
2024-09-24 20:43:54 +00:00
|
|
|
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,
|
2024-09-24 20:43:54 +00:00
|
|
|
Type: types.Lookup(rtype),
|
2024-09-14 04:21:14 +00:00
|
|
|
SubnetID: subnet,
|
|
|
|
Ipv4: addr,
|
|
|
|
Hostname: hostname,
|
|
|
|
}
|
|
|
|
|
|
|
|
return r
|
|
|
|
}
|