summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethernet_interface.cpp4
-rw-r--r--ethernet_interface.hpp2
-rw-r--r--network_manager.cpp4
-rw-r--r--network_manager.hpp2
-rw-r--r--xyz/openbmc_project/Network/VLAN/Create.interface.yaml5
5 files changed, 12 insertions, 5 deletions
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 999613d..154efcb 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -424,7 +424,7 @@ void EthernetInterface::loadVLAN(VlanId id)
std::move(vlanIntf));
}
-void EthernetInterface::createVLAN(VlanId id)
+ObjectPath EthernetInterface::createVLAN(VlanId id)
{
std::string vlanInterfaceName = interfaceName() + "." + std::to_string(id);
std::string path = objPath;
@@ -439,6 +439,8 @@ void EthernetInterface::createVLAN(VlanId id)
this->vlanInterfaces.emplace(vlanInterfaceName, std::move(vlanIntf));
// write the new vlan device entry to the configuration(network) file.
manager.writeToConfigurationFile();
+
+ return path;
}
ServerList EthernetInterface::getNTPServersFromConf()
diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp
index 7d7447d..c65726a 100644
--- a/ethernet_interface.hpp
+++ b/ethernet_interface.hpp
@@ -137,7 +137,7 @@ class EthernetInterface : public Ifaces
/** @brief create Vlan interface.
* @param[in] id- VLAN identifier.
*/
- void createVLAN(VlanId id);
+ ObjectPath createVLAN(VlanId id);
/** @brief load the vlan info from the system
* and creates the ip address dbus objects.
diff --git a/network_manager.cpp b/network_manager.cpp
index 4483631..fa5da0f 100644
--- a/network_manager.cpp
+++ b/network_manager.cpp
@@ -176,9 +176,9 @@ void Manager::createChildObjects()
bus, objPath.string(), *this);
}
-void Manager::vLAN(IntfName interfaceName, uint32_t id)
+ObjectPath Manager::vLAN(IntfName interfaceName, uint32_t id)
{
- interfaces[interfaceName]->createVLAN(id);
+ return interfaces[interfaceName]->createVLAN(id);
}
void Manager::reset()
diff --git a/network_manager.hpp b/network_manager.hpp
index e2dfea9..edb341f 100644
--- a/network_manager.hpp
+++ b/network_manager.hpp
@@ -56,7 +56,7 @@ class Manager : public details::VLANCreateIface
Manager(sdbusplus::bus::bus& bus, const char* objPath,
const std::string& dir);
- void vLAN(IntfName interfaceName, uint32_t id) override;
+ ObjectPath vLAN(IntfName interfaceName, uint32_t id) override;
/** @brief write the network conf file with the in-memory objects.
*/
diff --git a/xyz/openbmc_project/Network/VLAN/Create.interface.yaml b/xyz/openbmc_project/Network/VLAN/Create.interface.yaml
index be23a55..8e63f2f 100644
--- a/xyz/openbmc_project/Network/VLAN/Create.interface.yaml
+++ b/xyz/openbmc_project/Network/VLAN/Create.interface.yaml
@@ -12,3 +12,8 @@ methods:
type: uint32
description: >
VLAN Identifier.
+ returns:
+ - name: Path
+ type: path
+ description: >
+ The path for the created VLAN object.
OpenPOWER on IntegriCloud