Kea 2.7.6
|
rdata::TKEY
class represents the TKEY RDATA as defined in RFC2930.
More...
#include <rdataclass.h>
Public Member Functions | |
TKEY (const Name &algorithm, uint32_t inception, uint32_t expire, uint16_t mode, uint16_t error, uint16_t key_len, const void *key, uint16_t other_len, const void *other_data) | |
Constructor from RDATA field parameters. | |
TKEY (const std::string &type_str) | |
TKEY (const TKEY &other) | |
TKEY (isc::util::InputBuffer &buffer, size_t rdata_len) | |
TKEY (MasterLexer &lexer, const Name *name, MasterLoader::Options options, MasterLoaderCallbacks &callbacks) | |
~TKEY () | |
The destructor. | |
virtual int | compare (const Rdata &other) const |
Compare two instances of Rdata . | |
const Name & | getAlgorithm () const |
Return the algorithm name. | |
uint16_t | getError () const |
Return the value of the Error field. | |
uint32_t | getExpire () const |
Return the value of the Expire field as a number. | |
std::string | getExpireDate () const |
Return the value of the Expire field as a string. | |
uint32_t | getInception () const |
Return the value of the Inception field as a number. | |
std::string | getInceptionDate () const |
Return the value of the Inception field as a string. | |
const void * | getKey () const |
Return the value of the Key field. | |
uint16_t | getKeyLen () const |
Return the value of the Key Len field. | |
uint16_t | getMode () const |
Return the value of the Mode field. | |
const void * | getOtherData () const |
Return the value of the Other Data field. | |
uint16_t | getOtherLen () const |
Return the value of the Other Len field. | |
TKEY & | operator= (const TKEY &source) |
Assignment operator. | |
virtual std::string | toText () const |
Convert an Rdata to a string. | |
virtual void | toWire (AbstractMessageRenderer &renderer) const |
Render the Rdata in the wire format into a MessageRenderer object. | |
virtual void | toWire (isc::util::OutputBuffer &buffer) const |
Render the Rdata in the wire format into a buffer. | |
Public Member Functions inherited from isc::dns::rdata::Rdata | |
virtual uint16_t | getLength () const |
Get the wire format length of an Rdata. | |
virtual | ~Rdata () |
The destructor. | |
Static Public Attributes | |
static const uint16_t | GSS_API_MODE |
The GSS_API constant for the Mode field. | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::dns::rdata::Rdata | |
Rdata () | |
The default constructor. | |
rdata::TKEY
class represents the TKEY RDATA as defined in RFC2930.
This class implements the basic interfaces inherited from the abstract rdata::Rdata
class, and provides trivial accessors specific to the TKEY RDATA.
Definition at line 409 of file rdataclass.h.
|
explicit |
isc::dns::rdata::generic::TKEY::TKEY | ( | isc::util::InputBuffer & | buffer, |
size_t | rdata_len ) |
isc::dns::rdata::generic::TKEY::TKEY | ( | const TKEY & | other | ) |
isc::dns::rdata::generic::TKEY::TKEY | ( | MasterLexer & | lexer, |
const Name * | name, | ||
MasterLoader::Options | options, | ||
MasterLoaderCallbacks & | callbacks ) |
isc::dns::rdata::generic::TKEY::TKEY | ( | const Name & | algorithm, |
uint32_t | inception, | ||
uint32_t | expire, | ||
uint16_t | mode, | ||
uint16_t | error, | ||
uint16_t | key_len, | ||
const void * | key, | ||
uint16_t | other_len, | ||
const void * | other_data ) |
Constructor from RDATA field parameters.
The parameters are a straightforward mapping of TKEY RDATA fields as defined in RFC2930.
This RR is pretty close to the TSIG RR with 32 bit timestamps, or the RRSIG RR with a second "other" data field.
This constructor internally involves resource allocation, and if it fails, a corresponding standard exception will be thrown.
algorithm | The DNS name of the algorithm e.g. gss-tsig. |
inception | The inception time (in seconds since 1970). |
expire | The expire time (in seconds since 1970). |
mode | The mode e.g. Diffie-Hellman (2) or GSS-API (3). |
error | The error code (extended error space shared with TSIG). |
key_len | The key length (0 means no key). |
key | The key (can be 0). |
other_len | The other data length (0 means no other data). |
other_data | The other data (can be and usually is 0). |
isc::dns::rdata::generic::TKEY::~TKEY | ( | ) |
The destructor.
|
virtual |
Compare two instances of Rdata
.
This method compares this
and the other
Rdata objects in terms of the DNSSEC sorting order as defined in RFC4034, and returns the result as an integer.
This is a pure virtual method without the definition; the actual comparison logic is specific to each derived concrete class and should be explicitly defined in the derived class.
Specific implementations of this method must confirm that this
and the other
are objects of the same concrete derived class of Rdata
. This is normally done by dynamic_cast
in the implementation. It also means if the assumption isn't met an exception of class std::bad_cast
will be thrown.
Here is an implementation choice: instead of relying on dynamic_cast
, we could first convert the data into wire-format and compare the pair as opaque data. This would be more polymorphic, but might involve significant overhead, especially for a large size of RDATA.
other | the right-hand operand to compare against. |
this
would be sorted before other
. this
is identical to other
in terms of sorting order. this
would be sorted after other
. Implements isc::dns::rdata::Rdata.
const Name & isc::dns::rdata::generic::TKEY::getAlgorithm | ( | ) | const |
Return the algorithm name.
This method never throws an exception.
uint16_t isc::dns::rdata::generic::TKEY::getError | ( | ) | const |
Return the value of the Error field.
This method never throws an exception.
uint32_t isc::dns::rdata::generic::TKEY::getExpire | ( | ) | const |
Return the value of the Expire field as a number.
This method never throws an exception.
std::string isc::dns::rdata::generic::TKEY::getExpireDate | ( | ) | const |
Return the value of the Expire field as a string.
uint32_t isc::dns::rdata::generic::TKEY::getInception | ( | ) | const |
Return the value of the Inception field as a number.
This method never throws an exception.
std::string isc::dns::rdata::generic::TKEY::getInceptionDate | ( | ) | const |
Return the value of the Inception field as a string.
const void * isc::dns::rdata::generic::TKEY::getKey | ( | ) | const |
Return the value of the Key field.
This method never throws an exception.
uint16_t isc::dns::rdata::generic::TKEY::getKeyLen | ( | ) | const |
Return the value of the Key Len field.
This method never throws an exception.
uint16_t isc::dns::rdata::generic::TKEY::getMode | ( | ) | const |
Return the value of the Mode field.
This method never throws an exception.
const void * isc::dns::rdata::generic::TKEY::getOtherData | ( | ) | const |
Return the value of the Other Data field.
The same note as getMAC()
applies.
This method never throws an exception.
uint16_t isc::dns::rdata::generic::TKEY::getOtherLen | ( | ) | const |
Return the value of the Other Len field.
This method never throws an exception.
Assignment operator.
It internally allocates a resource, and if it fails a corresponding standard exception will be thrown. This operator never throws an exception otherwise.
This operator provides the strong exception guarantee: When an exception is thrown the content of the assignment target will be intact.
|
virtual |
Convert an Rdata
to a string.
This method returns a std::string
object representing the Rdata
.
This is a pure virtual method without the definition; the actual representation is specific to each derived concrete class and should be explicitly defined in the derived class.
Rdata
. Implements isc::dns::rdata::Rdata.
|
virtual |
Render the Rdata
in the wire format into a MessageRenderer
object.
This is a pure virtual method without the definition; the actual conversion is specific to each derived concrete class and should be explicitly defined in the derived class.
renderer | DNS message rendering context that encapsulates the output buffer in which the Rdata is to be stored. |
Implements isc::dns::rdata::Rdata.
|
virtual |
Render the Rdata
in the wire format into a buffer.
This is a pure virtual method without the definition; the actual conversion is specific to each derived concrete class and should be explicitly defined in the derived class.
buff | An output buffer to store the wire data. |
Implements isc::dns::rdata::Rdata.
|
static |
The GSS_API constant for the Mode field.
Definition at line 514 of file rdataclass.h.