ua_stack_session_manager.h 2.3 KB

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