Kea 2.5.8
tsigrecord.h
Go to the documentation of this file.
1// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef TSIGRECORD_H
8#define TSIGRECORD_H
9
10#include <ostream>
11#include <string>
12
13#include <boost/shared_ptr.hpp>
14
15#include <util/buffer.h>
16
17#include <dns/name.h>
18#include <dns/rdataclass.h>
19
20namespace isc {
21namespace dns {
22class AbstractMessageRenderer;
23
52public:
58
59
63 TSIGRecord(const Name& key_name, const rdata::any::TSIG& tsig_rdata);
64
161 TSIGRecord(const Name& name, const RRClass& rrclass, const RRTTL& ttl,
162 const rdata::Rdata& rdata, size_t length);
164
168 const Name& getName() const {
169 return (key_name_);
170 }
171
175 const rdata::any::TSIG& getRdata() const {
176 return (rdata_);
177 }
178
181
182
189 static const RRClass& getClass();
190
198 static const RRTTL& getTTL();
200
211 size_t getLength() const {
212 return (length_);
213 }
214
247 uint32_t toWire(AbstractMessageRenderer& renderer) const;
248
255 uint32_t toWire(isc::util::OutputBuffer& buffer) const;
256
267 std::string toText() const;
268
270 static const uint32_t TSIG_TTL = 0;
272
273private:
274 const Name key_name_;
275 const rdata::any::TSIG rdata_;
276 const size_t length_;
277};
278
280typedef boost::shared_ptr<TSIGRecord> TSIGRecordPtr;
281
283typedef boost::shared_ptr<const TSIGRecord> ConstTSIGRecordPtr;
284
295std::ostream& operator<<(std::ostream& os, const TSIGRecord& record);
296}
297}
298
299#endif // TSIGRECORD_H
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
The Name class encapsulates DNS names.
Definition: name.h:219
The RRClass class encapsulates DNS resource record classes.
Definition: rrclass.h:89
The RRTTL class encapsulates TTLs used in DNS resource records.
Definition: rrttl.h:51
TSIG resource record.
Definition: tsigrecord.h:51
static const RRClass & getClass()
Return the RR class of TSIG.
Definition: tsigrecord.cc:79
static const uint32_t TSIG_TTL
The TTL value to be used in TSIG RRs.
Definition: tsigrecord.h:270
static const RRTTL & getTTL()
Return the TTL value of TSIG.
Definition: tsigrecord.cc:84
size_t getLength() const
Return the length of the TSIG record.
Definition: tsigrecord.h:211
const Name & getName() const
Return the owner name of the TSIG RR, which is the TSIG key name.
Definition: tsigrecord.h:168
std::string toText() const
Convert the TSIG record to a string.
Definition: tsigrecord.cc:129
const rdata::any::TSIG & getRdata() const
Return the RDATA of the TSIG RR.
Definition: tsigrecord.h:175
uint32_t toWire(AbstractMessageRenderer &renderer) const
Render the TSIG RR in the wire format.
Definition: tsigrecord.cc:108
The Rdata class is an abstract base class that provides a set of common interfaces to manipulate conc...
Definition: rdata.h:120
rdata::TSIG class represents the TSIG RDATA as defined in RFC2845.
Definition: rdataclass.h:44
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:347
boost::shared_ptr< const TSIGRecord > ConstTSIGRecordPtr
A pointer-like type pointing to an immutable TSIGRecord object.
Definition: tsigrecord.h:283
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Definition: edns.cc:163
boost::shared_ptr< TSIGRecord > TSIGRecordPtr
A pointer-like type pointing to a TSIGRecord object.
Definition: tsigrecord.h:280
Defines the logger used by the top-level component of kea-lfc.