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

Acknowledgment Trivial File Transfer Protocol packet. More...

#include <packets.hpp>

Public Member Functions

 Acknowledgment ()=default
 Use with parsing functions only. More...
 
 Acknowledgment (std::uint16_t Block) noexcept
 
std::uint16_t getType () const noexcept
 
std::uint16_t getBlock () const noexcept
 
template<class OutputIterator >
std::size_t serialize (OutputIterator It) const noexcept
 

Friends

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

Detailed Description

Acknowledgment Trivial File Transfer Protocol packet.

Constructor & Destructor Documentation

◆ Acknowledgment() [1/2]

tftp_common::packets::Acknowledgment::Acknowledgment ( )
default

Use with parsing functions only.

◆ Acknowledgment() [2/2]

tftp_common::packets::Acknowledgment::Acknowledgment ( std::uint16_t  Block)
inlineexplicitnoexcept
Parameters
[Block]Assumptions: the Block is equal or greater than one

Member Function Documentation

◆ getBlock()

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

◆ getType()

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

◆ serialize()

template<class OutputIterator >
std::size_t tftp_common::packets::Acknowledgment::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,
Acknowledgment Packet 
)
friend

Parse acknowledgment 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: