|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.udp.PeerState
Contain all of the state about a UDP connection to a peer
Constructor Summary | |
PeerState(I2PAppContext ctx)
|
Method Summary | |
boolean |
allocateSendingBytes(int size)
Decrement the remaining bytes in the current period's window, returning true if the full size can be decremented, false if it cannot. |
static java.lang.String |
calculateRemoteHostString(byte[] ip,
int port)
|
static java.lang.String |
calculateRemoteHostString(UDPPacket packet)
|
void |
congestionOccurred()
either they told us to back off, or we had to resend to get the data through. |
void |
dataReceived()
|
void |
ECNReceived()
we received a backoff request, so cut our send window |
boolean |
equals(java.lang.Object o)
|
short |
getClockSkew()
how far off is the remote peer from our clock, in seconds? |
int |
getConsecutiveSendingSecondsWithoutACKS()
how many seconds have we sent packets without any ACKs received? |
SessionKey |
getCurrentCipherKey()
The AES key used to encrypt/decrypt packets, set only after the connection is established. |
SessionKey |
getCurrentMACKey()
The AES key used to verify packets, set only after the connection is established. |
long |
getCurrentReceiveSecond()
what is the current receive second, for congestion control? |
boolean |
getCurrentSecondECNReceived()
have we received a packet with the ECN bit set in the current second? |
long |
getKeyEstablishedTime()
when were the current cipher and MAC keys established/rekeyed? |
long |
getLastACKSend()
when did we last send an ACK to the peer? |
long |
getLastReceiveTime()
when did we last receive a packet from them? |
long |
getLastSendTime()
when did we last send them a packet? |
long |
getMessagesReceived()
|
long |
getMessagesSent()
|
int |
getMTU()
what is the largest packet we can send to the peer? |
long |
getMTULastChecked()
when did we last check the MTU? |
SessionKey |
getNextCipherKey()
The pending AES key for encrypting/decrypting packets if we are rekeying the connection, or null if we are not in the process of rekeying. |
byte[] |
getNextKeyingMaterial()
The keying material used for the rekeying, or null if we are not in the process of rekeying. |
SessionKey |
getNextMACKey()
The pending AES key for verifying packets if we are rekeying the connection, or null if we are not in the process of rekeying. |
boolean |
getRekeyBeganLocally()
true if we began the current rekeying, false otherwise |
java.lang.String |
getRemoteHostString()
|
byte[] |
getRemoteIP()
what IP is the peer sending and receiving packets on? |
java.net.InetAddress |
getRemoteIPAddress()
|
Hash |
getRemotePeer()
The peer are we talking to. |
int |
getRemotePort()
what port is the peer sending and receiving packets on? |
boolean |
getRemoteRequiresIntroduction()
if we need to contact them, do we need to talk to an introducer? |
boolean |
getRemoteWantsPreviousACKs()
have all of the packets received in the current second requested that the previous second's ACKs be sent? |
int |
getSendWindowBytes()
how many bytes should we send to the peer in a second |
int |
getSendWindowBytesRemaining()
how many bytes can we send to the peer in the current second |
int |
getSlowStartThreshold()
|
long |
getTheyRelayToUsAs()
If they have offered to serve as an introducer to us, this is the tag we can use to publish that fact. |
long |
getWeRelayToThemAs()
if we are serving as an introducer to them, this is the the tag that they can publish that, when presented to us, will cause us to send a relay introduction to the current peer |
int |
hashCode()
|
void |
incrementConsecutiveSendingSecondsWithoutACKS()
|
void |
messageACKed(int bytesACKed)
we sent a message which was ACKed containing the given # of bytes |
void |
messageFullyReceived(java.lang.Long messageId)
we received the message specified completely |
void |
remoteDoesNotWantPreviousACKs()
have all of the packets received in the current second requested that the previous second's ACKs be sent? |
void |
resetConsecutiveSendingSecondsWithoutACKS()
|
java.util.List |
retrieveACKs()
pull off the ACKs (Long) to send to the peer |
void |
setClockSkew(short skew)
how far off is the remote peer from our clock, in seconds? |
void |
setCurrentCipherKey(SessionKey key)
The AES key used to encrypt/decrypt packets, set only after the connection is established. |
void |
setCurrentMACKey(SessionKey key)
The AES key used to verify packets, set only after the connection is established. |
void |
setCurrentReceiveSecond(long sec)
what is the current receive second, for congestion control? |
void |
setKeyEstablishedTime(long when)
when were the current cipher and MAC keys established/rekeyed? |
void |
setLastACKSend(long when)
|
void |
setLastReceiveTime(long when)
when did we last receive a packet from them? |
void |
setLastSendTime(long when)
when did we last send them a packet? |
void |
setMTU(int mtu)
what is the largest packet we can send to the peer? |
void |
setNextCipherKey(SessionKey key)
The pending AES key for encrypting/decrypting packets if we are rekeying the connection, or null if we are not in the process of rekeying. |
void |
setNextKeyingMaterial(byte[] data)
The keying material used for the rekeying, or null if we are not in the process of rekeying. |
void |
setNextMACKey(SessionKey key)
The pending AES key for verifying packets if we are rekeying the connection, or null if we are not in the process of rekeying. |
void |
setRekeyBeganLocally(boolean local)
true if we began the current rekeying, false otherwise |
void |
setRemoteAddress(byte[] ip,
int port)
what IP+port is the peer sending and receiving packets on? |
void |
setRemotePeer(Hash peer)
The peer are we talking to. |
void |
setRemoteRequiresIntroduction(boolean required)
if we need to contact them, do we need to talk to an introducer? |
void |
setTheyRelayToUsAs(long tag)
If they have offered to serve as an introducer to us, this is the tag we can use to publish that fact. |
void |
setWeRelayToThemAs(long tag)
if we are serving as an introducer to them, this is the the tag that they can publish that, when presented to us, will cause us to send a relay introduction to the current peer |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PeerState(I2PAppContext ctx)
Method Detail |
public Hash getRemotePeer()
public SessionKey getCurrentMACKey()
public SessionKey getCurrentCipherKey()
public SessionKey getNextMACKey()
public SessionKey getNextCipherKey()
public byte[] getNextKeyingMaterial()
public boolean getRekeyBeganLocally()
public long getKeyEstablishedTime()
public short getClockSkew()
public long getCurrentReceiveSecond()
public long getLastSendTime()
public long getLastReceiveTime()
public int getConsecutiveSendingSecondsWithoutACKS()
public boolean getCurrentSecondECNReceived()
public boolean getRemoteWantsPreviousACKs()
public int getSendWindowBytes()
public int getSendWindowBytesRemaining()
public byte[] getRemoteIP()
public java.net.InetAddress getRemoteIPAddress()
public int getRemotePort()
public boolean getRemoteRequiresIntroduction()
public long getWeRelayToThemAs()
public long getTheyRelayToUsAs()
public int getMTU()
public long getMTULastChecked()
public void setRemotePeer(Hash peer)
public void setCurrentMACKey(SessionKey key)
public void setCurrentCipherKey(SessionKey key)
public void setNextMACKey(SessionKey key)
public void setNextCipherKey(SessionKey key)
public void setNextKeyingMaterial(byte[] data)
public void setRekeyBeganLocally(boolean local)
public void setKeyEstablishedTime(long when)
public void setClockSkew(short skew)
public void setCurrentReceiveSecond(long sec)
public void setLastSendTime(long when)
public void setLastReceiveTime(long when)
public void incrementConsecutiveSendingSecondsWithoutACKS()
public void resetConsecutiveSendingSecondsWithoutACKS()
public void remoteDoesNotWantPreviousACKs()
public boolean allocateSendingBytes(int size)
public void setRemoteAddress(byte[] ip, int port)
public void setRemoteRequiresIntroduction(boolean required)
public void setWeRelayToThemAs(long tag)
public void setTheyRelayToUsAs(long tag)
public void setMTU(int mtu)
public int getSlowStartThreshold()
public void messageFullyReceived(java.lang.Long messageId)
public void congestionOccurred()
public java.util.List retrieveACKs()
public void messageACKed(int bytesACKed)
public long getMessagesSent()
public long getMessagesReceived()
public void ECNReceived()
public void dataReceived()
public long getLastACKSend()
public void setLastACKSend(long when)
public java.lang.String getRemoteHostString()
public static java.lang.String calculateRemoteHostString(byte[] ip, int port)
public static java.lang.String calculateRemoteHostString(UDPPacket packet)
public int hashCode()
public boolean equals(java.lang.Object o)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |