Kea  1.5.0
dns/exceptions.h
Go to the documentation of this file.
1 // Copyright (C) 2010-2015 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 1
14 
15 #include <exceptions/exceptions.h>
16 
17 namespace isc {
18 namespace dns {
19 
23 class Rcode; // forward declaration
24 
25 class Exception : public isc::Exception {
26 public:
27  Exception(const char* file, size_t line, const char* what) :
28  isc::Exception(file, line, what) {}
29 };
30 
35 public:
36  DNSTextError(const char* file, size_t line, const char* what) :
37  isc::dns::Exception(file, line, what) {}
38 };
39 
44 public:
45  NameParserException(const char* file, size_t line, const char* what) :
46  DNSTextError(file, line, what) {}
47 };
48 
50 public:
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 
57 public:
58  DNSMessageFORMERR(const char* file, size_t line, const char* what) :
59  DNSProtocolError(file, line, what) {}
60  virtual const Rcode& getRcode() const;
61 };
62 
64 public:
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
73 
74 // Local Variables:
75 // mode: c++
76 // End:
isc::dns::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:27
isc::dns::DNSProtocolError::getRcode
virtual const Rcode & getRcode() const =0
isc::dns::DNSProtocolError
Definition: dns/exceptions.h:49
isc::dns::NameParserException::NameParserException
NameParserException(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:45
isc::dns::DNSMessageFORMERR::getRcode
virtual const Rcode & getRcode() const
Definition: dns/exceptions.cc:16
isc::dns::DNSMessageFORMERR::DNSMessageFORMERR
DNSMessageFORMERR(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:58
isc::Exception
This is a base class for exceptions thrown from the DNS library module.
Definition: exceptions/exceptions.h:23
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition: exceptions/exceptions.cc:32
isc::dns::DNSMessageBADVERS::DNSMessageBADVERS
DNSMessageBADVERS(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:65
isc::dns::DNSTextError::DNSTextError
DNSTextError(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:36
isc::dns::DNSMessageBADVERS
Definition: dns/exceptions.h:63
isc::dns::DNSProtocolError::DNSProtocolError
DNSProtocolError(const char *file, size_t line, const char *what)
Definition: dns/exceptions.h:51
isc::dns::Exception
Definition: dns/exceptions.h:25
isc::dns::NameParserException
Base class for name parser exceptions.
Definition: dns/exceptions.h:43
isc::dns::DNSTextError
Base class for all sorts of text parse errors.
Definition: dns/exceptions.h:34
isc::dns::DNSMessageFORMERR
Definition: dns/exceptions.h:56
exceptions.h
isc::dns::DNSMessageBADVERS::getRcode
virtual const Rcode & getRcode() const
Definition: dns/exceptions.cc:21
isc::dns::Rcode
DNS Response Codes (RCODEs) class.
Definition: rcode.h:40