package
0.0.0-20240720002214-37b2b8227b91
Repository: https://github.com/progrium/go-netstack.git
Documentation: pkg.go.dev

# Functions

IsAll returns a matcher that checks for all given matchers to be true.
IsCorrectServer returns a matcher that checks for the correct ServerAddress.
IsMessageType returns a matcher that checks for the message types.
New returns a client usable with an unconfigured interface.
NewBroadcastUDPConn returns a PacketConn that marshals and unmarshals UDP packets, sending them to the broadcast MAC at on rawPacketConn.
NewRawUDPConn returns a UDP connection bound to the interface and port given based on a raw packet socket.
NewWithConn creates a new DHCP client that sends and receives packets on the given interface.
WithDebugLogger logs multi-line full DHCPv4 messages when sent & received.
WithHWAddr tells to the Client to receive messages destinated to selected hardware address.
WithLogger set the logger (see interface Logger).
WithRetry configures the number of retransmissions to attempt.
WithServerAddr configures the address to send messages to.
WithSummaryLogger logs one-line DHCPv4 message summaries when sent & received.
WithTimeout configures the retransmission timeout.
WithUnicast forces client to send messages as unicast frames.

# Constants

ClientPort is the port that DHCP clients listen on.
DefaultRetries is amount of retries will be done if no answer was received within read-timeout amount of time.
DefaultTimeout is the default value for read-timeout if option WithTimeout is not set.
MaxMessageSize is the value to be used for DHCP option "MaxMessageSize".
ServerPort is the port that DHCP servers and relay agents listen on.

# Variables

BroadcastMac is the broadcast MAC address.
DefaultServers is the address of all link-local DHCP servers and relay agents.
ErrNoConn is returned when NewWithConn is called with nil-value as conn.
ErrNoIfaceHWAddr is returned when NewWithConn is called with nil-value as ifaceHWAddr.
ErrNoResponse is returned when no response packet is received.
ErrUDPAddrIsRequired is an error used when a passed argument is not of type "*net.UDPAddr".

# Structs

BroadcastRawUDPConn uses a raw socket to send UDP packets to the broadcast MAC address.
Client is an IPv4 DHCP client.
DebugLogger is a wrapper for Printfer to implement interface Logger.
EmptyLogger prints nothing.
ErrNak is returned if a DHCP server rejected our Request.
ErrTransactionIDInUse is returned if there were an attempt to send a message with the same TransactionID as we are already waiting an answer for.
Lease contains a DHCPv4 lease after DORA.
ShortSummaryLogger is a wrapper for Printfer to implement interface Logger.

# Interfaces

Logger is a handler which will be used to output logging messages.
Printfer is used for actual output of the logger.

# Type aliases

ClientOpt is a function that configures the Client.
Matcher matches DHCP packets.