30const unsigned int EXTRCODE_SHIFT = 4;
31const unsigned int RCODE_MASK = 0x000f;
35const uint16_t MAX_RCODE = 0xfff;
37const char*
const rcodetext[] = {
59 if (code_ > MAX_RCODE) {
65 code_((extended_code << EXTRCODE_SHIFT) | (code & RCODE_MASK))
67 if (code > RCODE_MASK) {
69 "Base Rcode is too large to construct: "
70 <<
static_cast<unsigned int>(code));
76 return (code_ >> EXTRCODE_SHIFT);
81 if (code_ <
sizeof(rcodetext) /
sizeof (
const char*)) {
82 return (rcodetext[code_]);
92 return (os << rcode.
toText());
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
DNS Response Codes (RCODEs) class.
Rcode(const uint16_t code)
Constructor from the code value.
std::string toText() const
Convert the Rcode to a string.
uint8_t getExtendedCode() const
Returns the upper 8-bit of the Rcode code value.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Defines the logger used by the top-level component of kea-lfc.