summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_domainsearchlist.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_domainsearchlist.go')
-rw-r--r--dhcpv6/option_domainsearchlist.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/dhcpv6/option_domainsearchlist.go b/dhcpv6/option_domainsearchlist.go
index 402c68e..a3c6f28 100644
--- a/dhcpv6/option_domainsearchlist.go
+++ b/dhcpv6/option_domainsearchlist.go
@@ -6,22 +6,24 @@ package dhcpv6
import (
"encoding/binary"
"fmt"
+
+ "github.com/insomniacslk/dhcp/rfc1035label"
)
-// OptDomainSearchList list implements a DOMAIN_SEARCH_LIST option
+// OptDomainSearchList list implements a OptionDomainSearchList option
type OptDomainSearchList struct {
DomainSearchList []string
}
func (op *OptDomainSearchList) Code() OptionCode {
- return DOMAIN_SEARCH_LIST
+ return OptionDomainSearchList
}
func (op *OptDomainSearchList) ToBytes() []byte {
buf := make([]byte, 4)
- binary.BigEndian.PutUint16(buf[0:2], uint16(DOMAIN_SEARCH_LIST))
+ binary.BigEndian.PutUint16(buf[0:2], uint16(OptionDomainSearchList))
binary.BigEndian.PutUint16(buf[2:4], uint16(op.Length()))
- buf = append(buf, LabelsToBytes(op.DomainSearchList)...)
+ buf = append(buf, rfc1035label.LabelsToBytes(op.DomainSearchList)...)
return buf
}
@@ -42,7 +44,7 @@ func (op *OptDomainSearchList) String() string {
func ParseOptDomainSearchList(data []byte) (*OptDomainSearchList, error) {
opt := OptDomainSearchList{}
var err error
- opt.DomainSearchList, err = LabelsFromBytes(data)
+ opt.DomainSearchList, err = rfc1035label.LabelsFromBytes(data)
if err != nil {
return nil, err
}