Kea
2.7.6
netconf/main.cc
Go to the documentation of this file.
1
// Copyright (C) 2018-2022 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
9
#include <
exceptions/exceptions.h
>
10
#include <
netconf/netconf_controller.h
>
11
12
#include <cstdlib>
13
#include <iostream>
14
15
using namespace
isc::netconf
;
16
using namespace
isc::process
;
17
18
using namespace
std;
19
20
int
main
(
int
argc,
char
* argv[]) {
21
int
ret = EXIT_SUCCESS;
22
23
// Launch the controller passing in command line arguments.
24
// Exit program with the controller's return code.
25
try
{
26
// Instantiate/fetch the application controller singleton.
27
DControllerBasePtr
& controller =
NetconfController::instance
();
28
29
// 'false' value disables test mode.
30
controller->launch(argc, argv,
false
);
31
}
catch
(
const
VersionMessage
& ex) {
32
string
msg(ex.
what
());
33
if
(!msg.empty()) {
34
cout << msg << endl;
35
}
36
}
catch
(
const
InvalidUsage
& ex) {
37
string
msg(ex.
what
());
38
if
(!msg.empty()) {
39
cerr << msg << endl;
40
}
41
ret = EXIT_FAILURE;
42
}
catch
(exception
const
& ex) {
43
cerr <<
"Service failed: "
<< ex.
what
() << endl;
44
ret = EXIT_FAILURE;
45
}
catch
(...) {
46
cerr <<
"Service failed"
<< endl;
47
ret = EXIT_FAILURE;
48
}
49
50
NetconfController::instance
().reset();
51
52
return
(ret);
53
}
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::netconf::NetconfController::instance
static process::DControllerBasePtr & instance()
Static singleton instance method.
Definition
netconf_controller.cc:29
isc::process::InvalidUsage
Exception thrown when the command line is invalid.
Definition
d_controller.h:30
isc::process::VersionMessage
Exception used to convey version info upwards.
Definition
d_controller.h:41
exceptions.h
isc::netconf
Definition
control_socket.cc:20
isc::process
Definition
cb_ctl_base.h:22
isc::process::DControllerBasePtr
boost::shared_ptr< DControllerBase > DControllerBasePtr
Definition
d_controller.h:78
main
int main(int argc, char *argv[])
Definition
netconf/main.cc:20
netconf_controller.h
src
bin
netconf
main.cc
Generated on Tue Dec 24 2024 13:23:53 for Kea by
1.12.0