user_channel: Rewriting ipmiUserSetUserName API
Rewriting ipmiUserSetUserName API
Tested:
Verified using ipmitool commands.
Command: ipmitool user set name 4 user4
Response: //Success
Command: ipmitool user set password 4 asdf1234
Response: Set User Password command successful (user 4)
Command: ipmitool user priv 4 0x03 1
Response: Set Privilege Level command successful (user 4)
Command: ipmitool user set name 14 user13asdfghkjlqwert
Response: Username is too long (> 16 bytes)
Command: ipmitool -I lanplus -C 3 -p 623 -U root -P <password> -H
<BMC-IP> user set name 8 WIJGueNKd
Response: //Success
Command: ipmitool user list 1 //User list for channel 1
1 root false true true ADMINISTRATOR
2 user2 true false false USER
3 user3 true false false NO ACCESS
4 user4 true false false OPERATOR
5 WIJGueNK true false false NO ACCESS
6 WIJGueNKb true false false NO ACCESS
7 WIJGueNKc true false false NO ACCESS
8 WIJGueNKd true false false NO ACCESS
9 true false false NO ACCESS
10 true false false NO ACCESS
Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I41c091f6d9aaf54326295d1e80e16db521b2e23d
diff --git a/user_channel/user_layer.hpp b/user_channel/user_layer.hpp
index b0d0d4c..0639474 100644
--- a/user_channel/user_layer.hpp
+++ b/user_channel/user_layer.hpp
@@ -143,6 +143,15 @@
*/
Cc ipmiUserSetUserName(const uint8_t userId, const char* userName);
+/** @brief set's user name
+ *
+ * @param[in] userId - user id
+ * @param[in] userName - user name
+ *
+ * @return ccSuccess for success, others for failure.
+ */
+Cc ipmiUserSetUserName(const uint8_t userId, const std::string& userName);
+
/** @brief set user password
*
* @param[in] userId - user id