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/channel_layer.cpp b/user_channel/channel_layer.cpp
index c6866c2..9336596 100644
--- a/user_channel/channel_layer.cpp
+++ b/user_channel/channel_layer.cpp
@@ -78,55 +78,51 @@
     return getChannelConfigObject().getChannelMaxTransferSize(chNum);
 }
 
-ipmi_ret_t ipmiChannelInit()
+Cc ipmiChannelInit()
 {
     getChannelConfigObject();
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo)
+Cc getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo)
 {
     return getChannelConfigObject().getChannelInfo(chNum, chInfo);
 }
 
-ipmi_ret_t getChannelAccessData(const uint8_t chNum,
-                                ChannelAccess& chAccessData)
+Cc getChannelAccessData(const uint8_t chNum, ChannelAccess& chAccessData)
 {
     return getChannelConfigObject().getChannelAccessData(chNum, chAccessData);
 }
 
-ipmi_ret_t setChannelAccessData(const uint8_t chNum,
-                                const ChannelAccess& chAccessData,
-                                const uint8_t setFlag)
+Cc setChannelAccessData(const uint8_t chNum, const ChannelAccess& chAccessData,
+                        const uint8_t setFlag)
 {
     return getChannelConfigObject().setChannelAccessData(chNum, chAccessData,
                                                          setFlag);
 }
 
-ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
-                                       ChannelAccess& chAccessData)
+Cc getChannelAccessPersistData(const uint8_t chNum, ChannelAccess& chAccessData)
 {
     return getChannelConfigObject().getChannelAccessPersistData(chNum,
                                                                 chAccessData);
 }
 
-ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
-                                       const ChannelAccess& chAccessData,
-                                       const uint8_t setFlag)
+Cc setChannelAccessPersistData(const uint8_t chNum,
+                               const ChannelAccess& chAccessData,
+                               const uint8_t setFlag)
 {
     return getChannelConfigObject().setChannelAccessPersistData(
         chNum, chAccessData, setFlag);
 }
 
-ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
-                                       uint8_t& authTypeSupported)
+Cc getChannelAuthTypeSupported(const uint8_t chNum, uint8_t& authTypeSupported)
 {
     return getChannelConfigObject().getChannelAuthTypeSupported(
         chNum, authTypeSupported);
 }
 
-ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
-                                     EAuthType& authType)
+Cc getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
+                             EAuthType& authType)
 {
     return getChannelConfigObject().getChannelEnabledAuthType(chNum, priv,
                                                               authType);
diff --git a/user_channel/channel_layer.hpp b/user_channel/channel_layer.hpp
index 4eb51b7..eaf631c 100644
--- a/user_channel/channel_layer.hpp
+++ b/user_channel/channel_layer.hpp
@@ -14,8 +14,7 @@
 // limitations under the License.
 */
 #pragma once
-#include <ipmid/api.h>
-
+#include <ipmid/api.hpp>
 #include <string>
 
 namespace ipmi
@@ -29,11 +28,8 @@
  * @enum IPMI return codes specific to channel (refer spec se 22.22 response
  * data)
  */
-enum ipmi_channel_return_codes
-{
-    IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL = 0x82,
-    IPMI_CC_ACCESS_MODE_NOT_SUPPORTED_FOR_CHANEL = 0x83
-};
+constexpr Cc ccActionNotSupportedForChannel = 0x82;
+constexpr Cc ccAccessModeNotSupportedForChannel = 0x83;
 
 /**
  * @enum Channel Protocol Type (refer spec sec 6.4)
@@ -254,28 +250,27 @@
 
 /** @brief initializes channel management
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t ipmiChannelInit();
+Cc ipmiChannelInit();
 
 /** @brief provides channel info details
  *
  *  @param[in] chNum - channel number
  *  @param[out] chInfo - channel info details
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
+Cc getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
 
 /** @brief provides channel access data
  *
  *  @param[in] chNum - channel number
  *  @param[out] chAccessData -channel access data
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t getChannelAccessData(const uint8_t chNum,
-                                ChannelAccess& chAccessData);
+Cc getChannelAccessData(const uint8_t chNum, ChannelAccess& chAccessData);
 
 /** @brief provides function to convert current channel number (0xE)
  *
@@ -301,21 +296,20 @@
  *  @param[in] chAccessData - channel access data
  *  @param[in] setFlag - flag to indicate updatable fields
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t setChannelAccessData(const uint8_t chNum,
-                                const ChannelAccess& chAccessData,
-                                const uint8_t setFlag);
+Cc setChannelAccessData(const uint8_t chNum, const ChannelAccess& chAccessData,
+                        const uint8_t setFlag);
 
 /** @brief to get channel access data persistent data
  *
  *  @param[in] chNum - channel number
  *  @param[out] chAccessData - channel access data
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
-                                       ChannelAccess& chAccessData);
+Cc getChannelAccessPersistData(const uint8_t chNum,
+                               ChannelAccess& chAccessData);
 
 /** @brief to set channel access data persistent data
  *
@@ -323,21 +317,20 @@
  *  @param[in] chAccessData - channel access data
  *  @param[in] setFlag - flag to indicate updatable fields
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
-                                       const ChannelAccess& chAccessData,
-                                       const uint8_t setFlag);
+Cc setChannelAccessPersistData(const uint8_t chNum,
+                               const ChannelAccess& chAccessData,
+                               const uint8_t setFlag);
 
 /** @brief provides supported authentication type for the channel
  *
  *  @param[in] chNum - channel number
  *  @param[out] authTypeSupported - supported authentication type
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
-                                       uint8_t& authTypeSupported);
+Cc getChannelAuthTypeSupported(const uint8_t chNum, uint8_t& authTypeSupported);
 
 /** @brief provides enabled authentication type for the channel
  *
@@ -345,10 +338,10 @@
  *  @param[in] priv - privilege
  *  @param[out] authType - enabled authentication type
  *
- *  @return IPMI_CC_OK for success, others for failure.
+ *  @return ccSuccess for success, others for failure.
  */
-ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
-                                     EAuthType& authType);
+Cc getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
+                             EAuthType& authType);
 
 /** @brief Retrieves the LAN channel name from the IPMI channel number
  *
diff --git a/user_channel/channel_mgmt.cpp b/user_channel/channel_mgmt.cpp
index 759de43..116521d 100644
--- a/user_channel/channel_mgmt.cpp
+++ b/user_channel/channel_mgmt.cpp
@@ -404,40 +404,38 @@
     return channelData[chNum].maxTransferSize;
 }
 
-ipmi_ret_t ChannelConfig::getChannelInfo(const uint8_t chNum,
-                                         ChannelInfo& chInfo)
+Cc ChannelConfig::getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     std::copy_n(reinterpret_cast<uint8_t*>(&channelData[chNum].chInfo),
                 sizeof(channelData[chNum].chInfo),
                 reinterpret_cast<uint8_t*>(&chInfo));
-
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ChannelConfig::getChannelAccessData(const uint8_t chNum,
-                                               ChannelAccess& chAccessData)
+Cc ChannelConfig::getChannelAccessData(const uint8_t chNum,
+                                       ChannelAccess& chAccessData)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
     {
         log<level::DEBUG>("Session-less channel doesn't have access data.");
-        return IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL;
+        return ccActionNotSupportedForChannel;
     }
 
     if (checkAndReloadVolatileData() != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
 
     std::copy_n(
@@ -445,24 +443,23 @@
         sizeof(channelData[chNum].chAccess.chVolatileData),
         reinterpret_cast<uint8_t*>(&chAccessData));
 
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t
-    ChannelConfig::setChannelAccessData(const uint8_t chNum,
-                                        const ChannelAccess& chAccessData,
-                                        const uint8_t setFlag)
+Cc ChannelConfig::setChannelAccessData(const uint8_t chNum,
+                                       const ChannelAccess& chAccessData,
+                                       const uint8_t setFlag)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
     {
         log<level::DEBUG>("Session-less channel doesn't have access data.");
-        return IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL;
+        return ccActionNotSupportedForChannel;
     }
 
     if (((setFlag & setAccessMode) &&
@@ -471,7 +468,7 @@
          (!isValidPrivLimit(chAccessData.privLimit))))
     {
         log<level::DEBUG>("Invalid access mode / privilege limit specified");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
@@ -479,7 +476,7 @@
 
     if (checkAndReloadVolatileData() != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
 
     if (setFlag & setAccessMode)
@@ -512,30 +509,29 @@
     if (writeChannelVolatileData() != 0)
     {
         log<level::DEBUG>("Failed to update the channel volatile data");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t
-    ChannelConfig::getChannelAccessPersistData(const uint8_t chNum,
-                                               ChannelAccess& chAccessData)
+Cc ChannelConfig::getChannelAccessPersistData(const uint8_t chNum,
+                                              ChannelAccess& chAccessData)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
     {
         log<level::DEBUG>("Session-less channel doesn't have access data.");
-        return IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL;
+        return ccActionNotSupportedForChannel;
     }
 
     if (checkAndReloadNVData() != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
 
     std::copy_n(reinterpret_cast<uint8_t*>(
@@ -543,23 +539,23 @@
                 sizeof(channelData[chNum].chAccess.chNonVolatileData),
                 reinterpret_cast<uint8_t*>(&chAccessData));
 
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ChannelConfig::setChannelAccessPersistData(
-    const uint8_t chNum, const ChannelAccess& chAccessData,
-    const uint8_t setFlag)
+Cc ChannelConfig::setChannelAccessPersistData(const uint8_t chNum,
+                                              const ChannelAccess& chAccessData,
+                                              const uint8_t setFlag)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
     {
         log<level::DEBUG>("Session-less channel doesn't have access data.");
-        return IPMI_CC_ACTION_NOT_SUPPORTED_FOR_CHANNEL;
+        return ccActionNotSupportedForChannel;
     }
 
     if (((setFlag & setAccessMode) &&
@@ -568,7 +564,7 @@
          (!isValidPrivLimit(chAccessData.privLimit))))
     {
         log<level::DEBUG>("Invalid access mode / privilege limit specified");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
@@ -576,7 +572,7 @@
 
     if (checkAndReloadNVData() != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
 
     if (setFlag & setAccessMode)
@@ -614,13 +610,13 @@
                 log<level::DEBUG>(
                     "Network interface does not exist",
                     entry("INTERFACE=%s", channelData[chNum].chName.c_str()));
-                return IPMI_CC_UNSPECIFIED_ERROR;
+                return ccUnspecifiedError;
             }
         }
         catch (const sdbusplus::exception::SdBusError& e)
         {
             log<level::ERR>("Exception: Network interface does not exist");
-            return IPMI_CC_INVALID_FIELD_REQUEST;
+            return ccInvalidFieldRequest;
         }
         signalFlag |= (1 << chNum);
         channelData[chNum].chAccess.chNonVolatileData.privLimit =
@@ -631,51 +627,50 @@
     if (writeChannelPersistData() != 0)
     {
         log<level::DEBUG>("Failed to update the presist data file");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t
-    ChannelConfig::getChannelAuthTypeSupported(const uint8_t chNum,
-                                               uint8_t& authTypeSupported)
+Cc ChannelConfig::getChannelAuthTypeSupported(const uint8_t chNum,
+                                              uint8_t& authTypeSupported)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     authTypeSupported = channelData[chNum].chInfo.authTypeSupported;
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ChannelConfig::getChannelEnabledAuthType(const uint8_t chNum,
-                                                    const uint8_t priv,
-                                                    EAuthType& authType)
+Cc ChannelConfig::getChannelEnabledAuthType(const uint8_t chNum,
+                                            const uint8_t priv,
+                                            EAuthType& authType)
 {
     if (!isValidChannel(chNum))
     {
         log<level::DEBUG>("Invalid channel");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (getChannelSessionSupport(chNum) == EChannelSessSupported::none)
     {
         log<level::DEBUG>("Sessionless channel doesn't have access data.");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     if (!isValidPrivLimit(priv))
     {
         log<level::DEBUG>("Invalid privilege specified.");
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
 
     // TODO: Hardcoded for now. Need to implement.
     authType = EAuthType::none;
 
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 std::time_t ChannelConfig::getUpdatedFileTime(const std::string& fileName)
diff --git a/user_channel/channel_mgmt.hpp b/user_channel/channel_mgmt.hpp
index 80bd6d9..0c31338 100644
--- a/user_channel/channel_mgmt.hpp
+++ b/user_channel/channel_mgmt.hpp
@@ -16,6 +16,7 @@
 
 #pragma once
 #include "channel_layer.hpp"
+#include "ipmid/api-types.hpp"
 
 #include <boost/interprocess/sync/file_lock.hpp>
 #include <boost/interprocess/sync/named_recursive_mutex.hpp>
@@ -146,19 +147,18 @@
      *  @param[in] chNum - channel number
      *  @param[out] chInfo - channel info details
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
+    Cc getChannelInfo(const uint8_t chNum, ChannelInfo& chInfo);
 
     /** @brief provides channel access data
      *
      *  @param[in] chNum - channel number
      *  @param[out] chAccessData - channel access data
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t getChannelAccessData(const uint8_t chNum,
-                                    ChannelAccess& chAccessData);
+    Cc getChannelAccessData(const uint8_t chNum, ChannelAccess& chAccessData);
 
     /** @brief to set channel access data
      *
@@ -166,21 +166,21 @@
      *  @param[in] chAccessData - channel access data
      *  @param[in] setFlag - flag to indicate updatable fields
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setChannelAccessData(const uint8_t chNum,
-                                    const ChannelAccess& chAccessData,
-                                    const uint8_t setFlag);
+    Cc setChannelAccessData(const uint8_t chNum,
+                            const ChannelAccess& chAccessData,
+                            const uint8_t setFlag);
 
     /** @brief to get channel access data persistent data
      *
      *  @param[in] chNum - channel number
      *  @param[out] chAccessData - channel access data
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t getChannelAccessPersistData(const uint8_t chNum,
-                                           ChannelAccess& chAccessData);
+    Cc getChannelAccessPersistData(const uint8_t chNum,
+                                   ChannelAccess& chAccessData);
 
     /** @brief to set channel access data persistent data
      *
@@ -188,21 +188,21 @@
      *  @param[in] chAccessData - channel access data
      *  @param[in] setFlag - flag to indicate updatable fields
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setChannelAccessPersistData(const uint8_t chNum,
-                                           const ChannelAccess& chAccessData,
-                                           const uint8_t setFlag);
+    Cc setChannelAccessPersistData(const uint8_t chNum,
+                                   const ChannelAccess& chAccessData,
+                                   const uint8_t setFlag);
 
     /** @brief provides supported authentication type for the channel
      *
      *  @param[in] chNum - channel number
      *  @param[out] authTypeSupported - supported authentication type
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t getChannelAuthTypeSupported(const uint8_t chNum,
-                                           uint8_t& authTypeSupported);
+    Cc getChannelAuthTypeSupported(const uint8_t chNum,
+                                   uint8_t& authTypeSupported);
 
     /** @brief provides enabled authentication type for the channel
      *
@@ -210,11 +210,10 @@
      *  @param[in] priv - privilege
      *  @param[out] authType - enabled authentication type
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t getChannelEnabledAuthType(const uint8_t chNum,
-                                         const uint8_t priv,
-                                         EAuthType& authType);
+    Cc getChannelEnabledAuthType(const uint8_t chNum, const uint8_t priv,
+                                 EAuthType& authType);
 
     /** @brief conver to channel privilege from system privilege
      *
diff --git a/user_channel/channelcommands.cpp b/user_channel/channelcommands.cpp
index adf19d5..714c05a 100644
--- a/user_channel/channelcommands.cpp
+++ b/user_channel/channelcommands.cpp
@@ -26,8 +26,6 @@
 namespace ipmi
 {
 
-static constexpr const uint8_t ccActionNotSupportedForChannel = 0x82;
-
 /** @brief implements the set channel access command
  *  @ param ctx - context pointer
  *  @ param channel - channel number
@@ -124,7 +122,7 @@
     if (setNVFlag != 0)
     {
         compCode = setChannelAccessPersistData(chNum, chNVData, setNVFlag);
-        if (compCode != IPMI_CC_OK)
+        if (compCode != ccSuccess)
         {
             log<level::DEBUG>("Set channel access - Failed to set access data");
             return response(compCode);
@@ -134,7 +132,7 @@
     if (setActFlag != 0)
     {
         compCode = setChannelAccessData(chNum, chActData, setActFlag);
-        if (compCode != IPMI_CC_OK)
+        if (compCode != ccSuccess)
         {
             log<level::DEBUG>("Set channel access - Failed to set access data");
             return response(compCode);
@@ -206,7 +204,7 @@
         compCode = getChannelAccessData(chNum, chAccess);
     }
 
-    if (compCode != IPMI_CC_OK)
+    if (compCode != ccSuccess)
     {
         return response(compCode);
     }
diff --git a/user_channel/user_layer.cpp b/user_channel/user_layer.cpp
index b309e86..5e4aed7 100644
--- a/user_channel/user_layer.cpp
+++ b/user_channel/user_layer.cpp
@@ -27,10 +27,10 @@
 namespace ipmi
 {
 
-ipmi_ret_t ipmiUserInit()
+Cc ipmiUserInit()
 {
     getUserAccessObject();
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 std::string ipmiUserGetPassword(const std::string& userName)
@@ -38,23 +38,23 @@
     return passwdMgr.getPasswdByUserName(userName);
 }
 
-ipmi_ret_t ipmiClearUserEntryPassword(const std::string& userName)
+Cc ipmiClearUserEntryPassword(const std::string& userName)
 {
     if (passwdMgr.updateUserEntry(userName, "") != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ipmiRenameUserEntryPassword(const std::string& userName,
-                                       const std::string& newUserName)
+Cc ipmiRenameUserEntryPassword(const std::string& userName,
+                               const std::string& newUserName)
 {
     if (passwdMgr.updateUserEntry(userName, newUserName) != 0)
     {
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 bool ipmiUserIsValidUserId(const uint8_t userId)
@@ -72,30 +72,29 @@
     return getUserAccessObject().getUserId(userName);
 }
 
-ipmi_ret_t ipmiUserSetUserName(const uint8_t userId, const char* userName)
+Cc ipmiUserSetUserName(const uint8_t userId, const char* userName)
 {
     return getUserAccessObject().setUserName(userId, userName);
 }
 
-ipmi_ret_t ipmiUserGetUserName(const uint8_t userId, std::string& userName)
+Cc ipmiUserGetUserName(const uint8_t userId, std::string& userName)
 {
     return getUserAccessObject().getUserName(userId, userName);
 }
 
-ipmi_ret_t ipmiUserSetUserPassword(const uint8_t userId,
-                                   const char* userPassword)
+Cc ipmiUserSetUserPassword(const uint8_t userId, const char* userPassword)
 {
     return getUserAccessObject().setUserPassword(userId, userPassword);
 }
 
-ipmi_ret_t ipmiSetSpecialUserPassword(const std::string& userName,
-                                      const std::string& userPassword)
+Cc ipmiSetSpecialUserPassword(const std::string& userName,
+                              const std::string& userPassword)
 {
     return getUserAccessObject().setSpecialUserPassword(userName, userPassword);
 }
 
-ipmi_ret_t ipmiUserGetAllCounts(uint8_t& maxChUsers, uint8_t& enabledUsers,
-                                uint8_t& fixedUsers)
+Cc ipmiUserGetAllCounts(uint8_t& maxChUsers, uint8_t& enabledUsers,
+                        uint8_t& fixedUsers)
 {
     maxChUsers = ipmiMaxUsers;
     UsersTbl* userData = getUserAccessObject().getUsersTblPtr();
@@ -113,36 +112,36 @@
             fixedUsers++;
         }
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state)
+Cc ipmiUserUpdateEnabledState(const uint8_t userId, const bool& state)
 {
     return getUserAccessObject().setUserEnabledState(userId, state);
 }
 
-ipmi_ret_t ipmiUserCheckEnabled(const uint8_t userId, bool& state)
+Cc ipmiUserCheckEnabled(const uint8_t userId, bool& state)
 {
     if (!UserAccess::isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     UserInfo* userInfo = getUserAccessObject().getUserInfo(userId);
     state = userInfo->userEnabled;
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-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)
 {
 
     if (!UserAccess::isValidChannel(chNum))
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!UserAccess::isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     UserInfo* userInfo = getUserAccessObject().getUserInfo(userId);
     privAccess.privilege = userInfo->userPrivAccess[chNum].privilege;
@@ -150,13 +149,12 @@
     privAccess.linkAuthEnabled =
         userInfo->userPrivAccess[chNum].linkAuthEnabled;
     privAccess.accessCallback = userInfo->userPrivAccess[chNum].accessCallback;
-
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
-                                      const PrivAccess& privAccess,
-                                      const bool& otherPrivUpdates)
+Cc ipmiUserSetPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
+                              const PrivAccess& privAccess,
+                              const bool& otherPrivUpdates)
 {
     UserPrivAccess userPrivAccess;
     userPrivAccess.privilege = privAccess.privilege;
@@ -176,37 +174,35 @@
     return pamUserCheckAuthenticate(userName, userPassword);
 }
 
-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)
 {
 
     if (!UserAccess::isValidChannel(chNum))
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!UserAccess::isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
 
     return getUserAccessObject().setUserPayloadAccess(chNum, operation, userId,
                                                       payloadAccess);
 }
 
-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)
 {
 
     if (!UserAccess::isValidChannel(chNum))
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!UserAccess::isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
 
     UserInfo* userInfo = getUserAccessObject().getUserInfo(userId);
@@ -220,7 +216,7 @@
     payloadAccess.oemPayloadEnables2Reserved =
         userInfo->payloadAccess[chNum].oemPayloadEnables2Reserved;
 
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 } // namespace ipmi
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
diff --git a/user_channel/user_mgmt.cpp b/user_channel/user_mgmt.cpp
index 102f990..c3517fd 100644
--- a/user_channel/user_mgmt.cpp
+++ b/user_channel/user_mgmt.cpp
@@ -713,26 +713,25 @@
     return true;
 }
 
-ipmi_ret_t UserAccess::setSpecialUserPassword(const std::string& userName,
-                                              const std::string& userPassword)
+Cc UserAccess::setSpecialUserPassword(const std::string& userName,
+                                      const std::string& userPassword)
 {
     if (pamUpdatePasswd(userName.c_str(), userPassword.c_str()) != PAM_SUCCESS)
     {
         log<level::DEBUG>("Failed to update password");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t UserAccess::setUserPassword(const uint8_t userId,
-                                       const char* userPassword)
+Cc UserAccess::setUserPassword(const uint8_t userId, const char* userPassword)
 {
     std::string userName;
-    if (ipmiUserGetUserName(userId, userName) != ipmi::ccSuccess)
+    if (ipmiUserGetUserName(userId, userName) != ccSuccess)
     {
         log<level::DEBUG>("User Name not found",
                           entry("USER-ID=%d", (uint8_t)userId));
-        return ipmi::ccParmOutOfRange;
+        return ccParmOutOfRange;
     }
     std::string passwd;
     passwd.assign(reinterpret_cast<const char*>(userPassword), 0,
@@ -744,28 +743,28 @@
     {
         case PAM_SUCCESS:
         {
-            return ipmi::ccSuccess;
+            return ccSuccess;
         }
         case PAM_AUTHTOK_ERR:
         {
             log<level::DEBUG>("Bad authentication token");
-            return ipmi::ccInvalidFieldRequest;
+            return ccInvalidFieldRequest;
         }
         default:
         {
             log<level::DEBUG>("Failed to update password",
                               entry("USER-ID=%d", (uint8_t)userId));
-            return ipmi::ccUnspecifiedError;
+            return ccUnspecifiedError;
         }
     }
 }
 
-ipmi_ret_t UserAccess::setUserEnabledState(const uint8_t userId,
-                                           const bool& enabledState)
+Cc UserAccess::setUserEnabledState(const uint8_t userId,
+                                   const bool& enabledState)
 {
     if (!isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
         userLock{*userMutex};
@@ -776,7 +775,7 @@
     if (userName.empty())
     {
         log<level::DEBUG>("User name not set / invalid");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
     if (userInfo->userEnabled != enabledState)
     {
@@ -791,31 +790,31 @@
         catch (const std::exception& e)
         {
             log<level::DEBUG>("Write user data failed");
-            return IPMI_CC_UNSPECIFIED_ERROR;
+            return ccUnspecifiedError;
         }
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t UserAccess::setUserPayloadAccess(const uint8_t chNum,
-                                            const uint8_t operation,
-                                            const uint8_t userId,
-                                            const PayloadAccess& payloadAccess)
+Cc UserAccess::setUserPayloadAccess(const uint8_t chNum,
+                                    const uint8_t operation,
+                                    const uint8_t userId,
+                                    const PayloadAccess& payloadAccess)
 {
     constexpr uint8_t enable = 0x0;
     constexpr uint8_t disable = 0x1;
 
     if (!isValidChannel(chNum))
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     if (operation != enable && operation != disable)
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     // Check operation & payloadAccess if required.
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
@@ -846,23 +845,22 @@
     catch (const std::exception& e)
     {
         log<level::ERR>("Write user data failed");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
-ipmi_ret_t UserAccess::setUserPrivilegeAccess(const uint8_t userId,
-                                              const uint8_t chNum,
-                                              const UserPrivAccess& privAccess,
-                                              const bool& otherPrivUpdates)
+Cc UserAccess::setUserPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
+                                      const UserPrivAccess& privAccess,
+                                      const bool& otherPrivUpdates)
 {
     if (!isValidChannel(chNum))
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
         userLock{*userMutex};
@@ -873,7 +871,7 @@
     if (userName.empty())
     {
         log<level::DEBUG>("User name not set / invalid");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
     std::string priv = convertToSystemPrivilege(
         static_cast<CommandPrivilege>(privAccess.privilege));
@@ -902,9 +900,9 @@
     catch (const std::exception& e)
     {
         log<level::DEBUG>("Write user data failed");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 uint8_t UserAccess::getUserId(const std::string& userName)
@@ -934,16 +932,16 @@
     return usrIndex;
 }
 
-ipmi_ret_t UserAccess::getUserName(const uint8_t userId, std::string& userName)
+Cc UserAccess::getUserName(const uint8_t userId, std::string& userName)
 {
     if (!isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     UserInfo* userInfo = getUserInfo(userId);
     userName.assign(reinterpret_cast<char*>(userInfo->userName), 0,
                     ipmiMaxUserName);
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 bool UserAccess::isIpmiInAvailableGroupList()
@@ -966,12 +964,11 @@
     return false;
 }
 
-ipmi_ret_t UserAccess::setUserName(const uint8_t userId,
-                                   const char* userNameInChar)
+Cc UserAccess::setUserName(const uint8_t userId, const char* userNameInChar)
 {
     if (!isValidUserId(userId))
     {
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
 
     boost::interprocess::scoped_lock<boost::interprocess::named_recursive_mutex>
@@ -983,7 +980,7 @@
     if (oldUser == newUser)
     {
         // requesting to set the same user name, return success.
-        return IPMI_CC_OK;
+        return ccSuccess;
     }
     bool validUser = isValidUserName(userNameInChar);
     UserInfo* userInfo = getUserInfo(userId);
@@ -1003,7 +1000,7 @@
             log<level::DEBUG>("Failed to excute method",
                               entry("METHOD=%s", deleteUserMethod),
                               entry("PATH=%s", userPath.c_str()));
-            return IPMI_CC_UNSPECIFIED_ERROR;
+            return ccUnspecifiedError;
         }
         deleteUserIndex(userId);
     }
@@ -1013,7 +1010,7 @@
         {
             if (!isIpmiInAvailableGroupList())
             {
-                return IPMI_CC_UNSPECIFIED_ERROR;
+                return ccUnspecifiedError;
             }
             // Create new user
             auto method = bus.new_method_call(
@@ -1027,7 +1024,7 @@
             log<level::DEBUG>("Failed to excute method",
                               entry("METHOD=%s", createUserMethod),
                               entry("PATH=%s", userMgrObjBasePath));
-            return IPMI_CC_UNSPECIFIED_ERROR;
+            return ccUnspecifiedError;
         }
         std::memcpy(userInfo->userName, userNameInChar, ipmiMaxUserName);
         userInfo->userInSystem = true;
@@ -1048,7 +1045,7 @@
             log<level::DEBUG>("Failed to excute method",
                               entry("METHOD=%s", renameUserMethod),
                               entry("PATH=%s", userMgrObjBasePath));
-            return IPMI_CC_UNSPECIFIED_ERROR;
+            return ccUnspecifiedError;
         }
         std::fill(static_cast<uint8_t*>(userInfo->userName),
                   static_cast<uint8_t*>(userInfo->userName) +
@@ -1060,7 +1057,7 @@
     }
     else if (!validUser)
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     try
     {
@@ -1069,9 +1066,9 @@
     catch (const std::exception& e)
     {
         log<level::DEBUG>("Write user data failed");
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return ccUnspecifiedError;
     }
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 static constexpr const char* jsonUserName = "user_name";
diff --git a/user_channel/user_mgmt.hpp b/user_channel/user_mgmt.hpp
index 159b15c..d77317a 100644
--- a/user_channel/user_mgmt.hpp
+++ b/user_channel/user_mgmt.hpp
@@ -202,47 +202,46 @@
      *  @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 getUserName(const uint8_t userId, std::string& userName);
+    Cc getUserName(const uint8_t userId, std::string& userName);
 
     /** @brief to set user name
      *
      *  @param[in] userId - user id
-     *  @param[in] userNameInChar - user name
+     *  @param[in] userName - user name
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setUserName(const uint8_t userId, const char* userNameInChar);
+    Cc setUserName(const uint8_t userId, const char* userNameInChar);
 
     /** @brief to set user enabled state
      *
      *  @param[in] userId - user id
      *  @param[in] enabledState - enabled state of the user
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setUserEnabledState(const uint8_t userId,
-                                   const bool& enabledState);
+    Cc setUserEnabledState(const uint8_t userId, const bool& enabledState);
 
     /** @brief to set user password
      *
      *  @param[in] userId - user id
      *  @param[in] userPassword  - new password of the user
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setUserPassword(const uint8_t userId, const char* userPassword);
+    Cc setUserPassword(const uint8_t userId, const char* userPassword);
 
     /** @brief to set special user password
      *
      *  @param[in] userName - user name
      *  @param[in] userPassword  - new password of the user
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setSpecialUserPassword(const std::string& userName,
-                                      const std::string& userPassword);
+    Cc setSpecialUserPassword(const std::string& userName,
+                              const std::string& userPassword);
 
     /** @brief to set user privilege and access details
      *
@@ -252,11 +251,11 @@
      *  @param[in] otherPrivUpdates - other privilege update flag to update ipmi
      * enable, link authentication and access callback
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setUserPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
-                                      const UserPrivAccess& privAccess,
-                                      const bool& otherPrivUpdates);
+    Cc setUserPrivilegeAccess(const uint8_t userId, const uint8_t chNum,
+                              const UserPrivAccess& privAccess,
+                              const bool& otherPrivUpdates);
 
     /** @brief to get user payload access details from userInfo entry.
      *
@@ -301,12 +300,11 @@
      *  @param[in] userId - user id
      *  @param[in] payloadAccess - payload access
      *
-     *  @return IPMI_CC_OK for success, others for failure.
+     *  @return ccSuccess for success, others for failure.
      */
