diff options
| author | raviteja-b <raviteja28031990@gmail.com> | 2019-03-28 05:59:36 -0500 |
|---|---|---|
| committer | raviteja28031990 <raviteja28031990@gmail.com> | 2019-04-04 12:21:35 +0000 |
| commit | ce3795602ee8d7593ae1effd8e5568c823326c88 (patch) | |
| tree | daa3458e0018b2955db0be43055f38955b72ad2d | |
| parent | 7a6287ce435614d15ecc5948d25d75a327d5d1d4 (diff) | |
| download | phosphor-networkd-ce3795602ee8d7593ae1effd8e5568c823326c88.tar.gz phosphor-networkd-ce3795602ee8d7593ae1effd8e5568c823326c88.zip | |
Network:Modified create interface to return the D-Bus object ID
Currently, the create interface doesn't return the Object identifier,
this commit is to modify Create Inferface to return the object identifier.
Change-Id: Icbd30481a1173a0c2b8dbe32ba913504555a119a
Signed-off-by: raviteja-b <raviteja28031990@gmail.com>
| -rw-r--r-- | ethernet_interface.cpp | 5 | ||||
| -rw-r--r-- | ethernet_interface.hpp | 5 | ||||
| -rw-r--r-- | xyz/openbmc_project/Network/IP/Create.interface.yaml | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp index 5416f74..999613d 100644 --- a/ethernet_interface.cpp +++ b/ethernet_interface.cpp @@ -104,8 +104,8 @@ void EthernetInterface::createIPAddressObjects() } } -void EthernetInterface::iP(IP::Protocol protType, std::string ipaddress, - uint8_t prefixLength, std::string gateway) +ObjectPath EthernetInterface::iP(IP::Protocol protType, std::string ipaddress, + uint8_t prefixLength, std::string gateway) { if (dHCPEnabled()) @@ -152,6 +152,7 @@ void EthernetInterface::iP(IP::Protocol protType, std::string ipaddress, origin, prefixLength, gateway)); manager.writeToConfigurationFile(); + return objectPath; } /* diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp index bfe1d54..7d7447d 100644 --- a/ethernet_interface.hpp +++ b/ethernet_interface.hpp @@ -31,6 +31,7 @@ using MacAddressIntf = sdbusplus::xyz::openbmc_project::Network::server::MACAddress; using ServerList = std::vector<std::string>; +using ObjectPath = sdbusplus::message::object_path; namespace fs = std::experimental::filesystem; @@ -86,8 +87,8 @@ class EthernetInterface : public Ifaces * @param[in] gateway - Gateway ip address. */ - void iP(IP::Protocol addressType, std::string ipaddress, - uint8_t prefixLength, std::string gateway) override; + ObjectPath iP(IP::Protocol addressType, std::string ipaddress, + uint8_t prefixLength, std::string gateway) override; /* @brief delete the dbus object of the given ipaddress. * @param[in] ipaddress - IP address. diff --git a/xyz/openbmc_project/Network/IP/Create.interface.yaml b/xyz/openbmc_project/Network/IP/Create.interface.yaml index 38805e7..4a14c16 100644 --- a/xyz/openbmc_project/Network/IP/Create.interface.yaml +++ b/xyz/openbmc_project/Network/IP/Create.interface.yaml @@ -20,5 +20,10 @@ methods: type: string description: > Gateway Address. + returns: + - name: Path + type: path + description: > + The path for the created ipaddress object. errors: - xyz.openbmc_project.Common.Error.InvalidArgument |

