ua_securechannel_manager.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include "ua_util.h"
  7. #include "ua_server.h"
  8. #include "ua_securechannel.h"
  9. #include "queue.h"
  10. typedef struct channel_list_entry {
  11. UA_SecureChannel channel;
  12. LIST_ENTRY(channel_list_entry) pointers;
  13. } channel_list_entry;
  14. typedef struct UA_SecureChannelManager {
  15. LIST_HEAD(channel_list, channel_list_entry) channels; // doubly-linked list of channels
  16. UA_UInt32 currentChannelCount;
  17. UA_UInt32 lastChannelId;
  18. UA_UInt32 lastTokenId;
  19. UA_Server *server;
  20. } UA_SecureChannelManager;
  21. UA_StatusCode
  22. UA_SecureChannelManager_init(UA_SecureChannelManager *cm, UA_Server *server);
  23. /* Remove a all securechannels */
  24. void
  25. UA_SecureChannelManager_deleteMembers(UA_SecureChannelManager *cm);
  26. /* Remove timed out securechannels with a delayed callback. So all currently
  27. * scheduled jobs with a pointer to a securechannel can finish first. */
  28. void
  29. UA_SecureChannelManager_cleanupTimedOut(UA_SecureChannelManager *cm,
  30. UA_DateTime nowMonotonic);
  31. UA_StatusCode
  32. UA_SecureChannelManager_open(UA_SecureChannelManager *cm, UA_Connection *conn,
  33. const UA_OpenSecureChannelRequest *request,
  34. UA_OpenSecureChannelResponse *response);
  35. UA_StatusCode
  36. UA_SecureChannelManager_renew(UA_SecureChannelManager *cm, UA_Connection *conn,
  37. const UA_OpenSecureChannelRequest *request,
  38. UA_OpenSecureChannelResponse *response);
  39. UA_SecureChannel *
  40. UA_SecureChannelManager_get(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  41. UA_StatusCode
  42. UA_SecureChannelManager_close(UA_SecureChannelManager *cm, UA_UInt32 channelId);
  43. #endif /* UA_CHANNEL_MANAGER_H_ */