| Ratan Gupta | 4af3676 | 2017-04-20 19:12:29 +0530 | [diff] [blame] | 1 | #pragma once | 
|  | 2 |  | 
|  | 3 | #include "xyz/openbmc_project/Network/IP/server.hpp" | 
|  | 4 | #include "xyz/openbmc_project/Object/Delete/server.hpp" | 
|  | 5 |  | 
|  | 6 | #include <sdbusplus/bus.hpp> | 
|  | 7 | #include <sdbusplus/server/object.hpp> | 
|  | 8 |  | 
|  | 9 | #include <string> | 
|  | 10 |  | 
|  | 11 | namespace phosphor | 
|  | 12 | { | 
|  | 13 | namespace network | 
|  | 14 | { | 
|  | 15 |  | 
|  | 16 | using IPIfaces = | 
|  | 17 | sdbusplus::server::object::object< | 
|  | 18 | sdbusplus::xyz::openbmc_project::Network::server::IP, | 
|  | 19 | sdbusplus::xyz::openbmc_project::Object::server::Delete>; | 
|  | 20 |  | 
|  | 21 | using IP = sdbusplus::xyz::openbmc_project::Network::server::IP; | 
|  | 22 |  | 
|  | 23 | class EthernetInterface; | 
|  | 24 |  | 
|  | 25 | /** @class IPAddress | 
|  | 26 | *  @brief OpenBMC IPAddress implementation. | 
|  | 27 | *  @details A concrete implementation for the | 
|  | 28 | *  xyz.openbmc_project.Network.IPProtocol | 
|  | 29 | *  xyz.openbmc_project.Network.IP Dbus interfaces. | 
|  | 30 | */ | 
|  | 31 | class IPAddress : public IPIfaces | 
|  | 32 | { | 
|  | 33 | public: | 
|  | 34 | IPAddress() = delete; | 
|  | 35 | IPAddress(const IPAddress&) = delete; | 
|  | 36 | IPAddress& operator=(const IPAddress&) = delete; | 
|  | 37 | IPAddress(IPAddress&&) = delete; | 
|  | 38 | IPAddress& operator=(IPAddress &&) = delete; | 
|  | 39 | virtual ~IPAddress() = default; | 
|  | 40 |  | 
|  | 41 | /** @brief Constructor to put object onto bus at a dbus path. | 
|  | 42 | *  @param[in] bus - Bus to attach to. | 
|  | 43 | *  @param[in] objPath - Path to attach at. | 
|  | 44 | *  @param[in] parent - Parent object. | 
|  | 45 | *  @param[in] type - ipaddress type(v4/v6). | 
|  | 46 | *  @param[in] ipAddress - ipadress. | 
| Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 47 | *  @param[in] origin - origin of ipaddress(dhcp/static/SLAAC/LinkLocal). | 
| Ratan Gupta | 4af3676 | 2017-04-20 19:12:29 +0530 | [diff] [blame] | 48 | *  @param[in] prefixLength - Length of prefix. | 
|  | 49 | *  @param[in] gateway - gateway address. | 
|  | 50 | */ | 
|  | 51 | IPAddress(sdbusplus::bus::bus& bus, | 
|  | 52 | const char* objPath, | 
|  | 53 | EthernetInterface& parent, | 
|  | 54 | IP::Protocol type, | 
|  | 55 | const std::string& ipAddress, | 
| Ratan Gupta | 29b0e43 | 2017-05-25 12:51:40 +0530 | [diff] [blame] | 56 | IP::AddressOrigin origin, | 
| Ratan Gupta | 4af3676 | 2017-04-20 19:12:29 +0530 | [diff] [blame] | 57 | uint8_t prefixLength, | 
|  | 58 | const std::string& gateway); | 
|  | 59 |  | 
|  | 60 | /** @brief Delete this d-bus object. | 
|  | 61 | */ | 
|  | 62 | void delete_() override; | 
|  | 63 |  | 
|  | 64 | private: | 
|  | 65 |  | 
|  | 66 | /** @brief Parent Object. */ | 
|  | 67 | EthernetInterface& parent; | 
|  | 68 |  | 
|  | 69 | }; | 
|  | 70 |  | 
|  | 71 | } // namespace network | 
|  | 72 | } // namespace phosphor |