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

Encapsulates data for any resource recourd which only contains a domain name. More...

#include <DwmDnsRRDataDomainName.hh>

Inheritance diagram for Dwm::Dns::RRDataDomainName:
Collaboration diagram for Dwm::Dns::RRDataDomainName:

Public Member Functions

 RRDataDomainName ()
 constructs an empty domain name resource record data object.
 
 RRDataDomainName (const std::string &value)
 Construct with the given domain name value.
 
bool operator== (const RRDataDomainName &domainName) const
 Equal-to operator, mostly for unit testing.
 
const std::string & Value () const
 Returns the contained domain name.
 
const std::string & Value (const std::string &value)
 Sets and returns the contained domain name.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the domain name 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 domain name resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Protected Attributes

std::string _value
 

Friends

std::ostream & operator<< (std::ostream &os, const RRDataDomainName &domainName)
 Print the domain name resource record data to an ostream in human readable form. More...
 

Detailed Description

Encapsulates data for any resource recourd which only contains a domain name.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataDomainName domainName 
)
friend

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


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