proxy

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package proxy implements a DHCP handler that provides proxyDHCP functionality.

"[A] Proxy DHCP server behaves much like a DHCP server by listening for ordinary DHCP client traffic and responding to certain client requests. However, unlike the DHCP server, the PXE Proxy DHCP server does not administer network addresses, and it only responds to clients that identify themselves as PXE clients. The responses given by the PXE Proxy DHCP server contain the mechanism by which the client locates the boot servers or the network addresses and descriptions of the supported, compatible boot servers."

Reference: https://www.ibm.com/docs/en/aix/7.1?topic=protocol-preboot-execution-environment-proxy-dhcp-daemon

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// Backend is the backend to use for getting DHCP data.
	Backend handler.BackendReader

	// IPAddr is the IP address to use in DHCP responses.
	// Option 54 and the sname DHCP header.
	// This could be a load balancer IP address or an ingress IP address or a local IP address.
	IPAddr netip.Addr

	// Log is used to log messages.
	// `logr.Discard()` can be used if no logging is desired.
	Log logr.Logger

	// Netboot configuration
	Netboot Netboot

	// OTELEnabled is used to determine if netboot options include otel naming.
	// When true, the netboot filename will be appended with otel information.
	// For example, the filename will be "snp.efi-00-23b1e307bb35484f535a1f772c06910e-d887dc3912240434-01".
	// <original filename>-00-<trace id>-<span id>-<trace flags>
	OTELEnabled bool

	// AutoProxyEnabled is used to determine if the proxyDHCP handler should do any Backend calls or not.
	// When enabled no Backend calls are made and responses are sent to all valid network boot clients.
	AutoProxyEnabled bool
}

Handler holds the configuration details for the running the DHCP server.

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, conn *ipv4.PacketConn, dp data.Packet)

Redirection name comes from section 2.5 of http://www.pix.net/software/pxeboot/archive/pxespec.pdf

type IgnorePacketError

type IgnorePacketError struct {
	PacketType dhcpv4.MessageType
	Details    string
}

IgnorePacketError is for when a DHCP packet should be ignored.

func (IgnorePacketError) Error

func (e IgnorePacketError) Error() string

Error returns the string representation of ErrIgnorePacket.

type Netboot

type Netboot struct {
	// iPXE binary server IP:Port serving via TFTP.
	IPXEBinServerTFTP netip.AddrPort

	// IPXEBinServerHTTP is the URL to the IPXE binary server serving via HTTP(s).
	IPXEBinServerHTTP *url.URL

	// IPXEScriptURL is the URL to the IPXE script to use.
	IPXEScriptURL func(*dhcpv4.DHCPv4) *url.URL

	// Enabled is whether to enable sending netboot DHCP options.
	Enabled bool

	// UserClass (for network booting) allows a custom DHCP option 77 to be used to break out of an iPXE loop.
	UserClass dhcp.UserClass
}

Netboot holds the netboot configuration details used in running a DHCP server.

Jump to

Keyboard shortcuts

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