class PeerStateDestroyed extends Object implements SSU2Payload.PayloadCallback, SSU2Sender
| Modifier and Type | Field and Description |
|---|---|
protected long |
_wantACKSendSince |
| Constructor and Description |
|---|
PeerStateDestroyed(RouterContext ctx,
UDPTransport transport,
PeerState2 peer)
This must be called after the first termination or termination ack
was sent from PeerState2, so the next packet number is correct.
|
PeerStateDestroyed(RouterContext ctx,
UDPTransport transport,
RemoteHostId id,
long sendID,
long rcvID,
CipherState sendCha,
CipherState rcvCha,
byte[] sendKey1,
byte[] sendKey2,
byte[] rcvKey2,
int reason)
Direct from IES2, there was never a PS2.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fragmentsSent(long pktNum,
int length,
List<PacketBuilder.Fragment> fragments) |
SSU2Bitfield |
getAckedMessages() |
byte |
getFlags() |
int |
getMTU() |
long |
getNextPacketNumber() |
(package private) long |
getRcvConnID() |
SSU2Bitfield |
getReceivedMessages() |
RemoteHostId |
getRemoteHostId() |
InetAddress |
getRemoteIPAddress() |
int |
getRemotePort() |
CipherState |
getSendCipher() |
long |
getSendConnID() |
byte[] |
getSendHeaderEncryptKey1() |
byte[] |
getSendHeaderEncryptKey2() |
void |
gotACK(long ackThru,
int acks,
byte[] ranges) |
void |
gotAddress(byte[] ip,
int port) |
void |
gotDateTime(long time) |
void |
gotFragment(byte[] data,
int off,
int len,
long messageId,
int frag,
boolean isLast)
Data must be copied out in this method.
|
void |
gotI2NP(I2NPMessage msg) |
void |
gotOptions(byte[] options,
boolean isHandshake) |
void |
gotPathChallenge(RemoteHostId from,
byte[] data) |
void |
gotPathResponse(RemoteHostId from,
byte[] data) |
void |
gotPeerTest(int msg,
int status,
Hash h,
byte[] data) |
void |
gotRelayIntro(Hash aliceHash,
byte[] data) |
void |
gotRelayRequest(byte[] data) |
void |
gotRelayResponse(int status,
byte[] data) |
void |
gotRelayTag(long tag) |
void |
gotRelayTagRequest() |
void |
gotRI(RouterInfo ri,
boolean isHandshake,
boolean flood) |
void |
gotRIFragment(byte[] data,
boolean isHandshake,
boolean flood,
boolean isGzipped,
int frag,
int totalFrags) |
void |
gotTermination(int reason,
long count) |
void |
gotToken(long token,
long expires) |
boolean |
isIPv6() |
void |
kill()
Call at transport shutdown or cache eviction
|
(package private) void |
receivePacket(RemoteHostId from,
UDPPacket packet) |
(package private) void |
receivePacket(UDPPacket packet) |
void |
setDestroyReason(int reason) |
String |
toString() |
public PeerStateDestroyed(RouterContext ctx, UDPTransport transport, PeerState2 peer)
peer - that just sent (or received and sent) a terminationpublic PeerStateDestroyed(RouterContext ctx, UDPTransport transport, RemoteHostId id, long sendID, long rcvID, CipherState sendCha, CipherState rcvCha, byte[] sendKey1, byte[] sendKey2, byte[] rcvKey2, int reason)
public void fragmentsSent(long pktNum,
int length,
List<PacketBuilder.Fragment> fragments)
fragmentsSent in interface SSU2Senderpublic SSU2Bitfield getAckedMessages()
getAckedMessages in interface SSU2Senderpublic byte getFlags()
getFlags in interface SSU2Senderpublic int getMTU()
getMTU in interface SSU2Senderpublic long getNextPacketNumber()
getNextPacketNumber in interface SSU2Senderlong getRcvConnID()
public SSU2Bitfield getReceivedMessages()
getReceivedMessages in interface SSU2Senderpublic RemoteHostId getRemoteHostId()
getRemoteHostId in interface SSU2Senderpublic InetAddress getRemoteIPAddress()
getRemoteIPAddress in interface SSU2Senderpublic int getRemotePort()
getRemotePort in interface SSU2Senderpublic CipherState getSendCipher()
getSendCipher in interface SSU2Senderpublic long getSendConnID()
getSendConnID in interface SSU2Senderpublic byte[] getSendHeaderEncryptKey1()
getSendHeaderEncryptKey1 in interface SSU2Senderpublic byte[] getSendHeaderEncryptKey2()
getSendHeaderEncryptKey2 in interface SSU2Senderpublic void gotACK(long ackThru,
int acks,
byte[] ranges)
gotACK in interface SSU2Payload.PayloadCallbackranges - null if nonepublic void gotAddress(byte[] ip,
int port)
gotAddress in interface SSU2Payload.PayloadCallbackpublic void gotDateTime(long time)
gotDateTime in interface SSU2Payload.PayloadCallbackpublic void gotFragment(byte[] data,
int off,
int len,
long messageId,
int frag,
boolean isLast)
SSU2Payload.PayloadCallbackgotFragment in interface SSU2Payload.PayloadCallbackoff - offset in datalen - length of data to copypublic void gotI2NP(I2NPMessage msg)
gotI2NP in interface SSU2Payload.PayloadCallbackpublic void gotOptions(byte[] options,
boolean isHandshake)
gotOptions in interface SSU2Payload.PayloadCallbackisHandshake - true only for message 3 part 2public void gotPathChallenge(RemoteHostId from, byte[] data)
gotPathChallenge in interface SSU2Payload.PayloadCallbackfrom - null if unknownpublic void gotPathResponse(RemoteHostId from, byte[] data)
gotPathResponse in interface SSU2Payload.PayloadCallbackfrom - null if unknownpublic void gotPeerTest(int msg,
int status,
Hash h,
byte[] data)
gotPeerTest in interface SSU2Payload.PayloadCallbackmsg - 1-7status - 0 = accept, 1-255 = rejecth - Alice or Charlie hash for msg 2 and 4, null for msg 1, 3, 5-7data - excludes flag, includes signaturepublic void gotRelayIntro(Hash aliceHash, byte[] data)
gotRelayIntro in interface SSU2Payload.PayloadCallbackdata - excludes flag, includes signaturepublic void gotRelayRequest(byte[] data)
gotRelayRequest in interface SSU2Payload.PayloadCallbackdata - excludes flag, includes signaturepublic void gotRelayResponse(int status,
byte[] data)
gotRelayResponse in interface SSU2Payload.PayloadCallbackstatus - 0 = accept, 1-255 = rejectdata - excludes flag, includes signaturepublic void gotRelayTag(long tag)
gotRelayTag in interface SSU2Payload.PayloadCallbackpublic void gotRelayTagRequest()
gotRelayTagRequest in interface SSU2Payload.PayloadCallbackpublic void gotRI(RouterInfo ri, boolean isHandshake, boolean flood)
gotRI in interface SSU2Payload.PayloadCallbackri - will already be validatedisHandshake - true only for message 3 part 2public void gotRIFragment(byte[] data,
boolean isHandshake,
boolean flood,
boolean isGzipped,
int frag,
int totalFrags)
gotRIFragment in interface SSU2Payload.PayloadCallbackdata - is first gzipped and then fragmentedisHandshake - true only for message 3 part 2public void gotTermination(int reason,
long count)
gotTermination in interface SSU2Payload.PayloadCallbackcount - in theory could wrap around to negative, but very unlikelypublic void gotToken(long token,
long expires)
gotToken in interface SSU2Payload.PayloadCallbackpublic boolean isIPv6()
isIPv6 in interface SSU2Senderpublic void kill()
void receivePacket(RemoteHostId from, UDPPacket packet)
from - source addresspacket - fully encrypted, header and body decryption will be done herevoid receivePacket(UDPPacket packet)
packet - fully encrypted, header and body decryption will be done herepublic void setDestroyReason(int reason)
setDestroyReason in interface SSU2Sender