summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2017-12-29 10:31:54 +0000
committerAndrea Barberio <insomniac@slackware.it>2017-12-29 10:31:54 +0000
commitc19213ee3957d06d102303af1a0d5970abbbb1c1 (patch)
treebe2455e4efe2dad563f8abcc24a282ba53bfe64e
parente61a9d0e4ba6b42ddf5ef5132c4333c366d69207 (diff)
Added OptRequestedOption.AddRequestedOption
-rw-r--r--dhcpv6/option_requestedoption.go4
-rw-r--r--dhcpv6/option_types.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/dhcpv6/option_requestedoption.go b/dhcpv6/option_requestedoption.go
index 64c123e..f6327f9 100644
--- a/dhcpv6/option_requestedoption.go
+++ b/dhcpv6/option_requestedoption.go
@@ -36,6 +36,10 @@ func (op *OptRequestedOption) SetRequestedOptions(opts []OptionCode) {
op.requestedOptions = opts
}
+func (op *OptRequestedOption) AddRequestedOption(opt OptionCode) {
+ op.requestedOptions = append(op.requestedOptions, opt)
+}
+
func (op *OptRequestedOption) Length() int {
return len(op.requestedOptions) * 2
}
diff --git a/dhcpv6/option_types.go b/dhcpv6/option_types.go
index 35fe1a7..0229b86 100644
--- a/dhcpv6/option_types.go
+++ b/dhcpv6/option_types.go
@@ -1,5 +1,6 @@
package dhcpv6
+// FIXME: rename all the options to have a consistent name, e.g. OPT_<NAME>
const (
_ OptionCode = iota // skip 0
OPTION_CLIENTID