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() +
44 rdata_.getAlgorithm().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() +
110 if (renderer.getLength() + length_ > renderer.getLengthLimit()) {
111 renderer.setTruncated();
116 renderer.writeName(key_name_,
false);
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...
The Name class encapsulates DNS names.
The RRClass class encapsulates DNS resource record classes.
static const RRClass & ANY()
The RRTTL class encapsulates TTLs used in DNS resource records.
static const RRType & TSIG()
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.
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...
virtual std::string toText() const =0
Convert an Rdata to a string.
rdata::TSIG class represents the TSIG RDATA as defined in RFC2845.
const Name & getAlgorithm() const
Return the algorithm name.
uint16_t getOtherLen() const
Return the value of the Other Len field.
virtual void toWire(isc::util::OutputBuffer &buffer) const
Render the Rdata in the wire format into a buffer.
uint16_t getMACSize() const
Return the value of the MAC Size field.
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.