From 533d03b5f923e6c59ca1ffb16b6a5eb14e3f96c6 Mon Sep 17 00:00:00 2001 From: Ratan Gupta Date: Sun, 30 Jul 2017 10:39:22 +0530 Subject: Add support for vlan(set lan command) Resolves openbmc/openbmc#1899 Change-Id: I3c436045676bc96e5d91fd9420509bc991549a13 Signed-off-by: Ratan Gupta --- transporthandler.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'transporthandler.hpp') 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 - // IPMI commands for Transport net functions. enum ipmi_netfn_storage_cmds { @@ -24,6 +24,7 @@ static const int LAN_PARM_IP = 3; 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 @@ struct ChannelConfig_t 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; } }; -- cgit v1.2.1