package
0.0.0-20240720002214-37b2b8227b91
Repository: https://github.com/progrium/go-netstack.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
Package client4 is deprecated.
Package nclient4 is a small, minimum-functionality client for DHCPv4.
Package server4 is a basic, extensible DHCPv4 server.
No description provided by the author
# Functions
BindToInterface (deprecated) redirects to interfaces.BindToInterface.
FromBytes decodes a DHCPv4 packet from a sequence of bytes, and returns an error if the packet is not valid.
GenerateTransactionID generates a random 32-bits number suitable for use as TransactionID.
GetExternalIPv4Addrs obtains the currently-configured, non-loopback IPv4 addresses from `addrs` coming from a particular interface (e.g.
GetIP returns code out of o parsed as an IP.
GetIPs parses a list of IPs from code in o.
GetString parses an RFC 2132 string from o[code].
GetUint16 parses a uint16 from code in o.
IPv4AddrsForInterface obtains the currently-configured, non-loopback IPv4 addresses for iface.
New creates a new DHCPv4 structure and fill it up with default values.
NewDiscovery builds a new DHCPv4 Discovery message, with a default Ethernet HW type and specified hardware address.
NewDiscoveryForInterface builds a new DHCPv4 Discovery message, with a default Ethernet HW type and the hardware address obtained from the specified interface.
NewInform builds a new DHCPv4 Informational message with the specified hardware address.
NewInformForInterface builds a new DHCPv4 Informational message with default Ethernet HW type and the hardware address obtained from the specified interface.
NewReleaseFromACK creates a DHCPv4 Release message from ACK.
NewReplyFromRequest builds a DHCPv4 reply from a request.
NewRequestFromOffer builds a DHCPv4 request from an offer.
OptBootFileName returns a new DHCPv4 Boot File Name option.
OptBroadcastAddress returns a new DHCPv4 Broadcast Address option.
OptClassIdentifier returns a new DHCPv4 Class Identifier option.
OptClasslessStaticRoute returns a new DHCPv4 Classless Static Route option.
OptClientArch returns a new Client System Architecture Type option.
OptClientIdentifier returns a new Client Identifier option.
OptDNS returns a new DHCPv4 Domain Name Server option.
OptDomainName returns a new DHCPv4 Domain Name option.
OptDomainSearch returns a new domain search option.
OptGeneric returns a generic option.
OptHostName returns a new DHCPv4 Host Name option.
OptionsFromList adds all given options to an options map.
OptIPAddressLeaseTime returns a new IP address lease time option.
OptMaxMessageSize returns a new DHCP Maximum Message Size option.
OptMessage returns a new DHCPv4 (Error) Message option.
OptMessageType returns a new DHCPv4 Message Type option.
OptNTPServers returns a new DHCPv4 NTP Server option.
OptParameterRequestList returns a new DHCPv4 Parameter Request List.
OptRelayAgentInfo returns a new DHCP Relay Agent Info option.
OptRequestedIPAddress returns a new DHCPv4 Requested IP Address option.
OptRFC3004UserClass returns a new user class option according to RFC 3004.
OptRootPath returns a new DHCPv4 Root Path option.
OptRouter returns a new DHCPv4 Router option.
OptServerIdentifier returns a new DHCPv4 Server Identifier option.
OptSubnetMask returns a new DHCPv4 SubnetMask option per RFC 2132, Section 3.3.
OptTFTPServerName returns a new DHCPv4 TFTP Server Name option.
OptUserClass returns a new DHCPv4 User Class option.
OptVIVC returns a new vendor-identifying vendor class option.
PrependModifiers prepends other to m.
WithBroadcast sets the packet to be broadcast or unicast.
WithClientIP sets the Client IP for a DHCPv4 packet.
WithDNS modifies a packet with the DHCPv4 Domain Name Server option.
WithDomainSearchList adds or updates an OptionDomainSearch.
WithGatewayIP sets the Gateway IP for the DHCPv4 packet.
No description provided by the author
WithHwAddr sets the hardware address for a packet.
WithHWType sets the Hardware Type for a DHCPv4 packet.
WithLeaseTime adds or updates an OptIPAddressLeaseTime.
WithMessageType adds the DHCPv4 message type m to a packet.
WithNetboot adds bootfile URL and bootfile param options to a DHCPv4 packet.
WithNetmask adds or updates an OptSubnetMask.
WithOption appends a DHCPv4 option provided by the user.
WithOptionCopied copies the value of option opt from request.
WithRelay adds parameters required for DHCPv4 to be relayed by the relay server with given ip.
WithReply fills in opcode, hwtype, xid, clienthwaddr, and flags from the given packet.
WithRequestedOptions adds requested options to the packet.
WithRouter updates a packet with the DHCPv4 Router option.
WithServerIP sets the Server IP for a DHCPv4 packet.
WithTransactionID sets the Transaction ID for the DHCPv4 packet.
WithUserClass adds a user class option to the packet.
WithYourIP sets the Your IP for a DHCPv4 packet.
# Constants
RFC 3046.
RFC 3046.
RFC 4030.
No description provided by the author
RFC 3256.
RFC 3527.
MaxHWAddrLen is the maximum hardware address length of the ClientHWAddr (client hardware address) according to RFC 2131, Section 2.
MaxMessageSize is the maximum size in bytes that a DHCPv4 packet can hold.
DHCP message types.
DHCP message types.
DHCP message types.
DHCP message types.
DHCP message types.
MessageTypeNone is not a real message type, it is used by certain functions to signal that no explicit message type is requested.
DHCP message types.
DHCP message types.
DHCP message types.
constants that represent valid values for OpcodeType.
constants that represent valid values for OpcodeType.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Option 115 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Option 96 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Options 222-223 returned in RFC 3679 Options 224-254 are reserved for private use.
Options 158-174 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Option 84 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Options 102-111 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Options 178-207 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Options 214-219 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
Options 144-149 returned in RFC 3679.
Options 126-127 returned in RFC 3679.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
DHCPv4 Options.
RFC 4014.
RFC 5010.
RFC 8357.
RFC 5107.
No description provided by the author
RFC 3993.
RFC 4243.
RFC 6607.
RFC 6607.
# Variables
ErrInvalidOptions is returned when invalid options data is encountered during parsing.
ErrShortByteStream is an error that is thrown any time a short byte stream is detected during option parsing.
ErrZeroLengthByteStream is an error that is thrown any time a zero-length byte stream is encountered.
MaxLeaseTime is the maximum lease time that can be encoded.
RandomTimeout is the amount of time to wait until random number generation is canceled.
# Structs
DHCPv4 represents a DHCPv4 packet header and options.
Option is a DHCPv4 option and consists of a 1-byte option code and a value stream of bytes.
OptionGeneric is an option that only contains the option code and associated data.
OptionHumanizer is used to interpret a set of Options for their option code name and values.
RelayOptions is like Options, but stringifies using the Relay Agent Specific option space.
Route is a classless static route as per RFC 3442.
VIVCIdentifier implements the vendor-identifying vendor class option described by RFC 3925.
# Interfaces
OptionCode is a single byte representing the code for a given Option.
OptionDecoder can decode a byte stream into a human-readable option.
OptionValue is an interface that all DHCP v4 options adhere to.
# Type aliases
Duration implements the IP address lease time option described by RFC 2132, Section 9.2.
GenericOptionCode is an unnamed option code.
IP implements DHCPv4 IP option marshaling and unmarshaling as described by RFC 2132, Sections 5.3, 9.1, 9.7, and others.
IPMask represents an option encapsulating the subnet mask.
IPs are IPv4 addresses from a DHCP packet as used and specified by options in RFC 2132, Sections 3.5 through 3.13, 8.2, 8.3, 8.5, 8.6, 8.9, and 8.10.
MessageType represents the possible DHCP message types - DISCOVER, OFFER, etc.
Modifier defines the signature for functions that can modify DHCPv4 structures.
OpcodeType represents a DHCPv4 opcode.
OptionCodeList is a list of DHCP option codes.
OptionParser gives a human-legible interpretation of data for the given option code.
Options is a collection of options.
Routes is a collection of network routes.
String represents an option encapsulating a string in IPv4 DHCP.
Strings represents an option encapsulating a list of strings in IPv4 DHCP as specified in RFC 3004
Strings implements the OptionValue type.
TransactionID represents a 4-byte DHCP transaction ID as defined in RFC 951, Section 3.
Uint16 implements encoding and decoding functions for a uint16 as used in RFC 2132, Section 9.10.
VIVCIdentifiers implements encoding and decoding methods for a DHCP option described in RFC 3925.