client

package
v1.4.3-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DuidEn uint16 = 2

DuidEn is the DUID type; see https://tools.ietf.org/html/rfc3315#section-9.3

View Source
const VMwarePEN uint32 = 6876

VMwarePEN is VMware's PEN (Private Enterprise Number); see http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers

Variables

Functions

This section is empty.

Types

type Client

type Client interface {
	// SetTimeout sets the timeout for a subsequent DHCP request
	SetTimeout(t time.Duration)

	// Request sends a full DHCP request, resulting in a DHCP lease.
	// On a successful lease, returns a DHCP acknowledgment packet
	Request() error

	// Renew renews an existing DHCP lease. Returns a new acknowledgment
	// packet on success.
	Renew() error

	// Release releases an existing DHCP lease.
	Release() error

	// SetParamterRequestList sets the DHCP parameter request list
	// per RFC 2132, section 9.8
	SetParameterRequestList(...byte)

	// LastAck returns the last ack packet from a request or renew operation.
	LastAck() *dhcp.Packet
}

Client represents a DHCP client

func NewClient

func NewClient(ifIndex int, hwaddr net.HardwareAddr) (Client, error)

NewClient creates a new DHCP client. Note the returned object is not thread-safe.

type Duid

type Duid struct {
	Type uint16
	PEN  uint32
	ID   uint64
}

Duid is a vendor based DUID per https://tools.ietf.org/html/rfc3315#section-9.3

func (Duid) MarshalBinary

func (d Duid) MarshalBinary() ([]byte, error)

MarshalBinary implements the BinaryMarshaler interface

type ID

type ID struct {
	Type uint8
	Iaid Iaid
	Duid Duid

	IfIndex      int
	HardwareAddr net.HardwareAddr
}

ID is a DHCPv4 client ID

func NewID

func NewID(ifindex int, hw net.HardwareAddr) (ID, error)

NewID generates a DHCPv4 client ID, per https://tools.ietf.org/html/rfc4361#section-6.1

func (ID) MarshalBinary

func (i ID) MarshalBinary() ([]byte, error)

MarshalBinary implements the BinaryMarshaler interface

type Iaid

type Iaid []byte

Iaid is an opaque 32-bit identifier unique to a network interface; see https://tools.ietf.org/html/rfc4361#section-6.1

func (Iaid) MarshalBinary

func (ia Iaid) MarshalBinary() ([]byte, error)

MarshalBinary implements the BinaryMarshaler interface

Jump to

Keyboard shortcuts

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