class InboundEstablishState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
InboundEstablishState.InboundState |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
_aliceIP |
protected int |
_alicePort |
protected byte[] |
_bobIP |
protected int |
_bobPort |
protected RouterContext |
_context |
protected int |
_createdSentCount |
protected InboundEstablishState.InboundState |
_currentState |
protected long |
_establishBegin |
protected boolean |
_introductionRequested |
protected long |
_lastSend |
protected Log |
_log |
protected long |
_nextSend |
protected RouterIdentity |
_receivedConfirmedIdentity |
protected RouterIdentity |
_receivedUnconfirmedIdentity |
protected RemoteHostId |
_remoteHostId |
protected int |
_rtt |
protected long |
_sentRelayTag |
protected static long |
MAX_DELAY
max delay including backoff
This should be a little shorter than for outbound.
|
protected static long |
RETRANSMIT_DELAY
basic delay before backoff
Transmissions at 0, 1, 3, 7 sec
This should be a little shorter than for outbound.
|
Modifier | Constructor and Description |
---|---|
protected |
InboundEstablishState(RouterContext ctx,
InetSocketAddress addr)
For SSU2
|
Modifier and Type | Method and Description |
---|---|
void |
addMessage(OutNetMessage msg)
Queue a message to be sent after the session is established.
|
void |
complete()
Notify successful completion
|
protected boolean |
confirmedFullyReceived()
Have we fully received the SessionConfirmed messages from Alice?
Caller must synch on this.
|
void |
createdPacketSent()
note that we just sent a SessionCreated packet
|
void |
fail() |
RouterIdentity |
getConfirmedIdentity()
Who is Alice (null if forged/unknown)
Note that this isn't really confirmed - see below.
|
long |
getEstablishBeginTime() |
long |
getLifetime()
how long have we been trying to establish this session?
|
long |
getLifetime(long now)
how long have we been trying to establish this session?
|
OutNetMessage |
getNextQueuedMessage()
Pull from the message queue
|
long |
getNextSendTime() |
byte[] |
getReceivedOurIP() |
byte[] |
getReceivedX() |
(package private) RemoteHostId |
getRemoteHostId()
RemoteHostId, uniquely identifies an attempt
|
(package private) int |
getRTT() |
byte[] |
getSentIP()
what IP do they appear to be on?
|
int |
getSentPort()
what port number do they appear to be coming from?
|
long |
getSentRelayTag() |
long |
getSentSignedOnTime() |
InboundEstablishState.InboundState |
getState() |
int |
getVersion() |
boolean |
isComplete() |
boolean |
isIntroductionRequested()
True (default) if no extended options in session request,
or value of flag bit in the extended options.
|
protected void |
packetReceived()
Call from synchronized method only
|
boolean |
sessionRequestReceived() |
void |
setSentRelayTag(long tag) |
String |
toString() |
protected final RouterContext _context
protected final Log _log
protected byte[] _bobIP
protected final int _bobPort
protected final byte[] _aliceIP
protected final int _alicePort
protected long _sentRelayTag
protected RouterIdentity _receivedUnconfirmedIdentity
protected RouterIdentity _receivedConfirmedIdentity
protected final long _establishBegin
protected long _lastSend
protected long _nextSend
protected final RemoteHostId _remoteHostId
protected InboundEstablishState.InboundState _currentState
protected int _createdSentCount
protected boolean _introductionRequested
protected int _rtt
protected static final long RETRANSMIT_DELAY
protected static final long MAX_DELAY
protected InboundEstablishState(RouterContext ctx, InetSocketAddress addr)
public int getVersion()
public InboundEstablishState.InboundState getState()
public boolean isComplete()
public void complete()
public void addMessage(OutNetMessage msg)
public OutNetMessage getNextQueuedMessage()
public boolean sessionRequestReceived()
public byte[] getReceivedX()
public byte[] getReceivedOurIP()
public boolean isIntroductionRequested()
public byte[] getSentIP()
public int getSentPort()
public void fail()
public long getSentRelayTag()
public void setSentRelayTag(long tag)
public long getSentSignedOnTime()
public void createdPacketSent()
public long getLifetime()
public long getLifetime(long now)
public long getEstablishBeginTime()
public long getNextSendTime()
int getRTT()
RemoteHostId getRemoteHostId()
protected boolean confirmedFullyReceived()
public RouterIdentity getConfirmedIdentity()
protected void packetReceived()