Ratan Gupta | 1dc9178 | 2018-04-19 16:47:12 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "xyz/openbmc_project/Network/Client/server.hpp" |
| 4 | #include "xyz/openbmc_project/Object/Delete/server.hpp" |
| 5 | |
| 6 | #include <sdbusplus/bus.hpp> |
| 7 | #include <sdbusplus/server/object.hpp> |
| 8 | |
| 9 | #include <string> |
| 10 | |
| 11 | namespace phosphor |
| 12 | { |
| 13 | namespace network |
| 14 | { |
| 15 | namespace snmp |
| 16 | { |
| 17 | |
| 18 | class ConfManager; |
| 19 | |
| 20 | using Ifaces = sdbusplus::server::object::object< |
| 21 | sdbusplus::xyz::openbmc_project::Network::server::Client, |
| 22 | sdbusplus::xyz::openbmc_project::Object::server::Delete>; |
| 23 | |
| 24 | /** @class Client |
| 25 | * @brief represents the snmp client configuration |
| 26 | * @details A concrete implementation for the |
| 27 | * xyz.openbmc_project.Network.Client Dbus interface. |
| 28 | */ |
| 29 | class Client : public Ifaces |
| 30 | { |
| 31 | public: |
| 32 | Client() = delete; |
| 33 | Client(const Client &) = delete; |
| 34 | Client &operator=(const Client &) = delete; |
| 35 | Client(Client &&) = delete; |
| 36 | Client &operator=(Client &&) = delete; |
| 37 | virtual ~Client() = default; |
| 38 | |
| 39 | /** @brief Constructor to put object onto bus at a dbus path. |
| 40 | * @param[in] bus - Bus to attach to. |
| 41 | * @param[in] objPath - Path to attach at. |
| 42 | * @param[in] parent - Parent D-bus Object. |
| 43 | * @param[in] address - IPaddress/Hostname. |
| 44 | * @param[in] port - network port. |
| 45 | */ |
| 46 | Client(sdbusplus::bus::bus &bus, const char *objPath, ConfManager &parent, |
| 47 | const std::string &address, uint16_t port); |
| 48 | |
Ratan Gupta | 212f53e | 2018-04-30 17:28:05 +0530 | [diff] [blame] | 49 | /** @brief Constructor to put object onto bus at a dbus path. |
| 50 | * @param[in] bus - Bus to attach to. |
| 51 | * @param[in] objPath - Path to attach at. |
| 52 | * @param[in] parent - Parent D-bus Object. |
| 53 | */ |
| 54 | Client(sdbusplus::bus::bus &bus, const char *objPath, ConfManager &parent) : |
| 55 | Ifaces(bus, objPath, true), parent(parent) |
| 56 | { |
| 57 | } |
| 58 | |
Ratan Gupta | 1dc9178 | 2018-04-19 16:47:12 +0530 | [diff] [blame] | 59 | /** @brief Delete this d-bus object. |
| 60 | */ |
| 61 | void delete_() override; |
| 62 | |
| 63 | private: |
| 64 | /** @brief Parent D-Bus Object. */ |
| 65 | ConfManager &parent; |
| 66 | }; |
| 67 | |
| 68 | } // namespace snmp |
| 69 | } // namespace network |
| 70 | } // namespace phosphor |