summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2018-04-19 21:45:52 +0100
committerAndrea Barberio <insomniac@slackware.it>2018-04-19 21:45:52 +0100
commitae181b6e52105a03adeda151ee944a14622e0729 (patch)
treee2280b799d67e6069885b6fcc8c45859a5531bb5 /dhcpv6
parent038a263926d20ad709490399448c278e9c970515 (diff)
OptArchType: made field public
Diffstat (limited to 'dhcpv6')
-rw-r--r--dhcpv6/dhcpv6message.go4
-rw-r--r--dhcpv6/option_archtype.go16
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
}