diff options
author | Hu Jun <hujun.work@gmail.com> | 2020-09-20 16:25:45 -0700 |
---|---|---|
committer | Hu Jun <hujun.work@gmail.com> | 2020-09-20 16:25:45 -0700 |
commit | 293d999bca6dd08bc2b7f1830625d22c7ea19695 (patch) | |
tree | e07ea9d127393d14d78b3842560903ac127e3818 | |
parent | 305577bdea50fad7732f75ef37864255b2f46d43 (diff) |
- rename raiValue to raiSubOptionValue to avoid confusion, and move it next to raiSubOptionCode
- a few minor changes to address latest feedback
Signed-off-by: Hu Jun <hujun.work@gmail.com>
-rw-r--r-- | dhcpv4/option_relay_agent_information.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dhcpv4/option_relay_agent_information.go b/dhcpv4/option_relay_agent_information.go index b2e84d8..a338902 100644 --- a/dhcpv4/option_relay_agent_information.go +++ b/dhcpv4/option_relay_agent_information.go @@ -4,14 +4,6 @@ import ( "fmt" ) -type raiValue struct { - val []byte -} - -func (rv raiValue) String() string { - return fmt.Sprintf("%s (%v)", string([]byte(rv.val)), rv.val) -} - // RelayOptions is like Options, but stringifies using the Relay Agent Specific // option space. type RelayOptions struct { @@ -20,7 +12,7 @@ type RelayOptions struct { var relayHumanizer = OptionHumanizer{ ValueHumanizer: func(code OptionCode, data []byte) fmt.Stringer { - return raiValue{val: data} + return raiSubOptionValue{data} }, CodeHumanizer: func(c uint8) OptionCode { return raiSubOptionCode(c) @@ -45,6 +37,14 @@ func OptRelayAgentInfo(o ...Option) Option { return Option{Code: OptionRelayAgentInformation, Value: RelayOptions{OptionsFromList(o...)}} } +type raiSubOptionValue struct { + val []byte +} + +func (rv raiSubOptionValue) String() string { + return fmt.Sprintf("%s (%v)", string(rv.val), rv.val) +} + type raiSubOptionCode uint8 func (o raiSubOptionCode) Code() uint8 { |