trivial v0.1.0 Trivial.Packet View Source
Code for converting structured erlang data into a udp packet
which is then sent over the udp connection in a Trivial.Conn
struct.
Link to this section Summary
Types
structured data representing a data response
POSIX atom terms to describe transaction errors.
structured data representing an error response
structured data for connection responses
Functions
converts a structured erlang term and sends the corresponding TFTP packet over an open udp socket
Link to this section Types
Link to this type
data_def()
View Source
data_def()
View Source
data_def() :: {:data, block_id :: non_neg_integer(), iodata()}
data_def() :: {:data, block_id :: non_neg_integer(), iodata()}
structured data representing a data response
Link to this type
error_codes()
View Source
error_codes()
View Source
error_codes() :: :error | :enoent | :eacces | :enotsup | :einval | :enouser
error_codes() :: :error | :enoent | :eacces | :enotsup | :einval | :enouser
POSIX atom terms to describe transaction errors.
The following definitions are from RFC 1350 Appendix I (p. 9)
atom value meaning
:error 0 Not defined, see error message (if any).
:enoent 1 File not found.
:eacces 2 Access violation.
- 3 Disk full or allocation exceeded.
:enotsup 4 Illegal TFTP operation.
:eninval 5 Unknown transfer ID.
- 6 File already exists.
:enouser 7 No such user.
Link to this type
error_def()
View Source
error_def()
View Source
error_def() :: {:error, error_codes(), iodata()}
error_def() :: {:error, error_codes(), iodata()}
structured data representing an error response
Link to this type
packet_def() View Source
structured data for connection responses
Link to this section Functions
Link to this function
send(conn, arg2)
View Source
send(conn, arg2)
View Source
send(Trivial.Conn.t(), packet_def()) :: any()
send(Trivial.Conn.t(), packet_def()) :: any()
converts a structured erlang term and sends the corresponding TFTP packet over an open udp socket