Kea 2.7.0
control_socket.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
9
10#include <config.h>
11
16
17using namespace std;
18
19namespace isc {
20namespace netconf {
21
24 if (!ctrl_sock) {
25 isc_throw(BadValue, "null control socket configuration");
26 }
27 CfgControlSocket::Type sock_type = ctrl_sock->getType();
28 switch (sock_type) {
30 return (createControlSocket<CfgControlSocket::Type::UNIX>(ctrl_sock));
32 return (createControlSocket<CfgControlSocket::Type::HTTP>(ctrl_sock));
34 return (createControlSocket<CfgControlSocket::Type::STDOUT>(ctrl_sock));
35 default:
36 isc_throw(BadValue, "Unknown control socket type: " << sock_type);
37 }
38}
39
40} // namespace netconf
41} // namespace isc
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Type
Defines the list of possible control socket types.
Contains declarations for control socket communication.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Contains declarations for HTTP control socket communication.
std::shared_ptr< ControlSocketBase > ControlSocketBasePtr
Type definition for the pointer to the ControlSocketBase.
std::shared_ptr< CfgControlSocket > CfgControlSocketPtr
Defines a pointer for CfgControlSocket instances.
ControlSocketBasePtr controlSocketFactory(CfgControlSocketPtr ctrl_sock)
Factory function for control sockets.
Defines the logger used by the top-level component of kea-lfc.
Contains declarations for stdout control socket communication.
Contains declarations for UNIX control socket communication.