Top Fields Constructors Methods
org.bouncycastle.tls

pack-priv Class DTLSRecordLayer

extends Object
implements DatagramTransport
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.DatagramTransport, org.bouncycastle.tls.TlsCloseable, org.bouncycastle.tls.DatagramSender, org.bouncycastle.tls.DatagramReceiver
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .InterruptedIOException, java.net.SocketTimeoutException, org.bouncycastle.tls.crypto.TlsCipher, .TlsDecodeResult, .TlsEncodeResult, .TlsNullNullCipher, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private volatile boolean
private final TlsContext
private DTLSEpoch
private volatile boolean
private TlsHeartbeat
private HeartbeatMessage
private int
private Timeout
private boolean
private Timeout
private volatile boolean
private volatile boolean
private static final int
private final TlsPeer
private DTLSEpoch
private volatile int
private DTLSEpoch
private volatile ProtocolVersion
pack-priv static final int
private final ByteQueue
private DTLSHandshakeRetransmit
private static final long
private DTLSEpoch
private Timeout
private static final long
private final DatagramTransport
private DTLSEpoch
private final Object
private volatile ProtocolVersion

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
private void
pack-priv void
fail(short alertDescription)

pack-priv void
private static long
getMacSequenceNumber(int epoch, long sequence_number)

pack-priv int
pack-priv ProtocolVersion
public int
public int
pack-priv void
pack-priv void
initHeartbeat(TlsHeartbeat heartbeat, boolean heartbeatResponder)

pack-priv void
initPendingEpoch(TlsCipher pendingCipher)

pack-priv boolean
private int
processRecord(int received, byte[] record, byte[] buf, int off, int len, DTLSRecordCallback recordCallback)

private void
raiseAlert(short alertLevel, short alertDescription, String message, Throwable cause)

public int
receive(byte[] buf, int off, int len, int waitMillis)

Implements org.bouncycastle.tls.DatagramReceiver.receive.

pack-priv int
receive(byte[] buf, int off, int len, int waitMillis, DTLSRecordCallback recordCallback)

pack-priv static int
receiveClientHelloRecord(byte[] data, int dataOff, int dataLen)

private int
receiveDatagram(byte[] buf, int off, int len, int waitMillis)

pack-priv int
receivePending(byte[] buf, int off, int len, DTLSRecordCallback recordCallback)

private int
receivePendingRecord(byte[] buf, int off, int len)

private int
receiveRecord(byte[] buf, int off, int len, int waitMillis)

pack-priv void
private void
pack-priv void
public void
send(byte[] buf, int off, int len)

Implements org.bouncycastle.tls.DatagramSender.send.

private static void
sendDatagram(DatagramSender sender, byte[] buf, int off, int len)

private void
pack-priv static void
sendHelloVerifyRequestRecord(DatagramSender sender, long recordSeq, byte[] message)

private void
sendRecord(short contentType, byte[] buf, int off, int len)

pack-priv void
setPlaintextLimit(int plaintextLimit)

pack-priv void
pack-priv void
pack-priv void
warn(short alertDescription, String message)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closedback to summary
private volatile boolean closed
contextback to summary
private final TlsContext context
currentEpochback to summary
private DTLSEpoch currentEpoch
failedback to summary
private volatile boolean failed
heartbeatback to summary
private TlsHeartbeat heartbeat
heartbeatInFlightback to summary
private HeartbeatMessage heartbeatInFlight
heartbeatResendMillisback to summary
private int heartbeatResendMillis
heartbeatResendTimeoutback to summary
private Timeout heartbeatResendTimeout
heartBeatResponderback to summary
private boolean heartBeatResponder
heartbeatTimeoutback to summary
private Timeout heartbeatTimeout
inConnectionback to summary
private volatile boolean inConnection
inHandshakeback to summary
private volatile boolean inHandshake
MAX_FRAGMENT_LENGTHback to summary
private static final int MAX_FRAGMENT_LENGTH
peerback to summary
private final TlsPeer peer
pendingEpochback to summary
private DTLSEpoch pendingEpoch
plaintextLimitback to summary
private volatile int plaintextLimit
readEpochback to summary
private DTLSEpoch readEpoch
readVersionback to summary
private volatile ProtocolVersion readVersion
RECORD_HEADER_LENGTHback to summary
pack-priv static final int RECORD_HEADER_LENGTH
recordQueueback to summary
private final ByteQueue recordQueue
retransmitback to summary
private DTLSHandshakeRetransmit retransmit
RETRANSMIT_TIMEOUTback to summary
private static final long RETRANSMIT_TIMEOUT
retransmitEpochback to summary
private DTLSEpoch retransmitEpoch
retransmitTimeoutback to summary
private Timeout retransmitTimeout
TCP_MSLback to summary
private static final long TCP_MSL
transportback to summary
private final DatagramTransport transport
writeEpochback to summary
private DTLSEpoch writeEpoch
writeLockback to summary
private final Object writeLock
writeVersionback to summary
private volatile ProtocolVersion writeVersion

