Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Exchange(ifname string, modifiers ...dhcpv6.Modifier) ([]dhcpv6.DHCPv6, error)
- func (c *Client) Request(ifname string, advertise *dhcpv6.Message, modifiers ...dhcpv6.Modifier) (dhcpv6.DHCPv6, dhcpv6.DHCPv6, error)
- func (c *Client) Solicit(ifname string, modifiers ...dhcpv6.Modifier) (dhcpv6.DHCPv6, dhcpv6.DHCPv6, error)
Constants ¶
const ( DefaultWriteTimeout = 3 * time.Second // time to wait for write calls DefaultReadTimeout = 3 * time.Second // time to wait for read calls DefaultInterfaceUpTimeout = 3 * time.Second // time to wait before a network interface goes up MaxUDPReceivedPacketSize = 8192 // arbitrary size. Theoretically could be up to 65kb )
Client constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ReadTimeout time.Duration WriteTimeout time.Duration LocalAddr net.Addr RemoteAddr net.Addr SimulateRelay bool RelayOptions dhcpv6.Options // These options will be added to relay message if SimulateRelay is true }
Client implements a DHCPv6 client
func (*Client) Exchange ¶
Exchange executes a 4-way DHCPv6 request (Solicit, Advertise, Request, Reply). The modifiers will be applied to the Solicit and Request packets. A common use is to make sure that the Solicit packet has the right options, see modifiers.go
func (*Client) Request ¶
func (c *Client) Request(ifname string, advertise *dhcpv6.Message, modifiers ...dhcpv6.Modifier) (dhcpv6.DHCPv6, dhcpv6.DHCPv6, error)
Request sends a Request built from an Advertise. It returns the Request, a Reply (if not nil), and an error if any. The modifiers will be applied to the Request before sending it, see modifiers.go
func (*Client) Solicit ¶
func (c *Client) Solicit(ifname string, modifiers ...dhcpv6.Modifier) (dhcpv6.DHCPv6, dhcpv6.DHCPv6, error)
Solicit sends a Solicit, returns the Solicit, an Advertise (if not nil), and an error if any. The modifiers will be applied to the Solicit before sending it, see modifiers.go