ua_session.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef UA_SESSION_H_
  2. #define UA_SESSION_H_
  3. #include "ua_types.h"
  4. #include "ua_securechannel.h"
  5. /**
  6. * @ingroup communication
  7. *
  8. * @{
  9. */
  10. struct UA_Session {
  11. UA_ApplicationDescription clientDescription;
  12. UA_String sessionName;
  13. UA_NodeId authenticationToken;
  14. UA_NodeId sessionId;
  15. UA_UInt32 maxRequestMessageSize;
  16. UA_UInt32 maxResponseMessageSize;
  17. UA_Int64 timeout;
  18. UA_DateTime validTill;
  19. UA_SecureChannel *channel;
  20. };
  21. extern UA_Session anonymousSession; ///< If anonymous access is allowed, this session is used internally (Session ID: 0)
  22. extern UA_Session adminSession; ///< Local access to the services (for startup and maintenance) uses this Session with all possible access rights (Session ID: 1)
  23. UA_Session * UA_Session_new();
  24. void UA_Session_init(UA_Session *session);
  25. void UA_Session_delete(UA_Session *session);
  26. void UA_Session_deleteMembers(UA_Session *session);
  27. /** Compares two session objects */
  28. UA_Boolean UA_Session_compare(UA_Session *session1, UA_Session *session2);
  29. /** If any activity on a session happens, the timeout must be extended */
  30. UA_StatusCode UA_Session_updateLifetime(UA_Session *session);
  31. /** Set up the point in time till the session is valid */
  32. UA_StatusCode UA_Session_setExpirationDate(UA_Session *session);
  33. /** Gets the sessions pending lifetime (calculated from the timeout which was set) */
  34. UA_StatusCode UA_Session_getPendingLifetime(UA_Session *session, UA_Double *pendingLifetime);
  35. void UA_Session_detachSecureChannel(UA_Session *session);
  36. /** @} */
  37. #endif /* UA_SESSION_H_ */