ua_session.h 1.8 KB

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