Kea
1.9.9-git
|
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 TSIGError & | BAD_ALG () |
A constant TSIG error object for the BADALG code (see TSIGError::BAD_ALG_CODE ). More... | |
static const TSIGError & | BAD_KEY () |
A constant TSIG error object for the BADKEY code (see TSIGError::BAD_KEY_CODE ). More... | |
static const TSIGError & | BAD_MODE () |
A constant TSIG error object for the BADMODE code (see TSIGError::BAD_MODE_CODE ). More... | |
static const TSIGError & | BAD_NAME () |
A constant TSIG error object for the BADNAME code (see TSIGError::BAD_NAME_CODE ). More... | |
static const TSIGError & | BAD_SIG () |
A constant TSIG error object for the BADSIG code (see TSIGError::BAD_SIG_CODE ). More... | |
static const TSIGError & | BAD_TIME () |
A constant TSIG error object for the BADTIME code (see TSIGError::BAD_TIME_CODE ). More... | |
static const TSIGError & | BAD_TRUNC () |
A constant TSIG error object for the BADTRUNC code (see TSIGError::BAD_TRUNC_CODE ). More... | |
static const TSIGError & | FORMERR () |
A constant TSIG error object derived from Rcode::FORMERR() More... | |
static const TSIGError & | NOERROR () |
A constant TSIG error object derived from Rcode::NOERROR() More... | |
static const TSIGError & | NOTAUTH () |
A constant TSIG error object derived from Rcode::NOTAUTH() More... | |
static const TSIGError & | NOTIMP () |
A constant TSIG error object derived from Rcode::NOTIMP() More... | |
static const TSIGError & | NOTZONE () |
A constant TSIG error object derived from Rcode::NOTZONE() More... | |
static const TSIGError & | NXDOMAIN () |
A constant TSIG error object derived from Rcode::NXDOMAIN() More... | |
static const TSIGError & | NXRRSET () |
A constant TSIG error object derived from Rcode::NXRRSET() More... | |
static const TSIGError & | REFUSED () |
A constant TSIG error object derived from Rcode::REFUSED() More... | |
static const TSIGError & | RESERVED11 () |
A constant TSIG error object derived from Rcode::RESERVED11() More... | |
static const TSIGError & | RESERVED12 () |
A constant TSIG error object derived from Rcode::RESERVED12() More... | |
static const TSIGError & | RESERVED13 () |
A constant TSIG error object derived from Rcode::RESERVED13() More... | |
static const TSIGError & | RESERVED14 () |
A constant TSIG error object derived from Rcode::RESERVED14() More... | |
static const TSIGError & | RESERVED15 () |
A constant TSIG error object derived from Rcode::RESERVED15() More... | |
static const TSIGError & | SERVFAIL () |
A constant TSIG error object derived from Rcode::SERVFAIL() More... | |
static const TSIGError & | YXDOMAIN () |
A constant TSIG error object derived from Rcode::YXDOMAIN() More... | |
static const TSIGError & | YXRRSET () |
A constant TSIG error object derived from Rcode::YXRRSET() More... | |
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 345 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 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().
|
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.
|
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.
|
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().
|
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().
|
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().
|
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 83 of file tsigerror.h.
Referenced by operator==().
|
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().
|
inline |
Returns the TSIGCode
error code value.
None |
TSIGError
. Definition at line 73 of file tsigerror.h.
Referenced by isc::dns::TSIGContext::sign().
|
inline |
Return true iff two TSIGError
objects are not equal.
None |
other | the TSIGError object to compare against. |
Definition at line 96 of file tsigerror.h.
Referenced by operator!=().
|
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().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTAUTH()
Definition at line 273 of file tsigerror.h.
References isc::dns::Rcode::NOTAUTH().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTIMP()
Definition at line 243 of file tsigerror.h.
References isc::dns::Rcode::NOTIMP().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NOTZONE()
Definition at line 279 of file tsigerror.h.
References isc::dns::Rcode::NOTZONE().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NXDOMAIN()
Definition at line 237 of file tsigerror.h.
References isc::dns::Rcode::NXDOMAIN().
|
inlinestatic |
A constant TSIG error object derived from Rcode::NXRRSET()
Definition at line 267 of file tsigerror.h.
References isc::dns::Rcode::NXRRSET().
|
inline |
Same as nequals()
.
Definition at line 100 of file tsigerror.h.
References nequals().
|
inline |
Same as equals()
.
Definition at line 87 of file tsigerror.h.
References equals().
|
inlinestatic |
A constant TSIG error object derived from Rcode::REFUSED()
Definition at line 249 of file tsigerror.h.
References isc::dns::Rcode::REFUSED().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED11()
Definition at line 285 of file tsigerror.h.
References isc::dns::Rcode::RESERVED11().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED12()
Definition at line 291 of file tsigerror.h.
References isc::dns::Rcode::RESERVED12().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED13()
Definition at line 297 of file tsigerror.h.
References isc::dns::Rcode::RESERVED13().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED14()
Definition at line 303 of file tsigerror.h.
References isc::dns::Rcode::RESERVED14().
|
inlinestatic |
A constant TSIG error object derived from Rcode::RESERVED15()
Definition at line 309 of file tsigerror.h.
References isc::dns::Rcode::RESERVED15().
|
inlinestatic |
A constant TSIG error object derived from Rcode::SERVFAIL()
Definition at line 231 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.
Referenced by isc::d2::D2UpdateMessage::fromWire(), and isc::dns::operator<<().
|
inlinestatic |
A constant TSIG error object derived from Rcode::YXDOMAIN()
Definition at line 255 of file tsigerror.h.
References isc::dns::Rcode::YXDOMAIN().
|
inlinestatic |
A constant TSIG error object derived from Rcode::YXRRSET()
Definition at line 261 of file tsigerror.h.
References isc::dns::Rcode::YXRRSET().