iPXE
tftp.h File Reference

TFTP protocol. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  tftp_rrq
 A TFTP read request (RRQ) packet. More...
struct  tftp_data
 A TFTP data (DATA) packet. More...
struct  tftp_ack
 A TFTP acknowledgement (ACK) packet. More...
struct  tftp_error
 A TFTP error (ERROR) packet. More...
struct  tftp_oack
 A TFTP options acknowledgement (OACK) packet. More...
struct  tftp_common
 The common header of all TFTP packets. More...
union  tftp_any
 A union encapsulating all TFTP packet types. More...

Macros

#define TFTP_PORT   69
 Default TFTP server port.
#define TFTP_DEFAULT_BLKSIZE   512
 Default TFTP data block size.
#define TFTP_MAX_BLKSIZE   1432
#define TFTP_RRQ   1
 Read request opcode.
#define TFTP_WRQ   2
 Write request opcode.
#define TFTP_DATA   3
 Data block opcode.
#define TFTP_ACK   4
 Data block acknowledgement opcode.
#define TFTP_ERROR   5
 Error opcode.
#define TFTP_OACK   6
 Options acknowledgement opcode.
#define TFTP_ERR_FILE_NOT_FOUND   1
 File not found.
#define TFTP_ERR_ACCESS_DENIED   2
 Access violation.
#define TFTP_ERR_DISK_FULL   3
 Disk full or allocation exceeded.
#define TFTP_ERR_ILLEGAL_OP   4
 Illegal TFTP operation.
#define TFTP_ERR_UNKNOWN_TID   5
 Unknown transfer ID.
#define TFTP_ERR_FILE_EXISTS   6
 File already exists.
#define TFTP_ERR_UNKNOWN_USER   7
 No such user.
#define TFTP_ERR_BAD_OPTS   8
 Option negotiation failed.
#define MTFTP_PORT   1759
 Default MTFTP server port.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
struct tftp_rrq __attribute__ ((packed))

Variables

uint16_t opcode
char data [0]
uint16_t block
uint16_t errcode
char errmsg [0]
union tftp_any __attribute__

Detailed Description

TFTP protocol.

Definition in file tftp.h.

Macro Definition Documentation

◆ TFTP_PORT

#define TFTP_PORT   69

Default TFTP server port.

Definition at line 15 of file tftp.h.

Referenced by tftm_open(), tftp_open(), and tftp_timer_expired().

◆ TFTP_DEFAULT_BLKSIZE

#define TFTP_DEFAULT_BLKSIZE   512

Default TFTP data block size.

Definition at line 16 of file tftp.h.

Referenced by pxe_tftp_open(), and tftp_core_open().

◆ TFTP_MAX_BLKSIZE

#define TFTP_MAX_BLKSIZE   1432

Definition at line 17 of file tftp.h.

Referenced by tftp_send_rrq().

◆ TFTP_RRQ

#define TFTP_RRQ   1

Read request opcode.

Definition at line 19 of file tftp.h.

Referenced by tftp_send_rrq().

◆ TFTP_WRQ

#define TFTP_WRQ   2

Write request opcode.

Definition at line 20 of file tftp.h.

◆ TFTP_DATA

#define TFTP_DATA   3

Data block opcode.

Definition at line 21 of file tftp.h.

Referenced by tftp_rx().

◆ TFTP_ACK

#define TFTP_ACK   4

Data block acknowledgement opcode.

Definition at line 22 of file tftp.h.

Referenced by tftp_send_ack().

◆ TFTP_ERROR

#define TFTP_ERROR   5

Error opcode.

Definition at line 23 of file tftp.h.

Referenced by tftp_rx(), and tftp_send_error().

◆ TFTP_OACK

#define TFTP_OACK   6

Options acknowledgement opcode.

Definition at line 24 of file tftp.h.

Referenced by tftp_rx().

◆ TFTP_ERR_FILE_NOT_FOUND

#define TFTP_ERR_FILE_NOT_FOUND   1

File not found.

Definition at line 26 of file tftp.h.

Referenced by tftp_errcode_to_rc().

◆ TFTP_ERR_ACCESS_DENIED

#define TFTP_ERR_ACCESS_DENIED   2

Access violation.

Definition at line 27 of file tftp.h.

Referenced by tftp_errcode_to_rc().

◆ TFTP_ERR_DISK_FULL

#define TFTP_ERR_DISK_FULL   3

Disk full or allocation exceeded.

Definition at line 28 of file tftp.h.

◆ TFTP_ERR_ILLEGAL_OP

#define TFTP_ERR_ILLEGAL_OP   4

Illegal TFTP operation.

Definition at line 29 of file tftp.h.

Referenced by tftp_errcode_to_rc().

◆ TFTP_ERR_UNKNOWN_TID

#define TFTP_ERR_UNKNOWN_TID   5

Unknown transfer ID.

Definition at line 30 of file tftp.h.

◆ TFTP_ERR_FILE_EXISTS

#define TFTP_ERR_FILE_EXISTS   6

File already exists.

Definition at line 31 of file tftp.h.

◆ TFTP_ERR_UNKNOWN_USER

#define TFTP_ERR_UNKNOWN_USER   7

No such user.

Definition at line 32 of file tftp.h.

◆ TFTP_ERR_BAD_OPTS

#define TFTP_ERR_BAD_OPTS   8

Option negotiation failed.

Definition at line 33 of file tftp.h.

◆ MTFTP_PORT

#define MTFTP_PORT   1759

Default MTFTP server port.

Definition at line 35 of file tftp.h.

Referenced by mtftp_open().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ __attribute__()

struct tftp_rrq __attribute__ ( (packed) )

Variable Documentation

◆ opcode

uint16_t opcode

Definition at line 0 of file tftp.h.

◆ data

char data[0]

Definition at line 1 of file tftp.h.

◆ block

uint16_t block

Definition at line 1 of file tftp.h.

◆ errcode

uint16_t errcode

Definition at line 1 of file tftp.h.

Referenced by tftp_errcode_to_rc(), and tftp_send_error().

◆ errmsg

char errmsg[0]

Definition at line 2 of file tftp.h.

Referenced by tftp_send_error().