diff options
Diffstat (limited to 'dhcpv6/modifiers.go')
-rw-r--r-- | dhcpv6/modifiers.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dhcpv6/modifiers.go b/dhcpv6/modifiers.go index 8099795..fbbad23 100644 --- a/dhcpv6/modifiers.go +++ b/dhcpv6/modifiers.go @@ -90,6 +90,23 @@ func WithIAID(iaid [4]byte) Modifier { } } +// WithIATA adds or updates an OptIANA option with the provided IAAddress +// options +func WithIATA(addrs ...OptIAAddress) Modifier { + return func(d DHCPv6) { + if msg, ok := d.(*Message); ok { + iata := msg.Options.OneIATA() + if iata == nil { + iata = &OptIATA{} + } + for _, addr := range addrs { + iata.Options.Add(&addr) + } + msg.UpdateOption(iata) + } + } +} + // WithDNS adds or updates an OptDNSRecursiveNameServer func WithDNS(dnses ...net.IP) Modifier { return WithOption(OptDNS(dnses...)) |