summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/options.go
diff options
context:
space:
mode:
authorChristopher Koch <c@chrisko.ch>2019-01-20 19:09:02 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-26 23:34:26 +0000
commit116fb1d0a3124d2a2dc14ead7db6b497224377ab (patch)
tree4b827727a1b9197d4b3a5b7eb7b295ff7bd86a27 /dhcpv6/options.go
parentc09728dd0f8ccf56e74efe7df7328191a347e821 (diff)
dhcpv6: move option code types; add Stringer.
Diffstat (limited to 'dhcpv6/options.go')
-rw-r--r--dhcpv6/options.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/dhcpv6/options.go b/dhcpv6/options.go
index 33f0d20..23ad589 100644
--- a/dhcpv6/options.go
+++ b/dhcpv6/options.go
@@ -5,9 +5,6 @@ import (
"fmt"
)
-// OptionCode is a single byte representing the code for a given Option.
-type OptionCode uint16
-
// Option is an interface that all DHCPv6 options adhere to.
type Option interface {
Code() OptionCode
@@ -38,11 +35,7 @@ func (og *OptionGeneric) ToBytes() []byte {
}
func (og *OptionGeneric) String() string {
- code, ok := OptionCodeToString[og.OptionCode]
- if !ok {
- code = "UnknownOption"
- }
- return fmt.Sprintf("%v -> %v", code, og.OptionData)
+ return fmt.Sprintf("%s -> %v", og.OptionCode, og.OptionData)
}
func (og *OptionGeneric) Length() int {