Kea 2.7.5
isc::dns::rdata::generic::TKEY Class Reference

rdata::TKEY class represents the TKEY RDATA as defined in RFC2930. More...

#include <rdataclass.h>

+ Inheritance diagram for isc::dns::rdata::generic::TKEY:

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 NamegetAlgorithm () 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.
 
TKEYoperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TKEY() [1/5]

isc::dns::rdata::generic::TKEY::TKEY ( const std::string & type_str)
explicit

◆ TKEY() [2/5]

isc::dns::rdata::generic::TKEY::TKEY ( isc::util::InputBuffer & buffer,
size_t rdata_len )

◆ TKEY() [3/5]

isc::dns::rdata::generic::TKEY::TKEY ( const TKEY & other)

◆ TKEY() [4/5]

isc::dns::rdata::generic::TKEY::TKEY ( MasterLexer & lexer,
const Name * name,
MasterLoader::Options options,
MasterLoaderCallbacks & callbacks )

◆ TKEY() [5/5]

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.

Parameters
algorithmThe DNS name of the algorithm e.g. gss-tsig.
inceptionThe inception time (in seconds since 1970).
expireThe expire time (in seconds since 1970).
modeThe mode e.g. Diffie-Hellman (2) or GSS-API (3).
errorThe error code (extended error space shared with TSIG).
key_lenThe key length (0 means no key).
keyThe key (can be 0).
other_lenThe other data length (0 means no other data).
other_dataThe other data (can be and usually is 0).

◆ ~TKEY()

isc::dns::rdata::generic::TKEY::~TKEY ( )

The destructor.

Member Function Documentation

◆ compare()

virtual int isc::dns::rdata::generic::TKEY::compare ( const Rdata & other) const
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.

Parameters
otherthe right-hand operand to compare against.
Returns
< 0 if this would be sorted before other.
0 if this is identical to other in terms of sorting order.
> 0 if this would be sorted after other.

Implements isc::dns::rdata::Rdata.

◆ getAlgorithm()

const Name & isc::dns::rdata::generic::TKEY::getAlgorithm ( ) const

Return the algorithm name.

This method never throws an exception.

◆ getError()

uint16_t isc::dns::rdata::generic::TKEY::getError ( ) const

Return the value of the Error field.

This method never throws an exception.

◆ getExpire()

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.

◆ getExpireDate()

std::string isc::dns::rdata::generic::TKEY::getExpireDate ( ) const

Return the value of the Expire field as a string.

◆ getInception()

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.

◆ getInceptionDate()

std::string isc::dns::rdata::generic::TKEY::getInceptionDate ( ) const

Return the value of the Inception field as a string.

◆ getKey()

const void * isc::dns::rdata::generic::TKEY::getKey ( ) const

Return the value of the Key field.

This method never throws an exception.

◆ getKeyLen()

uint16_t isc::dns::rdata::generic::TKEY::getKeyLen ( ) const

Return the value of the Key Len field.

This method never throws an exception.

◆ getMode()

uint16_t isc::dns::rdata::generic::TKEY::getMode ( ) const

Return the value of the Mode field.

This method never throws an exception.

◆ getOtherData()

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.

◆ getOtherLen()

uint16_t isc::dns::rdata::generic::TKEY::getOtherLen ( ) const

Return the value of the Other Len field.

This method never throws an exception.

◆ operator=()

TKEY & isc::dns::rdata::generic::TKEY::operator= ( const TKEY & source)

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.

◆ toText()

virtual std::string isc::dns::rdata::generic::TKEY::toText ( ) const
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.

Returns
A string representation of Rdata.

Implements isc::dns::rdata::Rdata.

◆ toWire() [1/2]

virtual void isc::dns::rdata::generic::TKEY::toWire ( AbstractMessageRenderer & renderer) const
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.

Parameters
rendererDNS message rendering context that encapsulates the output buffer in which the Rdata is to be stored.

Implements isc::dns::rdata::Rdata.

◆ toWire() [2/2]

virtual void isc::dns::rdata::generic::TKEY::toWire ( isc::util::OutputBuffer & buff) const
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.

Parameters
buffAn output buffer to store the wire data.

Implements isc::dns::rdata::Rdata.

Member Data Documentation

◆ GSS_API_MODE

const uint16_t isc::dns::rdata::generic::TKEY::GSS_API_MODE
static

The GSS_API constant for the Mode field.

Definition at line 514 of file rdataclass.h.


The documentation for this class was generated from the following file: