Kea 2.7.6
|
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... | |
Constructors | |
We use the default versions of destructor, copy constructor, and assignment operator. | |
TSIGError (uint16_t error_code) | |
Constructor from the code value. | |
TSIGError (Rcode rcode) | |
Constructor from Rcode . | |
uint16_t | getCode () const |
Returns the TSIGCode error code value. | |
bool | equals (const TSIGError &other) const |
Return true iff two TSIGError objects are equal. | |
bool | operator== (const TSIGError &other) const |
Same as equals() . | |
bool | nequals (const TSIGError &other) const |
Return true iff two TSIGError objects are not equal. | |
bool | operator!= (const TSIGError &other) const |
Same as nequals() . | |
std::string | toText () const |
Convert the TSIGError to a string. | |
Rcode | toRcode () const |
Convert the TSIGError to a Rcode . | |
static const TSIGError & | NOERROR () |
A constant TSIG error object derived from Rcode::NOERROR() | |
static const TSIGError & | FORMERR () |
A constant TSIG error object derived from Rcode::FORMERR() | |
static const TSIGError & | SERVFAIL () |
A constant TSIG error object derived from Rcode::SERVFAIL() | |
static const TSIGError & | NXDOMAIN () |
A constant TSIG error object derived from Rcode::NXDOMAIN() | |
static const TSIGError & | NOTIMP () |
A constant TSIG error object derived from Rcode::NOTIMP() | |
static const TSIGError & | REFUSED () |
A constant TSIG error object derived from Rcode::REFUSED() | |
static const TSIGError & | YXDOMAIN () |
A constant TSIG error object derived from Rcode::YXDOMAIN() | |
static const TSIGError & | YXRRSET () |
A constant TSIG error object derived from Rcode::YXRRSET() | |
static const TSIGError & | NXRRSET () |
A constant TSIG error object derived from Rcode::NXRRSET() | |
static const TSIGError & | NOTAUTH () |
A constant TSIG error object derived from Rcode::NOTAUTH() | |
static const TSIGError & | NOTZONE () |
A constant TSIG error object derived from Rcode::NOTZONE() | |
static const TSIGError & | RESERVED11 () |
A constant TSIG error object derived from Rcode::RESERVED11() | |
static const TSIGError & | RESERVED12 () |
A constant TSIG error object derived from Rcode::RESERVED12() | |
static const TSIGError & | RESERVED13 () |
A constant TSIG error object derived from Rcode::RESERVED13() | |
static const TSIGError & | RESERVED14 () |
A constant TSIG error object derived from Rcode::RESERVED14() | |
static const TSIGError & | RESERVED15 () |
A constant TSIG error object derived from Rcode::RESERVED15() | |
static const TSIGError & | BAD_SIG () |
A constant TSIG error object for the BADSIG code (see TSIGError::BAD_SIG_CODE ). | |
static const TSIGError & | BAD_KEY () |
A constant TSIG error object for the BADKEY code (see TSIGError::BAD_KEY_CODE ). | |
static const TSIGError & | BAD_TIME () |
A constant TSIG error object for the BADTIME code (see TSIGError::BAD_TIME_CODE ). | |
static const TSIGError & | BAD_MODE () |
A constant TSIG error object for the BADMODE code (see TSIGError::BAD_MODE_CODE ). | |
static const TSIGError & | BAD_NAME () |
A constant TSIG error object for the BADNAME code (see TSIGError::BAD_NAME_CODE ). | |
static const TSIGError & | BAD_ALG () |
A constant TSIG error object for the BADALG code (see TSIGError::BAD_ALG_CODE ). | |
static const TSIGError & | BAD_TRUNC () |
A constant TSIG error object for the BADTRUNC code (see TSIGError::BAD_TRUNC_CODE ). | |
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.
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.
Definition at line 32 of file tsigerror.h.
|
inlineexplicit |
Constructor from the code value.
None |
error_code | The underlying 16-bit error code value of the TSIGError . |
Definition at line 52 of file tsigerror.h.
|
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.
isc::OutOfRange | Given rcode is not convertible to TSIGErrors. |
Definition at line 33 of file tsigerror.cc.
References isc_throw.
|
inlinestatic |
A constant TSIG error object for the BADALG code (see TSIGError::BAD_ALG_CODE
).
Definition at line 353 of file tsigerror.h.
References BAD_ALG_CODE.
|
inlinestatic |
A constant TSIG error object for the BADKEY code (see TSIGError::BAD_KEY_CODE
).
Definition at line 329 of file tsigerror.h.
References BAD_KEY_CODE.
Referenced by isc::dns::TSIGContext::TSIGContext(), isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().
|
inlinestatic |
A constant TSIG error object for the BADMODE code (see TSIGError::BAD_MODE_CODE
).
Definition at line 341 of file tsigerror.h.
References BAD_MODE_CODE.
|
inlinestatic |
A constant TSIG error object for the BADNAME code (see TSIGError::BAD_NAME_CODE
).
Definition at line 347 of file tsigerror.h.
References BAD_NAME_CODE.
|
inlinestatic |
A constant TSIG error object for the BADSIG code (see TSIGError::BAD_SIG_CODE
).
Definition at line 323 of file tsigerror.h.
References BAD_SIG_CODE.
Referenced by isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().
|
inlinestatic |
A constant TSIG error object for the BADTIME code (see TSIGError::BAD_TIME_CODE
).
Definition at line 335 of file tsigerror.h.
References BAD_TIME_CODE.
Referenced by isc::dns::TSIGContext::getTSIGLength(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().
|
inlinestatic |
A constant TSIG error object for the BADTRUNC code (see TSIGError::BAD_TRUNC_CODE
).
Definition at line 359 of file tsigerror.h.
References BAD_TRUNC_CODE.
Referenced by isc::dns::TSIGContext::verify().
|
inline |
Return true iff two TSIGError
objects are equal.
Two TSIGError objects are equal iff their error codes are equal.
None |
other | the TSIGError object to compare against. |
Definition at line 85 of file tsigerror.h.
Referenced by operator==().
|
inlinestatic |
A constant TSIG error object derived from Rcode::FORMERR()
Definition at line 233 of file tsigerror.h.
References isc::dns::Rcode::FORMERR().
Referenced by isc::dns::TSIGContext::verify().
|
inline |
Returns the TSIGCode
error code value.
None |
TSIGError
. Definition at line 73 of file tsigerror.h.
|
inline |
Return true iff two TSIGError
objects are not equal.
None |
other | the TSIGError object to compare against. |
Definition at line 101 of file tsigerror.h.
Referenced by operator!=().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOERROR()
Definition at line 227 of file tsigerror.h.
References isc::dns::Rcode::NOERROR().
Referenced by isc::dns::TSIGContext::TSIGContextImpl::TSIGContextImpl(), isc::d2::D2UpdateMessage::fromWire(), isc::dns::TSIGContext::TSIGContextImpl::postVerifyUpdate(), isc::dns::TSIGContext::sign(), and isc::dns::TSIGContext::verify().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTAUTH()
Definition at line 281 of file tsigerror.h.
References isc::dns::Rcode::NOTAUTH().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTIMP()
Definition at line 251 of file tsigerror.h.
References isc::dns::Rcode::NOTIMP().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTZONE()
Definition at line 287 of file tsigerror.h.
References isc::dns::Rcode::NOTZONE().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NXDOMAIN()
Definition at line 245 of file tsigerror.h.
References isc::dns::Rcode::NXDOMAIN().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NXRRSET()
Definition at line 275 of file tsigerror.h.
References isc::dns::Rcode::NXRRSET().
|
inline |
Same as nequals()
.
Definition at line 106 of file tsigerror.h.
References nequals().
|
inline |
Same as equals()
.
Definition at line 90 of file tsigerror.h.
References equals().
|
inlinestatic |
A constant TSIG error object derived from Rcode::REFUSED()
Definition at line 257 of file tsigerror.h.
References isc::dns::Rcode::REFUSED().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED11()
Definition at line 293 of file tsigerror.h.
References isc::dns::Rcode::RESERVED11().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED12()
Definition at line 299 of file tsigerror.h.
References isc::dns::Rcode::RESERVED12().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED13()
Definition at line 305 of file tsigerror.h.
References isc::dns::Rcode::RESERVED13().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED14()
Definition at line 311 of file tsigerror.h.
References isc::dns::Rcode::RESERVED14().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED15()
Definition at line 317 of file tsigerror.h.
References isc::dns::Rcode::RESERVED15().
|
inlinestatic |
A constant TSIG error object derived from Rcode::SERVFAIL()
Definition at line 239 of file tsigerror.h.
References isc::dns::Rcode::SERVFAIL().
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.
None |
Definition at line 51 of file tsigerror.cc.
References BAD_TRUNC_CODE, isc::dns::Rcode::NOTAUTH(), and isc::dns::Rcode::SERVFAIL().
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.
std::bad_alloc | Resource allocation for the string fails |
TSIGError
. Definition at line 40 of file tsigerror.cc.
References BAD_TRUNC_CODE, and toText().
Referenced by toText().
|
inlinestatic |
A constant TSIG error object derived from Rcode::YXDOMAIN()
Definition at line 263 of file tsigerror.h.
References isc::dns::Rcode::YXDOMAIN().
|
inlinestatic |
A constant TSIG error object derived from Rcode::YXRRSET()
Definition at line 269 of file tsigerror.h.
References isc::dns::Rcode::YXRRSET().