Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIPv6UDPConn ¶
NewIPv6UDPConn returns a UDPv6-only connection bound to both the interface and port given based on a IPv6 DGRAM socket. As a bonus, you can actually listen on a multicast address instead of being punted to the wildcard
The interface must already be configured.
Types ¶
type Handler ¶
Handler is a type that defines the handler function to be called every time a valid DHCPv6 message is received
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a DHCPv6 server object
func NewServer ¶
func NewServer(ifname string, addr *net.UDPAddr, handler Handler, opt ...ServerOpt) (*Server, error)
NewServer initializes and returns a new Server object, listening on `addr`.
- If `addr` is a multicast group, the group will be additionally joined
- If `addr` is the wildcard address on the DHCPv6 server port (`[::]:547), the multicast groups All_DHCP_Relay_Agents_and_Servers(`[ff02::1:2]`) and All_DHCP_Servers(`[ff05::1:3]:547`) will be joined.
- If `addr` is nil, IPv6 unspec on the DHCP server port is used and the above behaviour applies
If `WithConn` is used with a non-nil address, `addr` and `ifname` have no effect. In such case, joining the multicast group is the caller's responsibility.
Click to show internal directories.
Click to hide internal directories.