tftp_common  1.3.0
Namespaces | Classes | Functions
tftp_common::packets Namespace Reference

Namespaces

 errors
 
 modes
 
 types
 

Classes

class  Request
 Read/Write Request (RRQ/WRQ) Trivial File Transfer Protocol packet. More...
 
class  Data
 Data Trivial File Transfer Protocol packet. More...
 
class  Acknowledgment
 Acknowledgment Trivial File Transfer Protocol packet. More...
 
class  Error
 Error Trivial File Transfer Protocol packet. More...
 
class  OptionAcknowledgment
 Option Acknowledgment Trivial File Transfer Protocol packet. More...
 
struct  ParseResult
 The result of parsing a single packet. More...
 

Functions

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

Function Documentation

◆ parse() [1/5]

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

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

◆ parse() [2/5]

ParseResult tftp_common::packets::parse ( const std::uint8_t *  Buffer,
std::size_t  Len,
Data Packet 
)

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

◆ parse() [3/5]

ParseResult tftp_common::packets::parse ( const std::uint8_t *  Buffer,
std::size_t  Len,
Error Packet 
)

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

◆ parse() [4/5]

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

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

◆ parse() [5/5]

ParseResult tftp_common::packets::parse ( const std::uint8_t *  Buffer,
std::size_t  Len,
Request Packet 
)

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
Here is the caller graph for this function: