package
0.0.0-20200221232812-81b9770086ea
Repository: https://github.com/elastic/dhcp.git
Documentation: pkg.go.dev
# Functions
Checksum calculates the checksum (as defined in RFC 1071) of the bytes in the given byte array.
ChecksumCombine combines the two uint16 to form their checksum.
IsMessageType returns a matcher that checks for the message type.
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.
PseudoHeaderChecksum calculates the pseudo-header checksum for the given destination protocol and network address, ignoring the length field.
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.
IPv4AddressSize is the size, in bytes, of an IPv4 address.
Flags that may be set in an IPv4 packet.
Flags that may be set in an IPv4 packet.
IPv4MaximumHeaderSize is the maximum size of an IPv4 header.
IPv4MinimumSize is the minimum size of a valid IPv4 packet.
IPv4Version is the version of the ipv4 protocol.
MaxMessageSize is the value to be used for DHCP option "MaxMessageSize".
ServerPort is the port that DHCP servers and relay agents listen on.
UDPMinimumSize is the minimum size of a valid UDP packet.
UDPProtocolNumber is UDP's transport protocol number.
# 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".
IPv4Any is the non-routable IPv4 "any" meta address.
IPv4Broadcast is the broadcast address of the IPv4 protocol.
# 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.
ErrTransactionIDInUse is returned if there were an attempt to send a message with the same TransactionID as we are already waiting an answer for.
IPv4Fields contains the fields of an IPv4 packet.
ShortSummaryLogger is a wrapper for Printfer to implement interface Logger.
UDPFields contains the fields of a UDP packet.
# Type aliases
ClientOpt is a function that configures the Client.
IPv4 represents an ipv4 header stored in a byte array.
Matcher matches DHCP packets.
TransportProtocolNumber is the number of a transport protocol.
UDP represents a UDP header stored in a byte array.