xref: /openbmc/phosphor-networkd/src/system_configuration.hpp (revision 89d734b9886c40fa530f9fd6e67eb87b6955ec08)
11bbe3d1eSWilliam A. Kennington III #pragma once
21bbe3d1eSWilliam A. Kennington III 
31bbe3d1eSWilliam A. Kennington III #include <sdbusplus/bus.hpp>
440c29b54SWilliam A. Kennington III #include <sdbusplus/bus/match.hpp>
51bbe3d1eSWilliam A. Kennington III #include <sdbusplus/server/object.hpp>
69ede1b74SWilliam A. Kennington III #include <stdplus/pinned.hpp>
7be3bd2fcSWilliam A. Kennington III #include <stdplus/zstring.hpp>
81bbe3d1eSWilliam A. Kennington III #include <xyz/openbmc_project/Network/SystemConfiguration/server.hpp>
91bbe3d1eSWilliam A. Kennington III 
10*89d734b9SPatrick Williams #include <string>
11*89d734b9SPatrick Williams 
121bbe3d1eSWilliam A. Kennington III namespace phosphor
131bbe3d1eSWilliam A. Kennington III {
141bbe3d1eSWilliam A. Kennington III namespace network
151bbe3d1eSWilliam A. Kennington III {
161bbe3d1eSWilliam A. Kennington III 
171bbe3d1eSWilliam A. Kennington III using SystemConfigIntf =
181bbe3d1eSWilliam A. Kennington III     sdbusplus::xyz::openbmc_project::Network::server::SystemConfiguration;
191bbe3d1eSWilliam A. Kennington III 
20c38b0710SPatrick Williams using Iface = sdbusplus::server::object_t<SystemConfigIntf>;
211bbe3d1eSWilliam A. Kennington III 
221bbe3d1eSWilliam A. Kennington III class Manager; // forward declaration of network manager.
231bbe3d1eSWilliam A. Kennington III 
241bbe3d1eSWilliam A. Kennington III /** @class SystemConfiguration
251bbe3d1eSWilliam A. Kennington III  *  @brief Network system configuration.
261bbe3d1eSWilliam A. Kennington III  *  @details A concrete implementation for the
271bbe3d1eSWilliam A. Kennington III  *  xyz.openbmc_project.Network.SystemConfiguration DBus API.
281bbe3d1eSWilliam A. Kennington III  */
291bbe3d1eSWilliam A. Kennington III class SystemConfiguration : public Iface
301bbe3d1eSWilliam A. Kennington III {
311bbe3d1eSWilliam A. Kennington III   public:
321bbe3d1eSWilliam A. Kennington III     SystemConfiguration(SystemConfiguration&&) = delete;
331bbe3d1eSWilliam A. Kennington III     SystemConfiguration& operator=(SystemConfiguration&&) = delete;
341bbe3d1eSWilliam A. Kennington III 
351bbe3d1eSWilliam A. Kennington III     /** @brief Constructor to put object onto bus at a dbus path.
361bbe3d1eSWilliam A. Kennington III      *  @param[in] bus - Bus to attach to.
371bbe3d1eSWilliam A. Kennington III      *  @param[in] objPath - Path to attach at.
381bbe3d1eSWilliam A. Kennington III      *  @param[in] parent - Parent object.
391bbe3d1eSWilliam A. Kennington III      */
409ede1b74SWilliam A. Kennington III     SystemConfiguration(stdplus::PinnedRef<sdbusplus::bus_t> bus,
419ede1b74SWilliam A. Kennington III                         stdplus::const_zstring objPath);
421bbe3d1eSWilliam A. Kennington III 
431bbe3d1eSWilliam A. Kennington III     /** @brief set the hostname of the system.
441bbe3d1eSWilliam A. Kennington III      *  @param[in] name - host name of the system.
451bbe3d1eSWilliam A. Kennington III      */
461bbe3d1eSWilliam A. Kennington III     std::string hostName(std::string name) override;
471bbe3d1eSWilliam A. Kennington III 
481bbe3d1eSWilliam A. Kennington III   private:
491bbe3d1eSWilliam A. Kennington III     /** @brief Persistent sdbusplus DBus bus connection. */
509ede1b74SWilliam A. Kennington III     stdplus::PinnedRef<sdbusplus::bus_t> bus;
5140c29b54SWilliam A. Kennington III 
5240c29b54SWilliam A. Kennington III     /** @brief Monitor for hostname changes */
5340c29b54SWilliam A. Kennington III     sdbusplus::bus::match_t hostnamePropMatch;
541bbe3d1eSWilliam A. Kennington III };
551bbe3d1eSWilliam A. Kennington III 
561bbe3d1eSWilliam A. Kennington III } // namespace network
571bbe3d1eSWilliam A. Kennington III } // namespace phosphor
58