blob: b2407effafadcdb0a4ca0af2fae01e22b33d2836 [file] [log] [blame]
Ratan Gupta2eff84f2017-04-20 19:19:15 +05301#include "ipaddress.hpp"
2#include "ethernet_interface.hpp"
3
4#include <phosphor-logging/log.hpp>
5
6namespace phosphor
7{
8namespace network
9{
10
11using namespace phosphor::logging;
12
13IPAddress::IPAddress(sdbusplus::bus::bus& bus,
14 const char* objPath,
15 EthernetInterface& parent,
16 IP::Protocol type,
17 const std::string& ipaddress,
Ratan Gupta29b0e432017-05-25 12:51:40 +053018 IP::AddressOrigin origin,
Ratan Gupta2eff84f2017-04-20 19:19:15 +053019 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 Gupta29b0e432017-05-25 12:51:40 +053028 this->origin(origin);
29
Ratan Gupta2eff84f2017-04-20 19:19:15 +053030 // Emit deferred signal.
31 emit_object_added();
32}
33
34
35void IPAddress::delete_()
36{
37 parent.deleteObject(address());
38}
39
40}//namespace network
41}//namespace phosphor