7#ifndef UNIX_COMMAND_CONFIG_H
8#define UNIX_COMMAND_CONFIG_H
52 const std::string explicit_path =
"");
60 static std::string
validatePath(
const std::string socket_path);
77 return (socket_type_);
84 socket_type_ = socket_type;
91 return (socket_name_);
98 socket_name_ = socket_name;
103 return (std::string(socket_name_ +
".lock"));
114 std::string socket_type_;
119 std::string socket_name_;
135 boost::shared_ptr<isc::asiolink::UnixDomainSocketAcceptor>
acceptor_;
138 boost::shared_ptr<isc::asiolink::UnixDomainSocket>
socket_;
static std::string getSocketPath(bool reset=false, const std::string explicit_path="")
Fetches the supported control socket path.
static mode_t getSocketPathPerms()
Fetches the required socket path permissions mask.
UnixCommandConfig(isc::data::ConstElementPtr config)
Constructor.
std::string getSocketName() const
Returns socket name.
static const mode_t DEFAULT_SOCKET_PATH_PERMS
Defines the default permissions for unix socket parent directory.
static void setSocketPathPerms(mode_t perms=DEFAULT_SOCKET_PATH_PERMS)
Sets the required socket path permissions mask.
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.
static std::string validatePath(const std::string socket_path)
Validates a path against the supported path for unix control sockets.
void setSocketType(const std::string &socket_type)
Sets socket type.
void setSocketName(const std::string &socket_name)
Sets socket name.
~UnixCommandConfig()=default
Virtual destructor.
static mode_t socket_path_perms_
Stores the default permissions for unix socket parent directory.
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
boost::shared_ptr< Element > ElementPtr
Defines the logger used by the top-level component of kea-lfc.
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.
UnixSocketInfo()
Constructor.
bool usable_
Flag which indicates if socket can be reused.
Abstract class for configuration Cfg_* classes.
Base class for user context.