Read/Write Request (RRQ/WRQ) Trivial File Transfer Protocol packet.
More...
#include <packets.hpp>
|
| Request ()=default |
| Use with parsing functions only. More...
|
|
| Request (types::Type Type, std::string_view Filename, std::string_view Mode) |
|
| Request (types::Type Type, std::string &&Filename, std::string &&Mode) noexcept |
|
| Request (types::Type Type, std::string_view Filename, std::string_view Mode, const std::vector< std::string > &OptionsNames, const std::vector< std::string > &OptionsValues) |
|
| Request (types::Type Type, std::string &&Filename, std::string &&Mode, std::vector< std::string > &&OptionsNames, std::vector< std::string > &&OptionsValues) noexcept |
|
template<class OutputIterator > |
std::size_t | serialize (OutputIterator It) const noexcept |
|
std::uint16_t | getType () const noexcept |
|
std::string_view | getFilename () const noexcept |
|
std::string_view | getMode () const noexcept |
|
std::string_view | getOptionName (std::size_t Idx) const noexcept |
|
std::string_view | getOptionValue (std::size_t Idx) const noexcept |
|
Read/Write Request (RRQ/WRQ) Trivial File Transfer Protocol packet.
◆ Request() [1/5]
tftp_common::packets::Request::Request |
( |
| ) |
|
|
default |
Use with parsing functions only.
◆ Request() [2/5]
tftp_common::packets::Request::Request |
( |
types::Type |
Type, |
|
|
std::string_view |
Filename, |
|
|
std::string_view |
Mode |
|
) |
| |
|
inline |
- Parameters
-
[Type] | Assumptions: The type is either ::ReadRequest or ::WriteRequest |
◆ Request() [3/5]
tftp_common::packets::Request::Request |
( |
types::Type |
Type, |
|
|
std::string && |
Filename, |
|
|
std::string && |
Mode |
|
) |
| |
|
inlinenoexcept |
- Parameters
-
[Type] | Assumptions: The type is either ::ReadRequest or ::WriteRequest |
◆ Request() [4/5]
tftp_common::packets::Request::Request |
( |
types::Type |
Type, |
|
|
std::string_view |
Filename, |
|
|
std::string_view |
Mode, |
|
|
const std::vector< std::string > & |
OptionsNames, |
|
|
const std::vector< std::string > & |
OptionsValues |
|
) |
| |
|
inline |
- Parameters
-
[Type] | Assumptions: The type is either ::ReadRequest or ::WriteRequest |
◆ Request() [5/5]
tftp_common::packets::Request::Request |
( |
types::Type |
Type, |
|
|
std::string && |
Filename, |
|
|
std::string && |
Mode, |
|
|
std::vector< std::string > && |
OptionsNames, |
|
|
std::vector< std::string > && |
OptionsValues |
|
) |
| |
|
inlinenoexcept |
- Parameters
-
[Type] | Assumptions: The type is either ::ReadRequest or ::WriteRequest |
◆ getFilename()
std::string_view tftp_common::packets::Request::getFilename |
( |
| ) |
const |
|
inlinenoexcept |
◆ getMode()
std::string_view tftp_common::packets::Request::getMode |
( |
| ) |
const |
|
inlinenoexcept |
◆ getOptionName()
std::string_view tftp_common::packets::Request::getOptionName |
( |
std::size_t |
Idx | ) |
const |
|
inlinenoexcept |
◆ getOptionValue()
std::string_view tftp_common::packets::Request::getOptionValue |
( |
std::size_t |
Idx | ) |
const |
|
inlinenoexcept |
◆ getType()
std::uint16_t tftp_common::packets::Request::getType |
( |
| ) |
const |
|
inlinenoexcept |
◆ serialize()
template<class OutputIterator >
std::size_t tftp_common::packets::Request::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
Parse read/write request 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: