Kea  1.9.9-git
isc::dns::TSIGError Class Reference

TSIG errors. More...

#include <tsigerror.h>

Public Types

enum  CodeValue {
  BAD_SIG_CODE = 16, BAD_KEY_CODE = 17, BAD_TIME_CODE = 18, BAD_MODE_CODE = 19,
  BAD_NAME_CODE = 20, BAD_ALG_CODE = 21, BAD_TRUNC_CODE = 22
}
 Constants for pre-defined TSIG error values. More...
 

Public Member Functions

bool equals (const TSIGError &other) const
 Return true iff two TSIGError objects are equal. More...
 
uint16_t getCode () const
 Returns the TSIGCode error code value. More...
 
bool nequals (const TSIGError &other) const
 Return true iff two TSIGError objects are not equal. More...
 
bool operator!= (const TSIGError &other) const
 Same as nequals(). More...
 
bool operator== (const TSIGError &other) const
 Same as equals(). More...
 
Rcode toRcode () const
 Convert the TSIGError to a Rcode. More...
 
std::string toText () const
 Convert the TSIGError to a string. More...
 
Constructors

We use the default versions of destructor, copy constructor, and assignment operator.

 TSIGError (uint16_t error_code)
 Constructor from the code value. More...
 
 TSIGError (Rcode rcode)
 Constructor from Rcode. More...
 

Static Public Member Functions

static const TSIGErrorBAD_ALG ()
 A constant TSIG error object for the BADALG code (see TSIGError::BAD_ALG_CODE). More...
 
static const TSIGErrorBAD_KEY ()
 A constant TSIG error object for the BADKEY code (see TSIGError::BAD_KEY_CODE). More...
 
static const TSIGErrorBAD_MODE ()
 A constant TSIG error object for the BADMODE code (see TSIGError::BAD_MODE_CODE). More...
 
static const TSIGErrorBAD_NAME ()
 A constant TSIG error object for the BADNAME code (see TSIGError::BAD_NAME_CODE). More...
 
static const TSIGErrorBAD_SIG ()
 A constant TSIG error object for the BADSIG code (see TSIGError::BAD_SIG_CODE). More...
 
static const TSIGErrorBAD_TIME ()
 A constant TSIG error object for the BADTIME code (see TSIGError::BAD_TIME_CODE). More...
 
static const TSIGErrorBAD_TRUNC ()
 A constant TSIG error object for the BADTRUNC code (see TSIGError::BAD_TRUNC_CODE). More...
 
static const TSIGErrorFORMERR ()
 A constant TSIG error object derived from Rcode::FORMERR() More...
 
static const TSIGErrorNOERROR ()
 A constant TSIG error object derived from Rcode::NOERROR() More...
 
static const TSIGErrorNOTAUTH ()
 A constant TSIG error object derived from Rcode::NOTAUTH() More...
 
static const TSIGErrorNOTIMP ()
 A constant TSIG error object derived from Rcode::NOTIMP() More...
 
static const TSIGErrorNOTZONE ()
 A constant TSIG error object derived from Rcode::NOTZONE() More...
 
static const TSIGErrorNXDOMAIN ()
 A constant TSIG error object derived from Rcode::NXDOMAIN() More...
 
static const TSIGErrorNXRRSET ()
 A constant TSIG error object derived from Rcode::NXRRSET() More...
 
static const TSIGErrorREFUSED ()
 A constant TSIG error object derived from Rcode::REFUSED() More...
 
static const TSIGErrorRESERVED11 ()
 A constant TSIG error object derived from Rcode::RESERVED11() More...
 
static const TSIGErrorRESERVED12 ()
 A constant TSIG error object derived from Rcode::RESERVED12() More...
 
static const TSIGErrorRESERVED13 ()
 A constant TSIG error object derived from Rcode::RESERVED13() More...
 
static const TSIGErrorRESERVED14 ()
 A constant TSIG error object derived from Rcode::RESERVED14() More...
 
static const TSIGErrorRESERVED15 ()
 A constant TSIG error object derived from Rcode::RESERVED15() More...
 
static const TSIGErrorSERVFAIL ()
 A constant TSIG error object derived from Rcode::SERVFAIL() More...
 
static const TSIGErrorYXDOMAIN ()
 A constant TSIG error object derived from Rcode::YXDOMAIN() More...
 
static const TSIGErrorYXRRSET ()
 A constant TSIG error object derived from Rcode::YXRRSET() More...
 

Detailed Description

TSIG errors.

The TSIGError class objects represent standard errors related to TSIG protocol operations as defined in related specifications, mainly in RFC2845, RFC2930 and RFC4635.

Definition at line 22 of file tsigerror.h.

Member Enumeration Documentation

Constants for pre-defined TSIG error values.

Code values from 0 through 15 (inclusive) are derived from those of RCODE and are not defined here. See the Rcode class.

Note
Unfortunately some systems define "BADSIG" as a macro in a public header file. To avoid conflict with it we add an underscore to our definitions.
Enumerator
BAD_SIG_CODE 

16: TSIG verification failure

BAD_KEY_CODE 

17: TSIG key is not recognized

