Create the VLAN Interface Object
Change-Id: I118fc4bbcad2a478a8aad976e0619537780c1227
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/ethernet_interface.hpp b/ethernet_interface.hpp
index 88cbf1e..0ab849c 100644
--- a/ethernet_interface.hpp
+++ b/ethernet_interface.hpp
@@ -1,6 +1,5 @@
#pragma once
-#include "ipaddress.hpp"
#include "types.hpp"
#include "util.hpp"
@@ -12,6 +11,7 @@
#include <sdbusplus/server/object.hpp>
#include <string>
+#include <experimental/filesystem>
namespace phosphor
{
@@ -29,15 +29,24 @@
using EthernetInterfaceIntf =
sdbusplus::xyz::openbmc_project::Network::server::EthernetInterface;
+namespace fs = std::experimental::filesystem;
+
class Manager; // forward declaration of network manager.
class TestEthernetInterface;
+class VlanInterface;
+
+class IPAddress;
+
using LinkSpeed = uint16_t;
using DuplexMode = uint8_t;
using Autoneg = uint8_t;
+using VlanId = uint32_t;
+using InterfaceName = std::string;
using InterfaceInfo = std::tuple<LinkSpeed, DuplexMode, Autoneg>;
using AddressMap = std::map<std::string, std::shared_ptr<IPAddress>>;
+using VlanInterfaceMap = std::map<InterfaceName, std::unique_ptr<VlanInterface>>;
/** @class EthernetInterface
* @brief OpenBMC Ethernet Interface implementation.
@@ -99,7 +108,16 @@
/** Set value of DHCPEnabled */
bool dHCPEnabled(bool value) override;
+ /** @brief create Vlan interface.
+ * @param[in] id- VLAN identifier.
+ */
+ void createVLAN(VlanId id);
+
using EthernetInterfaceIntf::dHCPEnabled;
+ using EthernetInterfaceIntf::interfaceName;
+
+ /** @brief Network Configuration directory. */
+ fs::path confDir;
protected:
@@ -150,6 +168,9 @@
/** @brief Persistent map of IPAddress dbus objects and their names */
AddressMap addrs;
+ /** @brief Persistent map of VLAN interface dbus objects and their names */
+ VlanInterfaceMap vlanInterfaces;
+
/** @brief Dbus object path */
std::string objPath;