-    ipmi_ret_t setUserPayloadAccess(const uint8_t chNum,
-                                    const uint8_t operation,
-                                    const uint8_t userId,
-                                    const PayloadAccess& payloadAccess);
+    Cc setUserPayloadAccess(const uint8_t chNum, const uint8_t operation,
+                            const uint8_t userId,
+                            const PayloadAccess& payloadAccess);
 
     /** @brief reads user management related data from configuration file
      *
diff --git a/user_channel/usercommands.cpp b/user_channel/usercommands.cpp
index 3396d2d..34687d5 100644
--- a/user_channel/usercommands.cpp
+++ b/user_channel/usercommands.cpp
@@ -217,7 +217,7 @@
     uint8_t maxChUsers = 0, enabledUsers = 0, fixedUsers = 0;
     ipmi::Cc retStatus;
     retStatus = ipmiUserGetAllCounts(maxChUsers, enabledUsers, fixedUsers);
-    if (retStatus != IPMI_CC_OK)
+    if (retStatus != ccSuccess)
     {
         return ipmi::response(retStatus);
     }
@@ -225,7 +225,7 @@
     bool enabledState = false;
     retStatus =
         ipmiUserCheckEnabled(static_cast<uint8_t>(userId), enabledState);
-    if (retStatus != IPMI_CC_OK)
+    if (retStatus != ccSuccess)
     {
         return ipmi::response(retStatus);
     }
@@ -235,7 +235,7 @@
     PrivAccess privAccess{};
     retStatus = ipmiUserGetPrivilegeAccess(static_cast<uint8_t>(userId), chNum,
                                            privAccess);
-    if (retStatus != IPMI_CC_OK)
+    if (retStatus != ccSuccess)
     {
         return ipmi::response(retStatus);
     }
@@ -254,9 +254,9 @@
         static_cast<uint1_t>(privAccess.reserved));
 }
 
-ipmi_ret_t ipmiSetUserName(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-                           ipmi_request_t request, ipmi_response_t response,
-                           ipmi_data_len_t dataLen, ipmi_context_t context)
+Cc ipmiSetUserName(ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+                   ipmi_response_t response, ipmi_data_len_t dataLen,
+                   ipmi_context_t context)
 {
     const SetUserNameReq* req = static_cast<SetUserNameReq*>(request);
     size_t reqLength = *dataLen;
@@ -265,16 +265,16 @@
     if (reqLength != sizeof(*req))
     {
         log<level::DEBUG>("Set user name - Invalid Length");
-        return IPMI_CC_REQ_DATA_LEN_INVALID;
+        return ccReqDataLenInvalid;
     }
     if (req->reserved1)
     {
-        return IPMI_CC_INVALID_FIELD_REQUEST;
+        return ccInvalidFieldRequest;
     }
     if (!ipmiUserIsValidUserId(req->userId))
     {
         log<level::DEBUG>("Set user name - Invalid user id");
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
 
     return ipmiUserSetUserName(req->userId,
@@ -290,9 +290,9 @@
  *  @param[in] context - ipmi context.
  *  @returns ipmi completion code.
  */
