diff options
author | JINMEI Tatuya <jinmei@isc.org> | 2011-04-27 23:55:44 +0200 |
---|---|---|
committer | JINMEI Tatuya <jinmei@isc.org> | 2011-04-27 23:55:44 +0200 |
commit | daa24430a497d145849a687f51252bfed16a2caf (patch) | |
tree | 4d306e5b7da812df425b5fee92984ae848df3e78 /src/lib/dns/tsig.h | |
parent | [trac812next] Merge branch 'trac812' into trac812next (diff) | |
download | kea-daa24430a497d145849a687f51252bfed16a2caf.tar.xz kea-daa24430a497d145849a687f51252bfed16a2caf.zip |
[trac812next] created separate tsigrecord.* files as TSIGRecord is quite
likely to be getting bigger.
Diffstat (limited to 'src/lib/dns/tsig.h')
-rw-r--r-- | src/lib/dns/tsig.h | 72 |
1 files changed, 1 insertions, 71 deletions
diff --git a/src/lib/dns/tsig.h b/src/lib/dns/tsig.h index 55ab41e1b4..fbcb1bb10b 100644 --- a/src/lib/dns/tsig.h +++ b/src/lib/dns/tsig.h @@ -15,84 +15,14 @@ #ifndef __TSIG_H #define __TSIG_H 1 -#include <boost/shared_ptr.hpp> #include <boost/noncopyable.hpp> -#include <dns/rdataclass.h> #include <dns/tsigerror.h> #include <dns/tsigkey.h> +#include <dns/tsigrecord.h> namespace isc { namespace dns { -/// TSIG resource record. -/// -/// A \c TSIGRecord class object represents a TSIG resource record and is -/// responsible for conversion to and from wire format TSIG record based on -/// the protocol specification (RFC2845). -/// This class is provided so that other classes and applications can handle -/// TSIG without knowing protocol details of TSIG, such as that it uses a -/// fixed constant of TTL. -/// -/// \note So the plan is to eventually provide a \c toWire() method and -/// the "from wire" constructor. They are not yet provided in this initial -/// step. -/// -/// \note -/// This class could be a derived class of \c AbstractRRset. That way -/// it would be able to be used in a polymorphic way; for example, -/// an application can construct a TSIG RR by itself and insert it to a -/// \c Message object as a generic RRset. On the other hand, it would mean -/// this class would have to implement an \c RdataIterator (even though it -/// can be done via straightforward forwarding) while the iterator is mostly -/// redundant since there should be one and only one RDATA for a valid TSIG -/// RR. Likewise, some methods such as \c setTTL() method wouldn't be well -/// defined due to such special rules for TSIG as using a fixed TTL. -/// Overall, TSIG is a very special RR type that simply uses the compatible -/// resource record format, and it will be unlikely that a user wants to -/// handle it through a generic interface in a polymorphic way. -/// We therefore chose to define it as a separate class. This is also -/// similar to why \c EDNS is a separate class. -class TSIGRecord { -public: - /// Constructor from TSIG RDATA - /// - /// \exception std::bad_alloc Resource allocation for copying the RDATA - /// fails - explicit TSIGRecord(const rdata::any::TSIG& tsig_rdata) : - rdata_(tsig_rdata) - {} - - /// Return the RDATA of the TSIG RR - /// - /// \exception None - const rdata::any::TSIG& getRdata() const { return (rdata_); } - - /// \name Protocol constants and defaults - /// - //@{ - /// Return the RR class of TSIG - /// - /// TSIG always uses the ANY RR class. This static method returns it, - /// when, though unlikely, an application wants to know which class TSIG - /// is supposed to use. - /// - /// \exception None - static const RRClass& getClass(); - - /// The TTL value to be used in TSIG RRs. - static const uint32_t TSIG_TTL = 0; - //@} - -private: - const rdata::any::TSIG rdata_; -}; - -/// A pointer-like type pointing to a \c TSIGRecord object. -typedef boost::shared_ptr<TSIGRecord> TSIGRecordPtr; - -/// A pointer-like type pointing to an immutable \c TSIGRecord object. -typedef boost::shared_ptr<const TSIGRecord> ConstTSIGRecordPtr; - /// TSIG session context. /// /// The \c TSIGContext class maintains a context of a signed session of |