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

Encapsulates SOA resource record data. More...

#include <DwmDnsRRDataSOA.hh>

Inheritance diagram for Dwm::Dns::RRDataSOA:
Collaboration diagram for Dwm::Dns::RRDataSOA:

Public Member Functions

 RRDataSOA ()
 Construct with an empty MNAME and RNAME.
 
 RRDataSOA (const std::string &mname, const std::string &rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum)
 Construct with the given mname, rname, serial, refresh, retry, expire and minimum. More...
 
bool operator== (const RRDataSOA &soa) const
 Equal-to operator, mostly for unit testing.
 
const std::string & Mname () const
 Returns the contained MNAME.
 
const std::string & Mname (const std::string &mname)
 Sets and returns the contained MNAME.
 
const std::string & Rname () const
 Returns the contained RNAME.
 
const std::string & Rname (const std::string &rname)
 Sets and returns the contained RNAME.
 
uint32_t Serial () const
 Returns the contained serial.
 
uint32_t Serial (uint32_t serial)
 Sets and returns the contained serial.
 
uint32_t Refresh () const
 Returns the contained refresh.
 
uint32_t Refresh (uint32_t refresh)
 Sets and returns the contained refresh.
 
uint32_t Retry () const
 Returns the contained retry.
 
uint32_t Retry (uint32_t retry)
 Sets and returns the contained retry.
 
uint32_t Expire () const
 Returns the contained expire.
 
uint32_t Expire (uint32_t expire)
 Sets and returns the contained expire.
 
uint32_t Minimum () const
 Returns the contained minimum.
 
uint32_t Minimum (uint32_t minimum)
 Sets and returns the contained minimum.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the SOA 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 SOA resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 6
 

Friends

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

Detailed Description

Encapsulates SOA resource record data.

See RFC1035 for details.

Constructor & Destructor Documentation

◆ RRDataSOA()

Dwm::Dns::RRDataSOA::RRDataSOA ( const std::string &  mname,
const std::string &  rname,
uint32_t  serial,
uint32_t  refresh,
uint32_t  retry,
uint32_t  expire,
uint32_t  minimum 
)

Construct with the given mname, rname, serial, refresh, retry, expire and minimum.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataSOA soa 
)
friend

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


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