opcua_connectionHelper.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 buffer_t
  27. {
  28. UInt32 recvBufferSize;
  29. UInt32 sendBufferSize;
  30. UInt32 protocolVersion;
  31. UInt32 maxMessageSize;
  32. UInt32 maxChunkCount;
  33. }TL_buffer;
  34. struct TL_connection
  35. {
  36. Int32 socket;
  37. UInt32 connectionState;
  38. TL_buffer clientConf;
  39. TL_buffer serverConf;
  40. UA_String endpointURL;
  41. };
  42. struct SL_connection
  43. {
  44. T_ApplicationInstanceCertificate clientCertificate;
  45. UInt32 requestType;
  46. UA_String secureChannelId;
  47. UInt32 UInt32_secureChannelId;
  48. UInt32 securityMode;
  49. UA_String clientNonce;
  50. UA_Duration requestedLifetime; /// life time of the secure channel
  51. UA_DateTime requestedAt; /// Point in time in which the secure channel was requested
  52. UInt32 connectionState;
  53. UInt32 tokenId;
  54. UInt32 revisedLifetime;
  55. };
  56. struct SS_connection
  57. {
  58. };
  59. typedef struct UA_connection_t
  60. {
  61. struct TL_connection transportLayer;
  62. struct SL_connection secureLayer;
  63. struct SS_connection serviceLayer;
  64. }UA_connection;
  65. #endif /* OPCUA_CONNECTIONHELPER_H_ */