netipmid: Manage and expose session object
Session (RMCP+) is managed by net-ipmid directly, but
session commands has to be supported in both LAN & other
session-less interfaces. In order to make session commands
to work in other interfaces, session objects must be
exposed as D-Bus objects, so that ipmi-providers can
query the same.
Tested:
1. Verified that RMCP+ session are perfectly working
2. Verified RMCP+ session establishment fails for wrong
password
3. Verified that session privilege level are maintained
and access are restricted accordingly
4. Verified session timeout and sessions are destroyed
accordingly after timeout
5. verified max session count working behavior
6. verified ipmi-providers responding with proper response for this
(or D-Bus objects are exposed correctly during session creation,
session deletion,session update,
(like privilege, - say even set session privilege level command)
7.Session objects are created dynamically.
Change-Id: I78a8449359877ef6cc4cd8161d8c67e6e54eb52b
Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com>
diff --git a/message_handler.cpp b/message_handler.cpp
index e2aafb3..f0c653d 100644
--- a/message_handler.cpp
+++ b/message_handler.cpp
@@ -43,6 +43,8 @@
sessionID = inMessage->bmcSessionID;
inMessage->rcSessionID = session->getRCSessionID();
session->updateLastTransactionTime();
+ session->channelPtr = channel;
+ session->remotePort(channel->getPort());
return true;
}
@@ -94,7 +96,7 @@
std::get<session::Manager&>(singletonPool).getSession(sessionID);
// Process PayloadType::IPMI only if ipmi is enabled or for sessionless
// or for session establisbment command
- if (this->sessionID == session::SESSION_ZERO ||
+ if (this->sessionID == session::sessionZero ||
session->sessionUserPrivAccess.ipmiEnabled)
{
if (inMessage->payload.size() <