Implement the Client create interface
This commit also implement the D-Bus service which would be
used for snmp client configuration and would add the
snmp manager/trap receiver D-Bus objects under
namespace /xyz/openbmc_project/network/snmp/manager/
It implements the delete interface for SNMP client D-Bus Object.
Resolves openbmc/openbmc#3057
Change-Id: I0df7b1475f81325b9ac497c1fb350c3f62329686
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/snmp_client.cpp b/snmp_client.cpp
new file mode 100644
index 0000000..4049e2d
--- /dev/null
+++ b/snmp_client.cpp
@@ -0,0 +1,30 @@
+#include "snmp_client.hpp"
+#include "snmp_conf_manager.hpp"
+
+namespace phosphor
+{
+namespace network
+{
+namespace snmp
+{
+
+Client::Client(sdbusplus::bus::bus& bus, const char* objPath,
+ ConfManager& parent, const std::string& address, uint16_t port) :
+ Ifaces(bus, objPath, true),
+ parent(parent)
+{
+ this->address(address);
+ this->port(port);
+
+ // Emit deferred signal.
+ emit_object_added();
+}
+
+void Client::delete_()
+{
+ parent.deleteSNMPClient(this->address());
+}
+
+} // namespace snmp
+} // namespace network
+} // namespace phosphor