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 kill()
public RemoteHostId getRemoteHostId()
getRemoteHostId
in interface SSU2Sender
public boolean isIPv6()
isIPv6
in interface SSU2Sender
public InetAddress getRemoteIPAddress()
getRemoteIPAddress
in interface SSU2Sender
public int getRemotePort()
getRemotePort
in interface SSU2Sender
public int getMTU()
getMTU
in interface SSU2Sender
public long getNextPacketNumber()
getNextPacketNumber
in interface SSU2Sender
public long getSendConnID()
getSendConnID
in interface SSU2Sender
public CipherState getSendCipher()
getSendCipher
in interface SSU2Sender
public byte[] getSendHeaderEncryptKey1()
getSendHeaderEncryptKey1
in interface SSU2Sender
public byte[] getSendHeaderEncryptKey2()
getSendHeaderEncryptKey2
in interface SSU2Sender
public void setDestroyReason(int reason)
setDestroyReason
in interface SSU2Sender
public SSU2Bitfield getReceivedMessages()
getReceivedMessages
in interface SSU2Sender
public SSU2Bitfield getAckedMessages()
getAckedMessages
in interface SSU2Sender
public void fragmentsSent(long pktNum, int length, List<PacketBuilder.Fragment> fragments)
fragmentsSent
in interface SSU2Sender
public byte getFlags()
getFlags
in interface SSU2Sender
long getRcvConnID()
void receivePacket(UDPPacket packet)
packet
- fully encrypted, header and body decryption will be done herevoid receivePacket(RemoteHostId from, UDPPacket packet)
from
- source addresspacket
- fully encrypted, header and body decryption will be done herepublic void gotDateTime(long time)
gotDateTime
in interface SSU2Payload.PayloadCallback
public void gotOptions(byte[] options, boolean isHandshake)
gotOptions
in interface SSU2Payload.PayloadCallback
isHandshake
- true only for message 3 part 2public void gotRI(RouterInfo ri, boolean isHandshake, boolean flood)
gotRI
in interface SSU2Payload.PayloadCallback
ri
- 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.PayloadCallback
data
- is first gzipped and then fragmentedisHandshake
- true only for message 3 part 2public void gotAddress(byte[] ip, int port)
gotAddress
in interface SSU2Payload.PayloadCallback
public void gotRelayTagRequest()
gotRelayTagRequest
in interface SSU2Payload.PayloadCallback
public void gotRelayTag(long tag)
gotRelayTag
in interface SSU2Payload.PayloadCallback
public void gotRelayRequest(byte[] data)
gotRelayRequest
in interface SSU2Payload.PayloadCallback
data
- excludes flag, includes signaturepublic void gotRelayResponse(int status, byte[] data)
gotRelayResponse
in interface SSU2Payload.PayloadCallback
status
- 0 = accept, 1-255 = rejectdata
- excludes flag, includes signaturepublic void gotRelayIntro(Hash aliceHash, byte[] data)
gotRelayIntro
in interface SSU2Payload.PayloadCallback
data
- excludes flag, includes signaturepublic void gotPeerTest(int msg, int status, Hash h, byte[] data)
gotPeerTest
in interface SSU2Payload.PayloadCallback
msg
- 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 gotToken(long token, long expires)
gotToken
in interface SSU2Payload.PayloadCallback
public void gotI2NP(I2NPMessage msg)
gotI2NP
in interface SSU2Payload.PayloadCallback
public void gotFragment(byte[] data, int off, int len, long messageId, int frag, boolean isLast)
SSU2Payload.PayloadCallback
gotFragment
in interface SSU2Payload.PayloadCallback
off
- offset in datalen
- length of data to copypublic void gotACK(long ackThru, int acks, byte[] ranges)
gotACK
in interface SSU2Payload.PayloadCallback
ranges
- null if nonepublic void gotTermination(int reason, long count)
gotTermination
in interface SSU2Payload.PayloadCallback
count
- in theory could wrap around to negative, but very unlikelypublic void gotPathChallenge(RemoteHostId from, byte[] data)
gotPathChallenge
in interface SSU2Payload.PayloadCallback
from
- null if unknownpublic void gotPathResponse(RemoteHostId from, byte[] data)
gotPathResponse
in interface SSU2Payload.PayloadCallback
from
- null if unknown