kdhcp/dhcp/options.go

47 lines
1.2 KiB
Go
Raw Normal View History

2023-05-02 23:33:14 +00:00
package dhcp
import (
"errors"
"io"
)
type OptionTag uint8
type Option func(req *BootRequest, r io.Reader) error
const (
OptionTagPadding OptionTag = 0
OptionTagHostName = 12
OptionTagMessageType = 53
OptionTagParameterRequestList = 55
OptionTagEnd = 255
)
var optionRegistry = map[OptionTag]Option{
OptionTagPadding: OptionTag,
OptionTagHostName: OptionHostName,
OptionTagMessageType: OptionMessageType,
OptionTagParameterRequestList: OptionParameterRequestList,
OptionTagEnd: OptionEnd,
}
func OptionPad(req *BootRequest, r io.Reader) error {
return nil
}
func OptionHostName(req *BootRequest, r io.Reader) error {
return errors.New("dhcp: option not implemented yet")
}
func OptionMessageType(req *BootRequest, r io.Reader) error {
return errors.New("dhcp: option not implemented yet")
}
func OptionParameterRequestList(req *BootRequest, r io.Reader) error {
return errors.New("dhcp: option not implemented yet")
}
func OptionEnd(req *BootRequest, r io.Reader) error {
return errors.New("dhcp: option not implemented yet")
}