-ipmi_ret_t ipmiGetUserName(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-                           ipmi_request_t request, ipmi_response_t response,
-                           ipmi_data_len_t dataLen, ipmi_context_t context)
+Cc ipmiGetUserName(ipmi_netfn_t netfn, ipmi_cmd_t cmd, ipmi_request_t request,
+                   ipmi_response_t response, ipmi_data_len_t dataLen,
+                   ipmi_context_t context)
 {
     const GetUserNameReq* req = static_cast<GetUserNameReq*>(request);
     size_t reqLength = *dataLen;
@@ -302,15 +302,15 @@
     if (reqLength != sizeof(*req))
     {
         log<level::DEBUG>("Get user name - Invalid Length");
-        return IPMI_CC_REQ_DATA_LEN_INVALID;
+        return ccReqDataLenInvalid;
     }
 
     std::string userName;
-    if (ipmiUserGetUserName(req->userId, userName) != IPMI_CC_OK)
+    if (ipmiUserGetUserName(req->userId, userName) != ccSuccess)
     { // Invalid User ID
         log<level::DEBUG>("User Name not found",
                           entry("USER-ID=%d", (uint8_t)req->userId));
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     GetUserNameResp* resp = static_cast<GetUserNameResp*>(response);
     std::fill(reinterpret_cast<uint8_t*>(resp),
@@ -319,7 +319,7 @@
                   sizeof(resp->userName), 0);
     *dataLen = sizeof(*resp);
 
-    return IPMI_CC_OK;
+    return ccSuccess;
 }
 
 /** @brief implementes the set user password command
@@ -331,9 +331,9 @@
  *  @param[in] context - ipmi context.
  *  @returns ipmi completion code.
  */
-ipmi_ret_t ipmiSetUserPassword(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
-                               ipmi_request_t request, ipmi_response_t response,
-                               ipmi_data_len_t dataLen, ipmi_context_t context)
+Cc ipmiSetUserPassword(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+                       ipmi_request_t request, ipmi_response_t response,
+                       ipmi_data_len_t dataLen, ipmi_context_t context)
 {
     const SetUserPasswordReq* req = static_cast<SetUserPasswordReq*>(request);
     size_t reqLength = *dataLen;
@@ -350,7 +350,7 @@
          ((reqLength < 2) || (reqLength > sizeof(SetUserPasswordReq)))))
     {
         log<level::DEBUG>("Invalid Length");
-        return IPMI_CC_REQ_DATA_LEN_INVALID;
+        return ccReqDataLenInvalid;
     }
     // If set / test password then password length has to be 16 or 20 bytes
     // based on the password size bit.
