Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 3 | #include <sdbusplus/bus.hpp> |
William A. Kennington III | 40c29b5 | 2022-11-16 17:48:10 -0800 | [diff] [blame] | 4 | #include <sdbusplus/bus/match.hpp> |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 5 | #include <sdbusplus/server/object.hpp> |
William A. Kennington III | be3bd2f | 2022-10-11 14:11:27 -0700 | [diff] [blame] | 6 | #include <stdplus/zstring.hpp> |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 7 | #include <string> |
Patrick Venture | 189d44e | 2018-07-09 12:30:59 -0700 | [diff] [blame] | 8 | #include <xyz/openbmc_project/Network/SystemConfiguration/server.hpp> |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 9 | |
| 10 | namespace phosphor |
| 11 | { |
| 12 | namespace network |
| 13 | { |
| 14 | |
| 15 | using SystemConfigIntf = |
| 16 | sdbusplus::xyz::openbmc_project::Network::server::SystemConfiguration; |
| 17 | |
Patrick Williams | c38b071 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 18 | using Iface = sdbusplus::server::object_t<SystemConfigIntf>; |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 19 | |
| 20 | class Manager; // forward declaration of network manager. |
| 21 | |
| 22 | /** @class SystemConfiguration |
| 23 | * @brief Network system configuration. |
| 24 | * @details A concrete implementation for the |
| 25 | * xyz.openbmc_project.Network.SystemConfiguration DBus API. |
| 26 | */ |
| 27 | class SystemConfiguration : public Iface |
| 28 | { |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 29 | public: |
| 30 | SystemConfiguration() = default; |
| 31 | SystemConfiguration(const SystemConfiguration&) = delete; |
| 32 | SystemConfiguration& operator=(const SystemConfiguration&) = delete; |
| 33 | SystemConfiguration(SystemConfiguration&&) = delete; |
| 34 | SystemConfiguration& operator=(SystemConfiguration&&) = delete; |
| 35 | virtual ~SystemConfiguration() = default; |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 36 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 37 | /** @brief Constructor to put object onto bus at a dbus path. |
| 38 | * @param[in] bus - Bus to attach to. |
| 39 | * @param[in] objPath - Path to attach at. |
| 40 | * @param[in] parent - Parent object. |
| 41 | */ |
William A. Kennington III | be3bd2f | 2022-10-11 14:11:27 -0700 | [diff] [blame] | 42 | SystemConfiguration(sdbusplus::bus_t& bus, stdplus::const_zstring objPath); |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 43 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 44 | /** @brief set the hostname of the system. |
| 45 | * @param[in] name - host name of the system. |
| 46 | */ |
| 47 | std::string hostName(std::string name) override; |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 48 | |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 49 | private: |
Gunnar Mills | 57d9c50 | 2018-09-14 14:42:34 -0500 | [diff] [blame] | 50 | /** @brief Persistent sdbusplus DBus bus connection. */ |
Patrick Williams | c38b071 | 2022-07-22 19:26:54 -0500 | [diff] [blame] | 51 | sdbusplus::bus_t& bus; |
William A. Kennington III | 40c29b5 | 2022-11-16 17:48:10 -0800 | [diff] [blame] | 52 | |
| 53 | /** @brief Monitor for hostname changes */ |
| 54 | sdbusplus::bus::match_t hostnamePropMatch; |
Ratan Gupta | 82e1ef9 | 2017-06-15 08:39:15 +0530 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace network |
| 58 | } // namespace phosphor |