Kea  1.9.9-git
masterload.h
Go to the documentation of this file.
1 // Copyright (C) 2010-2020 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 #ifndef MASTERLOAD_H
8 #define MASTERLOAD_H 1
9 
10 #include <dns/rrset.h>
11 #include <exceptions/exceptions.h>
12 
13 #include <functional>
14 #include <iosfwd>
15 
16 namespace isc {
17 namespace dns {
18 class Name;
19 class RRClass;
20 
24 public:
25  MasterLoadError(const char* file, size_t line, const char* what) :
26  isc::Exception(file, line, what) {}
27 };
28 
33 typedef std::function<void(RRsetPtr)> MasterLoadCallback;
34 
38 
39 void masterLoad(const char* const filename, const Name& origin,
140  const RRClass& zone_class, MasterLoadCallback callback);
141 
162 void masterLoad(std::istream& input, const Name& origin,
163  const RRClass& zone_class, MasterLoadCallback callback,
164  const char* source = NULL);
165 }
166 
167 
169 }
170 
171 #endif // MASTERLOAD_H
172 
173 // Local Variables:
174 // mode: c++
175 // End:
The Name class encapsulates DNS names.
Definition: name.h:223
An exception that is thrown if an error occurs while loading a master zone data.
Definition: masterload.h:23
The RRClass class encapsulates DNS resource record classes.
Definition: rrclass.h:98
std::function< void(RRsetPtr)> MasterLoadCallback
The type of the callback parameter of masterLoad().
Definition: masterload.h:33
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
MasterLoadError(const char *file, size_t line, const char *what)
Definition: masterload.h:25
void masterLoad(const char *const filename, const Name &origin, const RRClass &zone_class, MasterLoadCallback callback)
Master zone file loader from a file.
Definition: masterload.cc:82