<opc:TypeDictionary
  xmlns:opc="http://opcfoundation.org/BinarySchema/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ua="http://opcfoundation.org/UA/"
  xmlns:tns="http://opcfoundation.org/UA/"
  DefaultByteOrder="LittleEndian"
  TargetNamespace="http://opcfoundation.org/UA/"
>

  <opc:Import Namespace="http://opcfoundation.org/BinarySchema/" />

<!-- Transport types begin  -->

  <opc:EnumeratedType Name="MessageType" LengthInBits="32">
    <opc:Documentation>Message Type and whether the message contains an intermediate chunk</opc:Documentation>
    <opc:EnumeratedValue Name="ACK" Value="0x4B4341" />
    <opc:EnumeratedValue Name="HEL" Value="0x4C4548" />
    <opc:EnumeratedValue Name="MSG" Value="0x47534D" />
    <opc:EnumeratedValue Name="OPN" Value="0x4E504F" />
    <opc:EnumeratedValue Name="CLO" Value="0x4F4C43" />
    <opc:EnumeratedValue Name="ERR" Value="0x525245" />
  </opc:EnumeratedType>
  
  <opc:EnumeratedType Name="ChunkType" LengthInBits="32">
    <opc:Documentation>Type of the chunk</opc:Documentation>
    <opc:EnumeratedValue Name="FINAL" Value="0x46000000" />
    <opc:EnumeratedValue Name="INTERMEDIATE" Value="0x43000000" />
    <opc:EnumeratedValue Name="ABORT" Value="0x41000000" />

  </opc:EnumeratedType>

   <opc:StructuredType Name="TcpMessageHeader">
    <opc:Documentation>TCP Header</opc:Documentation>
    <opc:Field Name="MessageTypeAndChunkType" TypeName="opc:UInt32" />
    <opc:Field Name="MessageSize" TypeName="opc:UInt32" />
  </opc:StructuredType>
  
   <opc:StructuredType Name="TcpHelloMessage">
    <opc:Documentation>Hello Message</opc:Documentation>
    <opc:Field Name="ProtocolVersion" TypeName="opc:UInt32" />
    <opc:Field Name="ReceiveBufferSize" TypeName="opc:UInt32" />
    <opc:Field Name="SendBufferSize" TypeName="opc:UInt32" />
    <opc:Field Name="MaxMessageSize" TypeName="opc:UInt32" />
	<opc:Field Name="MaxChunkCount" TypeName="opc:UInt32" />
    <opc:Field Name="EndpointUrl" TypeName="opc:String" />
  </opc:StructuredType>
  
   <opc:StructuredType Name="TcpAcknowledgeMessage">
    <opc:Documentation>Acknowledge Message</opc:Documentation>
    <opc:Field Name="ProtocolVersion" TypeName="opc:UInt32" />
    <opc:Field Name="ReceiveBufferSize" TypeName="opc:UInt32" />
    <opc:Field Name="SendBufferSize" TypeName="opc:UInt32" />
    <opc:Field Name="MaxMessageSize" TypeName="opc:UInt32" />
	<opc:Field Name="MaxChunkCount" TypeName="opc:UInt32" />
  </opc:StructuredType>

  <opc:StructuredType Name="TcpErrorMessage">
    <opc:Documentation>Error Message</opc:Documentation>
    <opc:Field Name="Error" TypeName="opc:UInt32" />
    <opc:Field Name="Reason" TypeName="opc:String" />
  </opc:StructuredType>
  
  <opc:StructuredType Name="SecureConversationMessageHeader">
    <opc:Documentation>Secure Layer Sequence Header</opc:Documentation>
    <opc:Field Name="MessageHeader" TypeName="opc:TcpMessageHeader" />
    <opc:Field Name="SecureChannelId" TypeName="opc:UInt32" />
  </opc:StructuredType>
  
  <opc:StructuredType Name="AsymmetricAlgorithmSecurityHeader">
    <opc:Documentation>Security Header</opc:Documentation>
    <opc:Field Name="SecurityPolicyUri" TypeName="opc:ByteString" />
    <opc:Field Name="SenderCertificate" TypeName="opc:ByteString" />
    <opc:Field Name="ReceiverCertificateThumbprint" TypeName="opc:ByteString" />
  </opc:StructuredType>
  
  <opc:StructuredType Name="SymmetricAlgorithmSecurityHeader">
    <opc:Documentation>Secure Layer Symmetric Algorithm Header</opc:Documentation>
    <opc:Field Name="TokenId" TypeName="opc:UInt32" />
  </opc:StructuredType>
  
  <opc:StructuredType Name="SequenceHeader">
    <opc:Documentation>Secure Layer Sequence Header</opc:Documentation>
    <opc:Field Name="SequenceNumber" TypeName="opc:UInt32" />
    <opc:Field Name="RequestId" TypeName="opc:UInt32"/>
  </opc:StructuredType>
  
  <opc:StructuredType Name="SecureConversationMessageFooter">
    <opc:Documentation>Secure Conversation Message Footer</opc:Documentation>
    <opc:Field Name="PaddingSize" TypeName="opc:Byte" />
    <opc:Field Name="Padding" TypeName="opc:Byte" LengthField="PaddingSize" />
    <opc:Field Name="Signature" TypeName="opc:Byte"/>
  </opc:StructuredType>
  
  <opc:StructuredType Name="SecureConversationMessageAbortBody">
    <opc:Documentation>Secure Conversation Message Abort Body</opc:Documentation>
    <opc:Field Name="Error" TypeName="opc:UInt32" />
    <opc:Field Name="Reason" TypeName="opc:String" />
  </opc:StructuredType>
 
<!-- Transport types end -->

</opc:TypeDictionary>