BAD_TIME_CODE 

18: Current time and time signed are too different

BAD_MODE_CODE 

19: Bad TKEY mode

BAD_NAME_CODE 

20: Duplicate TKEY name

BAD_ALG_CODE 

21: TKEY algorithm not supported

BAD_TRUNC_CODE 

22: Bad truncation

Definition at line 32 of file tsigerror.h.

Constructor & Destructor Documentation

isc::dns::TSIGError::TSIGError ( uint16_t  error_code)
inlineexplicit

Constructor from the code value.

Exceptions
None
Parameters
error_codeThe underlying 16-bit error code value of the TSIGError.

Definition at line 52 of file tsigerror.h.

isc::dns::TSIGError::TSIGError ( Rcode  rcode)
explicit

Constructor from Rcode.

As defined in RFC2845, error code values from 0 to 15 (inclusive) are derived from the DNS RCODEs, which are represented via the Rcode class in this library. This constructor works as a converter from these RCODEs to corresponding TSIGError objects.

Exceptions
isc::OutOfRangeGiven rcode is not convertible to TSIGErrors.
Parameters
rcodethe Rcode from which the TSIGError should be derived.

Definition at line 33 of file tsigerror.cc.

References isc_throw.

Member Function Documentation

const TSIGError & isc::dns::TSIGError::BAD_ALG ( )
inlinestatic

A constant TSIG error object for the BADALG code (see TSIGError::BAD_ALG_CODE).

Definition at line 345 of file tsigerror.h.

References BAD_ALG_CODE.

const TSIGError & isc::dns::TSIGError::BAD_KEY ( )
inlinestatic

A constant TSIG error object for the BADKEY code (see TSIGError::BAD_KEY_CODE).

Definition at line 321 of file tsigerror.h.

References BAD_KEY_CODE.

Referenced by isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), isc::dns::TSIGContext::TSIGContext(), and isc::dns::TSIGContext::verify().

const TSIGError & isc::dns::TSIGError::BAD_MODE ( )
inlinestatic

A constant TSIG error object for the BADMODE code (see TSIGError::BAD_MODE_CODE).

Definition at line 333 of file tsigerror.h.

References BAD_MODE_CODE.

const TSIGError & isc::dns::TSIGError::BAD_NAME ( )
inlinestatic

A constant TSIG error object for the BADNAME code (see TSIGError::BAD_NAME_CODE).

Definition at line 339 of file tsigerror.h.

References BAD_NAME_CODE.

const TSIGError & isc::dns::TSIGError::BAD_SIG ( )
inlinestatic

A constant TSIG error object for the BADSIG code (see TSIGError::BAD_SIG_CODE).

Definition at line 315 of file tsigerror.h.

References BAD_SIG_CODE.

Referenced by isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().

const TSIGError & isc::dns::TSIGError::BAD_TIME ( )
inlinestatic

A constant TSIG error object for the BADTIME code (see TSIGError::BAD_TIME_CODE).

Definition at line 327 of file tsigerror.h.

References BAD_TIME_CODE.

Referenced by isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().

const TSIGError & isc::dns::TSIGError::BAD_TRUNC ( )
inlinestatic

A constant TSIG error object for the BADTRUNC code (see TSIGError::BAD_TRUNC_CODE).

Definition at line 351 of file tsigerror.h.

References BAD_TRUNC_CODE.

Referenced by isc::dns::TSIGContext::verify().

bool isc::dns::TSIGError::equals ( const TSIGError other) const
inline

Return true iff two TSIGError objects are equal.

Two TSIGError objects are equal iff their error codes are equal.

Exceptions
None
Parameters
otherthe TSIGError object to compare against.
Returns
true if the two TSIGError are equal; otherwise false.

Definition at line 83 of file tsigerror.h.

Referenced by operator==().

const TSIGError & isc::dns::TSIGError::FORMERR ( )
inlinestatic

A constant TSIG error object derived from Rcode::FORMERR()

Definition at line 225 of file tsigerror.h.

References isc::dns::Rcode::FORMERR().

Referenced by isc::dns::TSIGContext::verify().

+ Here is the call graph for this function:

uint16_t isc::dns::TSIGError::getCode ( ) const
inline

Returns the TSIGCode error code value.

Exceptions
None
Returns
The underlying code value corresponding to the TSIGError.

Definition at line 73 of file tsigerror.h.

Referenced by isc::dns::TSIGContext::sign().

bool isc::dns::TSIGError::nequals ( const TSIGError other) const
inline

Return true iff two TSIGError objects are not equal.

Exceptions
None
Parameters
otherthe TSIGError object to compare against.
Returns
true if the two TSIGError objects are not equal; otherwise false.

Definition at line 96 of file tsigerror.h.

Referenced by operator!=().

const TSIGError & isc::dns::TSIGError::NOERROR ( )
inlinestatic

A constant TSIG error object derived from Rcode::NOERROR()

Definition at line 219 of file tsigerror.h.

References isc::dns::Rcode::NOERROR().

