diff options
Diffstat (limited to 'src/lib/dns/tsigerror.cc')
-rw-r--r-- | src/lib/dns/tsigerror.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/dns/tsigerror.cc b/src/lib/dns/tsigerror.cc index e63c9ab2dd..36ef47da10 100644 --- a/src/lib/dns/tsigerror.cc +++ b/src/lib/dns/tsigerror.cc @@ -49,6 +49,17 @@ TSIGError::toText() const { } } +Rcode +TSIGError::toRcode() const { + if (code_ <= MAX_RCODE_FOR_TSIGERROR) { + return (Rcode(code_)); + } + if (code_ > BAD_TIME_CODE) { + return (Rcode::SERVFAIL()); + } + return (Rcode::NOTAUTH()); +} + std::ostream& operator<<(std::ostream& os, const TSIGError& error) { return (os << error.toText()); |