From 8a245966f316b2f19e13e806a95ef1c4e6806eb5 Mon Sep 17 00:00:00 2001 From: "Xuehao (David) Hu" Date: Tue, 4 Feb 2020 12:00:29 -0800 Subject: hcpv6 fqdn: implements OptionFQDN option per https://tools.ietf.org/rfc/rfc4704.txt Signed-off-by: Xuehao (David) Hu --- dhcpv6/modifiers.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'dhcpv6/modifiers.go') diff --git a/dhcpv6/modifiers.go b/dhcpv6/modifiers.go index efd14a5..06eb9d9 100644 --- a/dhcpv6/modifiers.go +++ b/dhcpv6/modifiers.go @@ -43,6 +43,14 @@ func WithNetboot(d DHCPv6) { msg.UpdateOption(oro) } +// WithFQDN adds a fully qualified domain name option to the packet +func WithFQDN(flags uint8, domainname string) Modifier { + return func(d DHCPv6) { + ofqdn := OptFQDN{Flags: flags, DomainName: domainname} + d.AddOption(&ofqdn) + } +} + // WithUserClass adds a user class option to the packet func WithUserClass(uc []byte) Modifier { // TODO let the user specify multiple user classes -- cgit v1.2.3