ua_services_securechannel.c 1.0 KB

1234567891011121314151617181920
  1. #include "ua_services.h"
  2. #include "ua_securechannel_manager.h"
  3. void Service_OpenSecureChannel(UA_Server *server, UA_Connection *connection,
  4. const UA_OpenSecureChannelRequest *request,
  5. UA_OpenSecureChannelResponse *response) {
  6. // todo: if(request->clientProtocolVersion != protocolVersion)
  7. if(request->requestType == UA_SECURITYTOKEN_ISSUE)
  8. UA_SecureChannelManager_open(server->secureChannelManager, connection, request, response);
  9. else
  10. UA_SecureChannelManager_renew(server->secureChannelManager, connection, request, response);
  11. }
  12. void Service_CloseSecureChannel(UA_Server *server, UA_SecureChannel *channel,
  13. const UA_CloseSecureChannelRequest *request,
  14. UA_CloseSecureChannelResponse *response) {
  15. UA_SecureChannelManager_close(server->secureChannelManager, channel->securityToken.channelId);
  16. // 62451 Part 6 Chapter 7.1.4 - The server does not send a CloseSecureChannel response
  17. }