Referenced by isc::d2::D2UpdateMessage::fromWire(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::NOTAUTH ( )
inlinestatic

A constant TSIG error object derived from Rcode::NOTAUTH()

Definition at line 273 of file tsigerror.h.

References isc::dns::Rcode::NOTAUTH().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::NOTIMP ( )
inlinestatic

A constant TSIG error object derived from Rcode::NOTIMP()

Definition at line 243 of file tsigerror.h.

References isc::dns::Rcode::NOTIMP().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::NOTZONE ( )
inlinestatic

A constant TSIG error object derived from Rcode::NOTZONE()

Definition at line 279 of file tsigerror.h.

References isc::dns::Rcode::NOTZONE().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::NXDOMAIN ( )
inlinestatic

A constant TSIG error object derived from Rcode::NXDOMAIN()

Definition at line 237 of file tsigerror.h.

References isc::dns::Rcode::NXDOMAIN().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::NXRRSET ( )
inlinestatic

A constant TSIG error object derived from Rcode::NXRRSET()

Definition at line 267 of file tsigerror.h.

References isc::dns::Rcode::NXRRSET().

+ Here is the call graph for this function:

bool isc::dns::TSIGError::operator!= ( const TSIGError other) const
inline

Same as nequals().

Definition at line 100 of file tsigerror.h.

References nequals().

+ Here is the call graph for this function:

bool isc::dns::TSIGError::operator== ( const TSIGError other) const
inline

Same as equals().

Definition at line 87 of file tsigerror.h.

References equals().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::REFUSED ( )
inlinestatic

A constant TSIG error object derived from Rcode::REFUSED()

Definition at line 249 of file tsigerror.h.

References isc::dns::Rcode::REFUSED().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::RESERVED11 ( )
inlinestatic

A constant TSIG error object derived from Rcode::RESERVED11()

Definition at line 285 of file tsigerror.h.

References isc::dns::Rcode::RESERVED11().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::RESERVED12 ( )
inlinestatic

A constant TSIG error object derived from Rcode::RESERVED12()

Definition at line 291 of file tsigerror.h.

References isc::dns::Rcode::RESERVED12().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::RESERVED13 ( )
inlinestatic

A constant TSIG error object derived from Rcode::RESERVED13()

Definition at line 297 of file tsigerror.h.

References isc::dns::Rcode::RESERVED13().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::RESERVED14 ( )
inlinestatic

A constant TSIG error object derived from Rcode::RESERVED14()

Definition at line 303 of file tsigerror.h.

References isc::dns::Rcode::RESERVED14().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::RESERVED15 ( )
inlinestatic

A constant TSIG error object derived from Rcode::RESERVED15()

Definition at line 309 of file tsigerror.h.

References isc::dns::Rcode::RESERVED15().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::SERVFAIL ( )
inlinestatic

A constant TSIG error object derived from Rcode::SERVFAIL()

Definition at line 231 of file tsigerror.h.

References isc::dns::Rcode::SERVFAIL().

+ Here is the call graph for this function:

Rcode isc::dns::TSIGError::toRcode ( ) const

Convert the TSIGError to a Rcode.

This method returns an Rcode object that is corresponding to the TSIG error. The returned Rcode is expected to be used by a verifying server to specify the RCODE of a response when TSIG verification fails.

Specifically, this method returns Rcode::NOTAUTH() for the TSIG specific errors, BADSIG, BADKEY, BADTIME, as described in RFC2845. For errors derived from the standard Rcode (code 0-15), it returns the corresponding Rcode. For others, this method returns Rcode::SERVFAIL() as a last resort.

Exceptions
None

Definition at line 51 of file tsigerror.cc.

References BAD_TRUNC_CODE, isc::dns::Rcode::NOTAUTH(), and isc::dns::Rcode::SERVFAIL().

+ Here is the call graph for this function:

std::string isc::dns::TSIGError::toText ( ) const

Convert the TSIGError to a string.

For codes derived from RCODEs up to 15, this method returns the same string as Rcode::toText() for the corresponding code. For other pre-defined code values (see TSIGError::CodeValue), this method returns a string representation of the "mnemonic' used for the enum and constant objects as defined in RFC2845. For example, the string for code value 16 is "BADSIG", etc. For other code values it returns a string representation of the decimal number of the value, e.g. "32", "100", etc.

Exceptions
std::bad_allocResource allocation for the string fails
Returns
A string representation of the TSIGError.

Definition at line 40 of file tsigerror.cc.

References BAD_TRUNC_CODE.

Referenced by isc::d2::D2UpdateMessage::fromWire(), and isc::dns::operator<<().

const TSIGError & isc::dns::TSIGError::YXDOMAIN ( )
inlinestatic

A constant TSIG error object derived from Rcode::YXDOMAIN()

Definition at line 255 of file tsigerror.h.

References isc::dns::Rcode::YXDOMAIN().

+ Here is the call graph for this function:

const TSIGError & isc::dns::TSIGError::YXRRSET ( )
inlinestatic

A constant TSIG error object derived from Rcode::YXRRSET()

Definition at line 261 of file tsigerror.h.

References isc::dns::Rcode::YXRRSET().

+ Here is the call graph for this function:


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