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, |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 18 | IP::AddressOrigin origin, |
Ratan Gupta | 2eff84f | 2017-04-20 19:19:15 +0530 | [diff] [blame] | 19 | uint8_t prefixLength, |
| 20 | const std::string& gateway): |
| 21 | IPIfaces(bus, objPath, true), |
| 22 | parent(parent) |
| 23 | { |
| 24 | this->address(ipaddress); |
| 25 | this->prefixLength(prefixLength); |
| 26 | this->gateway(gateway); |
| 27 | this->type(type); |
Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 28 | this->origin(origin); |
| 29 | |
Ratan Gupta | 2eff84f | 2017-04-20 19:19:15 +0530 | [diff] [blame] | 30 | // Emit deferred signal. |
| 31 | emit_object_added(); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | void IPAddress::delete_() |
| 36 | { |
| 37 | parent.deleteObject(address()); |
| 38 | } |
| 39 | |
| 40 | }//namespace network |
| 41 | }//namespace phosphor |