ua_securechannel_manager.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef UA_CHANNEL_MANAGER_H_
  5. #define UA_CHANNEL_MANAGER_H_
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. #include "ua_util.h"
  10. #include "ua_server.h"
  11. #include "ua_securechannel.h"
  12. #include "queue.h"
  13. typedef struct channel_list_entry {
  14. UA_SecureChannel channel;
  15. LIST_ENTRY(channel_list_entry) pointers;
  16. } channel_list_entry;
  17. typedef struct UA_SecureChannelManager {
  18. LIST_HEAD(channel_list, channel_list_entry) channels; // doubly-linked list of channels
  19. UA_UInt32 currentChannelCount;
  20. UA_UInt32 lastChannelId;
  21. UA_UInt32 lastTokenId;
  22. UA_Server *server;
  23. } UA_SecureChannelManager;
  24. UA_StatusCode
  25. UA_SecureChannelManager_init(UA_SecureChannelManager *cm, UA_Server *server);
  26. void UA_SecureChannelManager_deleteMembers(UA_SecureChannelManager *cm);
  27. void UA_SecureChannelManager_cleanupTimedOut(UA_SecureChannelManager *cm, UA_DateTime nowMonotonic);
  28. UA_StatusCode
  29. UA_SecureChannelManager_open(UA_SecureChannelManager *cm, UA_Connection *conn,
  30. const UA_OpenSecureChannelRequest *request,
  31. UA_OpenSecureChannelResponse *response);
  32. UA_StatusCode
  33. UA_SecureChannelManager_renew(UA_SecureChannelManager *cm, UA_Connection *conn,
  34. const UA_OpenSecureChannelRequest *request,
  35. UA_OpenSecureChannelResponse *response);
  36. UA_SecureChannel *
  37. UA_SecureChannelManager_get(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  38. UA_StatusCode
  39. UA_SecureChannelManager_close(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  40. #ifdef __cplusplus
  41. } // extern "C"
  42. #endif
  43. #endif /* UA_CHANNEL_MANAGER_H_ */