diff options
author | Chris Koch <chrisko@google.com> | 2019-12-28 07:41:20 -0800 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2020-03-05 15:51:55 +0000 |
commit | d9b1a20bc08c08acc5e43e818fe1c3b71612f0a7 (patch) | |
tree | baae82a03470d3d20761de6b46532f4e6eaa71dd /dhcpv6/dhcpv6message.go | |
parent | 26ec6ccc1813d21a91bc0227ce36dee3531c5c96 (diff) |
v6: add BootFileURL getter
Signed-off-by: Chris Koch <chrisko@google.com>
Diffstat (limited to 'dhcpv6/dhcpv6message.go')
-rw-r--r-- | dhcpv6/dhcpv6message.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go index 400c46a..d099386 100644 --- a/dhcpv6/dhcpv6message.go +++ b/dhcpv6/dhcpv6message.go @@ -104,6 +104,18 @@ func (mo MessageOptions) DNS() []net.IP { return nil } +// BootFileURL returns the Boot File URL option as defined by RFC 5970. +func (mo MessageOptions) BootFileURL() string { + opt := mo.Options.GetOne(OptionBootfileURL) + if opt == nil { + return "" + } + if u, ok := opt.(optBootFileURL); ok { + return string(u) + } + return "" +} + // Message represents a DHCPv6 Message as defined by RFC 3315 Section 6. type Message struct { MessageType MessageType |