File wsh_shell_user.h
FileList > src > wsh_shell_user.h
Go to the source code of this file
Shell user management API. More...
#include "wsh_shell_cfg.h"#include "wsh_shell_misc.h"#include "wsh_shell_types.h"
Classes
| Type | Name |
|---|---|
| struct | WshShellUser_Table_t Table of registered shell users. |
| struct | WshShellUser_t User object definition. |
Public Types
| Type | Name |
|---|---|
| typedef void(* | WshShellUser_HashFunc_t Hash function for salt + pass encryption. |
Public Functions
| Type | Name |
|---|---|
| WSH_SHELL_RET_STATE_t | WshShellUser_Attach (WshShellUser_Table_t * pShellUsers, const WshShellUser_t * pcUserTable, WshShell_Size_t userNum, WshShellUser_HashFunc_t extHashFunc) Initialize the shell user table. |
| WshShell_Bool_t | WshShellUser_CheckCredentials (WshShellUser_Table_t * pShellUsers, WshShell_Size_t UserID, const WshShell_Char_t * pcLogin, const WshShell_Char_t * pcPass) Verify login credentials of a user. |
| void | WshShellUser_DeAttach (WshShellUser_Table_t * pShellUsers) Destroy the user table. |
| const WshShellUser_t * | WshShellUser_FindByCredentials (WshShellUser_Table_t * pShellUsers, const WshShell_Char_t * pcLogin, const WshShell_Char_t * pcPass) Finds a user by login and password credentials. |
| const WshShellUser_t * | WshShellUser_GetUserByIndex (WshShellUser_Table_t * pShellUsers, WshShell_Size_t idx) Retrieve a user by index. |
| WshShell_Size_t | WshShellUser_GetUsersNum (WshShellUser_Table_t * pShellUsers) Get the number of users registered in the shell. |
Detailed Description
Author:
Whoosh Embedded Team
Copyright:
Copyright (c) 2025
Public Types Documentation
typedef WshShellUser_HashFunc_t
Hash function for salt + pass encryption.
Public Functions Documentation
function WshShellUser_Attach
Initialize the shell user table.
Registers a static user table for the shell instance.
Parameters:
pShellUsersPointer to the shell's user table.pcUserTablePointer to the static array of user records.userNumNumber of users in the array.
Return value:
WSH_SHELL_RET_STATE_SUCCESSInitialization succeeded.WSH_SHELL_RET_STATE_ERR_PARAMInvalid input arguments.WSH_SHELL_RET_STATE_ERR_BUSYTable was already initialized.
function WshShellUser_CheckCredentials
Verify login credentials of a user.
Validates login and password against the given user index.
Parameters:
pShellUsersPointer to the user table.UserIDIndex of the user to validate.pcLoginPointer to the login string.pcPassPointer to the password string.
Return value:
trueIf credentials match.falseIf mismatch or error.
function WshShellUser_DeAttach
Destroy the user table.
Resets the user list and count to zero.
Parameters:
pShellUsersPointer to the user table to reset.
function WshShellUser_FindByCredentials
Finds a user by login and password credentials.
Searches the given user table for a user whose login and password match the provided credentials. Comparison is done using the WshShellUser_CheckCredentials function.
Parameters:
pShellUsersPointer to the user table.pcLoginPointer to the login string.pcPassPointer to the password string.
Returns:
Pointer to the matching user object if found; NULL otherwise.
Note:
Returns NULL if any input pointer is NULL or if the user table is empty.
function WshShellUser_GetUserByIndex
Retrieve a user by index.
Parameters:
pShellUsersPointer to the user table.idxIndex of the user.
Returns:
Pointer to the user object, or NULL if invalid.
function WshShellUser_GetUsersNum
Get the number of users registered in the shell.
Parameters:
pShellUsersPointer to the user table.
Returns:
Number of users, or 0 if uninitialized or NULL.
The documentation for this class was generated from the following file src/wsh_shell_user.h