@@ -361,15 +361,15 @@
           (passwordLength != maxIpmi15PasswordSize))))
     {
         log<level::DEBUG>("Invalid Length");
-        return IPMI_CC_REQ_DATA_LEN_INVALID;
+        return ccReqDataLenInvalid;
     }
 
     std::string userName;
-    if (ipmiUserGetUserName(req->userId, userName) != IPMI_CC_OK)
+    if (ipmiUserGetUserName(req->userId, userName) != ccSuccess)
     {
         log<level::DEBUG>("User Name not found",
                           entry("USER-ID=%d", (uint8_t)req->userId));
-        return IPMI_CC_PARM_OUT_OF_RANGE;
+        return ccParmOutOfRange;
     }
     if (req->operation == setPassword)
     {
@@ -394,12 +394,12 @@
         {
             log<level::DEBUG>("Test password failed",
                               entry("USER-ID=%d", (uint8_t)req->userId));
-            return static_cast<ipmi_ret_t>(
+            return static_cast<Cc>(
                 IPMISetPasswordReturnCodes::ipmiCCPasswdFailMismatch);
         }
-        return IPMI_CC_OK;
+        return ccSuccess;
     }
-    return IPMI_CC_INVALID_FIELD_REQUEST;
+    return ccInvalidFieldRequest;
 }
 
 /** @brief implements the get channel authentication command
@@ -641,7 +641,7 @@
     PayloadAccess payloadAccess = {};
     retStatus = ipmiUserGetUserPayloadAccess(
         chNum, static_cast<uint8_t>(userId), payloadAccess);
-    if (retStatus != IPMI_CC_OK)
+    if (retStatus != ccSuccess)
     {
         return ipmi::response(retStatus);
     }