ua_session_manager.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef UA_SESSION_MANAGER_H_
  2. #define UA_SESSION_MANAGER_H_
  3. #include "ua_session.h"
  4. struct UA_SessionManager;
  5. typedef struct UA_SessionManager UA_SessionManager;
  6. UA_Int32 UA_SessionManager_new(UA_SessionManager **sessionManager, UA_UInt32 maxSessionCount,
  7. UA_UInt32 sessionLifetime, UA_UInt32 startSessionId);
  8. UA_Int32 UA_SessionManager_delete(UA_SessionManager *sessionManager);
  9. UA_Int32 UA_SessionManager_addSession(UA_SessionManager *sessionManager,
  10. UA_SecureChannel *channel, UA_Session **session);
  11. /**
  12. * @brief removes a session from the manager list
  13. * @param sessionId id which assign to a session
  14. * @return error code
  15. */
  16. UA_Int32 UA_SessionManager_removeSession(UA_SessionManager *sessionManager,
  17. UA_NodeId *sessionId);
  18. /**
  19. * @brief finds the session which is identified by the sessionId
  20. * @param sessionId the session id is used to identify the unknown session
  21. * @param session the session object is returned if no error occurs
  22. * @return error code
  23. */
  24. UA_Int32 UA_SessionManager_getSessionById(UA_SessionManager *sessionManager,
  25. UA_NodeId *sessionId, UA_Session **session);
  26. /**
  27. * @brief
  28. * @param token authentication token which is used to get the session object
  29. * @param session output, session object which is identified by the authentication token
  30. * @return error code
  31. */
  32. UA_Int32 UA_SessionManager_getSessionByToken(UA_SessionManager *sessionManager,
  33. UA_NodeId *token, UA_Session **session);
  34. /**
  35. * @brief gets the session timeout value which should be assigned to
  36. * all sessions handled by the manager
  37. * @param timeout_ms timeout in milliseconds
  38. * @return error code
  39. */
  40. UA_Int32 UA_SessionManager_getSessionTimeout(UA_SessionManager *sessionManager,
  41. UA_Int64 *timeout_ms);
  42. //UA_Int32 UA_SessionManager_updateSessions();
  43. //UA_Int32 UA_SessionManager_generateToken(UA_Session session, UA_Int32 requestedLifeTime, SecurityTokenRequestType requestType, UA_ChannelSecurityToken* newToken);
  44. UA_Int32 UA_SessionManager_generateSessionId(UA_SessionManager *sessionManager,
  45. UA_NodeId *newSessionId);
  46. #endif /* UA_SESSION_MANAGER_H_ */