func (om OptionMap) SetString(o Option, v string) {
	om.SetOption(o, []byte(v))
}
SetString sets the string value of an option.
package dhcpv4
import (
	"bytes"
	"encoding/binary"
	"net"
	"reflect"
	"sort"
	"strconv"
	"time"
)
type MessageType byte
const (
	MessageTypeDHCPDiscover = MessageType(1)
	MessageTypeDHCPOffer    = MessageType(2)
	MessageTypeDHCPRequest  = MessageType(3)
	MessageTypeDHCPDecline  = MessageType(4)
	MessageTypeDHCPAck      = MessageType(5)
	MessageTypeDHCPNak      = MessageType(6)
	MessageTypeDHCPRelease  = MessageType(7)
	MessageTypeDHCPInform   = MessageType(8)
)
type OptionGetter interface {
	GetOption(Option) ([]byte, bool)
	GetMessageType() MessageType
	GetUint8(Option) (uint8, bool)
	GetUint16(Option) (uint16, bool)
	GetUint32(Option) (uint32, bool)
	GetString(Option) (string, bool)
	GetIP(Option) (net.IP, bool)
	GetDuration(Option) (time.Duration, bool)
}
type OptionSetter interface {
	SetOption(Option, []byte)
	SetMessageType(MessageType)
	SetUint8(Option, uint8)
	SetUint16(Option, uint16)
	SetUint32(Option, uint32)
	SetString(Option, string)
	SetIP(Option, net.IP)
	SetDuration(Option, time.Duration)
}
type Option byte
type OptionMap map[Option][]byte
type optionSlice []Option
func (o optionSlice) Len() int {
	return len(o)
}
func (o optionSlice) Less(i, j int) bool {
	return o[i] < o[j]
}
func (o optionSlice) Swap(i, j int) {
	x := o[i]
	o[i] = o[j]
	o[j] = x
}
func sortedOptions(om OptionMap) optionSlice {
	ks := make(optionSlice, 0, len(om))
	for k := range om {
		ks = append(ks, k)
	}
	sort.Sort(ks)
	return ks
}
func (om OptionMap) GetOption(o Option) ([]byte, bool) {
	v, ok := om[o]
	return v, ok
}
func (om OptionMap) SetOption(o Option, v []byte) {
	om[o] = v
}
func (om OptionMap) GetMessageType() MessageType {
	v, ok := om.GetOption(OptionDHCPMsgType)
	if !ok || len(v) != 1 {
		return MessageType(0)
	}
	return MessageType(v[0])
}
func (om OptionMap) SetMessageType(m MessageType) {
	om.SetOption(OptionDHCPMsgType, []byte{byte(m)})
}
func (om OptionMap) GetUint8(o Option) (uint8, bool) {
	if v, ok := om.GetOption(o); ok && len(v) == 1 {
		return uint8(v[0]), true
	}
	return uint8(0), false
}
func (om OptionMap) SetUint8(o Option, v uint8) {
	b := make([]byte, 1)
	b[0] = uint8(v)
	om.SetOption(o, b)
}
func (om OptionMap) GetUint16(o Option) (uint16, bool) {
	if v, ok := om.GetOption(o); ok && len(v) == 2 {
		return binary.BigEndian.Uint16(v), true
	}
	return uint16(0), false
}
func (om OptionMap) SetUint16(o Option, v uint16) {
	b := make([]byte, 2)
	binary.BigEndian.PutUint16(b, v)
	om.SetOption(o, b)
}
func (om OptionMap) GetUint32(o Option) (uint32, bool) {
	if v, ok := om.GetOption(o); ok && len(v) == 4 {
		return binary.BigEndian.Uint32(v), true
	}
	return uint32(0), false
}
func (om OptionMap) SetUint32(o Option, v uint32) {
	b := make([]byte, 4)
	binary.BigEndian.PutUint32(b, v)
	om.SetOption(o, b)
}
func (om OptionMap) GetString(o Option) (string, bool) {
	if v, ok := om.GetOption(o); ok {
		return string(v), true
	}
	return "", false
}