public class DtlsPacketTransformer extends java.lang.Object implements PacketTransformer
PacketTransformer
for DTLS-SRTP. It's capable of working
in pure DTLS mode if appropriate flag was set in DtlsControlImpl.Modifier and Type | Field and Description |
---|---|
(package private) static int |
DTLS_RECORD_HEADER_LENGTH
The length of the header of a DTLS record.
|
Constructor and Description |
---|
DtlsPacketTransformer(DtlsTransformEngine transformEngine,
int componentID)
Initializes a new DtlsPacketTransformer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this PacketTransformer i.e.
|
(package private) DtlsControlImpl |
getDtlsControl()
Gets the DtlsControl implementation associated with this
instance.
|
(package private) Properties |
getProperties()
Gets the properties of
DtlsControlImpl and their values which
the associated DtlsControlImpl shares with this instance. |
(package private) DtlsTransformEngine |
getTransformEngine()
Gets the TransformEngine which has initialized this instance.
|
static boolean |
isDtlsRecord(byte[] buf,
int off,
int len)
Determines whether a specific array of bytes appears to contain
a DTLS record.
|
(package private) void |
notifyAlertRaised(org.bouncycastle.crypto.tls.TlsPeer tlsPeer,
short alertLevel,
short alertDescription,
java.lang.String message,
java.lang.Throwable cause)
Notifies this instance that the DTLS record layer associated with a
specific TlsPeer has raised an alert.
|
RawPacket[] |
reverseTransform(RawPacket[] pkts)
Reverse-transforms each packet in an array of packets.
|
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.
|
(package private) void |
setRtcpmux(boolean rtcpmux)
Enables/disables rtcp-mux.
|
RawPacket[] |
transform(RawPacket[] pkts)
Transforms each packet in an array of packets.
|
static final int DTLS_RECORD_HEADER_LENGTH
public DtlsPacketTransformer(DtlsTransformEngine transformEngine, int componentID)
transformEngine
- the TransformEngine which is initializing
the new instancecomponentID
- the ID of the component for which the new instance is
to workpublic static boolean isDtlsRecord(byte[] buf, int off, int len)
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 analyzedpublic void close()
close
in interface PacketTransformer
DtlsControlImpl getDtlsControl()
Properties getProperties()
DtlsControlImpl
and their values which
the associated DtlsControlImpl
shares with this instance.DtlsControlImpl
and their values which
the associated DtlsControlImpl
shares with this instanceDtlsTransformEngine getTransformEngine()
void notifyAlertRaised(org.bouncycastle.crypto.tls.TlsPeer tlsPeer, short alertLevel, short alertDescription, java.lang.String message, java.lang.Throwable cause)
tlsPeer
- the TlsPeer whose associated DTLS record layer
has raised an alertalertLevel
- AlertLevel
alertDescription
- AlertDescription
message
- a human-readable message explaining what caused the alert.
May be null.cause
- the exception that caused the alert to be raised. May be
null.public RawPacket[] reverseTransform(RawPacket[] pkts)
reverseTransform
in interface PacketTransformer
pkts
- the transformed packets to be restored.public void sendApplicationData(byte[] buf, int off, int len)
buf
- the byte array containing data to send.off
- the offset in buf where the data begins.len
- the length of data to send.void setRtcpmux(boolean rtcpmux)
rtcpmux
- true
to enable rtcp-mux or false
to
disable it.public RawPacket[] transform(RawPacket[] pkts)
transform
in interface PacketTransformer
pkts
- the packets to be transformed
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.