dhcp

package
v1.4.3 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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options dhcp4.Options

type Packet

type Packet struct {
	Packet  []byte
	Options Options
}

Packet is a representation of a DHCP packet

func NewPacket

func NewPacket(p []byte) *Packet

func (*Packet) DNS

func (p *Packet) DNS() []net.IP

DNS returns the name server entries in the dhcp packet

func (*Packet) Gateway

func (p *Packet) Gateway() net.IP

Gateway return the GIP field in the packet (server assigned gateway)

func (*Packet) LeaseTime

func (p *Packet) LeaseTime() time.Duration

LeaseTime returns the lease time (in seconds) in the packet

func (*Packet) ServerIP

func (p *Packet) ServerIP() net.IP

ServerIP returns the DHCP server's IP address

func (*Packet) SubnetMask

func (p *Packet) SubnetMask() net.IPMask

SubnetMask returns the subnet mask option in the packet

func (*Packet) YourIP

func (p *Packet) YourIP() net.IP

YourIP returns the YIP field in the packet (this is IP assigned by server to the client)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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