Kea  2.1.7-git
control_socket.cc
Go to the documentation of this file.
1 // Copyright (C) 2018 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 
12 #include <netconf/control_socket.h>
16 
17 using namespace std;
18 
19 namespace isc {
20 namespace 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) {
29  case CfgControlSocket::Type::UNIX:
30  return (createControlSocket<CfgControlSocket::Type::UNIX>(ctrl_sock));
31  case CfgControlSocket::Type::HTTP:
32  return (createControlSocket<CfgControlSocket::Type::HTTP>(ctrl_sock));
33  case CfgControlSocket::Type::STDOUT:
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
Contains declarations for HTTP control socket communication.
boost::shared_ptr< ControlSocketBase > ControlSocketBasePtr
Type definition for the pointer to the ControlSocketBase.
STL namespace.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Contains declarations for stdout control socket communication.
Type
Defines the list of possible control socket types.
Defines the logger used by the top-level component of kea-lfc.
Contains declarations for control socket communication.
ControlSocketBasePtr createControlSocket(CfgControlSocketPtr ctrl_sock)
Factory template for control sockets.
boost::shared_ptr< CfgControlSocket > CfgControlSocketPtr
Defines a pointer for CfgControlSocket instances.
Contains declarations for UNIX control socket communication.