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