tftp_common  1.3.0
Public Member Functions | Friends | List of all members
tftp_common::packets::OptionAcknowledgment Class Referencefinal

Option Acknowledgment Trivial File Transfer Protocol packet. More...

#include <packets.hpp>

Public Member Functions

 OptionAcknowledgment ()=default
 Use with parsing functions only. More...
 
 OptionAcknowledgment (std::unordered_map< std::string, std::string > Options)
 
template<class OutputIterator >
std::size_t serialize (OutputIterator It) const noexcept
 
std::uint16_t getType () const noexcept
 
auto begin () noexcept
 
auto begin () const noexcept
 
auto cbegin () const noexcept
 
auto end () noexcept
 
auto end () const noexcept
 
auto cend () const noexcept
 
std::string_view getOptionValue (const std::string &OptionName) const noexcept
 

Friends

ParseResult parse (const std::uint8_t *Buffer, std::size_t Len, OptionAcknowledgment &Packet)
 

Detailed Description

Option Acknowledgment Trivial File Transfer Protocol packet.

Constructor & Destructor Documentation

◆ OptionAcknowledgment() [1/2]

tftp_common::packets::OptionAcknowledgment::OptionAcknowledgment ( )
default

Use with parsing functions only.

◆ OptionAcknowledgment() [2/2]

tftp_common::packets::OptionAcknowledgment::OptionAcknowledgment ( std::unordered_map< std::string, std::string >  Options)
inline

Member Function Documentation

◆ begin() [1/2]

auto tftp_common::packets::OptionAcknowledgment::begin ( ) const
inlinenoexcept
Returns
Constant iterator to the first option (name and value) pair

◆ begin() [2/2]

auto tftp_common::packets::OptionAcknowledgment::begin ( )
inlinenoexcept
Returns
Iterator to the first option (name and value) pair

◆ cbegin()

auto tftp_common::packets::OptionAcknowledgment::cbegin ( ) const
inlinenoexcept
Returns
Constant iterator to the first option (name and value) pair

◆ cend()

auto tftp_common::packets::OptionAcknowledgment::cend ( ) const
inlinenoexcept
Returns
Constant iterator to the element following the last option (name and value) pair

◆ end() [1/2]

auto tftp_common::packets::OptionAcknowledgment::end ( ) const
inlinenoexcept
Returns
Constant iterator to the element following the last option (name and value) pair

◆ end() [2/2]

auto tftp_common::packets::OptionAcknowledgment::end ( )
inlinenoexcept
Returns
Iterator to the element following the last option (name and value) pair

◆ getOptionValue()

std::string_view tftp_common::packets::OptionAcknowledgment::getOptionValue ( const std::string &  OptionName) const
inlinenoexcept

Get option value by its name

Exceptions
std::out_of_rangeif there's no option with the specified name
Here is the caller graph for this function:

◆ getType()

std::uint16_t tftp_common::packets::OptionAcknowledgment::getType ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ serialize()

template<class OutputIterator >
std::size_t tftp_common::packets::OptionAcknowledgment::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)
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ parse

ParseResult parse ( const std::uint8_t *  Buffer,
std::size_t  Len,
OptionAcknowledgment 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: