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

Encapsulates SSHFP recource record data. More...

#include <DwmDnsRRDataSSHFP.hh>

Inheritance diagram for Dwm::Dns::RRDataSSHFP:
Collaboration diagram for Dwm::Dns::RRDataSSHFP:

Public Member Functions

 RRDataSSHFP ()
 Construct with an empty fingerprint.
 
 RRDataSSHFP (uint8_t algorithm, uint8_t fpType, const std::string &fingerprint)
 Construct with the given algorithm, fpType and fingerprint. More...
 
bool operator== (const RRDataSSHFP &sshfp) const
 Equal-to operator, mostly for unit testing.
 
uint8_t Algorithm () const
 Returns the contained algorithm.
 
uint8_t Algorithm (uint8_t algorithm)
 Sets and returns the contained algorithm.
 
uint8_t FPType () const
 Returns the contained fingerprint type.
 
uint8_t FPType (uint8_t fpType)
 Sets and returns the contained fingerprint type.
 
const std::string & Fingerprint () const
 Returns the contained fingerprint.
 
const std::string & Fingerprint (const std::string &fingerprint)
 Sets and returns the contained fingerprint.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the SSHFP 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 SSHFP resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 44
 
static const uint8_t k_algorithmReserved = 0
 
static const uint8_t k_algorithmRSA = 1
 
static const uint8_t k_algorithmDSS = 2
 
static const uint8_t k_fpTypeReserved = 0
 
static const uint8_t k_fpTypeSHA1 = 1
 

Friends

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

Detailed Description

Encapsulates SSHFP recource record data.

See RFC4255 for details.

Constructor & Destructor Documentation

◆ RRDataSSHFP()

Dwm::Dns::RRDataSSHFP::RRDataSSHFP ( uint8_t  algorithm,
uint8_t  fpType,
const std::string &  fingerprint 
)

Construct with the given algorithm, fpType and fingerprint.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataSSHFP sshfp 
)
friend

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


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