summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_archtype.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv6/option_archtype.go')
-rw-r--r--dhcpv6/option_archtype.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/dhcpv6/option_archtype.go b/dhcpv6/option_archtype.go
index 734d89e..9d513c7 100644
--- a/dhcpv6/option_archtype.go
+++ b/dhcpv6/option_archtype.go
@@ -38,7 +38,7 @@ var ArchTypeToStringMap = map[ArchType]string{
}
type OptClientArchType struct {
- archType ArchType
+ ArchType ArchType
}
func (op *OptClientArchType) Code() OptionCode {
@@ -49,24 +49,16 @@ func (op *OptClientArchType) ToBytes() []byte {
buf := make([]byte, 6)
binary.BigEndian.PutUint16(buf[0:2], uint16(OPTION_CLIENT_ARCH_TYPE))
binary.BigEndian.PutUint16(buf[2:4], uint16(op.Length()))
- binary.BigEndian.PutUint16(buf[4:6], uint16(op.archType))
+ binary.BigEndian.PutUint16(buf[4:6], uint16(op.ArchType))
return buf
}
-func (op *OptClientArchType) ArchType() ArchType {
- return op.archType
-}
-
-func (op *OptClientArchType) SetArchType(archType ArchType) {
- op.archType = archType
-}
-
func (op *OptClientArchType) Length() int {
return 2
}
func (op *OptClientArchType) String() string {
- name, ok := ArchTypeToStringMap[op.archType]
+ name, ok := ArchTypeToStringMap[op.ArchType]
if !ok {
name = "Unknown"
}
@@ -80,6 +72,6 @@ func ParseOptClientArchType(data []byte) (*OptClientArchType, error) {
if len(data) != 2 {
return nil, fmt.Errorf("Invalid arch type data length. Expected 2 bytes, got %v", len(data))
}
- opt.archType = ArchType(binary.BigEndian.Uint16(data))
+ opt.ArchType = ArchType(binary.BigEndian.Uint16(data))
return &opt, nil
}