java.lang.Object
net.i2p.router.transport.udp.PeerTestManager.PTCallback
- All Implemented Interfaces:
SSU2Payload.PayloadCallback
- Enclosing class:
PeerTestManager
Collects the payloads of one peer test reply.
Field Summary
Modifier and TypeFieldDescriptionbyte[]Alice's IP as seen by the peer.intAlice's port as seen by the peer.private final RemoteHostIdThe host the reply came from.longWhen the reply arrived.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidgotACK(long ackThru, int acks, byte[] ranges) Receive an acknowledgment block.voidgotAddress(byte[] ip, int port) Receive an address block.voidgotDateTime(long time) Receive a date/time synchronization block.voidgotFragment(byte[] data, int off, int len, long messageId, int frag, boolean isLast) Receive a fragment of a fragmented message.voidgotI2NP(I2NPMessage msg) Receive an I2NP message block.voidgotOptions(byte[] options, boolean isHandshake) Receive a session options block.voidgotPathChallenge(RemoteHostId from, byte[] data) Receive a path challenge block.voidgotPathResponse(RemoteHostId from, byte[] data) Receive a path response block.voidgotPeerTest(int msg, int status, Hash h, byte[] data) Receive a peer test block.voidgotRelayIntro(Hash aliceHash, byte[] data) Receive a relay introduction.voidgotRelayRequest(byte[] data) Receive a relay request.voidgotRelayResponse(int status, byte[] data) Receive a relay response.voidgotRelayTag(long tag) Receive a relay tag.voidReceive a relay tag request.voidgotRI(RouterInfo ri, boolean isHandshake, boolean flood) Receive a complete RouterInfo block.voidgotRIFragment(byte[] data, boolean isHandshake, boolean flood, boolean isGzipped, int frag, int totalFrags) Receive a fragment of a RouterInfo block.voidgotTermination(int reason, long count) Receive a session termination block.voidgotToken(long token, long expires) Receive a new session token.
Field Details
_from
The host the reply came from._timeReceived
public long _timeReceivedWhen the reply arrived._aliceIP
public byte[] _aliceIPAlice's IP as seen by the peer._alicePort
public int _alicePortAlice's port as seen by the peer.
Constructor Details
PTCallback
Prepares to collect one peer test reply.- Parameters:
from- the host the reply comes from
Method Details
gotDateTime
public void gotDateTime(long time) Description copied from interface:SSU2Payload.PayloadCallbackReceive a date/time synchronization block.- Specified by:
gotDateTimein interfaceSSU2Payload.PayloadCallback- Parameters:
time- time in milliseconds since epoch
gotOptions
public void gotOptions(byte[] options, boolean isHandshake) Description copied from interface:SSU2Payload.PayloadCallbackReceive a session options block.- Specified by:
gotOptionsin interfaceSSU2Payload.PayloadCallback- Parameters:
options- the option dataisHandshake- true only for message 3 part 2
gotRI
Description copied from interface:SSU2Payload.PayloadCallbackReceive a complete RouterInfo block.- Specified by:
gotRIin interfaceSSU2Payload.PayloadCallback- Parameters:
ri- will already be validatedisHandshake- true only for message 3 part 2flood- true if this is a floodfill router
gotRIFragment
public void gotRIFragment(byte[] data, boolean isHandshake, boolean flood, boolean isGzipped, int frag, int totalFrags) Description copied from interface:SSU2Payload.PayloadCallbackReceive a fragment of a RouterInfo block.- Specified by:
gotRIFragmentin interfaceSSU2Payload.PayloadCallback- Parameters:
data- 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 fragments
gotAddress
public void gotAddress(byte[] ip, int port) Description copied from interface:SSU2Payload.PayloadCallbackReceive an address block.- Specified by:
gotAddressin interfaceSSU2Payload.PayloadCallback- Parameters:
ip- IP address bytesport- the port number to send
gotRelayTagRequest
public void gotRelayTagRequest()Description copied from interface:SSU2Payload.PayloadCallbackReceive a relay tag request.- Specified by:
gotRelayTagRequestin interfaceSSU2Payload.PayloadCallback
gotRelayTag
public void gotRelayTag(long tag) Description copied from interface:SSU2Payload.PayloadCallbackReceive a relay tag.- Specified by:
gotRelayTagin interfaceSSU2Payload.PayloadCallback- Parameters:
tag- the relay tag
gotRelayRequest
public void gotRelayRequest(byte[] data) Description copied from interface:SSU2Payload.PayloadCallbackReceive a relay request.- Specified by:
gotRelayRequestin interfaceSSU2Payload.PayloadCallback- Parameters:
data- excludes flag, includes signature
gotRelayResponse
public void gotRelayResponse(int status, byte[] data) Description copied from interface:SSU2Payload.PayloadCallbackReceive a relay response.- Specified by:
gotRelayResponsein interfaceSSU2Payload.PayloadCallback- Parameters:
status- 0 = accept, 1-255 = rejectdata- excludes flag, includes signature
gotRelayIntro
Description copied from interface:SSU2Payload.PayloadCallbackReceive a relay introduction.- Specified by:
gotRelayIntroin interfaceSSU2Payload.PayloadCallback- Parameters:
aliceHash- hash of the introducerdata- excludes flag, includes signature
gotPeerTest
Description copied from interface:SSU2Payload.PayloadCallbackReceive a peer test block.- Specified by:
gotPeerTestin interfaceSSU2Payload.PayloadCallback- Parameters:
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 signature
gotToken
public void gotToken(long token, long expires) Description copied from interface:SSU2Payload.PayloadCallbackReceive a new session token.- Specified by:
gotTokenin interfaceSSU2Payload.PayloadCallback- Parameters:
token- the session token to attach to the next peer testexpires- token expiration time in milliseconds
gotI2NP
Description copied from interface:SSU2Payload.PayloadCallbackReceive an I2NP message block.- Specified by:
gotI2NPin interfaceSSU2Payload.PayloadCallback- Parameters:
msg- the parsed I2NP message
gotFragment
public void gotFragment(byte[] data, int off, int len, long messageId, int frag, boolean isLast) Description copied from interface:SSU2Payload.PayloadCallbackReceive a fragment of a fragmented message. Data must be copied out in this method. Data starts at the 9 byte header for fragment 0.- Specified by:
gotFragmentin interfaceSSU2Payload.PayloadCallback- Parameters:
data- 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 fragment
gotACK
public void gotACK(long ackThru, int acks, byte[] ranges) Description copied from interface:SSU2Payload.PayloadCallbackReceive an acknowledgment block.- Specified by:
gotACKin interfaceSSU2Payload.PayloadCallback- Parameters:
ackThru- highest contiguous sequence number acknowledgedacks- number of additional acknowledgments beyond ackThruranges- null if none
gotTermination
public void gotTermination(int reason, long count) Description copied from interface:SSU2Payload.PayloadCallbackReceive a session termination block.- Specified by:
gotTerminationin interfaceSSU2Payload.PayloadCallback- Parameters:
reason- termination reason codecount- in theory could wrap around to negative, but very unlikely
gotPathChallenge
Description copied from interface:SSU2Payload.PayloadCallbackReceive a path challenge block.- Specified by:
gotPathChallengein interfaceSSU2Payload.PayloadCallback- Parameters:
from- null if unknowndata- the challenge bytes, which must be copied out
gotPathResponse
Description copied from interface:SSU2Payload.PayloadCallbackReceive a path response block.- Specified by:
gotPathResponsein interfaceSSU2Payload.PayloadCallback- Parameters:
from- null if unknowndata- the response bytes, which must be copied out