Constructor Detail

DTLSRecordLayerback to summary
pack-priv DTLSRecordLayer(TlsContext context, TlsPeer peer, DatagramTransport transport)

Method Detail

closeback to summary
public void close() throws IOException

Implements org.bouncycastle.tls.TlsCloseable.close.

closeTransportback to summary
private void closeTransport()
failback to summary
pack-priv void fail(short alertDescription)
failedback to summary
pack-priv void failed()
getMacSequenceNumberback to summary
private static long getMacSequenceNumber(int epoch, long sequence_number)
getReadEpochback to summary
pack-priv int getReadEpoch()
getReadVersionback to summary
pack-priv ProtocolVersion getReadVersion()
getReceiveLimitback to summary
public int getReceiveLimit() throws IOException

Implements org.bouncycastle.tls.DatagramReceiver.getReceiveLimit.

getSendLimitback to summary
public int getSendLimit() throws IOException

Implements org.bouncycastle.tls.DatagramSender.getSendLimit.

handshakeSuccessfulback to summary
pack-priv void handshakeSuccessful(DTLSHandshakeRetransmit retransmit)
initHeartbeatback to summary
pack-priv void initHeartbeat(TlsHeartbeat heartbeat, boolean heartbeatResponder)
initPendingEpochback to summary
pack-priv void initPendingEpoch(TlsCipher pendingCipher)
isClosedback to summary
pack-priv boolean isClosed()
processRecordback to summary
private int processRecord(int received, byte[] record, byte[] buf, int off, int len, DTLSRecordCallback recordCallback) throws IOException
raiseAlertback to summary
private void raiseAlert(short alertLevel, short alertDescription, String message, Throwable cause) throws IOException
receiveback to summary
public int receive(byte[] buf, int off, int len, int waitMillis) throws IOException

Implements org.bouncycastle.tls.DatagramReceiver.receive.

receiveback to summary
pack-priv int receive(byte[] buf, int off, int len, int waitMillis, DTLSRecordCallback recordCallback) throws IOException
receiveClientHelloRecordback to summary
pack-priv static int receiveClientHelloRecord(byte[] data, int dataOff, int dataLen) throws IOException
receiveDatagramback to summary
private int receiveDatagram(byte[] buf, int off, int len, int waitMillis) throws IOException
receivePendingback to summary
pack-priv int receivePending(byte[] buf, int off, int len, DTLSRecordCallback recordCallback) throws IOException
receivePendingRecordback to summary
private int receivePendingRecord(byte[] buf, int off, int len) throws IOException
receiveRecordback to summary
private int receiveRecord(byte[] buf, int off, int len, int waitMillis) throws IOException
resetAfterHelloVerifyRequestServerback to summary
pack-priv void resetAfterHelloVerifyRequestServer(long recordSeq)
resetHeartbeatback to summary
private void resetHeartbeat()
resetWriteEpochback to summary
pack-priv void resetWriteEpoch()
sendback to summary
public void send(byte[] buf, int off, int len) throws IOException

Implements org.bouncycastle.tls.DatagramSender.send.

sendDatagramback to summary
private static void sendDatagram(DatagramSender sender, byte[] buf, int off, int len) throws IOException
sendHeartbeatMessageback to summary
private void sendHeartbeatMessage(HeartbeatMessage heartbeatMessage) throws IOException
sendHelloVerifyRequestRecordback to summary
pack-priv static void sendHelloVerifyRequestRecord(DatagramSender sender, long recordSeq, byte[] message) throws IOException
sendRecordback to summary
private void sendRecord(short contentType, byte[] buf, int off, int len) throws IOException
setPlaintextLimitback to summary
pack-priv void setPlaintextLimit(int plaintextLimit)
setReadVersionback to summary
pack-priv void setReadVersion(ProtocolVersion readVersion)
setWriteVersionback to summary
pack-priv void setWriteVersion(ProtocolVersion writeVersion)
warnback to summary
pack-priv void warn(short alertDescription, String message) throws IOException