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

Encapsulates DHCID resource record data. More...

#include <DwmDnsRRDataDHCID.hh>

Inheritance diagram for Dwm::Dns::RRDataDHCID:
Collaboration diagram for Dwm::Dns::RRDataDHCID:

Public Member Functions

 RRDataDHCID ()
 Default constructor.
 
 RRDataDHCID (uint16_t id, uint8_t digestType, const std::string &digest)
 Construct with the given id, digestType and digest.
 
bool operator== (const RRDataDHCID &dhcid) const
 Equal-to operator, mostly for unit testing.
 
uint16_t Id () const
 Returns the ID in the DHCID resource record data.
 
uint16_t Id (uint16_t id)
 Sets and returns the ID in the DHCID resource record data.
 
uint8_t DigestType () const
 Returns the digest type in the DHCID resource record data.
 
uint8_t DigestType (uint8_t digestType)
 Sets and returns the digest type in the DHCID resource record data.
 
const std::string & Digest () const
 Returns the digest in the DHCID resource record data.
 
const std::string & Digest (const std::string &digest)
 Sets and returns the digest in the DHCID resource record data.
 
uint8_t * Encode (uint8_t *pkt, uint8_t *ptr, uint16_t pktlen, LabelPositions &lps) const
 Encodes the DHCID 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 DHCID resource record data from buffer pkt of length pktlen, starting at ptr. More...
 

Static Public Attributes

static const uint16_t k_rrtype = 49
 
static const uint16_t k_idDHCPv4HtypeHlen = 0
 
static const uint16_t k_idDHCPv4ClientId = 1
 
static const uint16_t k_idDUID = 2
 
static const uint8_t k_digestTypeReserved = 0
 
static const uint8_t k_digestTypeSHA256 = 1
 

Friends

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

Detailed Description

Encapsulates DHCID resource record data.

Member Function Documentation

◆ Decode()

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

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

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

Implements Dwm::Dns::RRData.

◆ Encode()

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

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

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

Implements Dwm::Dns::RRData.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RRDataDHCID dhcid 
)
friend

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


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