ua_services_securechannel.c 1.0 KB

1234567891011121314151617181920
  1. #include "ua_server_internal.h"
  2. #include "ua_services.h"
  3. #include "ua_securechannel_manager.h"
  4. void Service_OpenSecureChannel(UA_Server *server, UA_Connection *connection,
  5. const UA_OpenSecureChannelRequest *request,
  6. UA_OpenSecureChannelResponse *response) {
  7. // todo: if(request->clientProtocolVersion != protocolVersion)
  8. if(request->requestType == UA_SECURITYTOKENREQUESTTYPE_ISSUE)
  9. UA_SecureChannelManager_open(&server->secureChannelManager, connection, request, response);
  10. else
  11. UA_SecureChannelManager_renew(&server->secureChannelManager, connection, request, response);
  12. }
  13. void Service_CloseSecureChannel(UA_Server *server, UA_Int32 channelId) {
  14. //Sten: this service is a bit assymmetric to OpenSecureChannel since CloseSecureChannelRequest does not contain any indormation
  15. UA_SecureChannelManager_close(&server->secureChannelManager, channelId);
  16. // 62451 Part 6 Chapter 7.1.4 - The server does not send a CloseSecureChannel response
  17. }