Kea 2.5.8
dns/exceptions.h
Go to the documentation of this file.
1// Copyright (C) 2010-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7// XXX: we have another exceptions.h, so we need to use a prefix "DNS_" in
8// the include guard. More preferably, we should define a consistent naming
9// style for the header guide (e.g. module-name_file-name_H) throughout the
10// package.
11
12#ifndef DNS_EXCEPTIONS_H
13#define DNS_EXCEPTIONS_H
14
16
17namespace isc {
18namespace dns {
19
23class Rcode; // forward declaration
24
25class Exception : public isc::Exception {
26public:
27 Exception(const char* file, size_t line, const char* what) :
28 isc::Exception(file, line, what) {}
29};
30
35public:
36 DNSTextError(const char* file, size_t line, const char* what) :
37 isc::dns::Exception(file, line, what) {}
38};
39
44public:
45 NameParserException(const char* file, size_t line, const char* what) :
46 DNSTextError(file, line, what) {}
47};
48
50public:
51 DNSProtocolError(const char* file, size_t line, const char* what) :
52 isc::dns::Exception(file, line, what) {}
53 virtual const Rcode& getRcode() const = 0;
54};
55
57public:
58 DNSMessageFORMERR(const char* file, size_t line, const char* what) :
59 DNSProtocolError(file, line, what) {}
60 virtual const Rcode& getRcode() const;
61};
62
64public:
65 DNSMessageBADVERS(const char* file, size_t line, const char* what) :
66 DNSProtocolError(file, line, what) {}
67 virtual const Rcode& getRcode() const;
68};
69
70}
71}
72#endif // DNS_EXCEPTIONS_H
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
DNSMessageBADVERS(const char *file, size_t line, const char *what)
virtual const Rcode & getRcode() const
virtual const Rcode & getRcode() const
DNSMessageFORMERR(const char *file, size_t line, const char *what)
virtual const Rcode & getRcode() const =0
DNSProtocolError(const char *file, size_t line, const char *what)
Base class for all sorts of text parse errors.
DNSTextError(const char *file, size_t line, const char *what)
Exception(const char *file, size_t line, const char *what)
Base class for name parser exceptions.
NameParserException(const char *file, size_t line, const char *what)
DNS Response Codes (RCODEs) class.
Definition: rcode.h:40
Defines the logger used by the top-level component of kea-lfc.