summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/option_serverid.go
diff options
context:
space:
mode:
authorinsomniac <insomniacslk@users.noreply.github.com>2018-05-02 00:08:35 +0200
committerGitHub <noreply@github.com>2018-05-02 00:08:35 +0200
commit412a04020e7b7082b33269fd236fa539a7d8720b (patch)
tree5bbdb031f35aa864caa840a639d2e56db68b2947 /dhcpv6/option_serverid.go
parent0a594bd0cd2eedcdb3b3c0ae394d03d2036e8e2c (diff)
ClientID and ServerID are now public, with no setter/getter (#52)
Diffstat (limited to 'dhcpv6/option_serverid.go')
-rw-r--r--dhcpv6/option_serverid.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/dhcpv6/option_serverid.go b/dhcpv6/option_serverid.go
index 75aea9b..298b095 100644
--- a/dhcpv6/option_serverid.go
+++ b/dhcpv6/option_serverid.go
@@ -9,7 +9,7 @@ import (
)
type OptServerId struct {
- sid Duid
+ Sid Duid
}
func (op *OptServerId) Code() OptionCode {
@@ -20,24 +20,16 @@ func (op *OptServerId) ToBytes() []byte {
buf := make([]byte, 4)
binary.BigEndian.PutUint16(buf[0:2], uint16(OPTION_SERVERID))
binary.BigEndian.PutUint16(buf[2:4], uint16(op.Length()))
- buf = append(buf, op.sid.ToBytes()...)
+ buf = append(buf, op.Sid.ToBytes()...)
return buf
}
-func (op *OptServerId) ServerID() Duid {
- return op.sid
-}
-
-func (op *OptServerId) SetServerID(sid Duid) {
- op.sid = sid
-}
-
func (op *OptServerId) Length() int {
- return op.sid.Length()
+ return op.Sid.Length()
}
func (op *OptServerId) String() string {
- return fmt.Sprintf("OptServerId{sid=%v}", op.sid.String())
+ return fmt.Sprintf("OptServerId{sid=%v}", op.Sid.String())
}
// build an OptServerId structure from a sequence of bytes.
@@ -52,6 +44,6 @@ func ParseOptServerId(data []byte) (*OptServerId, error) {
if err != nil {
return nil, err
}
- opt.sid = *sid
+ opt.Sid = *sid
return &opt, nil
}