client6

package
v0.0.0-...-a481575 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: BSD-3-Clause Imports: 5 Imported by: 34

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

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

Jump to

Keyboard shortcuts

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