Kea 2.2.0
tsigrecord.h
Go to the documentation of this file.
1// Copyright (C) 2011-2015 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 1
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 util {
22class OutputBuffer;
23}
24namespace dns {
25class AbstractMessageRenderer;
26
55public:
61
62
66 TSIGRecord(const Name& key_name, const rdata::any::TSIG& tsig_rdata);
67
164 TSIGRecord(const Name& name, const RRClass& rrclass, const RRTTL& ttl,
165 const rdata::Rdata& rdata, size_t length);
167
171 const Name& getName() const { return (key_name_); }
172
176 const rdata::any::TSIG& getRdata() const { return (rdata_); }
177
180
181
188 static const RRClass& getClass();
189
197 static const RRTTL& getTTL();
199
210 size_t getLength() const { return (length_); }
211
244 int toWire(AbstractMessageRenderer& renderer) const;
245
252 int toWire(isc::util::OutputBuffer& buffer) const;
253
264 std::string toText() const;
265
267 static const uint32_t TSIG_TTL = 0;
269
270private:
271 const Name key_name_;
272 const rdata::any::TSIG rdata_;
273 const size_t length_;
274};
275
277typedef boost::shared_ptr<TSIGRecord> TSIGRecordPtr;
278
280typedef boost::shared_ptr<const TSIGRecord> ConstTSIGRecordPtr;
281
292std::ostream& operator<<(std::ostream& os, const TSIGRecord& record);
293}
294}
295
296#endif // TSIGRECORD_H
297
298// Local Variables:
299// mode: c++
300// End:
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
The Name class encapsulates DNS names.
Definition: name.h:223
The RRClass class encapsulates DNS resource record classes.
Definition: rrclass.h:98
The RRTTL class encapsulates TTLs used in DNS resource records.
Definition: rrttl.h:55
TSIG resource record.
Definition: tsigrecord.h:54
static const RRClass & getClass()
Return the RR class of TSIG.
Definition: tsigrecord.cc:81
static const uint32_t TSIG_TTL
The TTL value to be used in TSIG RRs.
Definition: tsigrecord.h:267
TSIGRecord(const Name &key_name, const rdata::any::TSIG &tsig_rdata)
Constructor from TSIG key name and RDATA.
Definition: tsigrecord.cc:41
static const RRTTL & getTTL()
Return the TTL value of TSIG.
Definition: tsigrecord.cc:86
int toWire(AbstractMessageRenderer &renderer) const
Render the TSIG RR in the wire format.
Definition: tsigrecord.cc:110
size_t getLength() const
Return the length of the TSIG record.
Definition: tsigrecord.h:210
const Name & getName() const
Return the owner name of the TSIG RR, which is the TSIG key name.
Definition: tsigrecord.h:171
std::string toText() const
Convert the TSIG record to a string.
Definition: tsigrecord.cc:131
const rdata::any::TSIG & getRdata() const
Return the RDATA of the TSIG RR.
Definition: tsigrecord.h:176
The Rdata class is an abstract base class that provides a set of common interfaces to manipulate conc...
Definition: rdata.h:123
rdata::TSIG class represents the TSIG RDATA as defined in RFC2845.
Definition: rdataclass.h:63
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
boost::shared_ptr< const TSIGRecord > ConstTSIGRecordPtr
A pointer-like type pointing to an immutable TSIGRecord object.
Definition: tsigrecord.h:280
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Definition: edns.cc:172
boost::shared_ptr< TSIGRecord > TSIGRecordPtr
A pointer-like type pointing to a TSIGRecord object.
Definition: tsigrecord.h:277
Defines the logger used by the top-level component of kea-lfc.