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

Encapsulates MX resource record data. More...

#include <DwmDnsRRDataMX.hh>

Inheritance diagram for Dwm::Dns::RRDataMX:
Collaboration diagram for Dwm::Dns::RRDataMX:

Public Member Functions

 RRDataMX ()
 Construct with an empty exchange with preference 0.
 
 RRDataMX (uint16_t preference, const std::string &exchange)
 Construct with the given preference and exchange.
 
bool operator== (const RRDataMX &mx) const
 Equal-to operator, mostly for unit testing.
 
uint16_t Preference () const
 Returns the preference in the MX resource record data.
 
uint16_t Preference (uint16_t preference)
 Sets and returns the preference in the MX resource record data.
 
const std::string & Exchange () const
 Returns the exchange in the MX resource record data.
 
const std::string & Exchange (const std::string &exchange)
 Sets and returns the exchange in the MX resource record data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the MX 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 MX resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 15
 

Friends

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

Detailed Description

Encapsulates MX resource record data.

See RFC1035 for details.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataMX mx 
)
friend

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


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