public static interface SSU2Payload.PayloadCallback| Modifier and Type | Method and Description |
|---|---|
void | gotACK(long ackThru,
int acks,
byte[] ranges)Receive an acknowledgment block. |
void | gotAddress(byte[] ip,
int port)Receive an address block. |
void | gotDateTime(long time)Receive a date/time synchronization block. |
void | gotFragment(byte[] data,
int off,
int len,
long messageID,
int frag,
boolean isLast)Receive a fragment of a fragmented message. |
void | gotI2NP(I2NPMessage msg)Receive an I2NP message block. |
void | gotOptions(byte[] options,
boolean isHandshake)Receive a session options block. |
void | gotPathChallenge(RemoteHostId from,
byte[] data)Receive a path challenge block. |
void | gotPathResponse(RemoteHostId from,
byte[] data)Receive a path response block. |
void | gotPeerTest(int msg,
int status,
Hash h,
byte[] data)Receive a peer test block. |
void | gotRelayIntro(Hash aliceHash,
byte[] data)Receive a relay introduction. |
void | gotRelayRequest(byte[] data)Receive a relay request. |
void | gotRelayResponse(int status,
byte[] data)Receive a relay response. |
void | gotRelayTag(long tag)Receive a relay tag. |
void | gotRelayTagRequest()Receive a relay tag request. |
void | gotRI(RouterInfo ri,
boolean isHandshake,
boolean flood)Receive a complete RouterInfo block. |
void | gotRIFragment(byte[] data,
boolean isHandshake,
boolean flood,
boolean isGzipped,
int frag,
int totalFrags)Receive a fragment of a RouterInfo block. |
void | gotTermination(int reason,
long lastReceived)Receive a session termination block. |
void | gotToken(long token,
long expires)Receive a new session token. |
void gotACK(long ackThru,
int acks,
byte[] ranges)ackThru - highest contiguous sequence number acknowledgedacks - number of additional acknowledgments beyond ackThruranges - null if nonevoid gotAddress(byte[] ip,
int port)ip - IP address bytesport - port numbervoid gotDateTime(long time)
throws DataFormatExceptiontime - time in milliseconds since epochDataFormatExceptionvoid gotFragment(byte[] data,
int off,
int len,
long messageID,
int frag,
boolean isLast)
throws DataFormatExceptiondata - 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 fragmentDataFormatExceptionvoid gotI2NP(I2NPMessage msg) throws I2NPMessageException
msg - the parsed I2NP messageI2NPMessageExceptionvoid gotOptions(byte[] options,
boolean isHandshake)
throws DataFormatExceptionoptions - the option dataisHandshake - true only for message 3 part 2DataFormatExceptionvoid gotPathChallenge(RemoteHostId from, byte[] data)
from - null if unknownvoid gotPathResponse(RemoteHostId from, byte[] data)
from - null if unknownvoid gotPeerTest(int msg,
int status,
Hash h,
byte[] data)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 signaturevoid gotRelayIntro(Hash aliceHash, byte[] data)
aliceHash - hash of the introducerdata - excludes flag, includes signaturevoid gotRelayRequest(byte[] data)
data - excludes flag, includes signaturevoid gotRelayResponse(int status,
byte[] data)status - 0 = accept, 1-255 = rejectdata - excludes flag, includes signaturevoid gotRelayTag(long tag)
tag - the relay tagvoid gotRelayTagRequest()
void gotRI(RouterInfo ri, boolean isHandshake, boolean flood) throws DataFormatException
ri - will already be validatedisHandshake - true only for message 3 part 2flood - true if this is a floodfill routerDataFormatExceptionvoid gotRIFragment(byte[] data,
boolean isHandshake,
boolean flood,
boolean isGzipped,
int frag,
int totalFrags)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 fragmentsvoid gotTermination(int reason,
long lastReceived)reason - termination reason codelastReceived - in theory could wrap around to negative, but very unlikelyvoid gotToken(long token,
long expires)token - the token valueexpires - token expiration time in milliseconds