dhcpv4

package
v3.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	testMode bool,
	results protos.Reporter,
	cfg *common.Config,
) (protos.Plugin, error)

New constructs a new dhcpv4 protocol plugin.

Types

type IPAddressOption

type IPAddressOption struct {
	OptionCode dhcpv4.OptionCode
	IPAddress  net.IP
}

IPAddressOption represents an option whose value is a single IP address.

func ParseIPAddressOption

func ParseIPAddressOption(data []byte) (*IPAddressOption, error)

ParseIPAddressOption returns a new IPAddressOption from a byte stream, or error if any.

func (*IPAddressOption) Code

func (o *IPAddressOption) Code() dhcpv4.OptionCode

Code returns the option code.

func (*IPAddressOption) Length

func (o *IPAddressOption) Length() int

Length returns the length of the data portion (excluding option code an byte length).

func (*IPAddressOption) String

func (o *IPAddressOption) String() string

String returns a human-readable string.

func (*IPAddressOption) ToBytes

func (o *IPAddressOption) ToBytes() []byte

ToBytes returns a serialized stream of bytes for this option.

type IPAddressesOption

type IPAddressesOption struct {
	dhcpv4.OptionCode
	IPAddresses []net.IP
}

IPAddressesOption represents an option whose value is a list of IP addresses.

func ParseIPAddressesOption

func ParseIPAddressesOption(data []byte) (*IPAddressesOption, error)

ParseIPAddressesOption returns a new IPAddressesOption from a byte stream, or error if any.

func (*IPAddressesOption) Code

Code returns the option code.

func (*IPAddressesOption) Length

func (o *IPAddressesOption) Length() int

Length returns the length of the data portion (excluding option code an byte length).

func (*IPAddressesOption) String

func (o *IPAddressesOption) String() string

String returns a human-readable string.

func (*IPAddressesOption) ToBytes

func (o *IPAddressesOption) ToBytes() []byte

ToBytes returns a serialized stream of bytes for this option.

type TextOption

type TextOption struct {
	OptionCode dhcpv4.OptionCode
	Text       string
}

TextOption represents an option whose value is a string.

func ParseTextOption

func ParseTextOption(data []byte) (*TextOption, error)

ParseTextOption returns a new TextOption from a byte stream, or error if any.

func (*TextOption) Code

func (o *TextOption) Code() dhcpv4.OptionCode

Code returns the option code.

func (*TextOption) Length

func (o *TextOption) Length() int

Length returns the length of the data portion (excluding option code an byte length).

func (*TextOption) String

func (o *TextOption) String() string

String returns a human-readable string.

func (*TextOption) ToBytes

func (o *TextOption) ToBytes() []byte

ToBytes returns a serialized stream of bytes for this option.

Jump to

Keyboard shortcuts

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