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

Encapsulates DNSKEY resource record data. More...

#include <DwmDnsRRDataDNSKEY.hh>

Inheritance diagram for Dwm::Dns::RRDataDNSKEY:
Collaboration diagram for Dwm::Dns::RRDataDNSKEY:

Public Member Functions

 RRDataDNSKEY ()
 Constructs empty DNSKEY resource record data.
 
 RRDataDNSKEY (uint16_t flags, uint8_t protocol, uint8_t algorithm, const std::string &publicKey)
 Construct DNSKEY resource record data with the given flags, protocol, algorithm and publicKey. More...
 
bool operator== (const RRDataDNSKEY &dnskey) const
 Equal-to operator, mostly for unit testing.
 
uint16_t Flags () const
 Returns the flags in the DNSKEY resource record data.
 
uint16_t Flags (uint16_t flags)
 Sets and returns the flags in the DNSKEY resource record data.
 
uint8_t Protocol () const
 Per RFC 4034, protocol must always be 3.
 
uint8_t Protocol (uint8_t protocol)
 Per RFC 4034, protocol must always be 3.
 
uint8_t Algorithm () const
 Returns the algorithm in the DNSKEY resource record data.
 
uint8_t Algorithm (uint8_t algorithm)
 Sets and returns the algorithm in the DNSKEY resource record data.
 
const std::string & PublicKey () const
 Returns the public key in the DNSKEY resource record data.
 
const std::string & PublicKey (const std::string &publicKey)
 Set and returns the public key in the DNSKEY resource record data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the DNSKEY 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 DNSKEY resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 48
 
static const uint16_t k_flagsZoneKeyMask = 0x0080
 
static const uint16_t k_flagsSecureEntryPointMask = 0x8000
 
static const uint8_t k_algorithmReserved = 0
 
static const uint8_t k_algorithmRSAMD5 = 1
 
static const uint8_t k_algorithmDiffieHellman = 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 RRDataDNSKEY &dnskey)
 Print the DNSKEY resource record data to an ostream in human readable form. More...
 

Detailed Description

Encapsulates DNSKEY resource record data.

See RFC 4034 for details.

Constructor & Destructor Documentation

◆ RRDataDNSKEY()

Dwm::Dns::RRDataDNSKEY::RRDataDNSKEY ( uint16_t  flags,
uint8_t  protocol,
uint8_t  algorithm,
const std::string &  publicKey 
)

Construct DNSKEY resource record data with the given flags, protocol, algorithm and publicKey.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataDNSKEY dnskey 
)
friend

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


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