ua_session.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_String sessionName;
  21. UA_NodeId authenticationToken;
  22. UA_NodeId sessionId;
  23. UA_UInt32 maxRequestMessageSize;
  24. UA_UInt32 maxResponseMessageSize;
  25. UA_Int64 timeout;
  26. UA_DateTime validTill;
  27. UA_SecureChannel *channel;
  28. LIST_HEAD(ContinuationPointList, ContinuationPointEntry) continuationPoints;
  29. };
  30. extern UA_Session anonymousSession; ///< If anonymous access is allowed, this session is used internally (Session ID: 0)
  31. extern UA_Session adminSession; ///< Local access to the services (for startup and maintenance) uses this Session with all possible access rights (Session ID: 1)
  32. void UA_Session_init(UA_Session *session);
  33. void UA_Session_deleteMembers(UA_Session *session);
  34. /** If any activity on a session happens, the timeout must be extended */
  35. UA_StatusCode UA_Session_updateLifetime(UA_Session *session);
  36. /** Set up the point in time till the session is valid */
  37. UA_StatusCode UA_Session_setExpirationDate(UA_Session *session);
  38. /** Gets the sessions pending lifetime (calculated from the timeout which was set) */
  39. UA_StatusCode UA_Session_getPendingLifetime(UA_Session *session, UA_Double *pendingLifetime);
  40. void UA_Session_detachSecureChannel(UA_Session *session);
  41. /** @} */
  42. #endif /* UA_SESSION_H_ */