net.i2p.router.transport.udp
Class OutboundEstablishState

java.lang.Object
  extended bynet.i2p.router.transport.udp.OutboundEstablishState

public class OutboundEstablishState
extends java.lang.Object

Data for a new connection being established, where we initiated the connection with a remote peer. In other words, we are Alice and they are Bob.


Field Summary
static int STATE_CONFIRMED_COMPLETELY
          we have received a data packet
static int STATE_CONFIRMED_PARTIALLY
          we have sent one or more confirmation packets
static int STATE_CREATED_RECEIVED
          we have received a signed creation packet
static int STATE_REQUEST_SENT
          we have sent an initial request
static int STATE_UNKNOWN
          nothin sent yet
 
Constructor Summary
OutboundEstablishState(RouterContext ctx, java.net.InetAddress remoteHost, int remotePort, RouterIdentity remotePeer, SessionKey introKey)
           
 
Method Summary
 void addMessage(OutNetMessage msg)
           
 void confirmedPacketsSent()
          note that we just sent the SessionConfirmed packet
 void dataReceived()
          we have received a real data packet, so we're done establishing
 SessionKey getCipherKey()
           
 long getEstablishBeginTime()
           
 SessionKey getIntroKey()
           
 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()
           
 java.lang.String getRemoteHostInfo()
          host+port, uniquely identifies an attempt
 RouterIdentity getRemoteIdentity()
           
 byte[] getSentIP()
           
 int getSentPort()
           
 Signature getSentSignature()
           
 long getSentSignedOnTime()
           
 byte[] getSentX()
           
 int getState()
           
 void prepareSessionConfirmed()
          Lets sign everything so we can fragment properly
 void prepareSessionRequest()
           
 void receiveSessionCreated(UDPPacketReader.SessionCreatedReader reader)
           
 void requestSent()
          note that we just sent the SessionRequest packet
 void setNextSendTime(long when)
           
 boolean validateSessionCreated()
          Blocking call (run in the establisher thread) to determine if the session was created properly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_UNKNOWN

public static final int STATE_UNKNOWN
nothin sent yet

See Also:
Constant Field Values

STATE_REQUEST_SENT

public static final int STATE_REQUEST_SENT
we have sent an initial request

See Also:
Constant Field Values

STATE_CREATED_RECEIVED

public static final int STATE_CREATED_RECEIVED
we have received a signed creation packet

See Also:
Constant Field Values

STATE_CONFIRMED_PARTIALLY

public static final int STATE_CONFIRMED_PARTIALLY
we have sent one or more confirmation packets

See Also:
Constant Field Values

STATE_CONFIRMED_COMPLETELY

public static final int STATE_CONFIRMED_COMPLETELY
we have received a data packet

See Also:
Constant Field Values
Constructor Detail

OutboundEstablishState

public OutboundEstablishState(RouterContext ctx,
                              java.net.InetAddress remoteHost,
                              int remotePort,
                              RouterIdentity remotePeer,
                              SessionKey introKey)
Method Detail

getState

public int getState()

addMessage

public void addMessage(OutNetMessage msg)

getNextQueuedMessage

public OutNetMessage getNextQueuedMessage()

getRemoteIdentity

public RouterIdentity getRemoteIdentity()

getIntroKey

public SessionKey getIntroKey()

prepareSessionRequest

public void prepareSessionRequest()

getSentX

public byte[] getSentX()

getSentIP

public byte[] getSentIP()

getSentPort

public int getSentPort()

receiveSessionCreated

public void receiveSessionCreated(UDPPacketReader.SessionCreatedReader reader)

validateSessionCreated

public boolean validateSessionCreated()
Blocking call (run in the establisher thread) to determine if the session was created properly. If it wasn't, all the SessionCreated remnants are dropped (perhaps they were spoofed, etc) so that we can receive another one


getCipherKey

public SessionKey getCipherKey()

getMACKey

public SessionKey getMACKey()

getReceivedRelayTag

public long getReceivedRelayTag()

getSentSignedOnTime

public long getSentSignedOnTime()

getReceivedSignedOnTime

public long getReceivedSignedOnTime()

getReceivedIP

public byte[] getReceivedIP()

getReceivedPort

public int getReceivedPort()

prepareSessionConfirmed

public void prepareSessionConfirmed()
Lets sign everything so we can fragment properly


getSentSignature

public Signature getSentSignature()

confirmedPacketsSent

public void confirmedPacketsSent()
note that we just sent the SessionConfirmed packet


requestSent

public void requestSent()
note that we just sent the SessionRequest packet


getLifetime

public long getLifetime()
how long have we been trying to establish this session?


getEstablishBeginTime

public long getEstablishBeginTime()

getNextSendTime

public long getNextSendTime()

setNextSendTime

public void setNextSendTime(long when)

getRemoteHostInfo

public java.lang.String getRemoteHostInfo()
host+port, uniquely identifies an attempt


dataReceived

public void dataReceived()
we have received a real data packet, so we're done establishing