data

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package data is an interface between DHCP backend implementations and the DHCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHCP

type DHCP struct {
	MACAddress       net.HardwareAddr // chaddr DHCP header.
	IPAddress        netip.Addr       // yiaddr DHCP header.
	SubnetMask       net.IPMask       // DHCP option 1.
	DefaultGateway   netip.Addr       // DHCP option 3.
	NameServers      []net.IP         // DHCP option 6.
	Hostname         string           // DHCP option 12.
	DomainName       string           // DHCP option 15.
	BroadcastAddress netip.Addr       // DHCP option 28.
	NTPServers       []net.IP         // DHCP option 42.
	VLANID           string           // DHCP option 43.116.
	LeaseTime        uint32           // DHCP option 51.
	Arch             string           // DHCP option 93.
	DomainSearch     []string         // DHCP option 119.
}

DHCP holds the DHCP headers and options to be set in a DHCP handler response. This is the API between a DHCP handler and a backend.

func (*DHCP) EncodeToAttributes

func (d *DHCP) EncodeToAttributes() []attribute.KeyValue

EncodeToAttributes returns a slice of opentelemetry attributes that can be used to set span.SetAttributes.

type Metadata

type Metadata struct {
	// IfName is the name of the interface that the DHCP message was received on.
	IfName string
	// IfIndex is the index of the interface that the DHCP message was received on.
	IfIndex int
}

Metadata holds metadata about the DHCP packet that was received.

type Netboot

type Netboot struct {
	AllowNetboot  bool     // If true, the client will be provided netboot options in the DHCP offer/ack.
	IPXEScriptURL *url.URL // Overrides a default value that is passed into DHCP on startup.
	IPXEScript    string   // Overrides a default value that is passed into DHCP on startup.
	Console       string
	Facility      string
}

Netboot holds info used in netbooting a client.

func (*Netboot) EncodeToAttributes

func (n *Netboot) EncodeToAttributes() []attribute.KeyValue

EncodeToAttributes returns a slice of opentelemetry attributes that can be used to set span.SetAttributes.

type Packet

type Packet struct {
	// Peer is the address of the client that sent the DHCP message.
	Peer net.Addr
	// Pkt is the DHCP message.
	Pkt *dhcpv4.DHCPv4
	// Md is the metadata that was passed to the DHCP server.
	Md *Metadata
}

Packet holds the data that is passed to a DHCP handler.

Jump to

Keyboard shortcuts

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