dhcp4client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2015 License: MPL-2.0, Apache-2.0 Imports: 8 Imported by: 0

README

dhcp4client GoDoc Coverage Status Codeship Status for d2g/dhcp4client

DHCP Client

Thanks to:

@eyakubovich For AF_PACKET support.

Documentation

Index

Constants

View Source
const (
	MaxDHCPLen = 576
)

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(b bool) func(*Client) error

func Connection

func Connection(conn connection) func(*Client) error

func HardwareAddr

func HardwareAddr(h net.HardwareAddr) func(*Client) error

func IgnoreServers

func IgnoreServers(s []net.IP) func(*Client) error

func NewInetSock

func NewInetSock(options ...func(*inetSock) error) (*inetSock, error)

func NewPacketSock

func NewPacketSock(ifindex int) (*packetSock, error)

func SetLocalAddr

func SetLocalAddr(l net.UDPAddr) func(*inetSock) error

func SetRemoteAddr

func SetRemoteAddr(r net.UDPAddr) func(*inetSock) error

func Timeout

func Timeout(t time.Duration) func(*Client) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(options ...func(*Client) error) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

* Close Connections

func (*Client) DiscoverPacket

func (c *Client) DiscoverPacket() dhcp4.Packet

* Create Discover Packet

func (*Client) GetAcknowledgement

func (c *Client) GetAcknowledgement(requestPacket *dhcp4.Packet) (dhcp4.Packet, error)

* Retreive Acknowledgement * Wait for the offer for a specific Request Packet.

func (*Client) GetOffer

func (c *Client) GetOffer(discoverPacket *dhcp4.Packet) (dhcp4.Packet, error)

* Retreive Offer... * Wait for the offer for a specific Discovery Packet.

func (*Client) Release

func (c *Client) Release(acknowledgement dhcp4.Packet) error

* Release a lease backed on the Acknowledgement Packet. * Returns Any Errors

func (*Client) ReleasePacket

func (c *Client) ReleasePacket(acknowledgement *dhcp4.Packet) dhcp4.Packet

* Create Release Packet For a Release

func (*Client) Renew

func (c *Client) Renew(acknowledgement dhcp4.Packet) (bool, dhcp4.Packet, error)

* Renew a lease backed on the Acknowledgement Packet. * Returns Sucessfull, The AcknoledgementPacket, Any Errors

func (*Client) RenewalRequestPacket

func (c *Client) RenewalRequestPacket(acknowledgement *dhcp4.Packet) dhcp4.Packet

* Create Request Packet For a Renew

func (*Client) Request

func (c *Client) Request() (bool, dhcp4.Packet, error)

* Lets do a Full DHCP Request.

func (*Client) RequestPacket

func (c *Client) RequestPacket(offerPacket *dhcp4.Packet) dhcp4.Packet

* Create Request Packet

func (*Client) SendDiscoverPacket

func (c *Client) SendDiscoverPacket() (dhcp4.Packet, error)

* Send the Discovery Packet to the Broadcast Channel

func (*Client) SendPacket

func (c *Client) SendPacket(packet dhcp4.Packet) error

* Send a DHCP Packet.

func (*Client) SendRequest

func (c *Client) SendRequest(offerPacket *dhcp4.Packet) (dhcp4.Packet, error)

* Send Request Based On the offer Received.

func (*Client) SetOption

func (c *Client) SetOption(options ...func(*Client) error) error

Jump to

Keyboard shortcuts

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