47 lines
1.2 KiB
Go
47 lines
1.2 KiB
Go
|
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")
|
||
|
}
|