Kea 2.7.6
unix_control_client.h
Go to the documentation of this file.
1// Copyright (C) 2015-2024 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_CONTROL_CLIENT_H
8#define UNIX_CONTROL_CLIENT_H
9
10#include <string>
11
12namespace isc {
13namespace dhcp {
14namespace test {
15
23public:
24
27
30
33
37 bool connectToServer(const std::string& socket_path);
38
42 bool sendCommand(const std::string& command);
43
50 bool getResponse(std::string& response, const unsigned int timeout_sec = 0);
51
56 int selectCheck(const unsigned int timeout_sec);
57
60};
61
62} // end of isc::dhcp::test namespace
63} // end of isc::dhcp namespace
64} // end of isc namespace
65
66#endif // UNIX_CONTROL_CLIENT_H
Class that acts as a UnixCommandSocket client.
void disconnectFromServer()
Closes the Control Channel socket.
int socket_fd_
Retains the fd of the open socket.
bool getResponse(std::string &response, const unsigned int timeout_sec=0)
Reads the response text from the open Control Channel.
int selectCheck(const unsigned int timeout_sec)
Uses select to poll the Control Channel for data waiting.
bool sendCommand(const std::string &command)
Sends the given command across the open Control Channel.
bool connectToServer(const std::string &socket_path)
Connects to a Unix socket at the given path.
Defines the logger used by the top-level component of kea-lfc.