Kea
1.9.9-git
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
d2/main.cc
Go to the documentation of this file.
1
// Copyright (C) 2013-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
#include <config.h>
8
#include <
d2/d2_log.h
>
9
#include <
d2/d2_controller.h
>
10
#include <
exceptions/exceptions.h
>
11
#include <
log/logger_support.h
>
12
#include <
log/logger_manager.h
>
13
14
#include <iostream>
15
16
using namespace
isc::d2
;
17
using namespace
isc::process
;
18
using namespace
std
;
19
25
int
main
(
int
argc,
char
* argv[]) {
26
int
ret = EXIT_SUCCESS;
27
28
// Launch the controller passing in command line arguments.
29
// Exit program with the controller's return code.
30
try
{
31
// Instantiate/fetch the DHCP-DDNS application controller singleton.
32
DControllerBasePtr
& controller =
D2Controller::instance
();
33
34
// 'false' value disables test mode.
35
ret = controller->launch(argc, argv,
false
);
36
}
catch
(
const
VersionMessage
& ex) {
37
std::string msg(ex.
what
());
38
if
(!msg.empty()) {
39
std::cout << msg << std::endl;
40
}
41
}
catch
(
const
InvalidUsage
& ex) {
42
std::string msg(ex.
what
());
43
if
(!msg.empty()) {
44
std::cerr << msg << std::endl;
45
}
46
ret = EXIT_FAILURE;
47
}
catch
(
const
isc::Exception
& ex) {
48
std::cerr <<
"Service failed: "
<< ex.
what
() << std::endl;
49
ret = EXIT_FAILURE;
50
}
51
52
return
(ret);
53
}
isc::process::DControllerBasePtr
boost::shared_ptr< DControllerBase > DControllerBasePtr
Definition:
d_controller.h:78
exceptions.h
std
STL namespace.
isc::d2
Definition:
d2_cfg_mgr.cc:23
isc::d2::D2Controller::instance
static process::DControllerBasePtr & instance()
Static singleton instance method.
Definition:
d2_controller.cc:32
isc::process::VersionMessage
Exception used to convey version info upwards.
Definition:
d_controller.h:41
logger_manager.h
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::process::InvalidUsage
Exception thrown when the command line is invalid.
Definition:
d_controller.h:30
d2_controller.h
isc::Exception
This is a base class for exceptions thrown from the DNS library module.
Definition:
exceptions/exceptions.h:23
logger_support.h
Logging initialization functions.
main
int main(int argc, char *argv[])
This file contains entry point (main() function) for standard DHCP-DDNS process, kea-dhcp-ddns, component of Kea software suite.
Definition:
d2/main.cc:25
d2_log.h
isc::process
Definition:
cb_ctl_base.h:20
src
bin
d2
main.cc
Generated on Wed Sep 15 2021 10:48:31 for Kea by
1.8.9.1