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

Encapsulates KEY resource record data. More...

#include <DwmDnsRRDataKEY.hh>

Inheritance diagram for Dwm::Dns::RRDataKEY:
Collaboration diagram for Dwm::Dns::RRDataKEY:

Public Member Functions

 RRDataKEY ()
 Construct with an empty public key.
 
 RRDataKEY (uint16_t flags, uint8_t protocol, uint8_t algorithm, uint16_t moreFlags, const std::string &publicKey)
 Construct with the given flags, protocol, algorithm, moreFlags and publicKey. More...
 
bool operator== (const RRDataKEY &key) const
 Equal-to operator, mostly for unit testing.
 
uint16_t Flags () const
 Returns the contained flags.
 
uint16_t Flags (uint16_t flags)
 Sets and returns the contained flags.
 
uint8_t Protocol () const
 Returns the contained protocol.
 
uint8_t Protocol (uint8_t protocol)
 Sets and returns the contained protocol.
 
uint8_t Algorithm () const
 Returns the contained algorithm.
 
uint8_t Algorithm (uint8_t algorithm)
 Sets and returns the contained algorithm.
 
uint16_t MoreFlags () const
 Returns the contained 'more flags'.
 
uint16_t MoreFlags (uint16_t moreFlags)
 Sets and returns the contained 'more flags'.
 
const std::string & PublicKey () const
 Returns the contained public key.
 
const std::string & PublicKey (const std::string &publicKey)
 Sets and returns the contained public key.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the KEY 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 KEY resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 25
 
static const uint16_t k_flagsACMask = 0xC000
 
static const uint16_t k_flagsXTMask = 0x1000
 
static const uint16_t k_flagsNAMTYPEMask = 0x0300
 
static const uint16_t k_flagsSIGMask = 0x000F
 
static const uint8_t k_protocolReserved = 0
 
static const uint8_t k_protocolTLS = 1
 
static const uint8_t k_protocolEmail = 2
 
static const uint8_t k_protocolDNSSEC = 3
 
static const uint8_t k_protocolIPSEC = 4
 
static const uint8_t k_protocolAll = 255
 
static const uint8_t k_algorithmReserved = 0
 
static const uint8_t k_algorithmRSA_MD5 = 1
 
static const uint8_t k_algorithmDiffieHellman = 2
 
static const uint8_t k_algorithmDSA = 3
 

Friends

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

Detailed Description

Encapsulates KEY resource record data.

See RFC 2535 for details. Note that RFC 2535 is basically dead with respect to DNSSEC, so no one should be using it for DNSSEC purposes, and probably shouldn't be using it at all.

Constructor & Destructor Documentation

◆ RRDataKEY()

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

Construct with the given flags, protocol, algorithm, moreFlags and publicKey.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataKEY key 
)
friend

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


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