ua_services_securechannel.c 849 B

123456789101112131415161718192021222324252627
  1. #include "ua_services.h"
  2. #include "ua_transport_binary_secure.h"
  3. UA_Int32 Service_OpenSecureChannel(SL_Channel *channel,
  4. const UA_OpenSecureChannelRequest* request,
  5. UA_OpenSecureChannelResponse* response)
  6. {
  7. UA_Int32 retval = UA_SUCCESS;
  8. SL_channelState channelState;
  9. //channel takes care of opening process
  10. retval |= SL_Channel_processOpenRequest(channel, request,response);
  11. retval |= SL_Channel_getState(channel, &channelState);
  12. return retval;
  13. }
  14. UA_Int32 Service_CloseSecureChannel(SL_Channel *channel, const UA_CloseSecureChannelRequest *request,
  15. UA_CloseSecureChannelResponse *response)
  16. {
  17. UA_Int32 retval = UA_SUCCESS;
  18. UA_UInt32 channelId;
  19. SL_Channel_getChannelId(channel,&channelId);
  20. SL_ChannelManager_removeChannel(channelId);
  21. // 62451 Part 6 Chapter 7.1.4 - The server does not send a CloseSecureChannel response
  22. return retval;
  23. }