|
@@ -138,6 +138,27 @@ typedef struct
|
|
const uint32_t userIdslength; /**< length of the user list */
|
|
const uint32_t userIdslength; /**< length of the user list */
|
|
} shellmatta_auth_perm_t;
|
|
} shellmatta_auth_perm_t;
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * @brief login states
|
|
|
|
+ */
|
|
|
|
+typedef enum
|
|
|
|
+{
|
|
|
|
+ SHELLMATTA_AUTH_IDLE, /**< authentication system waits */
|
|
|
|
+ SHELLMATTA_AUTH_USERNAME, /**< input of username */
|
|
|
|
+ SHELLMATTA_AUTH_PASSWORD /**< input of password */
|
|
|
|
+} shellmatta_auth_state_t;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @brief log actions - passed to the log function
|
|
|
|
+ */
|
|
|
|
+typedef enum
|
|
|
|
+{
|
|
|
|
+ SHELLMATTA_AUTH_EVENT_NONE, /**< no event (init value) */
|
|
|
|
+ SHELLMATTA_AUTH_EVENT_LOGIN, /**< successful login event */
|
|
|
|
+ SHELLMATTA_AUTH_EVENT_LOGIN_FAILED, /**< failed login event */
|
|
|
|
+ SHELLMATTA_AUTH_EVENT_LOGOUT, /**< succesful logout event */
|
|
|
|
+} shellmatta_auth_log_event_t;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @brief custom shellmatta authentication method
|
|
* @brief custom shellmatta authentication method
|
|
* @param[in] userId user id to log in (name of the user role)
|
|
* @param[in] userId user id to log in (name of the user role)
|
|
@@ -148,20 +169,10 @@ typedef shellmatta_retCode_t (*shellmatta_auth_check_t)(const uint32_t userId, c
|
|
|
|
|
|
/**
|
|
/**
|
|
* @brief shellmatta authentication log method - will be called whenever a login attempt is done
|
|
* @brief shellmatta authentication log method - will be called whenever a login attempt is done
|
|
- * @param[in] userId userId to be logged in (0 on unknown user)
|
|
|
|
- * @param[in] success true: the login succeeded
|
|
|
|
- */
|
|
|
|
-typedef void (*shellmatta_auth_log_t)(const uint32_t userId, bool success);
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * @brief login states
|
|
|
|
|
|
+ * @param[in] userId userId to be logged in (0 on unknown user)
|
|
|
|
+ * @param[in] event event type to be logged (e.g. successful login)
|
|
*/
|
|
*/
|
|
-typedef enum
|
|
|
|
-{
|
|
|
|
- SHELLMATTA_AUTH_IDLE, /**< authentication system waits */
|
|
|
|
- SHELLMATTA_AUTH_USERNAME, /**< input of username */
|
|
|
|
- SHELLMATTA_AUTH_PASSWORD /**< input of password */
|
|
|
|
-} shellmatta_auth_state_t;
|
|
|
|
|
|
+typedef void (*shellmatta_auth_log_t)(const uint32_t userId, shellmatta_auth_log_event_t event);
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -233,7 +244,7 @@ typedef struct
|
|
shellmatta_auth_perm_t *permList; /**< permission list */
|
|
shellmatta_auth_perm_t *permList; /**< permission list */
|
|
uint32_t permListLength; /**< length of the permission list */
|
|
uint32_t permListLength; /**< length of the permission list */
|
|
shellmatta_auth_check_t checkFct; /**< custom credential check function */
|
|
shellmatta_auth_check_t checkFct; /**< custom credential check function */
|
|
- shellmatta_auth_log_t logFct; /**< login log function */
|
|
|
|
|
|
+ shellmatta_auth_log_t logFct; /**< auth log function */
|
|
#endif
|
|
#endif
|
|
} shellmatta_instance_t;
|
|
} shellmatta_instance_t;
|
|
|
|
|