Expand description
TFTP (Trivial File Transfer Protocol) layer implementation.
Implements RFC 1350 TFTP packet parsing as a zero-copy view into a packet buffer.
TFTP operates over UDP port 69 and defines 5 packet types:
§Packet Types
| Opcode | Abbreviation | Packet Type |
|---|---|---|
| 1 | RRQ | Read Request |
| 2 | WRQ | Write Request |
| 3 | DATA | Data |
| 4 | ACK | Acknowledgment |
| 5 | ERROR | Error |
§Packet Formats
RRQ / WRQ:
2 bytes string 1 byte string 1 byte
+---------+--------+--------+--------+--------+
| Opcode |Filename| 0 | Mode | 0 |
+---------+--------+--------+--------+--------+DATA:
2 bytes 2 bytes n bytes
+---------+---------+--------+
| Opcode | Block# | Data |
+---------+---------+--------+ACK:
2 bytes 2 bytes
+---------+---------+
| Opcode | Block# |
+---------+---------+ERROR:
2 bytes 2 bytes string 1 byte
+---------+---------+--------+--------+
| Opcode | ErrorCode| ErrMsg | 0 |
+---------+---------+--------+--------+Re-exports§
pub use builder::TftpBuilder;
Modules§
- builder
- TFTP packet builder.
Structs§
- Tftp
Layer - A zero-copy view into a TFTP layer within a packet buffer.
Constants§
- ERR_
ACCESS_ VIOLATION - ERR_
DISK_ FULL - ERR_
FILE_ EXISTS - ERR_
FILE_ NOT_ FOUND - ERR_
ILLEGAL_ OPERATION - ERR_
NO_ SUCH_ USER - ERR_
UNDEFINED - ERR_
UNKNOWN_ TID - OPCODE_
ACK - OPCODE_
DATA - OPCODE_
ERROR - OPCODE_
RRQ - OPCODE_
WRQ - TFTP_
DEFAULT_ BLOCK_ SIZE - Default TFTP data block size (bytes).
- TFTP_
MIN_ HEADER_ LEN - Minimum TFTP header: opcode (2 bytes).
- TFTP_
PORT - TFTP server UDP port.
Statics§
- TFTP_
FIELD_ NAMES - Field names for Python/generic access.
Functions§
- error_
code_ description - Returns a human-readable description for a TFTP error code.
- is_
tftp_ payload - Returns true if
buflooks like a TFTP payload. - opcode_
name - Returns a human-readable name for a TFTP opcode.
- tftp_
show_ fields - Display fields for
TftpLayerinshow()output.