Ratan Gupta | 1dc9178 | 2018-04-19 16:47:12 +0530 | [diff] [blame] | 1 | #include "snmp_client.hpp" |
| 2 | #include "snmp_conf_manager.hpp" |
| 3 | |
| 4 | namespace phosphor |
| 5 | { |
| 6 | namespace network |
| 7 | { |
| 8 | namespace snmp |
| 9 | { |
| 10 | |
| 11 | Client::Client(sdbusplus::bus::bus& bus, const char* objPath, |
| 12 | ConfManager& parent, const std::string& address, uint16_t port) : |
| 13 | Ifaces(bus, objPath, true), |
Ratan Gupta | a7ff385 | 2018-11-16 14:05:57 +0530 | [diff] [blame^] | 14 | id(std::stol(std::experimental::filesystem::path(objPath).filename())), |
Ratan Gupta | 1dc9178 | 2018-04-19 16:47:12 +0530 | [diff] [blame] | 15 | parent(parent) |
| 16 | { |
| 17 | this->address(address); |
| 18 | this->port(port); |
| 19 | |
| 20 | // Emit deferred signal. |
| 21 | emit_object_added(); |
| 22 | } |
| 23 | |
| 24 | void Client::delete_() |
| 25 | { |
Ratan Gupta | a7ff385 | 2018-11-16 14:05:57 +0530 | [diff] [blame^] | 26 | parent.deleteSNMPClient(id); |
Ratan Gupta | 1dc9178 | 2018-04-19 16:47:12 +0530 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | } // namespace snmp |
| 30 | } // namespace network |
| 31 | } // namespace phosphor |