blob: 32411027dea3cc74c7f778d6d72bcf4a51521dfa [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,
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
32void IPAddress::delete_()
33{
34 parent.deleteObject(address());
35}
36
37}//namespace network
38}//namespace phosphor