public class DtlsHandler extends Object implements PacketHandler, org.bouncycastle.crypto.tls.DatagramTransport
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MTU |
static int |
MAX_DELAY |
Constructor and Description |
---|
DtlsHandler(DtlsSrtpServerProvider tlsServerProvider) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(DtlsListener listener) |
boolean |
canHandle(byte[] packet) |
boolean |
canHandle(byte[] packet,
int dataLength,
int offset) |
void |
close() |
int |
compareTo(PacketHandler o) |
byte[] |
decodeRTCP(byte[] packet,
int offset,
int length)
Decodes an RTCP Packet
|
byte[] |
decodeRTP(byte[] packet,
int offset,
int length)
Decodes an RTP Packet
|
byte[] |
encodeRTCP(byte[] packet,
int offset,
int length)
Encodes an RTCP packet
|
byte[] |
encodeRTP(byte[] packet,
int offset,
int length)
Encodes an RTP packet
|
String |
getLocalFingerprint() |
String |
getLocalHashFunction() |
int |
getPipelinePriority() |
int |
getReceiveLimit() |
String |
getRemoteFingerprint() |
String |
getRemoteFingerprintValue() |
String |
getRemoteHashFunction() |
int |
getSendLimit() |
PacketTransformer |
getSrtcpDecoder() |
PacketTransformer |
getSrtcpEncoder() |
PacketTransformer |
getSrtpDecoder() |
PacketTransformer |
getSrtpEncoder() |
byte[] |
handle(byte[] packet,
InetSocketAddress localPeer,
InetSocketAddress remotePeer) |
byte[] |
handle(byte[] packet,
int dataLength,
int offset,
InetSocketAddress localPeer,
InetSocketAddress remotePeer) |
void |
handshake() |
boolean |
isHandshakeComplete() |
boolean |
isHandshakeFailed() |
boolean |
isHandshaking() |
int |
receive(byte[] buf,
int off,
int len,
int waitMillis) |
void |
reset() |
void |
resetLocalFingerprint() |
void |
send(byte[] buf,
int off,
int len) |
void |
setChannel(DatagramChannel channel) |
void |
setPipelinePriority(int pipelinePriority) |
void |
setRemoteFingerprint(String hashFunction,
String fingerprint) |
public static final int DEFAULT_MTU
public static final int MAX_DELAY
public DtlsHandler(DtlsSrtpServerProvider tlsServerProvider)
public void setChannel(DatagramChannel channel)
public void addListener(DtlsListener listener)
public boolean isHandshakeComplete()
public boolean isHandshakeFailed()
public boolean isHandshaking()
public String getLocalFingerprint()
public void resetLocalFingerprint()
public String getLocalHashFunction()
public String getRemoteHashFunction()
public String getRemoteFingerprintValue()
public String getRemoteFingerprint()
public PacketTransformer getSrtpDecoder()
public PacketTransformer getSrtpEncoder()
public PacketTransformer getSrtcpDecoder()
public PacketTransformer getSrtcpEncoder()
public byte[] decodeRTP(byte[] packet, int offset, int length)
packet
- The encoded RTP packetpublic byte[] encodeRTP(byte[] packet, int offset, int length)
packet
- The decoded RTP packetpublic byte[] decodeRTCP(byte[] packet, int offset, int length)
packet
- The encoded RTP packetpublic byte[] encodeRTCP(byte[] packet, int offset, int length)
packet
- The decoded RTP packetpublic void handshake()
public void reset()
public int compareTo(PacketHandler o)
compareTo
in interface Comparable<PacketHandler>
public boolean canHandle(byte[] packet)
canHandle
in interface PacketHandler
public boolean canHandle(byte[] packet, int dataLength, int offset)
canHandle
in interface PacketHandler
public byte[] handle(byte[] packet, InetSocketAddress localPeer, InetSocketAddress remotePeer) throws PacketHandlerException
handle
in interface PacketHandler
PacketHandlerException
public byte[] handle(byte[] packet, int dataLength, int offset, InetSocketAddress localPeer, InetSocketAddress remotePeer) throws PacketHandlerException
handle
in interface PacketHandler
PacketHandlerException
public int getPipelinePriority()
getPipelinePriority
in interface PacketHandler
public void setPipelinePriority(int pipelinePriority)
public int getReceiveLimit() throws IOException
getReceiveLimit
in interface org.bouncycastle.crypto.tls.DatagramTransport
IOException
public int getSendLimit() throws IOException
getSendLimit
in interface org.bouncycastle.crypto.tls.DatagramTransport
IOException
public int receive(byte[] buf, int off, int len, int waitMillis) throws IOException
receive
in interface org.bouncycastle.crypto.tls.DatagramTransport
IOException
public void send(byte[] buf, int off, int len) throws IOException
send
in interface org.bouncycastle.crypto.tls.DatagramTransport
IOException
public void close() throws IOException
close
in interface org.bouncycastle.crypto.tls.DatagramTransport
IOException
Copyright © 2017 TeleStax, Inc.. All Rights Reserved.