diff options
author | Chris Koch <chrisko@google.com> | 2020-02-10 14:33:15 -0800 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2020-03-05 15:51:55 +0000 |
commit | f5ab3598d1cc467e484cc1f7ea4ffa6e8f3cba1f (patch) | |
tree | 6babfbb1a3787dcb92c73b1ecf658f8245c74e19 /dhcpv6/dhcpv6message.go | |
parent | 54c911b4349d9fc445ad10c5399db12a58dfcec9 (diff) |
v6: DomainSearchList getter
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r-- | dhcpv6/dhcpv6message.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index 8ba7943..56f8627 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -7,6 +7,7 @@ import ( "time" "github.com/insomniacslk/dhcp/iana" + "github.com/insomniacslk/dhcp/rfc1035label" "github.com/u-root/u-root/pkg/rand" "github.com/u-root/u-root/pkg/uio" ) @@ -130,6 +131,18 @@ func (mo MessageOptions) DNS() []net.IP { return nil } +// DomainSearchList returns the Domain List option as defined by RFC 3646. +func (mo MessageOptions) DomainSearchList() *rfc1035label.Labels { + opt := mo.Options.GetOne(OptionDomainSearchList) + if opt == nil { + return nil + } + if dsl, ok := opt.(*optDomainSearchList); ok { + return dsl.DomainSearchList + } + return nil +} + // BootFileURL returns the Boot File URL option as defined by RFC 5970. func (mo MessageOptions) BootFileURL() string { opt := mo.Options.GetOne(OptionBootfileURL) |