Kea 2.7.7
unix_command_config.h
Go to the documentation of this file.
1// Copyright (C) 2024-2025 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 UNIX_COMMAND_CONFIG_H
8#define UNIX_COMMAND_CONFIG_H
9
10#include <asiolink/asiolink.h>
14#include <cc/cfg_to_element.h>
15#include <cc/user_context.h>
16
17namespace isc {
18namespace config {
19
23public:
28
30 ~UnixCommandConfig() = default;
31
35 std::string getSocketType() const {
36 return (socket_type_);
37 }
38
42 void setSocketType(const std::string& socket_type) {
43 socket_type_ = socket_type;
44 }
45
49 std::string getSocketName() const {
50 return (socket_name_);
51 }
52
56 void setSocketName(const std::string& socket_name) {
57 socket_name_ = socket_name;
58 }
59
61 std::string getLockName() {
62 return (std::string(socket_name_ + ".lock"));
63 }
64
68 virtual isc::data::ElementPtr toElement() const;
69
70private:
71
73 std::string socket_type_;
74
78 std::string socket_name_;
79};
80
82typedef boost::shared_ptr<UnixCommandConfig> UnixCommandConfigPtr;
83
88 bool usable_;
89
92
94 boost::shared_ptr<isc::asiolink::UnixDomainSocketAcceptor> acceptor_;
95
97 boost::shared_ptr<isc::asiolink::UnixDomainSocket> socket_;
98
101
104 }
105
107 ~UnixSocketInfo() = default;
108};
109
111typedef boost::shared_ptr<UnixSocketInfo> UnixSocketInfoPtr;
112
113} // end of isc::config namespace
114} // end of isc namespace
115#endif
UNIX command config aka UNIX control socket info class.
UnixCommandConfig(isc::data::ConstElementPtr config)
Constructor.
std::string getSocketName() const
Returns socket name.
std::string getSocketType() const
Returns socket type.
std::string getLockName()
Returns the lock file name.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void setSocketType(const std::string &socket_type)
Sets socket type.
void setSocketName(const std::string &socket_name)
Sets socket name.
~UnixCommandConfig()=default
Virtual destructor.
boost::shared_ptr< UnixSocketInfo > UnixSocketInfoPtr
Pointer to a UnixSocketInfo object.
boost::shared_ptr< UnixCommandConfig > UnixCommandConfigPtr
Pointer to a UnixCommandConfig object.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
Defines the logger used by the top-level component of kea-lfc.
Structure used to store UNIX connection data.
boost::shared_ptr< isc::asiolink::UnixDomainSocketAcceptor > acceptor_
Pointer to the acceptor service.
UnixCommandConfigPtr config_
Pointer to the socket config.
boost::shared_ptr< isc::asiolink::UnixDomainSocket > socket_
Pointer to the socket into which the new connection is accepted.
~UnixSocketInfo()=default
Destructor.
int lock_fd_
File description to lock name file.
bool usable_
Flag which indicates if socket can be reused.
Abstract class for configuration Cfg_* classes.
Base class for user context.