diff options
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) |