itftp

package
v0.0.0-...-b179a34 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package itftp implements a TFTP server for iPXE binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, addr netip.AddrPort, s *tftp.Server) error

ListenAndServe sets up the listener on the given address and serves TFTP requests.

func Serve

func Serve(_ context.Context, conn net.PacketConn, s *tftp.Server) error

Serve serves TFTP requests using the given conn and server.

Types

type Handler

type Handler struct {
	Log   logr.Logger
	Patch []byte
}

Handler is the struct that implements the TFTP read and write function handlers.

func (Handler) HandleRead

func (t Handler) HandleRead(filename string, rf io.ReaderFrom) error

HandleRead handlers TFTP GET requests. The function signature satisfies the tftp.Server.readHandler parameter type.

func (Handler) HandleWrite

func (t Handler) HandleWrite(filename string, wt io.WriterTo) error

HandleWrite handles TFTP PUT requests. It will always return an error. This library does not support PUT.

Jump to

Keyboard shortcuts

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