Add multi-host support

This refactoring includes:
- added multi-host mode support;
- added support for graceful shutdown of the service;
- added support to flush the log buffer as it fills;
- D-Bus service xyz.openbmc_project.HostLogger replaced with SIGUSR1
  signal handler;
- self diagnostic messages now registered via phosphor-logging;
- added unit tests;
- build system migrated from autotools to meson;
- source code aligned with OpenBMC conventions.

Change-Id: If6c1dfde278af685d8563450543a6587a282c7e4
Signed-off-by: Artem Senichev <a.senichev@yadro.com>
diff --git a/src/host_console.hpp b/src/host_console.hpp
new file mode 100644
index 0000000..b0369af
--- /dev/null
+++ b/src/host_console.hpp
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (C) 2020 YADRO
+
+#pragma once
+
+#include <string>
+
+/**
+ * @class HostConsole
+ * @brief Connection with host's console.
+ */
+class HostConsole
+{
+  public:
+    /**
+     * @brief Constructor.
+     *
+     * @param[in] socketId socket ID used for construction path to the socket
+     */
+    HostConsole(const std::string& socketId);
+
+    ~HostConsole();
+
+    /**
+     * @brief Connect to the host's console via socket.
+     *
+     * @throw std::invalid_argument if socket ID is invalid
+     * @throw std::system_error in case of other errors
+     */
+    void connect();
+
+    /**
+     * @brief Non-blocking read data from console's socket.
+     *
+     * @param[out] buf buffer to write the incoming data
+     * @param[in] sz size of the buffer
+     *
+     * @throw std::system_error in case of errors
+     *
+     * @return number of actually read bytes
+     */
+    size_t read(char* buf, size_t sz) const;
+
+    /** @brief Get socket file descriptor, used for watching IO. */
+    operator int() const;
+
+  private:
+    /** @brief Socket Id. */
+    std::string socketId;
+    /** @brief File descriptor of the socket. */
+    int socketFd;
+};