Implement Get channel access command

The get channel access command is implemented to support the set
channel access command. The set channel access command is used to
apply the network settings. Before the set channel access is issued
ipmitool issues get channel access command to get all the fields and
then copy into the buffer for set channel access. This would enable
the following ipmitool command.

ipmitool lan set 1 access on

There is no backend support for these settings and values are
hardcoded in the command implementation.

Resolves openbmc/openbmc#1565

Change-Id: I6c7b2ca7971155b90914ab5b68ab3038bfaba185
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/apphandler.h b/apphandler.h
index ec7d4b0..497b24b 100644
--- a/apphandler.h
+++ b/apphandler.h
@@ -15,7 +15,28 @@
     IPMI_CMD_SET_WD                 = 0x24,
     IPMI_CMD_GET_CAP_BIT            = 0x36,
     IPMI_CMD_SET_CHAN_ACCESS        = 0x40,
+    IPMI_CMD_GET_CHANNEL_ACCESS     = 0x41,
     IPMI_CMD_GET_CHAN_INFO          = 0x42,
 };
 
+/** @struct GetChannelAccessRequest
+ *
+ *  IPMI payload for Get Channel access command request.
+ */
+struct GetChannelAccessRequest
+{
+    uint8_t channelNumber;      //!< Channel number.
+    uint8_t volatileSetting;    //!< Get non-volatile or the volatile setting.
+} __attribute__((packed));
+
+/** @struct GetChannelAccessResponse
+ *
+ *  IPMI payload for Get Channel access command response.
+ */
+struct GetChannelAccessResponse
+{
+    uint8_t settings;          //!< Channel settings.
+    uint8_t privilegeLimit;    //!< Channel privilege level limit.
+} __attribute__((packed));
+
 #endif