Data Trivial File Transfer Protocol packet.
More...
#include <packets.hpp>
|
| Data ()=default |
| Use with parsing functions only. More...
|
|
| Data (std::uint16_t Block, const std::vector< std::uint8_t > &Buffer) |
|
| Data (std::uint16_t Block, std::vector< std::uint8_t > &&Buffer) noexcept |
|
template<class OutputIterator > |
std::size_t | serialize (OutputIterator It) const noexcept |
|
std::uint16_t | getType () const noexcept |
|
std::uint16_t | getBlock () const noexcept |
|
const std::vector< std::uint8_t > & | getData () const noexcept |
|
Data Trivial File Transfer Protocol packet.
◆ Data() [1/3]
tftp_common::packets::Data::Data |
( |
| ) |
|
|
default |
Use with parsing functions only.
◆ Data() [2/3]
tftp_common::packets::Data::Data |
( |
std::uint16_t |
Block, |
|
|
const std::vector< std::uint8_t > & |
Buffer |
|
) |
| |
|
inline |
- Parameters
-
[Block] | Assumptions: The Block value is greater than one |
[Buffer] | Assumptions: The Buffer size is greater or equal than 0 and less or equal than 512 |
◆ Data() [3/3]
tftp_common::packets::Data::Data |
( |
std::uint16_t |
Block, |
|
|
std::vector< std::uint8_t > && |
Buffer |
|
) |
| |
|
inlinenoexcept |
- Parameters
-
[Block] | Assumptions: The Block value is greater than one |
[Buffer] | Assumptions: The Buffer size is greater or equal than 0 and less or equal than 512 |
◆ getBlock()
std::uint16_t tftp_common::packets::Data::getBlock |
( |
| ) |
const |
|
inlinenoexcept |
◆ getData()
const std::vector<std::uint8_t>& tftp_common::packets::Data::getData |
( |
| ) |
const |
|
inlinenoexcept |
◆ getType()
std::uint16_t tftp_common::packets::Data::getType |
( |
| ) |
const |
|
inlinenoexcept |
◆ serialize()
template<class OutputIterator >
std::size_t tftp_common::packets::Data::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, |
|
|
Data & |
Packet |
|
) |
| |
|
friend |
Parse data 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: