ua_securechannel_manager.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef UA_CHANNEL_MANAGER_H_
  2. #define UA_CHANNEL_MANAGER_H_
  3. #ifdef _WIN32
  4. # include "../deps/queue.h"
  5. #else
  6. # include <sys/queue.h>
  7. #endif
  8. #include "ua_server.h"
  9. #include "ua_securechannel.h"
  10. #include "ua_util.h"
  11. typedef struct UA_SecureChannelManager {
  12. LIST_HEAD(channel_list, channel_list_entry) channels; // doubly-linked list of channels
  13. UA_Int32 maxChannelCount;
  14. UA_DateTime maxChannelLifetime;
  15. UA_MessageSecurityMode securityMode;
  16. UA_DateTime channelLifeTime;
  17. UA_Int32 lastChannelId;
  18. UA_UInt32 lastTokenId;
  19. } UA_SecureChannelManager;
  20. UA_StatusCode UA_SecureChannelManager_init(UA_SecureChannelManager *cm, UA_UInt32 maxChannelCount,
  21. UA_UInt32 tokenLifetime, UA_UInt32 startChannelId,
  22. UA_UInt32 startTokenId);
  23. void UA_SecureChannelManager_deleteMembers(UA_SecureChannelManager *cm);
  24. UA_StatusCode UA_SecureChannelManager_open(UA_SecureChannelManager *cm, UA_Connection *conn,
  25. const UA_OpenSecureChannelRequest *request,
  26. UA_OpenSecureChannelResponse *response);
  27. UA_StatusCode UA_SecureChannelManager_renew(UA_SecureChannelManager *cm, UA_Connection *conn,
  28. const UA_OpenSecureChannelRequest *request,
  29. UA_OpenSecureChannelResponse *response);
  30. UA_SecureChannel * UA_SecureChannelManager_get(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  31. UA_StatusCode UA_SecureChannelManager_close(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  32. #endif /* UA_CHANNEL_MANAGER_H_ */