ua_session.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef UA_SESSION_H_
  2. #define UA_SESSION_H_
  3. #include "queue.h"
  4. #include "ua_types.h"
  5. #include "ua_securechannel.h"
  6. #include "ua_server.h"
  7. #define MAXCONTINUATIONPOINTS 5
  8. #ifdef ENABLE_SUBSCRIPTIONS
  9. #include "server/ua_subscription_manager.h"
  10. #endif
  11. /**
  12. * @ingroup communication
  13. *
  14. * @{
  15. */
  16. struct ContinuationPointEntry {
  17. LIST_ENTRY(ContinuationPointEntry) pointers;
  18. UA_ByteString identifier;
  19. UA_BrowseDescription browseDescription;
  20. UA_Int32 continuationIndex;
  21. UA_UInt32 maxReferences;
  22. };
  23. struct UA_Session {
  24. UA_ApplicationDescription clientDescription;
  25. UA_Boolean activated;
  26. UA_String sessionName;
  27. UA_NodeId authenticationToken;
  28. UA_NodeId sessionId;
  29. UA_UInt32 maxRequestMessageSize;
  30. UA_UInt32 maxResponseMessageSize;
  31. UA_Int64 timeout; // [ms]
  32. UA_DateTime validTill;
  33. #ifdef ENABLE_SUBSCRIPTIONS
  34. UA_SubscriptionManager subscriptionManager;
  35. #endif
  36. UA_SecureChannel *channel;
  37. UA_UInt16 availableContinuationPoints;
  38. LIST_HEAD(ContinuationPointList, ContinuationPointEntry) continuationPoints;
  39. };
  40. extern UA_Session anonymousSession; ///< If anonymous access is allowed, this session is used internally (Session ID: 0)
  41. extern UA_Session adminSession; ///< Local access to the services (for startup and maintenance) uses this Session with all possible access rights (Session ID: 1)
  42. void UA_Session_init(UA_Session *session);
  43. void UA_Session_deleteMembersCleanup(UA_Session *session, UA_Server *server);
  44. /** If any activity on a session happens, the timeout is extended */
  45. void UA_Session_updateLifetime(UA_Session *session);
  46. /** @} */
  47. #endif /* UA_SESSION_H_ */