Add support for vlan(set lan command)
Resolves openbmc/openbmc#1899
Change-Id: I3c436045676bc96e5d91fd9420509bc991549a13
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/transporthandler.hpp b/transporthandler.hpp
index f1fd410..24ee8be 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
@@ -1,7 +1,7 @@
#pragma once
+#include "types.hpp"
#include <string>
-
// IPMI commands for Transport net functions.
enum ipmi_netfn_storage_cmds
{
@@ -24,6 +24,7 @@
static const int LAN_PARM_MAC = 5;
static const int LAN_PARM_SUBNET = 6;
static const int LAN_PARM_GATEWAY = 12;
+static const int LAN_PARM_VLAN = 20;
struct ChannelConfig_t
{
@@ -31,11 +32,17 @@
std::string netmask;
std::string gateway;
std::string macAddress;
+ // IPMI stores the vlan info in 16 bits,32 bits is to aligned
+ // with phosphor-dbus interfaces.
+ // vlan id is in 12 bits and the 16th bit is for enable mask.
+ uint32_t vlanID = ipmi::network::VLAN_ID_MASK;
+
void clear()
{
ipaddr.clear();
netmask.clear();
gateway.clear();
macAddress.clear();
+ vlanID = ipmi::network::VLAN_ID_MASK;
}
};