26const size_t RR_COMMON_LEN = 10;
35const size_t RDATA_COMMON_LEN = 16;
42 key_name_(key_name), rdata_(tsig_rdata),
43 length_(RR_COMMON_LEN + RDATA_COMMON_LEN + key_name_.
getLength() +
45 rdata_.getMACSize() + rdata_.getOtherLen()) {
59 "TSIG record is being constructed from "
60 "incompatible RDATA: " <<
rdata.toText());
69 key_name_(
name), rdata_(castToTSIGRdata(
rdata)), length_(length) {
90template <
typename OUTPUT>
99 output.writeUint16(RDATA_COMMON_LEN +
rdata.getAlgorithm().getLength() +
103 rdata.toWire(output);
117 toWireCommon(renderer, rdata_);
123 key_name_.toWire(buffer);
124 toWireCommon(buffer, rdata_);
132 rdata_.toText() +
"\n");
137 return (os << record.
toText());
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
virtual void setTruncated()=0
Mark the renderer to indicate truncation has occurred while rendering.
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...
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.
The Name class encapsulates DNS names.
The RRClass class encapsulates DNS resource record classes.
static const RRClass & ANY()
void toWire(AbstractMessageRenderer &renderer) const
Render the RRClass in the wire format.
The RRTTL class encapsulates TTLs used in DNS resource records.
static const RRType & TSIG()
void toWire(AbstractMessageRenderer &renderer) const
Render the RRType in the wire format.
static const RRClass & getClass()
Return the RR class of TSIG.
static const uint32_t TSIG_TTL
The TTL value to be used in TSIG RRs.
TSIGRecord(const Name &key_name, const rdata::any::TSIG &tsig_rdata)
Constructor from TSIG key name and RDATA.
static const RRTTL & getTTL()
Return the TTL value of TSIG.
size_t getLength() const
Return the length of the TSIG record.
std::string toText() const
Convert the TSIG record to a string.
uint32_t toWire(AbstractMessageRenderer &renderer) const
Render the TSIG RR in the wire format.
The Rdata class is an abstract base class that provides a set of common interfaces to manipulate conc...
rdata::TSIG class represents the TSIG RDATA as defined in RFC2845.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Defines the logger used by the top-level component of kea-lfc.