dhcpd: imp docs

This commit is contained in:
Eugene Burkov
2025-03-06 15:54:02 +03:00
parent 74640fb06c
commit ed947a048e

View File

@@ -16,20 +16,47 @@ import (
) )
// raCtx is a context for the Router Advertisement logic. // raCtx is a context for the Router Advertisement logic.
//
// TODO(e.burkov): !! Improve docs
type raCtx struct { type raCtx struct {
raAllowSLAAC bool // send RA packets with MO flags // raAllowSLAAC is used to determine if the ICMP Router Advertisement
raSLAACOnly bool // send RA packets without MO flags // messages should be sent.
ipAddr net.IP // source IP address (link-local-unicast) //
dnsIPAddr net.IP // IP address for DNS Server option // If both raAllowSLAAC and raSLAACOnly are false, the Router Advertisement
prefixIPAddr net.IP // IP address for Prefix option // messages aren't sent.
ifaceName string raAllowSLAAC bool
iface *net.Interface
packetSendPeriod time.Duration // how often RA packets are sent
conn *icmp.PacketConn // ICMPv6 socket // raSLAACOnly is used to determine if the ICMP Router Advertisement
stop atomic.Value // stop the packet sending loop // messages should set M and O flags, see RFC 4861, section 4.2.
//
// If both raAllowSLAAC and raSLAACOnly are false, the Router Advertisement
// messages aren't sent.
raSLAACOnly bool
// ipAddr is an IP address used within the Source Link-Layer Address option.
// See RFC 4861, section 4.6.1.
ipAddr net.IP
// dnsIPAddr is an IP address used within the DNS Server option.
dnsIPAddr net.IP
// prefixIPAddr is an IP address used within the Prefix Information option.
// See RFC 4861, section 4.6.2.
prefixIPAddr net.IP
// ifaceName is the name of the interface used as a scope of the IP
// addresses.
ifaceName string
// iface is the network interface used to send the ICMPv6 packets.
iface *net.Interface
// packetSendPeriod is the interval between sending the ICMPv6 packets.
packetSendPeriod time.Duration
// conn is the ICMPv6 socket.
conn *icmp.PacketConn
// stop is used to stop the packet sending loop.
stop atomic.Value
} }
type icmpv6RA struct { type icmpv6RA struct {