blob: 2d2e1d54e5f5eebbb7f7c7213b7ed75e3c33d2cc [file] [log] [blame]
Ratan Gupta1dc91782018-04-19 16:47:12 +05301#include "snmp_client.hpp"
2#include "snmp_conf_manager.hpp"
3
4namespace phosphor
5{
6namespace network
7{
8namespace snmp
9{
10
11Client::Client(sdbusplus::bus::bus& bus, const char* objPath,
12 ConfManager& parent, const std::string& address, uint16_t port) :
13 Ifaces(bus, objPath, true),
Ratan Guptaa7ff3852018-11-16 14:05:57 +053014 id(std::stol(std::experimental::filesystem::path(objPath).filename())),
Ratan Gupta1dc91782018-04-19 16:47:12 +053015 parent(parent)
16{
17 this->address(address);
18 this->port(port);
19
20 // Emit deferred signal.
21 emit_object_added();
22}
23
24void Client::delete_()
25{
Ratan Guptaa7ff3852018-11-16 14:05:57 +053026 parent.deleteSNMPClient(id);
Ratan Gupta1dc91782018-04-19 16:47:12 +053027}
28
29} // namespace snmp
30} // namespace network
31} // namespace phosphor