DwmDns-0.1.0
Dwm::Dns::RRDataTXT Class Reference

Encapsulates TXT resource record data. More...

#include <DwmDnsRRDataTXT.hh>

Inheritance diagram for Dwm::Dns::RRDataTXT:
Collaboration diagram for Dwm::Dns::RRDataTXT:

Public Member Functions

 RRDataTXT ()
 Construct with empty data.
 
 RRDataTXT (const std::vector< std::string > &txt)
 Construct with the given txt.
 
bool operator== (const RRDataTXT &txt) const
 Equal-to operator, mostly for unit testing.
 
const std::vector< std::string > & Txt () const
 Returns the contained TXT data.
 
const std::vector< std::string > & Txt (const std::vector< std::string > &txt)
 Sets and returns the contained TXT data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the TXT resource record data into buffer @ pkt of length pktlen, starting at ptr. More...
 
const uint8_t * Decode (const uint8_t *pkt, const uint8_t *ptr, uint16_t pktlen, uint16_t rdlen)
 Decodes the TXT resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 16
 

Friends

std::ostream & operator<< (std::ostream &os, const RRDataTXT &txt)
 Print the TXT resource record data to an ostream in human readable form. More...
 

Detailed Description

Encapsulates TXT resource record data.

See RFC1035 for details.

Member Function Documentation

◆ Decode()

const uint8_t* Dwm::Dns::RRDataTXT::Decode ( const uint8_t *  pkt,
const uint8_t *  ptr,
uint16_t  pktlen,
uint16_t  rdlen 
)
virtual

Decodes the TXT resource record data from buffer pkt of length pktlen, starting at ptr.

Returns the address immediately following the encoded TXT resource record data in pkt on success. Throws std::out_of_range if pkt was too short to contain an encoded TXT resource record data.

Implements Dwm::Dns::RRData.

◆ Encode()

uint8_t* Dwm::Dns::RRDataTXT::Encode ( uint8_t *  pkt,
uint8_t *  ptr,
uint16_t  pktlen,
LabelPositions lps 
) const
virtual

Encodes the TXT resource record data into buffer @ pkt of length pktlen, starting at ptr.

Returns the address immediately following the encoded TXT resource record data in pkt on success. Throws std::out_of_range if pkt is too short to contain the encoded TXT resource record data.

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataTXT txt 
)
friend

Print the TXT resource record data to an ostream in human readable form.


The documentation for this class was generated from the following file: