27 const size_t RR_COMMON_LEN = 10;
36 const size_t RDATA_COMMON_LEN = 16;
41 TSIGRecord::TSIGRecord(
const Name& key_name,
43 key_name_(key_name), rdata_(tsig_rdata),
44 length_(RR_COMMON_LEN + RDATA_COMMON_LEN + key_name_.getLength() +
45 rdata_.getAlgorithm().getLength() +
46 rdata_.getMACSize() + rdata_.getOtherLen())
60 "TSIG record is being constructed from "
61 "incompatible RDATA: " << rdata.
toText());
70 key_name_(name), rdata_(castToTSIGRdata(rdata)), length_(length)
92 template <
typename OUTPUT>
119 toWireCommon(renderer, rdata_);
126 toWireCommon(buffer, rdata_);
139 return (os << record.
toText());
rdata::TSIG class represents the TSIG RDATA as defined in RFC2845.
The Name class encapsulates DNS names.
static const uint32_t TSIG_TTL
The TTL value to be used in TSIG RRs.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
static const RRType & TSIG()
virtual void writeName(const Name &name, bool compress=true)=0
Write a Name object into the internal buffer in wire format, with or without name compression...
std::string toText(bool omit_final_dot=false) const
Convert the Name to a string.
uint16_t getOtherLen() const
Return the value of the Other Len field.
The Rdata class is an abstract base class that provides a set of common interfaces to manipulate conc...
uint16_t getMACSize() const
Return the value of the MAC Size field.
virtual void toWire(isc::util::OutputBuffer &buffer) const
Render the Rdata in the wire format into a buffer.
The RRClass class encapsulates DNS resource record classes.
virtual std::string toText() const
Convert an Rdata to a string.
const std::string toText() const
Convert the RRType to a string.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::string toText() const
Convert the TSIG record to a string.
static const RRClass & getClass()
Return the RR class of TSIG.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
TSIGRecord(const Name &key_name, const rdata::any::TSIG &tsig_rdata)
Constructor from TSIG key name and RDATA.
virtual void setTruncated()=0
Mark the renderer to indicate truncation has occurred while rendering.
const std::string toText() const
Convert the RRClass to a string.
int toWire(AbstractMessageRenderer &renderer) const
Render the TSIG RR in the wire format.
void toWire(AbstractMessageRenderer &renderer) const
Render the RRType in the wire format.
The RRTTL class encapsulates TTLs used in DNS resource records.
void toWire(AbstractMessageRenderer &renderer) const
Render the RRClass in the wire format.
static const RRClass & ANY()
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
static const RRTTL & getTTL()
Return the TTL value of TSIG.
Defines the logger used by the top-level component of kea-dhcp-ddns.
const std::string toText() const
Convert the RRTTL to a string.
const Name & getAlgorithm() const
Return the algorithm name.
size_t getLength() const
Gets the length of the Name in its wire format.
size_t getLength() const
Return the length of data written in the internal buffer.
virtual size_t getLengthLimit() const =0
Return the maximum length of rendered data that can fit in the corresponding DNS message without trun...
void toWire(AbstractMessageRenderer &renderer) const
Render the Name in the wire format with compression.
virtual std::string toText() const =0
Convert an Rdata to a string.