From 412a04020e7b7082b33269fd236fa539a7d8720b Mon Sep 17 00:00:00 2001 From: insomniac Date: Wed, 2 May 2018 00:08:35 +0200 Subject: ClientID and ServerID are now public, with no setter/getter (#52) --- dhcpv6/option_serverid.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'dhcpv6/option_serverid.go') 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 } -- cgit v1.2.3