user_channel:Change fun ret&cmd cc as per New Std

Modified ipmi function return status code and
command completion codes as per new standard.

Tested:
verified using ipmitool commands.
1. create new user
Command : ipmitool user set name 5 user5
Response:                          //user created successfully
Command: ipmitool user set password 5 0penBmc\'  //set password
Response: Set User Password command successful (user 5)

2. Set password
Command :  ipmitool user set password 5 0penBmc\'
Response: Set User Password command successful (user 5)

3. set channel access
Command: ipmitool channel setaccess 1 5 callin=on ipmi=on link=on
            privilege=4
Response: Set User Access (channel 1 id 5) successful.

4. get channel access
Command:  ipmitool channel getaccess 1 5
Response:
Maximum User IDs     : 15
Enabled User IDs     : 5

User ID              : 5
User Name            : user5
Fixed Name           : No
Access Available     : call-in / callback
Link Authentication  : enabled
IPMI Messaging       : enabled
Privilege Level      : ADMINISTRATOR
Enable Status        : disabled

5. User list
Command: ipmitool user list 1
Response:
ID  Name             Callin  Link Auth  IPMI Msg   Channel Priv Limit
1   root             false   true       true       ADMINISTRATOR
2   putty_operator   true    true       true       OPERATOR
3   ipmi_admin       true    true       true       ADMINISTRATOR
4   user2            false   true       true       OPERATOR
5   user5            true    true       true       ADMINISTRATOR
6                    true    false      false      NO ACCESS
7                    true    false      false      NO ACCESS
8                    true    false      false      NO ACCESS
9                    true    false      false      NO ACCESS
10                   true    false      false      NO ACCESS
11                   true    false      false      NO ACCESS
12                   true    false      false      NO ACCESS
13                   true    false      false      NO ACCESS
14                   true    false      false      NO ACCESS
15                   true    false      false      NO ACCESS

Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Signed-off-by: NITIN SHARMA <nitin1x.sharma@intel.com>
Change-Id: I5f2c32f50edc2de204ac361364e21a61a4bcf237
diff --git a/user_channel/user_layer.hpp b/user_channel/user_layer.hpp
index 450d878..26f980a 100644
--- a/user_channel/user_layer.hpp
+++ b/user_channel/user_layer.hpp
@@ -14,9 +14,9 @@
 // limitations under the License.
 */
 #pragma once
-#include <ipmid/api.h>
 
 #include <bitset>
+#include <ipmid/api.hpp>
 #include <string>
 
 namespace ipmi
@@ -78,9 +78,9 @@
 
 /** @brief initializes user management
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserInit();
+Cc ipmiUserInit();
 
 /** @brief The ipmi get user password layer call
  *
@@ -97,7 +97,7 @@
  *
  *  @return 0 on success, non-zero otherwise.
  */
-ipmi_ret_t ipmiClearUserEntryPassword(const std::string& userName);
+Cc ipmiClearUserEntryPassword(const std::string& userName);
 
 /** @brief The IPMI call to reuse password entry for the renamed user
  *  to another one
@@ -107,8 +107,8 @@
  *
  *  @return 0 on success, non-zero otherwise.
  */
-ipmi_ret_t ipmiRenameUserEntryPassword(const std::string& userName,
-                                       const std::string& newUserName);
+Cc ipmiRenameUserEntryPassword(const std::string& userName,
+                               const std::string& newUserName);
 
 /** @brief determines valid userId
  *
@@ -139,38 +139,37 @@
  *  @param[in] userId - user id
  *  @param[in] userName - user name
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetUserName(const uint8_t userId, const char* userName);
+Cc ipmiUserSetUserName(const uint8_t userId, const std::string& userName);
 
 /** @brief set user password
  *
  *  @param[in] userId - user id
  *  @param[in] userPassword - New Password
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetUserPassword(const uint8_t userId,
-                                   const char* userPassword);
+Cc ipmiUserSetUserPassword(const uint8_t userId, const char* userPassword);
 
 /** @brief set special user password (non-ipmi accounts)
  *
  *  @param[in] userName - user name
  *  @param[in] userPassword - New Password
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiSetSpecialUserPassword(const std::string& userName,
-                                      const std::string& userPassword);
+Cc ipmiSetSpecialUserPassword(const std::string& userName,
+                              const std::string& userPassword);
 
 /** @brief get user name
  *
  *  @param[in] userId - user id
  *  @param[out] userName - user name
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetUserName(const uint8_t userId, std::string& userName);
+Cc ipmiUserGetUserName(const uint8_t userId, std::string& userName);
 
 /** @brief provides available fixed, max, and enabled user counts
  *
@@ -178,28 +177,28 @@
  *  @param[out] enabledUsers - enabled user count
  *  @param[out] fixedUsers - fixed user count
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetAllCounts(uint8_t& maxChUsers, uint8_t& enabledUsers,
-                                uint8_t& fixedUsers);
+Cc ipmiUserGetAllCounts(uint8_t& maxChUsers, uint8_t& enabledUsers,
+                        uint8_t& fixedUsers);
 
 /** @brief function to update user enabled state
  *
  *  @param[in] userId - user id
  *..@param[in] state - state of the user to be updated, true - user enabled.
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state);
+Cc ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state);
 
 /** @brief determines whether user is enabled
  *
  *  @param[in] userId - user id
  *..@param[out] state - state of the user
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserCheckEnabled(const uint8_t userId, bool& state);
+Cc ipmiUserCheckEnabled(const uint8_t userId, bool& state);
 
 /** @brief provides user privilege access data
  *
@@ -207,10 +206,10 @@
  *  @param[in] chNum - channel number
  *  @param[out] privAccess - privilege access data
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
-                                      PrivAccess& privAccess);
+Cc ipmiUserGetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
+                              PrivAccess& privAccess);
 
 /** @brief sets user privilege access data
  *
@@ -219,11 +218,11 @@
  *  @param[in] privAccess - privilege access data
  *  @param[in] otherPrivUpdate - flags to indicate other fields update
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
-                                      const PrivAccess& privAccess,
-                                      const bool& otherPrivUpdate);
+Cc ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
+                              const PrivAccess& privAccess,
+                              const bool& otherPrivUpdate);
 
 /** @brief check for user pam authentication. This is to determine, whether user
  * is already locked out for failed login attempt
@@ -243,12 +242,11 @@
  *  @param[in] userId - user id
  *  @param[in] payloadAccess - payload access data
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserSetUserPayloadAccess(const uint8_t chNum,
-                                        const uint8_t operation,
-                                        const uint8_t userId,
-                                        const PayloadAccess& payloadAccess);
+Cc ipmiUserSetUserPayloadAccess(const uint8_t chNum, const uint8_t operation,
+                                const uint8_t userId,
+                                const PayloadAccess& payloadAccess);
 
 /** @brief provides user payload access data
  *
@@ -256,10 +254,9 @@
  *  @param[in] userId - user id
  *  @param[out] payloadAccess - payload access data
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiUserGetUserPayloadAccess(const uint8_t chNum,
-                                        const uint8_t userId,
-                                        PayloadAccess& payloadAccess);
+Cc ipmiUserGetUserPayloadAccess(const uint8_t chNum, const uint8_t userId,
+                                PayloadAccess& payloadAccess);
 
 } // namespace ipmi