ua_stack_session_manager.h 2.4 KB

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