class PeerStateDestroyed extends Object implements SSU2Payload.PayloadCallback, SSU2Sender
| Modifier and Type | Field and Description |
|---|---|
protected long | _wantACKSendSince_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)fragmentsSent. |
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)gotACK. |
void | gotAddress(byte[] ip,
int port)gotAddress. |
void | gotDateTime(long time)gotDateTime. |
void | gotFragment(byte[] data,
int off,
int len,
long messageId,
int frag,
boolean isLast)gotFragment. |
void | gotI2NP(I2NPMessage msg)gotI2NP. |
void | gotOptions(byte[] options,
boolean isHandshake)gotOptions. |
void | gotPathChallenge(RemoteHostId from,
byte[] data)gotPathChallenge. |
void | gotPathResponse(RemoteHostId from,
byte[] data)gotPathResponse. |
void | gotPeerTest(int msg,
int status,
Hash h,
byte[] data)gotPeerTest. |
void | gotRelayIntro(Hash aliceHash,
byte[] data)gotRelayIntro. |
void | gotRelayRequest(byte[] data)gotRelayRequest. |
void | gotRelayResponse(int status,
byte[] data)gotRelayResponse. |
void | gotRelayTag(long tag)gotRelayTag. |
void | gotRelayTagRequest()gotRelayTagRequest. |
void | gotRI(RouterInfo ri,
boolean isHandshake,
boolean flood)gotRI. |
void | gotRIFragment(byte[] data,
boolean isHandshake,
boolean flood,
boolean isGzipped,
int frag,
int totalFrags)gotRIFragment. |
void | gotTermination(int reason,
long count)gotTermination. |
void | gotToken(long token,
long expires)gotToken. |
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)setDestroyReason. |
String | toString()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 SSU2SenderpktNum - packet number, @param length fragment length, @param fragments fragment listpublic 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.PayloadCallbackackThru - highest contiguous sequence number acknowledgedacks - number of additional acknowledgments beyond ackThruranges - null if nonepublic void gotAddress(byte[] ip,
int port)gotAddress in interface SSU2Payload.PayloadCallbackip - IP address bytesport - port numberpublic void gotDateTime(long time)
gotDateTime in interface SSU2Payload.PayloadCallbacktime - time in milliseconds since epochpublic void gotFragment(byte[] data,
int off,
int len,
long messageId,
int frag,
boolean isLast)gotFragment in interface SSU2Payload.PayloadCallbackdata - buffer containing fragment dataoff - offset in datalen - length of data to copymessageId - unique message identifierfrag - fragment number (0-based)isLast - whether this is the last fragmentpublic void gotI2NP(I2NPMessage msg)
gotI2NP in interface SSU2Payload.PayloadCallbackmsg - the parsed I2NP messagepublic void gotOptions(byte[] options,
boolean isHandshake)gotOptions in interface SSU2Payload.PayloadCallbackoptions - the option dataisHandshake - 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.PayloadCallbackaliceHash - hash of the introducerdata - 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.PayloadCallbacktag - the relay tagpublic 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 2flood - true if this is a floodfill routerpublic 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 2flood - true if this is a floodfill routerisGzipped - true if the data is gzippedfrag - fragment number (0-based)totalFrags - total number of fragmentspublic void gotTermination(int reason,
long count)gotTermination in interface SSU2Payload.PayloadCallbackreason - termination reason codecount - in theory could wrap around to negative, but very unlikelypublic void gotToken(long token,
long expires)gotToken in interface SSU2Payload.PayloadCallbacktoken - the token valueexpires - token expiration time in millisecondspublic 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 SSU2Senderreason - destroy reason