opcua_connectionHelper.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * opcua_connectionHelper.h
  3. *
  4. * Created on: Jan 13, 2014
  5. * Author: opcua
  6. */
  7. #ifndef OPCUA_CONNECTIONHELPER_H_
  8. #define OPCUA_CONNECTIONHELPER_H_
  9. #include "opcua_builtInDatatypes.h"
  10. #include "opcua_types.h"
  11. enum packetType
  12. {
  13. packetType_HEL,
  14. packetType_ACK,
  15. packetType_ERR,
  16. packetType_OPN,
  17. packetType_MSG,
  18. packetType_CLO
  19. };
  20. enum connectionState
  21. {
  22. connectionState_CLOSED,
  23. connectionState_OPENING,
  24. connectionState_ESTABLISHED,
  25. };
  26. typedef struct
  27. {
  28. UInt32 secureChannelId;
  29. UInt32 tokenId;
  30. UA_DateTime createdAt;
  31. Int32 revisedLifetime;
  32. }SL_ChannelSecurityToken;
  33. typedef struct
  34. {
  35. UInt32 recvBufferSize;
  36. UInt32 sendBufferSize;
  37. UInt32 protocolVersion;
  38. UInt32 maxMessageSize;
  39. UInt32 maxChunkCount;
  40. }TL_buffer;
  41. struct TL_connection
  42. {
  43. Int32 socket;
  44. UInt32 connectionState;
  45. TL_buffer remoteConf;
  46. TL_buffer localConf;
  47. UA_String endpointURL;
  48. };
  49. struct SL_connection
  50. {
  51. T_ApplicationInstanceCertificate clientCertificate;
  52. UInt32 requestType;
  53. UA_String secureChannelId;
  54. UInt32 UInt32_secureChannelId;
  55. UInt32 securityMode;
  56. UA_ByteString clientNonce;
  57. UInt32 connectionState;
  58. SL_ChannelSecurityToken securityToken;
  59. };
  60. struct SS_connection
  61. {
  62. };
  63. typedef struct
  64. {
  65. struct TL_connection transportLayer;
  66. struct SL_connection secureLayer;
  67. struct SS_connection serviceLayer;
  68. }UA_connection;
  69. #endif /* OPCUA_CONNECTIONHELPER_H_ */