Class DtlsPacketTransformer
- java.lang.Object
-
- org.jitsi.impl.neomedia.transform.dtls.DtlsPacketTransformer
-
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PacketTransformer
public class DtlsPacketTransformer extends Object implements PacketTransformer, PropertyChangeListener
ImplementsPacketTransformerfor DTLS-SRTP. It's capable of working in pure DTLS mode if appropriate flag was set in DtlsControlImpl.- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description DtlsPacketTransformer(DtlsTransformEngine transformEngine, int componentID)Initializes a new DtlsPacketTransformer instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this PacketTransformer i.e.static booleanisDtlsRecord(byte[] buf, int off, int len)Determines whether a specific array of bytes appears to contain a DTLS record.voidpropertyChange(PropertyChangeEvent ev)RawPacket[]reverseTransform(RawPacket[] pkts)Reverse-transforms each packet in an array of packets.voidsendApplicationData(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.RawPacket[]transform(RawPacket[] pkts)Transforms each packet in an array of packets.
-
-
-
Constructor Detail
-
DtlsPacketTransformer
public DtlsPacketTransformer(DtlsTransformEngine transformEngine, int componentID)
Initializes a new DtlsPacketTransformer instance.- Parameters:
transformEngine- the TransformEngine which is initializing the new instancecomponentID- 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 analyzedoff- the offset within buf at which the analysis is to startlen- 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:
closein interfacePacketTransformer
-
propertyChange
public void propertyChange(PropertyChangeEvent ev)
- Specified by:
propertyChangein interfacePropertyChangeListener
-
reverseTransform
public RawPacket[] reverseTransform(RawPacket[] pkts)
Reverse-transforms each packet in an array of packets. Null values must be ignored.- Specified by:
reverseTransformin interfacePacketTransformer- 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:
transformin interfacePacketTransformer- Parameters:
pkts- the packets to be transformed- Returns:
- the transformed packets
-
-