client6

package
v0.0.0-...-cedea85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var (
	AllDHCPRelayAgentsAndServers = net.ParseIP("ff02::1:2")
	AllDHCPServers               = net.ParseIP("ff05::1:3")
)

Broadcast destination IP addresses as defined by RFC 3315

Functions

This section is empty.

Types

type Client

type Client struct {
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	LocalAddr    net.Addr
	RemoteAddr   net.Addr
}

Client implements a DHCPv6 client

func NewClient

func NewClient() *Client

NewClient returns a Client with default settings

func (*Client) Exchange

func (c *Client) Exchange(ifname string, modifiers ...dhcpv6.Modifier) ([]dhcpv6.DHCPv6, error)

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.DHCPv6, 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL