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

Encapsulates DS resource record data. More...

#include <DwmDnsRRDataDS.hh>

Inheritance diagram for Dwm::Dns::RRDataDS:
Collaboration diagram for Dwm::Dns::RRDataDS:

Public Member Functions

 RRDataDS ()
 Constructs an empty DS resource record data object.
 
 RRDataDS (uint16_t keyTag, uint8_t algorithm, uint8_t digestType, const std::string &digest)
 Constructs DS resource record dats with keyTag, algorithm, digestType and digest. More...
 
bool operator== (const RRDataDS &ds) const
 Equal-to operator, mostly for unit testing.
 
uint16_t KeyTag () const
 Returns the key tag in the DS resource record data.
 
uint16_t KeyTag (uint16_t keyTag)
 Sets and returns the key tag in the DS resource record data.
 
uint8_t Algorithm () const
 Returns the algorithm in the DS resource record data.
 
uint8_t Algorithm (uint8_t algorithm)
 Sets and returns the algorithm in the DS resource record data.
 
uint8_t DigestType () const
 Returns the digest type in the DS resource record data.
 
uint8_t DigestType (uint16_t digestType)
 Sets and returns the digest type in the DS resource record data.
 
const std::string & Digest () const
 Returns the digest in the DS resource record data.
 
const std::string & Digest (const std::string &digest)
 Sets and returns the digest in the DS resource record data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the DS 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 DS resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 43
 
static const uint8_t k_digestTypeReserved = 0
 
static const uint8_t k_digestTypeSHA1 = 1
 
static const uint8_t k_algorithmReserved = 0
 
static const uint8_t k_algorithmRSAMD5 = 1
 
static const uint8_t k_algorithmDH = 2
 
static const uint8_t k_algorithmDSA = 3
 
static const uint8_t k_algorithmECC = 4
 
static const uint8_t k_algorithmRSASHA1 = 5
 
static const uint8_t k_algorithmINDIRECT = 252
 
static const uint8_t k_algorithmPRIVATEDNS = 253
 
static const uint8_t k_algorithmPRIVATEOID = 254
 

Friends

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

Detailed Description

Encapsulates DS resource record data.

See RFC 4034 for details.

Constructor & Destructor Documentation

◆ RRDataDS()

Dwm::Dns::RRDataDS::RRDataDS ( uint16_t  keyTag,
uint8_t  algorithm,
uint8_t  digestType,
const std::string &  digest 
)

Constructs DS resource record dats with keyTag, algorithm, digestType and digest.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataDS ds 
)
friend

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


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