Error Trivial File Transfer Protocol packet.
More...
#include <packets.hpp>
|
| Error ()=default |
| Use with parsing functions only. More...
|
|
| Error (std::uint16_t ErrorCode, std::string_view ErrorMessage) |
|
| Error (std::uint16_t ErrorCode, std::string &&ErrorMessage) |
|
std::uint16_t | getType () const noexcept |
|
std::uint16_t | getErrorCode () const noexcept |
|
std::string_view | getErrorMessage () const noexcept |
|
template<class OutputIterator > |
std::size_t | serialize (OutputIterator It) const noexcept |
|
Error Trivial File Transfer Protocol packet.
◆ Error() [1/3]
tftp_common::packets::Error::Error |
( |
| ) |
|
|
default |
Use with parsing functions only.
◆ Error() [2/3]
tftp_common::packets::Error::Error |
( |
std::uint16_t |
ErrorCode, |
|
|
std::string_view |
ErrorMessage |
|
) |
| |
|
inline |
- Parameters
-
[ErrorCode] | Assumptions: The ErrorCode is equal or greater than zero and less or equal than eight |
◆ Error() [3/3]
tftp_common::packets::Error::Error |
( |
std::uint16_t |
ErrorCode, |
|
|
std::string && |
ErrorMessage |
|
) |
| |
|
inline |
- Parameters
-
[ErrorCode] | Assumptions: The ErrorCode is equal or greater than zero and less or equal than eight |
◆ getErrorCode()
std::uint16_t tftp_common::packets::Error::getErrorCode |
( |
| ) |
const |
|
inlinenoexcept |
◆ getErrorMessage()
std::string_view tftp_common::packets::Error::getErrorMessage |
( |
| ) |
const |
|
inlinenoexcept |
◆ getType()
std::uint16_t tftp_common::packets::Error::getType |
( |
| ) |
const |
|
inlinenoexcept |
◆ serialize()
template<class OutputIterator >
std::size_t tftp_common::packets::Error::serialize |
( |
OutputIterator |
It | ) |
const |
|
inlinenoexcept |
Convert packet to network byte order and serialize it into the given buffer by the iterator
- Parameters
-
[It] | Requirements: * (It) must be assignable from std::uint8_t |
- Returns
- Size of the packet (in bytes)
◆ parse
ParseResult parse |
( |
const std::uint8_t * |
Buffer, |
|
|
std::size_t |
Len, |
|
|
Error & |
Packet |
|
) |
| |
|
friend |
Parse error packet from buffer converting all fields to host byte order
- Parameters
-
[Buffer] | Assumptions: Buffer is not a nullptr, it's size is greater or equal than Len |
[Len] | Assumptions: Len is greater than zero
If parsing wasn't successful, Packet remains in valid but unspecified state |
The documentation for this class was generated from the following file: