ua_stack_session_manager.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "../include/opcua.h"
  10. #include "../include/ua_list.h"
  11. #include "ua_stack_session.h"
  12. //hide internal data of channelManager
  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 if all goes well UA_SUCCESS is returned
  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 if all goes well UA_SUCCESS is returned
  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 if all goes well UA_SUCCESS is returned
  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 if all goes well UA_SUCCESS is returned
  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 if all goes well UA_SUCCESS is returned
  47. */
  48. UA_Int32 UA_SessionManager_getSessionByToken(UA_NodeId *token, UA_Session *session);
  49. UA_Int32 UA_SessionManager_updateSessions();
  50. UA_Int32 UA_SessionManager_getSessionLifeTime(UA_DateTime *lifeTime);
  51. //UA_Int32 UA_SessionManager_generateToken(UA_Session session, UA_Int32 requestedLifeTime, SecurityTokenRequestType requestType, UA_ChannelSecurityToken* newToken);
  52. UA_Int32 UA_SessionManager_generateSessionId(UA_NodeId *newSessionId);
  53. #endif /* UA_STACK_SESSION_MANAGER_H_ */