ua_services_securechannel.c 1.1 KB

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