ua_session.h 1.7 KB

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