summaryrefslogtreecommitdiffstats
path: root/session.hpp
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-09-06 07:08:51 +0530
committerRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2018-11-21 05:42:58 +0530
commit127748a82ce1459a35d9886dc250697e78c24dd2 (patch)
tree1560381a360d58efdb9d0e412d638a267dbc50e9 /session.hpp
parentd6f3f7d7622a48fd139b5ce36e314ff6d15db9d3 (diff)
downloadphosphor-net-ipmid-127748a82ce1459a35d9886dc250697e78c24dd2.tar.gz
phosphor-net-ipmid-127748a82ce1459a35d9886dc250697e78c24dd2.zip
RMCP+ login support with privilege
Implementation of RMCP login support with appropriate privilege level. Unit Test: 1. Verified that user is able to login without any issues 2. Privilege of the user is minimum of requested, user & channel 3. Unable to set higher privilege using Set session commands Change-Id: I5e9ef21dfc1f1b50aa815562a3a65d90c434877c Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
Diffstat (limited to 'session.hpp')
-rw-r--r--session.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/session.hpp b/session.hpp
index f3dc2ae..bf136e3 100644
--- a/session.hpp
+++ b/session.hpp
@@ -43,6 +43,10 @@ constexpr auto SESSION_SETUP_TIMEOUT = 5s;
// Seconds of inactivity allowed when session is active
constexpr auto SESSION_INACTIVITY_TIMEOUT = 60s;
+// Mask to get only the privilege from requested maximum privlege (RAKP message
+// 1)
+constexpr uint8_t reqMaxPrivMask = 0xF;
+
/**
* @struct SequenceNumbers Session Sequence Numbers
*
@@ -261,12 +265,12 @@ class Session
/**
* @brief Session's Current Privilege Level
*/
- Privilege curPrivLevel;
+ Privilege curPrivLevel = Privilege::CALLBACK;
/**
- * @brief Session's Maximum Privilege Level
+ * @brief Session's Requested Maximum Privilege Level
*/
- Privilege maxPrivLevel = Privilege::CALLBACK;
+ uint8_t reqMaxPrivLevel;
SequenceNumbers sequenceNums; // Session Sequence Numbers
State state = State::INACTIVE; // Session State
@@ -274,6 +278,7 @@ class Session
/** @brief Socket channel for communicating with the remote client.*/
std::shared_ptr<udpsocket::Channel> channelPtr;
+ uint8_t chNum;
private:
SessionID bmcSessionID = 0; // BMC Session ID
OpenPOWER on IntegriCloud