ua_transport_binary.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef OPCUA_TRANSPORT_BINARY_H_
  2. #define OPCUA_TRANSPORT_BINARY_H_
  3. #include <stdio.h>
  4. #include "opcua.h"
  5. #include "ua_transport_binary.h"
  6. //transport errors begin at 1000
  7. #define UA_ERROR_MULTIPLE_HEL 1000
  8. #define UA_ERROR_RCV_ERROR 1001
  9. //variables which belong to layer
  10. #define TL_SERVER_PROTOCOL_VERSION 0
  11. #define TL_SERVER_MAX_CHUNK_COUNT 1
  12. #define TL_SERVER_MAX_MESSAGE_SIZE 8192
  13. typedef struct {
  14. UA_UInt32 protocolVersion;
  15. UA_UInt32 sendBufferSize;
  16. UA_UInt32 recvBufferSize;
  17. UA_UInt32 maxMessageSize;
  18. UA_UInt32 maxChunkCount;
  19. } TL_Buffer;
  20. /* Transport Layer Connection */
  21. struct TL_Connection_T; // forward declaration
  22. typedef UA_Int32 (*TL_Writer)(struct TL_Connection_T* connection, const UA_ByteString** gather_bufs, UA_Int32 gather_len); // send mutiple buffer concatenated into one msg (zero copy)
  23. typedef struct TL_Connection_T {
  24. UA_Int32 connectionHandle;
  25. UA_UInt32 connectionState;
  26. TL_Buffer localConf;
  27. TL_Buffer remoteConf;
  28. TL_Writer writerCallback;
  29. UA_String localEndpointUrl;
  30. UA_String remoteEndpointUrl;
  31. struct SL_Channel_T* secureChannel;
  32. } TL_Connection;
  33. UA_Int32 TL_Send(TL_Connection* connection, const UA_ByteString** gather_buf, UA_UInt32 gather_len);
  34. UA_Int32 TL_Process(TL_Connection *connection, const UA_ByteString *packet);
  35. #endif /* OPCUA_TRANSPORT_BINARY_H_ */