Ratan Gupta | 2eff84f | 2017-04-20 19:19:15 +0530 | [diff] [blame] | 1 | #include "ipaddress.hpp" |
| 2 | #include "ethernet_interface.hpp" |
| 3 | |
| 4 | #include <phosphor-logging/log.hpp> |
| 5 | |
| 6 | namespace phosphor |
| 7 | { |
| 8 | namespace network |
| 9 | { |
| 10 | |
| 11 | using namespace phosphor::logging; |
| 12 | |
| 13 | IPAddress::IPAddress(sdbusplus::bus::bus& bus, |
| 14 | const char* objPath, |
| 15 | EthernetInterface& parent, |
| 16 | IP::Protocol type, |
| 17 | const std::string& ipaddress, |
| 18 | uint8_t prefixLength, |
| 19 | const std::string& gateway): |
| 20 | IPIfaces(bus, objPath, true), |
| 21 | parent(parent) |
| 22 | { |
| 23 | this->address(ipaddress); |
| 24 | this->prefixLength(prefixLength); |
| 25 | this->gateway(gateway); |
| 26 | this->type(type); |
| 27 | // Emit deferred signal. |
| 28 | emit_object_added(); |
| 29 | } |
| 30 | |
| 31 | |
| 32 | void IPAddress::delete_() |
| 33 | { |
| 34 | parent.deleteObject(address()); |
| 35 | } |
| 36 | |
| 37 | }//namespace network |
| 38 | }//namespace phosphor |