ua_stack_session_manager.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef UA_STACK_SESSION_MANAGER_H_
  2. #define UA_STACK_SESSION_MANAGER_H_
  3. #include "ua_stack_session.h"
  4. struct UA_SessionManager;
  5. typedef struct UA_SessionManager UA_SessionManager;
  6. /**
  7. * @brief initializes the session manager
  8. * @param maxSessionCount maximum amount of sessions which should be allowed to be created
  9. * @param sessionLifetime lifetime of a session, after this time the session must be renewed
  10. * @param startSessionId the start id of the session identifiers, newer sessions get higher ids
  11. * @return error code
  12. */
  13. UA_Int32 UA_SessionManager_init(UA_UInt32 maxSessionCount,UA_UInt32 sessionLifetime, UA_UInt32 startSessionId);
  14. /**
  15. * @brief adds a session to the manager list
  16. * @param session session object which should be added to the manager list
  17. * @return error code
  18. */
  19. UA_Int32 UA_SessionManager_addSession(UA_Session *session);
  20. /**
  21. * @brief removes a session from the manager list
  22. * @param sessionId id which assign to a session
  23. * @return error code
  24. */
  25. UA_Int32 UA_SessionManager_removeSession(UA_NodeId *sessionId);
  26. /**
  27. * @brief finds the session which is identified by the sessionId
  28. * @param sessionId the session id is used to identify the unknown session
  29. * @param session the session object is returned if no error occurs
  30. * @return error code
  31. */
  32. UA_Int32 UA_SessionManager_getSessionById(UA_NodeId *sessionId, UA_Session **session);
  33. /**
  34. * @brief
  35. * @param token authentication token which is used to get the session object
  36. * @param session output, session object which is identified by the authentication token
  37. * @return error code
  38. */
  39. UA_Int32 UA_SessionManager_getSessionByToken(UA_NodeId *token, UA_Session **session);
  40. /**
  41. * @brief gets the session timeout value which should be assigned to
  42. * all sessions handled by the manager
  43. * @param timeout_ms timeout in milliseconds
  44. * @return error code
  45. */
  46. UA_Int32 UA_SessionManager_getSessionTimeout(UA_Int64 *timeout_ms);
  47. //UA_Int32 UA_SessionManager_updateSessions();
  48. //UA_Int32 UA_SessionManager_generateToken(UA_Session session, UA_Int32 requestedLifeTime, SecurityTokenRequestType requestType, UA_ChannelSecurityToken* newToken);
  49. UA_Int32 UA_SessionManager_generateSessionId(UA_NodeId *newSessionId);
  50. #endif /* UA_STACK_SESSION_MANAGER_H_ */