class OutboundEstablishState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OutboundEstablishState.OutboundState |
Constructor and Description |
---|
OutboundEstablishState(RouterContext ctx,
RemoteHostId claimedAddress,
RemoteHostId remoteHostId,
RouterIdentity remotePeer,
boolean allowExtendedOptions,
boolean needIntroduction,
SessionKey introKey,
UDPAddress addr,
DHSessionKeyBuilder.Factory dh) |
Modifier and Type | Method and Description |
---|---|
void |
addMessage(OutNetMessage msg)
Queue a message to be sent after the session is established.
|
boolean |
complete() |
void |
confirmedPacketsSent()
note that we just sent the SessionConfirmed packet
|
void |
dataReceived()
we have received a real data packet, so we're done establishing
|
void |
fail()
The SessionCreated validation failed
|
SessionKey |
getCipherKey() |
(package private) RemoteHostId |
getClaimedAddress()
This will never be a hash-based address.
|
long |
getConfirmedSentTime() |
long |
getEstablishBeginTime() |
SessionKey |
getIntroKey()
Bob's introduction key, as published in the netdb
|
long |
getIntroNonce() |
long |
getIntroSentTime() |
long |
getLifetime()
how long have we been trying to establish this session?
|
SessionKey |
getMACKey() |
OutNetMessage |
getNextQueuedMessage() |
long |
getNextSendTime() |
byte[] |
getReceivedIP() |
int |
getReceivedPort() |
long |
getReceivedRelayTag() |
long |
getReceivedSignedOnTime() |
UDPAddress |
getRemoteAddress() |
(package private) RemoteHostId |
getRemoteHostId()
This should be what the state is currently indexed by in the _outboundStates table.
|
RouterIdentity |
getRemoteIdentity() |
long |
getRequestSentTime() |
byte[] |
getSentIP()
The remote side (Bob) - note that in some places he's called Charlie.
|
int |
getSentPort()
The remote side (Bob) - note that in some places he's called Charlie.
|
Signature |
getSentSignature() |
long |
getSentSignedOnTime() |
byte[] |
getSentX() |
OutboundEstablishState.OutboundState |
getState() |
void |
introduced(byte[] bobIP,
int bobPort)
This changes the remoteHostId from a hash-based one or possibly
incorrect IP/port to what the introducer told us.
|
void |
introductionFailed() |
void |
introSent()
note that we just sent the RelayRequest packet
|
boolean |
isExtendedOptionsAllowed()
Are we allowed to send extended options to this peer?
|
boolean |
isFirstMessageOurDSM()
Is the first message queued our own DatabaseStoreMessage?
|
boolean |
needIntroduction()
Should we ask this peer to be an introducer for us?
Ignored unless allowExtendedOptions is true
|
void |
prepareSessionConfirmed()
Let's sign everything so we can fragment properly.
|
(package private) boolean |
receiveHolePunch()
Accelerate response to RelayResponse if we haven't sent it yet.
|
void |
receiveSessionCreated(UDPPacketReader.SessionCreatedReader reader) |
void |
requestSent()
note that we just sent the SessionRequest packet
|
void |
setIntroNonce(long nonce) |
String |
toString() |
boolean |
validateSessionCreated()
Blocking call (run in the establisher thread) to determine if the
session was created properly.
|
public OutboundEstablishState(RouterContext ctx, RemoteHostId claimedAddress, RemoteHostId remoteHostId, RouterIdentity remotePeer, boolean allowExtendedOptions, boolean needIntroduction, SessionKey introKey, UDPAddress addr, DHSessionKeyBuilder.Factory dh)
claimedAddress
- an IP/port based RemoteHostId, or null if unknownremoteHostId
- non-null, == claimedAddress if direct, or a hash-based one if indirectremotePeer
- must have supported sig typeallowExtendedOptions
- are we allowed to send extended options to Bob?needIntroduction
- should we ask Bob to be an introducer for us?
ignored unless allowExtendedOptions is trueintroKey
- Bob's introduction key, as published in the netdbaddr
- non-nullpublic OutboundEstablishState.OutboundState getState()
public boolean complete()
public UDPAddress getRemoteAddress()
public void setIntroNonce(long nonce)
public long getIntroNonce()
public boolean isExtendedOptionsAllowed()
public boolean needIntroduction()
public void addMessage(OutNetMessage msg)
public boolean isFirstMessageOurDSM()
public OutNetMessage getNextQueuedMessage()
public RouterIdentity getRemoteIdentity()
public SessionKey getIntroKey()
public byte[] getSentX()
public byte[] getSentIP()
public int getSentPort()
public void receiveSessionCreated(UDPPacketReader.SessionCreatedReader reader)
public boolean validateSessionCreated()
public void fail()
public SessionKey getCipherKey()
public SessionKey getMACKey()
public long getReceivedRelayTag()
public long getSentSignedOnTime()
public long getReceivedSignedOnTime()
public byte[] getReceivedIP()
public int getReceivedPort()
public void prepareSessionConfirmed()
public Signature getSentSignature()
public void confirmedPacketsSent()
public long getConfirmedSentTime()
public void requestSent()
public long getRequestSentTime()
public void introSent()
public long getIntroSentTime()
public void introductionFailed()
public void introduced(byte[] bobIP, int bobPort)
boolean receiveHolePunch()
public long getLifetime()
public long getEstablishBeginTime()
public long getNextSendTime()
RemoteHostId getRemoteHostId()
RemoteHostId getClaimedAddress()
public void dataReceived()