transport

package
v0.0.0-...-5fb8a3f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package transport contains Linux-based transports for the DHCP broadcast and unicast specifications.

Index

Constants

This section is empty.

Variables

View Source
var ErrDeadlineExceeded = errors.New("deadline exceeded")

Functions

func NewInvalidMessageError

func NewInvalidMessageError(internalErr error) error

Types

type BroadcastTransport

type BroadcastTransport struct {
	// contains filtered or unexported fields
}

BroadcastTransport implements a DHCP transport based on a custom IP/UDP stack fulfilling the specific requirements for broadcasting DHCP packets (like all-zero source address, no ARP, ...)

func NewBroadcastTransport

func NewBroadcastTransport(iface *net.Interface) *BroadcastTransport

func (*BroadcastTransport) Close

func (t *BroadcastTransport) Close() error

func (*BroadcastTransport) Open

func (t *BroadcastTransport) Open() error

func (*BroadcastTransport) Receive

func (t *BroadcastTransport) Receive() (*dhcpv4.DHCPv4, error)

func (*BroadcastTransport) Send

func (t *BroadcastTransport) Send(payload *dhcpv4.DHCPv4) error

func (*BroadcastTransport) SetReceiveDeadline

func (t *BroadcastTransport) SetReceiveDeadline(deadline time.Time) error

type InvalidMessageError

type InvalidMessageError struct {
	// contains filtered or unexported fields
}

func (InvalidMessageError) Error

func (i InvalidMessageError) Error() string

func (InvalidMessageError) Unwrap

func (i InvalidMessageError) Unwrap() error

type UnicastTransport

type UnicastTransport struct {
	// contains filtered or unexported fields
}

UnicastTransport implements a DHCP transport based on a normal Linux UDP socket with some custom socket options to influence DSCP and routing.

func NewUnicastTransport

func NewUnicastTransport(iface *net.Interface) *UnicastTransport

func (*UnicastTransport) Close

func (t *UnicastTransport) Close() error

func (*UnicastTransport) Open

func (t *UnicastTransport) Open(serverIP, bindIP net.IP) error

func (*UnicastTransport) Receive

func (t *UnicastTransport) Receive() (*dhcpv4.DHCPv4, error)

func (*UnicastTransport) Send

func (t *UnicastTransport) Send(payload *dhcpv4.DHCPv4) error

func (*UnicastTransport) SetReceiveDeadline

func (t *UnicastTransport) SetReceiveDeadline(deadline time.Time) error

Jump to

Keyboard shortcuts

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