dhcp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncapsulatedOptions = 175 // ipxe-encap-opts: encapsulate ipxe

	OptionPriority        = 1   // ipxe.priority: int8
	OptionKeepSAN         = 8   // ipxe.keep-san: uint8
	OptionSkipSANBoot     = 9   // ipxe.skip-san-boot: uint8
	OptionUserClass       = 77  // ipxe.user-class: string
	OptionSyslogs         = 85  // ipxe.syslogs: string
	OptionCertificate     = 91  // ipxe.cert: string
	OptionPrivateKey      = 92  // ipxe.privkey: string
	OptionCrossCert       = 93  // ipxe.crosscert: string
	OptionNoPXEDHCP       = 176 // ipxe.no-pxedhcp: uint8
	OptionBusID           = 177 // ipxe.bus-id: string
	OptionBIOSDrive       = 189 // ipxe.bios-drive: uint8
	OptionUsername        = 190 // ipxe.username: string
	OptionPassword        = 191 // ipxe.password: string
	OptionReverseUsername = 192 // ipxe.reverse-username: string
	OptionReversePassword = 193 // ipxe.reverse-password: string
	OptionInitiatorIQN    = 203 // iscsi-initiator-iqn: string
	OptionVersion         = 235 // ipxe.version: string

	FeaturePXEXT     = 16 // ipxe.pxeext: uint8
	FeatureISCSI     = 17 // ipxe.iscsi: uint8
	FeatureAoE       = 18 // ipxe.aoe: uint8
	FeatureHTTP      = 19 // ipxe.http: uint8
	FeatureHTTPS     = 20 // ipxe.https: uint8
	FeatureTFTP      = 21 // ipxe.tftp: uint8
	FeatureFTP       = 22 // ipxe.ftp: uint8
	FeatureDNS       = 23 // ipxe.dns: uint8
	FeatureBzImage   = 24 // ipxe.bzimage: uint8
	FeatureMultiboot = 25 // ipxe.multiboot: uint8
	FeatureSLAM      = 26 // ipxe.slam: uint8
	FeatureSRP       = 27 // ipxe.srp: uint8
	FeatureNBI       = 32 // ipxe.nbi: uint8
	FeaturePXE       = 33 // ipxe.pxe: uint8
	FeatureELF       = 34 // ipxe.elf: uint8
	FeatureCOMBOOT   = 35 // ipxe.comboot: uint8
	FeatureEFI       = 36 // ipxe.efi: uint8
	FeatureFCoE      = 37 // ipxe.fcoe: uint8
	FeatureVLAN      = 38 // ipxe.vlan: uint8
	FeatureMenu      = 39 // ipxe.menu: uint8
	FeatureSDI       = 40 // ipxe.sdi: uint8
	FeatureNFS       = 41 // ipxe.nfs: uint8
)

Variables

This section is empty.

Functions

func Arch

func Arch(req *dhcp4.Packet) string

func IsARM

func IsARM(req *dhcp4.Packet) bool

func IsHTTPClient added in v0.7.0

func IsHTTPClient(req *dhcp4.Packet) bool

IsHTTPClient returns a boolean of whether the client supports HTTP fetching.

func IsPXE

func IsPXE(req *dhcp4.Packet) bool

func IsTinkerbellIPXE added in v0.9.0

func IsTinkerbellIPXE(req *dhcp4.Packet) bool

IsTinkerbellIPXE returns bool depending on if the DHCP request originated from an iPXE binary with its user-class (opt 77) set to "Tinkerbell" github.com/tinkerbell/boots-ipxe builds the iPXE binary with the user-class set to "Tinkerbell" https://ipxe.org/appnote/userclass

func IsUEFI

func IsUEFI(req *dhcp4.Packet) bool

func ProcessorArchType

func ProcessorArchType(req *dhcp4.Packet) string

func SetFilename

func SetFilename(log logr.Logger, rep *dhcp4.Packet, filename string, nextServer net.IP, httpClient bool, httpServerFQDN string)

func Setup added in v0.9.0

func Setup(rep *dhcp4.Packet, publicSyslogIPv4 net.IP)

func SetupPXE

func SetupPXE(ctx context.Context, log logr.Logger, rep, req *dhcp4.Packet) bool

Types

type Ack

type Ack struct {
	dhcp4.Ack
	// contains filtered or unexported fields
}

func NewAck

func NewAck(w dhcp4.ReplyWriter, req *dhcp4.Packet) *Ack

func (*Ack) Packet

func (r *Ack) Packet() *dhcp4.Packet

func (*Ack) Send

func (r *Ack) Send() error

type Config

type Config struct {
	Log logr.Logger
	// contains filtered or unexported fields
}

func (*Config) ApplyTo

func (c *Config) ApplyTo(rep *dhcp4.Packet) bool

func (*Config) SetDHCPServer

func (c *Config) SetDHCPServer(ip net.IP)

func (*Config) SetDNSServers

func (c *Config) SetDNSServers(ips []net.IP)

func (*Config) SetHostname

func (c *Config) SetHostname(s string)

func (*Config) SetLeaseTime

func (c *Config) SetLeaseTime(d time.Duration)

func (*Config) SetOpt43SubOpt added in v0.8.0

func (c *Config) SetOpt43SubOpt(subOpt dhcp4.Option, s string)

SetOpt43SubOpt sets an option 43 sub-option. If option 43 is already set, the sub-option is appended.

func (*Config) Setup

func (c *Config) Setup(address, netmask, gateway net.IP)

type Offer

type Offer struct {
	dhcp4.Offer
	// contains filtered or unexported fields
}

func NewOffer

func NewOffer(w dhcp4.ReplyWriter, req *dhcp4.Packet) *Offer

func (*Offer) Packet

func (r *Offer) Packet() *dhcp4.Packet

func (*Offer) Send

func (r *Offer) Send() error

type Reply

type Reply interface {
	Packet() *dhcp4.Packet
	Send() error
}

func NewReply

func NewReply(w dhcp4.ReplyWriter, req *dhcp4.Packet) Reply

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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