Class DtlsPacketTransformer

    • Constructor Detail

      • DtlsPacketTransformer

        public DtlsPacketTransformer​(DtlsTransformEngine transformEngine,
                                     int componentID)
        Initializes a new DtlsPacketTransformer instance.
        Parameters:
        transformEngine - the TransformEngine which is initializing the new instance
        componentID - the ID of the component for which the new instance is to work
    • Method Detail

      • isDtlsRecord

        public static boolean isDtlsRecord​(byte[] buf,
                                           int off,
                                           int len)
        Determines whether a specific array of bytes appears to contain a DTLS record.
        Parameters:
        buf - the array of bytes to be analyzed
        off - the offset within buf at which the analysis is to start
        len - the number of bytes within buf starting at off to be analyzed
        Returns:
        true if the specified buf appears to contain a DTLS record
      • close

        public void close()
        Closes this PacketTransformer i.e. releases the resources allocated by it and prepares it for garbage collection.
        Specified by:
        close in interface PacketTransformer
      • reverseTransform

        public RawPacket[] reverseTransform​(RawPacket[] pkts)
        Reverse-transforms each packet in an array of packets. Null values must be ignored.
        Specified by:
        reverseTransform in interface PacketTransformer
        Parameters:
        pkts - the transformed packets to be restored.
        Returns:
        the restored packets.
      • sendApplicationData

        public void sendApplicationData​(byte[] buf,
                                        int off,
                                        int len)
        Sends the data contained in a specific byte array as application data through the DTLS connection of this DtlsPacketTransformer.
        Parameters:
        buf - the byte array containing data to send.
        off - the offset in buf where the data begins.
        len - the length of data to send.
      • transform

        public RawPacket[] transform​(RawPacket[] pkts)
        Transforms each packet in an array of packets. Null values must be ignored.
        Specified by:
        transform in interface PacketTransformer
        Parameters:
        pkts - the packets to be transformed
        Returns:
        the transformed packets