blob: fbc76fba43db62f2af8af11d00af2484c3939208 [file] [log] [blame]
Ratan Gupta1dc91782018-04-19 16:47:12 +05301#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
11namespace phosphor
12{
13namespace network
14{
15namespace snmp
16{
17
18class ConfManager;
19
20using 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 */
29class 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 Gupta212f53e2018-04-30 17:28:05 +053049 /** @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 Gupta1dc91782018-04-19 16:47:12 +053059 /** @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