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>
117 toWireCommon(renderer, rdata_);
124 toWireCommon(buffer, rdata_);
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.
std::string toText(bool omit_final_dot=false) const
Convert the Name to a string.
void toWire(AbstractMessageRenderer &renderer) const
Render the Name in the wire format with compression.
size_t getLength() const
Gets the length of the Name in its wire format.
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.
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.
virtual std::string toText() const
Convert an Rdata to a string.
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.