diff options
-rw-r--r-- | dhcpv6/dhcpv6message.go | 4 | ||||
-rw-r--r-- | dhcpv6/option_archtype.go | 16 |
2 files changed, 4 insertions, 16 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index e7e6bda..b14daa6 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -149,10 +149,6 @@ func NewRequestFromAdvertise(advertise DHCPv6) (DHCPv6, error) { nii.SetMajor(3) // UNDI - Universal Network Device Interface nii.SetMinor(2) // UNDI rev. 3.2 - second generation EFI runtime driver support, see rfc457 req.AddOption(&nii) - // add OptClientArchType - cat := OptClientArchType{} - cat.SetArchType(EFI_BC) - req.AddOption(&cat) // add OPTION_VENDOR_CLASS, only if present in the original request // TODO implement OptionVendorClass vClass := adv.GetOneOption(OPTION_VENDOR_CLASS) 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 } |