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

Encapsulates A resource record data. More...

#include <DwmDnsRRDataA.hh>

Inheritance diagram for Dwm::Dns::RRDataA:
Collaboration diagram for Dwm::Dns::RRDataA:

Public Member Functions

 RRDataA ()
 Constructs an empty A record's data.
 
 RRDataA (const in_addr &inAddr)
 Constructs an A record's data with the given IPv4 address inAddr. More...
 
bool operator== (const RRDataA &a) const
 Equal-to operator, for unit testing.
 
const in_addr & InAddr () const
 Returns IPv4 address in the A record's data.
 
const in_addr & InAddr (const in_addr &inAddr)
 Sets and returns IPv4 address in the A record's data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the A 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 A record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 1
 

Friends

std::ostream & operator<< (std::ostream &os, const RRDataA &a)
 Prints the A record data to an ostream in human readable form.
 

Detailed Description

Encapsulates A resource record data.

See RFC1035 for details.

Constructor & Destructor Documentation

◆ RRDataA()

Dwm::Dns::RRDataA::RRDataA ( const in_addr &  inAddr)

Constructs an A record's data with the given IPv4 address inAddr.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.


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