From c19213ee3957d06d102303af1a0d5970abbbb1c1 Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Fri, 29 Dec 2017 10:31:54 +0000 Subject: Added OptRequestedOption.AddRequestedOption --- dhcpv6/option_requestedoption.go | 4 ++++ dhcpv6/option_types.go | 1 + 2 files changed, 5 insertions(+) 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_ const ( _ OptionCode = iota // skip 0 OPTION_CLIENTID -- cgit v1.2.3